3
0
Fork 0

## 等级、复购级差添加到7级;

This commit is contained in:
cabbage 2025-07-08 14:26:46 +08:00
parent 1373947c10
commit 21a2db7a93
16 changed files with 408 additions and 672 deletions

View File

@ -9,12 +9,7 @@ import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* 公告表 Mapper 接口
* </p>
*
* @author hzs
* @since 2022-08-09
*/
public interface BdNoticeMapper extends BaseMapper<BdNotice> {
@ -26,7 +21,6 @@ public interface BdNoticeMapper extends BaseMapper<BdNotice> {
*/
List<BdNotice> getMemberNotice(BdNoticeVO noticeVO);
/**
* 查询后台公告列表信息
*
@ -35,7 +29,6 @@ public interface BdNoticeMapper extends BaseMapper<BdNotice> {
*/
List<BdNotice> getAdminNotice(BdNoticeVO noticeVO);
/**
* 后台首页显示
*
@ -44,15 +37,6 @@ public interface BdNoticeMapper extends BaseMapper<BdNotice> {
*/
List<BdNotice> getAdminIndexNotice(BdNoticeVO noticeVO);
/**
* 根据 ID删除公告信息
*
* @param notice 参数
* @return Boolean
*/
Integer deleteNoticeById(BdNotice notice);
/**
* 会员首页显示公告
*
@ -69,7 +53,6 @@ public interface BdNoticeMapper extends BaseMapper<BdNotice> {
*/
List<BdNoticeExt> showIndexMailNotice(BdNoticeVO noticeVO);
/**
* 会员端弹窗显示
*
@ -78,7 +61,6 @@ public interface BdNoticeMapper extends BaseMapper<BdNotice> {
*/
List<BdNotice> showIndexPopScreen(BdNoticeVO noticeVO);
/**
* 会员首页公告站内信总条数
*
@ -87,7 +69,6 @@ public interface BdNoticeMapper extends BaseMapper<BdNotice> {
*/
Integer showIndexNoticeCount(BdNoticeVO noticeVO);
/**
* 会员首页站内信的未读条数
*
@ -112,7 +93,6 @@ public interface BdNoticeMapper extends BaseMapper<BdNotice> {
*/
List<BdNoticeExt> selectAdminNotice(@Param("pkCountry") Integer pkCountry);
/**
* 后台根据角色弹窗显示
*

View File

@ -13,9 +13,6 @@ import java.util.Map;
/**
* 公告表 服务类
*
* @author hzs
* @since 2022-08-09
*/
public interface IBdNoticeService extends IService<BdNotice> {
@ -104,20 +101,12 @@ public interface IBdNoticeService extends IService<BdNotice> {
/**
* @description: 获取等级的翻译KEY值
* @author: zhang jing
* @date: 2023/3/2 12:00
* @param: [pkId, gradeMap]
* @return: java.lang.Integer
* 获取等级的翻译KEY值
**/
Integer getGradeTranslateValue(Integer pkId, Map<Integer, BdGrade> gradeMap);
/**
* @description: 获取奖衔的翻译KEY值
* @author: zhang jing
* @date: 2023/3/2 12:00
* @param: [pkId, awardsMap]
* @return: java.lang.Integer
* 获取奖衔的翻译KEY值
**/
Integer getAwardsTranslateValue(Integer pkId, Map<Integer, BdAwards> awardsMap);
@ -154,7 +143,6 @@ public interface IBdNoticeService extends IService<BdNotice> {
*/
Object[] selectAdminNotice(Integer pkCountry);
/**
* 会员首页公告站内信总条数
*

View File

@ -22,7 +22,6 @@ import com.hzs.common.domain.system.ext.BdNoticeExt;
import com.hzs.common.domain.system.sys.SysRole;
import com.hzs.common.service.ITransactionCommonService;
import com.hzs.system.base.mapper.BdNoticeMapper;
import com.hzs.system.base.service.IBdMemberNoticeService;
import com.hzs.system.base.service.IBdNoticeDetailService;
import com.hzs.system.base.service.IBdNoticeService;
import com.hzs.system.base.vo.*;
@ -43,19 +42,16 @@ import java.util.stream.Collectors;
/**
* 公告表 服务实现类
*
* @author hzs
* @since 2022-08-09
*/
@Service
public class BdNoticeServiceImpl extends ServiceImpl<BdNoticeMapper, BdNotice> implements IBdNoticeService {
@Autowired
private ISysRoleService sysRoleService;
private ISysRoleService iSysRoleService;
@Autowired
private IBdGradeService gradeService;
private IBdGradeService iBdGradeService;
@Autowired
private IBdAwardsService awardsService;
private IBdAwardsService iBdAwardsService;
@Autowired
private IBdNoticeDetailService iBdNoticeDetailService;
@Autowired
@ -64,7 +60,7 @@ public class BdNoticeServiceImpl extends ServiceImpl<BdNoticeMapper, BdNotice> i
private RabbitTemplate rabbitTemplate;
@DubboReference
IApprovalServiceApi approvalServiceApi;
IApprovalServiceApi iApprovalServiceApi;
@Override
@Transactional(rollbackFor = Exception.class)
@ -93,7 +89,6 @@ public class BdNoticeServiceImpl extends ServiceImpl<BdNoticeMapper, BdNotice> i
return result;
}
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean adminSaveNotice(NoticePetitionVO noticePetitionVO) {
@ -127,7 +122,6 @@ public class BdNoticeServiceImpl extends ServiceImpl<BdNoticeMapper, BdNotice> i
return submitApproval(noticePetitionVO, batchCode);
}
/**
* 公告站内信 操作日志
*
@ -166,7 +160,7 @@ public class BdNoticeServiceImpl extends ServiceImpl<BdNoticeMapper, BdNotice> i
.signType(ESignType.getEnumByValue(noticePetitionVO.getSignType())).userIdList(noticePetitionVO.getUserIdList())
.sendIdList(noticePetitionVO.getSendIdList())
.remark(noticePetitionVO.getRemark()).build();
R<String> submit = approvalServiceApi.submit(approvalSubmitDTO, noticeVO.getLoginUser());
R<String> submit = iApprovalServiceApi.submit(approvalSubmitDTO, noticeVO.getLoginUser());
if (!submit.isSuccess()) {
throw new RuntimeException(submit.getMsg());
} else {
@ -200,9 +194,9 @@ public class BdNoticeServiceImpl extends ServiceImpl<BdNoticeMapper, BdNotice> i
if (CollUtil.isNotEmpty(noticeList)) {
// 查询等级奖衔列表
List<BdGrade> gradeList = gradeService.selectGradeAll(noticeVO.getPkCountry());
List<BdGrade> gradeList = iBdGradeService.selectGradeAll(noticeVO.getPkCountry());
Map<Integer, BdGrade> gradeMap = gradeList.stream().collect(Collectors.toMap(BdGrade::getPkId, val -> val));
List<BdAwards> awardsList = awardsService.getBdAwards(noticeVO.getPkCountry(), null);
List<BdAwards> awardsList = iBdAwardsService.getBdAwards(noticeVO.getPkCountry(), null);
Map<Integer, BdAwards> awardsMap = awardsList.stream().collect(Collectors.toMap(BdAwards::getPkId, val -> val));
for (BdNotice notice : noticeList) {
@ -258,7 +252,6 @@ public class BdNoticeServiceImpl extends ServiceImpl<BdNoticeMapper, BdNotice> i
return new Object[]{noticeList, bdNoticeVOList};
}
@Override
public Object[] showIndexNotice(BdNoticeVO noticeVO) {
List<BdNoticeExt> noticeList;
@ -271,7 +264,6 @@ public class BdNoticeServiceImpl extends ServiceImpl<BdNoticeMapper, BdNotice> i
}
List<BdNoticeVO> bdNoticeVOList = BeanUtil.copyToList(noticeList, BdNoticeVO.class);
return new Object[]{noticeList, bdNoticeVOList};
}
@Override
@ -280,7 +272,6 @@ public class BdNoticeServiceImpl extends ServiceImpl<BdNoticeMapper, BdNotice> i
return BeanUtil.copyToList(noticeList, BdNoticeVO.class);
}
@Override
public BdNoticeVO showIndexNoticeDetail(Long pkId, Integer pkCountry, Long pkMember) {
BdNoticeDetail noticeDetail = iBdNoticeDetailService.selectNoticeDetailByPkNoticeId(pkId, pkMember);
@ -298,20 +289,12 @@ public class BdNoticeServiceImpl extends ServiceImpl<BdNoticeMapper, BdNotice> i
return changeTranslate(notice, null, null);
}
@Override
public BdNoticeVO showNoticeDetail(Long pkId) {
BdNotice notice = baseMapper.selectById(pkId);
return changeTranslate(notice, null, null);
}
/**
* 获取等级的翻译KEY值
*
* @param pkId ID
* @param gradeMap 等级map
* @return Integer
*/
@Override
public Integer getGradeTranslateValue(Integer pkId, Map<Integer, BdGrade> gradeMap) {
BdGrade bdGrade;
@ -321,20 +304,13 @@ public class BdNoticeServiceImpl extends ServiceImpl<BdNoticeMapper, BdNotice> i
return bdGrade.getPkTransaction();
}
}
bdGrade = gradeService.getBdGrade(pkId);
bdGrade = iBdGradeService.getBdGrade(pkId);
if (null != bdGrade) {
return bdGrade.getPkTransaction();
}
return 0;
}
/**
* 获取奖衔的翻译KEY值
*
* @param pkId ID
* @param awardsMap 奖衔map
* @return Integer
*/
@Override
public Integer getAwardsTranslateValue(Integer pkId, Map<Integer, BdAwards> awardsMap) {
BdAwards bdAwards;
@ -344,7 +320,7 @@ public class BdNoticeServiceImpl extends ServiceImpl<BdNoticeMapper, BdNotice> i
return bdAwards.getPkTransaction();
}
}
bdAwards = awardsService.getBdAwardsOne(pkId);
bdAwards = iBdAwardsService.getBdAwardsOne(pkId);
if (bdAwards != null) {
return bdAwards.getPkTransaction();
}
@ -410,7 +386,6 @@ public class BdNoticeServiceImpl extends ServiceImpl<BdNoticeMapper, BdNotice> i
return noticeAwardList;
}
/**
* 发布位置翻译
*
@ -443,7 +418,7 @@ public class BdNoticeServiceImpl extends ServiceImpl<BdNoticeMapper, BdNotice> i
String[] roles = role.split(",");
List<String> roleNames = new ArrayList<>();
for (String roleStr : roles) {
SysRole sysRole = sysRoleService.selectRoleById(Long.parseLong(roleStr));
SysRole sysRole = iSysRoleService.selectRoleById(Long.parseLong(roleStr));
if (null != sysRole) {
roleNames.add(sysRole.getRoleName());
}
@ -481,7 +456,6 @@ public class BdNoticeServiceImpl extends ServiceImpl<BdNoticeMapper, BdNotice> i
showVO.setNoticeList(bdNoticeVOList);
showVO.setMonthTime(entry.getKey());
bdNoticeAdminShowVOList.add(showVO);
}
}
return new Object[]{bdNoticeExtList, bdNoticeAdminShowVOList};
@ -497,7 +471,6 @@ public class BdNoticeServiceImpl extends ServiceImpl<BdNoticeMapper, BdNotice> i
return baseMapper.showIndexMailCount(noticeVO);
}
@Override
public List<BdNotice> selectAdminNoticeByRole(BdNoticeVO noticeVO) {
return baseMapper.selectAdminNoticeByRole(noticeVO);

View File

@ -15,11 +15,7 @@ import java.util.Date;
import java.util.List;
/**
* @Description: 公告VO
* @Author: ljc
* @Time: 2023/2/3 11:24
* @Classname: BdNoticeVO
* @Package_name: com.hzs.system.base.vo
* 公告VO
*/
@Data
@Builder

View File

@ -6,25 +6,25 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.hzs.common.core.annotation.Log;
import com.hzs.common.core.constant.msg.ConfigMsgConstants;
import com.hzs.common.core.domain.R;
import com.hzs.common.core.enums.*;
import com.hzs.common.core.utils.StringUtils;
import com.hzs.common.core.utils.poi.ExcelUtil;
import com.hzs.common.core.web.controller.BaseController;
import com.hzs.common.core.web.domain.AjaxResult;
import com.hzs.common.core.web.page.TableDataInfo;
import com.hzs.common.domain.system.config.BdAwards;
import com.hzs.common.domain.system.config.BdGrade;
import com.hzs.common.domain.system.config.BdRange;
import com.hzs.common.domain.system.config.ext.BdRangeDetailsExt;
import com.hzs.common.domain.system.config.ext.BdRangeExt;
import com.hzs.common.security.utils.SecurityUtils;
import com.hzs.common.util.TransactionUtils;
import com.hzs.system.base.ITransactionServiceApi;
import com.hzs.system.base.service.IBdNoticeService;
import com.hzs.system.config.service.IBdAwardsService;
import com.hzs.system.config.service.IBdGradeService;
import com.hzs.system.config.service.IBdRangeDetailsService;
import com.hzs.system.config.service.IBdRangeService;
import com.hzs.system.config.vo.RangeVo;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -35,9 +35,6 @@ import java.util.List;
/**
* 新零售极差配置 前端控制器
*
* @author zhangjing
* @since 2022-09-09
*/
@Slf4j
@RestController
@ -45,21 +42,16 @@ import java.util.List;
public class BdRetailRangeController extends BaseController {
@Autowired
private IBdRangeService rangeService;
private IBdRangeService iBdRangeService;
@Autowired
private IBdRangeDetailsService rangeDetailsService;
private IBdRangeDetailsService iBdRangeDetailsService;
@Autowired
private IBdNoticeService noticeService;
@DubboReference
ITransactionServiceApi iTransactionServiceApi;
private IBdGradeService iBdGradeService;
@Autowired
private IBdAwardsService iBdAwardsService;
/**
* @description: 查询极差配置列表
* @author: zhang jing
* @date: 2022/8/30 10:20
* @param: [range]
* @return: com.hzs.common.core.web.page.TableDataInfo
* 查询极差配置列表
**/
@Log(module = EOperationModule.LEVEL_CONFIG, business = EOperationBusiness.REPURCHASE_RANGE, method = EOperationMethod.SELECT)
@GetMapping("/list")
@ -71,48 +63,47 @@ public class BdRetailRangeController extends BaseController {
queryWrapper.eq(BdRange::getRangeName, range.getRangeName());
}
queryWrapper.orderByDesc(BdRange::getRangeValue, BdRange::getCreationTime);
List<BdRange> list = rangeService.list(queryWrapper);
startPage();
List<BdRange> list = iBdRangeService.list(queryWrapper);
List<BdRangeExt> listExt = new ArrayList<>();
if (CollectionUtil.isNotEmpty(list)) {
for (BdRange bdRange : list) {
BdRangeExt rangeExt = BeanUtil.copyProperties(bdRange, BdRangeExt.class);
BdRangeDetailsExt rangeDetailsExt = new BdRangeDetailsExt();
rangeDetailsExt.setPkRange(bdRange.getPkId());
List<BdRangeDetailsExt> rangeDetailsGradeList = new ArrayList<>();
List<BdRangeDetailsExt> rangeDetailsAwardList = new ArrayList<>();
List<BdRangeDetailsExt> bdRangeDetailsList = rangeDetailsService.getBdRangeDetailsList(rangeDetailsExt);
BdRangeDetailsExt rangeDetailsExt = new BdRangeDetailsExt();
rangeDetailsExt.setPkRange(bdRange.getPkId());
List<BdRangeDetailsExt> bdRangeDetailsList = iBdRangeDetailsService.getBdRangeDetailsList(rangeDetailsExt);
if (CollectionUtil.isNotEmpty(bdRangeDetailsList)) {
for (BdRangeDetailsExt brde : bdRangeDetailsList) {
if (StringUtils.isNotNull(brde.getRangeType()) && brde.getRangeType() == ERangeType.GRADE.getValue()) {
//等级key
Integer pkRegisterGrade = noticeService.getGradeTranslateValue(brde.getPkLevel(), null);
brde.setPkGrade(pkRegisterGrade);
// 等级
BdGrade bdGrade = iBdGradeService.getBdGrade(brde.getPkLevel());
brde.setPkGrade(bdGrade.getPkId());
brde.setPkGradeVal(bdGrade.getGradeName());
rangeDetailsGradeList.add(brde);
}
if (StringUtils.isNotNull(brde.getRangeType()) && brde.getRangeType() == ERangeType.AWARDS.getValue()) {
//奖衔key
Integer pkAward = noticeService.getAwardsTranslateValue(brde.getPkLevel(), null);
brde.setPkAward(pkAward);
// 奖衔
BdAwards bdAwards = iBdAwardsService.getBdAwardsOne(brde.getPkLevel());
brde.setPkAward(bdAwards.getPkId());
brde.setPkAwardVal(bdAwards.getAwardsName());
rangeDetailsAwardList.add(brde);
}
}
}
rangeExt.setRangeDetailsAward(rangeDetailsAwardList);
rangeExt.setRangeDetailsGrade(rangeDetailsGradeList);
rangeExt.setRangeDetailsAward(rangeDetailsAwardList);
listExt.add(rangeExt);
}
}
return getDataTable(listExt);
}
/**
* @description: 导出复购极差
* @author: zhang jing
* @date: 2023/3/9 15:47
* @param: [response, range]
* @return: void
* 导出复购极差
**/
@Log(module = EOperationModule.LEVEL_CONFIG, business = EOperationBusiness.REPURCHASE_RANGE, method = EOperationMethod.EXPORT)
@PostMapping("/export")
@ -124,7 +115,7 @@ public class BdRetailRangeController extends BaseController {
queryWrapper.eq(BdRange::getRangeName, range.getRangeName());
}
queryWrapper.orderByDesc(BdRange::getCreationTime);
List<BdRange> list = rangeService.list(queryWrapper);
List<BdRange> list = iBdRangeService.list(queryWrapper);
startPage();
List<BdRangeExt> listExt = new ArrayList<>();
for (BdRange bdRange : list) {
@ -133,38 +124,35 @@ public class BdRetailRangeController extends BaseController {
rangeDetailsExt.setPkRange(bdRange.getPkId());
List<BdRangeDetailsExt> rangeDetailsGradeList = new ArrayList<>();
List<BdRangeDetailsExt> rangeDetailsAwardList = new ArrayList<>();
List<BdRangeDetailsExt> bdRangeDetailsList = rangeDetailsService.getBdRangeDetailsList(rangeDetailsExt);
List<BdRangeDetailsExt> bdRangeDetailsList = iBdRangeDetailsService.getBdRangeDetailsList(rangeDetailsExt);
if (CollectionUtil.isNotEmpty(bdRangeDetailsList)) {
for (BdRangeDetailsExt brde : bdRangeDetailsList) {
if (StringUtils.isNotNull(brde.getRangeType()) && brde.getRangeType() == ERangeType.GRADE.getValue()) {
//等级key
Integer pkRegisterGrade = noticeService.getGradeTranslateValue(brde.getPkLevel(), null);
brde.setPkGrade(pkRegisterGrade);
// 等级
BdGrade bdGrade = iBdGradeService.getBdGrade(brde.getPkLevel());
brde.setPkGrade(bdGrade.getPkId());
brde.setPkGradeVal(bdGrade.getGradeName());
rangeDetailsGradeList.add(brde);
}
if (StringUtils.isNotNull(brde.getRangeType()) && brde.getRangeType() == ERangeType.AWARDS.getValue()) {
//奖衔key
Integer pkAward = noticeService.getAwardsTranslateValue(brde.getPkLevel(), null);
brde.setPkAward(pkAward);
// 奖衔
BdAwards bdAwards = iBdAwardsService.getBdAwardsOne(brde.getPkLevel());
brde.setPkAward(bdAwards.getPkId());
brde.setPkAwardVal(bdAwards.getAwardsName());
rangeDetailsAwardList.add(brde);
}
}
}
rangeExt.setRangeDetailsAward(rangeDetailsAwardList);
rangeExt.setRangeDetailsGrade(rangeDetailsGradeList);
rangeExt.setRangeDetailsAward(rangeDetailsAwardList);
listExt.add(rangeExt);
}
ExcelUtil<BdRangeExt> util = new ExcelUtil<>(BdRangeExt.class);
util.exportExcel(response, listExt, "复购");
util.exportExcel(response, listExt, "复购");
}
/**
* @description: 新增极差配置
* @author: zhang jing
* @date: 2022/8/30 10:21
* @param: [range]
* @return: com.hzs.common.core.web.domain.AjaxResult
* 新增极差配置
**/
@Log(module = EOperationModule.LEVEL_CONFIG, business = EOperationBusiness.REPURCHASE_RANGE, method = EOperationMethod.INSERT)
@PostMapping("/generate")
@ -190,7 +178,7 @@ public class BdRetailRangeController extends BaseController {
queryWrapper.eq(BdRange::getPkCountry, SecurityUtils.getPkCountry());
queryWrapper.eq(BdRange::getRangeValue, rangeExt.getRangeValue());
queryWrapper.eq(BdRange::getSystemType, ESystemType.DEFAULT.getValue());
List<BdRange> list = rangeService.list(queryWrapper);
List<BdRange> list = iBdRangeService.list(queryWrapper);
if (CollectionUtil.isNotEmpty(list)) {
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.RANGE_VALUE_REPEAT));
}
@ -200,17 +188,13 @@ public class BdRetailRangeController extends BaseController {
rangeExt.setPkCreator(SecurityUtils.getUserId());
rangeExt.setCreationTime(new Date());
rangeExt.setSystemType(ESystemType.DEFAULT.getValue());
rangeService.saveRange(rangeExt);
iBdRangeService.saveRange(rangeExt);
}
return AjaxResult.success();
}
/**
* @description: 修改极差配置
* @author: zhang jing
* @date: 2022/8/30 10:21
* @param: [range]
* @return: com.hzs.common.core.web.domain.AjaxResult
* 修改极差配置
**/
@Log(module = EOperationModule.LEVEL_CONFIG, business = EOperationBusiness.REPURCHASE_RANGE, method = EOperationMethod.UPDATE)
@PostMapping("/update")
@ -231,40 +215,25 @@ public class BdRetailRangeController extends BaseController {
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.PK_GRADE_AWARDS_NOT_NULL));
}
//字段翻译保存到数据库
if (null != rangeExt.getPkTransaction()) {
R<Boolean> b = iTransactionServiceApi.updateTransaction(pkCountry,
rangeExt.getRangeName(), rangeExt.getPkTransaction(), true);
} else {
//字段翻译保存到数据库
R<Integer> pkTransaction = iTransactionServiceApi.createTransaction(pkCountry, ETransactionKey.RANGE,
rangeExt.getRangeName(), EYesNo.YES, EYesNo.NO);
rangeExt.setPkTransaction(pkTransaction.getData());
}
rangeExt.setPkModified(SecurityUtils.getUserId());
rangeExt.setPkCountry(pkCountry);
rangeExt.setModifiedTime(new Date());
return toAjax(rangeService.updateRange(rangeExt));
return toAjax(iBdRangeService.updateRange(rangeExt));
}
/**
* @description: 查询单条极差配置
* @author: zhang jing
* @date: 2022/8/30 10:21
* @param: [pkId]
* @return: com.hzs.common.core.web.domain.AjaxResult
* 查询单条极差配置
**/
@Log(module = EOperationModule.LEVEL_CONFIG, business = EOperationBusiness.REPURCHASE_RANGE, method = EOperationMethod.SELECT)
@GetMapping("/getOne/{pkId}")
public AjaxResult getOne(@PathVariable Long pkId) {
BdRange range = rangeService.getById(pkId);
BdRange range = iBdRangeService.getById(pkId);
BdRangeExt rangeExt = BeanUtil.copyProperties(range, BdRangeExt.class);
BdRangeDetailsExt rangeDetailsExt = new BdRangeDetailsExt();
List<Integer> gradeList = new ArrayList<>();
List<Integer> awardsList = new ArrayList<>();
rangeDetailsExt.setPkRange(pkId.intValue());
List<BdRangeDetailsExt> bdRangeDetailsList = rangeDetailsService.getBdRangeDetailsList(rangeDetailsExt);
List<BdRangeDetailsExt> bdRangeDetailsList = iBdRangeDetailsService.getBdRangeDetailsList(rangeDetailsExt);
if (CollectionUtil.isNotEmpty(bdRangeDetailsList)) {
for (BdRangeDetailsExt bdRangeDetailsExt : bdRangeDetailsList) {
if (StringUtils.isNotNull(bdRangeDetailsExt.getRangeType()) && ERangeType.GRADE.getValue() == bdRangeDetailsExt.getRangeType()) {
@ -281,13 +250,8 @@ public class BdRetailRangeController extends BaseController {
return AjaxResult.success(rangeExt);
}
/**
* @description: 删除极差配置
* @author: zhang jing
* @date: 2022/8/30 10:21
* @param: [pkId]
* @return: com.hzs.common.core.web.domain.AjaxResult
* 删除极差配置
**/
@Log(module = EOperationModule.LEVEL_CONFIG, business = EOperationBusiness.REPURCHASE_RANGE, method = EOperationMethod.DELETE)
@DeleteMapping("/{pkId}")
@ -297,12 +261,8 @@ public class BdRetailRangeController extends BaseController {
updateWrapper.set(BdRange::getDelFlag, EDelFlag.DELETE.getValue());
updateWrapper.set(BdRange::getPkModified, SecurityUtils.getUserId());
updateWrapper.set(BdRange::getModifiedTime, new Date());
BdRange bdRange = rangeService.getById(pkId);
//删除翻译
List<Long> pkIdList = new ArrayList<>();
pkIdList.add(bdRange.getPkTransaction().longValue());
R<Boolean> b = iTransactionServiceApi.removeTransactionByPkId(pkIdList);
return toAjax(rangeService.update(updateWrapper));
BdRange bdRange = iBdRangeService.getById(pkId);
return toAjax(iBdRangeService.update(updateWrapper));
}
/**
@ -317,11 +277,12 @@ public class BdRetailRangeController extends BaseController {
LambdaQueryWrapper<BdRange> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(BdRange::getPkCountry, SecurityUtils.getPkCountry());
queryWrapper.eq(BdRange::getSystemType, ESystemType.DEFAULT.getValue());
for (BdRange range : rangeService.list(queryWrapper)) {
for (BdRange range : iBdRangeService.list(queryWrapper)) {
RangeVo rangeVo = BeanUtil.copyProperties(range, RangeVo.class);
rangeVo.setPkRange(range.getPkId());
resultList.add(rangeVo);
}
return AjaxResult.success(resultList);
}
}

View File

@ -1,6 +1,5 @@
package com.hzs.system.config.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hzs.common.domain.system.config.BdRangeDetails;
import com.hzs.common.domain.system.config.ext.BdRangeDetailsExt;
@ -8,21 +7,12 @@ import com.hzs.common.domain.system.config.ext.BdRangeDetailsExt;
import java.util.List;
/**
* <p>
* 极差详细表 Mapper 接口
* </p>
*
* @author hzs
* @since 2022-10-28
*/
public interface BdRangeDetailsMapper extends BaseMapper<BdRangeDetails> {
/**
* @description: 查询极差详情
* @author: zhang jing
* @date: 2022/10/28 11:34
* @param: [rangeDetailsExt]
* @return: java.util.List<com.hzs.common.domain.system.config.ext.BdRangeDetailsExt>
* 查询极差详情
**/
List<BdRangeDetailsExt> getBdRangeDetailsList(BdRangeDetailsExt rangeDetailsExt);
}

View File

@ -1,6 +1,5 @@
package com.hzs.system.config.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hzs.common.domain.system.config.BdRangeDetails;
import com.hzs.common.domain.system.config.ext.BdRangeDetailsExt;
@ -8,20 +7,13 @@ import com.hzs.common.domain.system.config.ext.BdRangeDetailsExt;
import java.util.List;
/**
* <p>
* 极差详细表 服务类
* </p>
*
* @author hzs
* @since 2022-10-28
*/
public interface IBdRangeDetailsService extends IService<BdRangeDetails> {
/**
* @description: 查询极差详情
* @author: zhang jing
* @date: 2022/10/28 11:36
* @param: [rangeDetailsExt]
* @return: java.util.List<com.hzs.common.domain.system.config.ext.BdRangeDetailsExt>
* 查询极差详情
**/
List<BdRangeDetailsExt> getBdRangeDetailsList(BdRangeDetailsExt rangeDetailsExt);
}

View File

@ -10,25 +10,14 @@ import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 极差详细表 服务实现类
* </p>
*
* @author hzs
* @since 2022-10-28
*/
@Service
public class BdRangeDetailsServiceImpl extends ServiceImpl<BdRangeDetailsMapper, BdRangeDetails> implements IBdRangeDetailsService {
/**
* @description: 查询极差详情
* @author: zhang jing
* @date: 2022/10/28 11:35
* @param: [rangeDetailsExt]
* @return: java.util.List<com.hzs.common.domain.system.config.ext.BdRangeDetailsExt>
**/
@Override
public List<BdRangeDetailsExt> getBdRangeDetailsList(BdRangeDetailsExt rangeDetailsExt) {
return baseMapper.getBdRangeDetailsList(rangeDetailsExt);
}
}

View File

@ -78,6 +78,7 @@
<include refid="list_where"></include>
order by t.creation_time desc
</select>
<sql id="list_where">
<where>
t.del_flag = 0
@ -130,6 +131,7 @@
</if>
</where>
</sql>
<select id="getAdminIndexNotice" resultMap="BaseResultMap">
select t.title, t.pk_id,t.creation_time
from BD_NOTICE t
@ -149,15 +151,6 @@
order by t.creation_time desc
</select>
<update id="deleteNoticeById">
update bd_notice n
set n.del_flag = 1,
PK_MODIFIED=#{pkModified},
MODIFIED_TIME = sysdate
where PK_ID = #{pkId}
</update>
<select id="showIndexNotice" resultType="com.hzs.common.domain.system.ext.BdNoticeExt">
select n.pk_id, n.title, n.content,n.top,
n.creation_time creationTime,

View File

@ -4,28 +4,17 @@
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.hzs.common.domain.system.config.BdRangeDetails">
<id column="PK_ID" property="pkId" />
<result column="DEL_FLAG" property="delFlag" />
<result column="PK_COUNTRY" property="pkCountry" />
<result column="CREATION_TIME" property="creationTime" />
<result column="MODIFIED_TIME" property="modifiedTime" />
<result column="PK_CREATOR" property="pkCreator" />
<result column="PK_MODIFIED" property="pkModified" />
<result column="PK_RANGE" property="pkRange" />
<result column="PK_LEVEL" property="pkLevel" />
<id column="PK_ID" property="pkId"/>
<result column="DEL_FLAG" property="delFlag"/>
<result column="PK_COUNTRY" property="pkCountry"/>
<result column="CREATION_TIME" property="creationTime"/>
<result column="MODIFIED_TIME" property="modifiedTime"/>
<result column="PK_CREATOR" property="pkCreator"/>
<result column="PK_MODIFIED" property="pkModified"/>
<result column="PK_RANGE" property="pkRange"/>
<result column="PK_LEVEL" property="pkLevel"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
DEL_FLAG,
PK_COUNTRY,
CREATION_TIME,
MODIFIED_TIME,
PK_CREATOR,
PK_MODIFIED,
PK_ID, PK_RANGE, PK_LEVEL
</sql>
<select id="getBdRangeDetailsList"
parameterType="com.hzs.common.domain.system.config.ext.BdRangeDetailsExt"
resultType="com.hzs.common.domain.system.config.ext.BdRangeDetailsExt">
@ -44,11 +33,11 @@
BD_RANGE_DETAILS a
INNER JOIN BD_RANGE b ON a.PK_RANGE = b.PK_ID
WHERE
a.DEL_FLAG = 0 and b.DEL_FLAG = 0
a.DEL_FLAG = 0
and b.DEL_FLAG = 0
<if test="pkRange != null">
AND a.PK_RANGE = #{pkRange}
</if>
</select>
</mapper>

View File

@ -5,11 +5,7 @@ import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* @author: sui q
* @time: 2022/8/27 10:35
* @description: 极差类型枚举
* @classname: ERangeType
* @package_name: com.hzs.common.core.enums
* 极差类型枚举
*/
@AllArgsConstructor
@Getter

View File

@ -13,9 +13,6 @@ import java.util.Date;
/**
* 公告表
*
* @author hzs
* @since 2023-02-03
*/
@Data
@Builder

View File

@ -12,12 +12,7 @@ import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
* 极差详细表
* </p>
*
* @author hzs
* @since 2022-10-28
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ -51,5 +46,4 @@ public class BdRangeDetails extends BaseEntity {
private Integer rangeType;
}

View File

@ -1,23 +1,11 @@
package com.hzs.common.domain.system.config.ext;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.hzs.common.core.annotation.Transaction;
import com.hzs.common.core.constant.EnumsPrefixConstants;
import com.hzs.common.core.web.domain.BaseEntity;
import com.hzs.common.domain.system.config.BdRangeDetails;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
* 极差详细表
* </p>
*
* @author hzs
* @since 2022-10-28
*/
@EqualsAndHashCode(callSuper = true)
@Data
@ -30,14 +18,13 @@ public class BdRangeDetailsExt extends BdRangeDetails {
*/
private String rangeTypeVal;
@Transaction(transactionKey = EnumsPrefixConstants.KEY_GRADE)
private Integer pkGrade;
@Transaction(transactionKey = EnumsPrefixConstants.KEY_AWARD)
private Integer pkAward;
/**
* 等级翻译
*/
private String pkGradeVal;
private Integer pkAward;
/**
* 奖衔翻译
*/

View File

@ -1,27 +1,14 @@
package com.hzs.common.domain.system.config.ext;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.hzs.common.core.annotation.Excel;
import com.hzs.common.core.annotation.Transaction;
import com.hzs.common.core.web.domain.BaseEntity;
import com.hzs.common.domain.system.config.BdRange;
import com.hzs.common.domain.system.config.BdRangeDetails;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.List;
/**
* <p>
* 极差配置
* </p>
*
* @author zhangjing
* @since 2022-09-09
*/
@EqualsAndHashCode(callSuper = true)
@Data
@ -32,22 +19,21 @@ public class BdRangeExt extends BdRange {
/**
* 等级极差详情集合
*/
@Transaction
private List<BdRangeDetailsExt> rangeDetailsGrade;
@Excel(name = "等级",sort=2)
private String rangeDetailsGradeVal;
/**
* 奖衔极差详情集合
*/
@Transaction
private List<BdRangeDetailsExt> rangeDetailsAward;
private List<BdRangeDetailsExt> rangeDetails;
@Excel(name = "奖衔",sort=3)
@Excel(name = "等级", sort = 2)
private String rangeDetailsGradeVal;
@Excel(name = "奖衔", sort = 3)
private String rangeDetailsAwardVal;
private List<BdRangeDetailsExt> rangeDetails;
/**
* 等级集合
*/