## 辅导收益添加小区月度新増业绩配置;
This commit is contained in:
parent
f32a51af1a
commit
140df30246
|
@ -34,9 +34,6 @@ import java.util.List;
|
|||
|
||||
/**
|
||||
* 奖衔配置前端控制器
|
||||
*
|
||||
* @author zhangjing
|
||||
* @since 2022-09-08
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
|
@ -44,27 +41,18 @@ import java.util.List;
|
|||
public class BdAwardsController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IBdAwardsService awardsService;
|
||||
private IBdAwardsService iBdAwardsService;
|
||||
@Autowired
|
||||
private IBdNoticeService noticeService;
|
||||
private IBdNoticeService iBdNoticeService;
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
|
||||
@DubboReference
|
||||
ITransactionServiceApi iTransactionServiceApi;
|
||||
|
||||
private RedisService redisService;
|
||||
|
||||
@Autowired
|
||||
public void setRedisService(RedisService redisService) {
|
||||
this.redisService = redisService;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @description: 查询奖衔配置列表
|
||||
* @author: zhang jing
|
||||
* @date: 2022/8/30 10:20
|
||||
* @param: [awards]
|
||||
* @return: com.hzs.common.core.web.page.TableDataInfo
|
||||
* 查询奖衔配置列表
|
||||
**/
|
||||
@Log(module = EOperationModule.LEVEL_CONFIG, business = EOperationBusiness.AWARD_CONTROL, method = EOperationMethod.SELECT)
|
||||
@GetMapping("/list")
|
||||
|
@ -77,15 +65,15 @@ public class BdAwardsController extends BaseController {
|
|||
}
|
||||
queryWrapper.orderByAsc(BdAwards::getAwardsValue);
|
||||
List<BdAwardsExt> listExt = new ArrayList<>();
|
||||
List<BdAwards> list = awardsService.list(queryWrapper);
|
||||
List<BdAwards> list = iBdAwardsService.list(queryWrapper);
|
||||
list.forEach(item -> listExt.add(BeanUtil.copyProperties(item, BdAwardsExt.class)));
|
||||
if (CollectionUtil.isNotEmpty(listExt)) {
|
||||
for (BdAwardsExt ae : listExt) {
|
||||
if (StringUtils.isNotNull(ae.getPkCheckAwardsLeft())) {
|
||||
ae.setPkCheckAwardsLeft(noticeService.getAwardsTranslateValue(ae.getPkCheckAwardsLeft(), null));
|
||||
ae.setPkCheckAwardsLeft(iBdNoticeService.getAwardsTranslateValue(ae.getPkCheckAwardsLeft(), null));
|
||||
}
|
||||
if (StringUtils.isNotNull(ae.getPkCheckAwardsRight())) {
|
||||
ae.setPkCheckAwardsRight(noticeService.getAwardsTranslateValue(ae.getPkCheckAwardsRight(), null));
|
||||
ae.setPkCheckAwardsRight(iBdNoticeService.getAwardsTranslateValue(ae.getPkCheckAwardsRight(), null));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -93,11 +81,7 @@ public class BdAwardsController extends BaseController {
|
|||
}
|
||||
|
||||
/**
|
||||
* @description: 导出奖衔配置
|
||||
* @author: zhang jing
|
||||
* @date: 2023/3/9 15:32
|
||||
* @param: [response, awards]
|
||||
* @return: void
|
||||
* 导出奖衔配置
|
||||
**/
|
||||
@Log(module = EOperationModule.LEVEL_CONFIG, business = EOperationBusiness.AWARD_CONTROL, method = EOperationMethod.SELECT)
|
||||
@PostMapping("/export")
|
||||
|
@ -110,12 +94,12 @@ public class BdAwardsController extends BaseController {
|
|||
}
|
||||
queryWrapper.orderByAsc(BdAwards::getAwardsValue);
|
||||
List<BdAwardsExt> listExt = new ArrayList<>();
|
||||
List<BdAwards> list = awardsService.list(queryWrapper);
|
||||
List<BdAwards> list = iBdAwardsService.list(queryWrapper);
|
||||
list.forEach(item -> listExt.add(BeanUtil.copyProperties(item, BdAwardsExt.class)));
|
||||
if (CollectionUtil.isNotEmpty(listExt)) {
|
||||
for (BdAwardsExt ae : listExt) {
|
||||
ae.setPkCheckAwardsLeft(noticeService.getAwardsTranslateValue(ae.getPkCheckAwardsLeft(), null));
|
||||
ae.setPkCheckAwardsRight(noticeService.getAwardsTranslateValue(ae.getPkCheckAwardsRight(), null));
|
||||
ae.setPkCheckAwardsLeft(iBdNoticeService.getAwardsTranslateValue(ae.getPkCheckAwardsLeft(), null));
|
||||
ae.setPkCheckAwardsRight(iBdNoticeService.getAwardsTranslateValue(ae.getPkCheckAwardsRight(), null));
|
||||
}
|
||||
}
|
||||
ExcelUtil<BdAwardsExt> util = new ExcelUtil<>(BdAwardsExt.class);
|
||||
|
@ -123,11 +107,7 @@ public class BdAwardsController extends BaseController {
|
|||
}
|
||||
|
||||
/**
|
||||
* @description: 真实奖衔下拉选
|
||||
* @author: zhang jing
|
||||
* @date: 2022/10/27 10:15
|
||||
* @param: [awards]
|
||||
* @return: com.hzs.common.core.web.page.TableDataInfo
|
||||
* 真实奖衔下拉选
|
||||
**/
|
||||
@Log(module = EOperationModule.LEVEL_CONFIG, business = EOperationBusiness.AWARD_CONTROL, method = EOperationMethod.SELECT)
|
||||
@GetMapping("/awardsList")
|
||||
|
@ -135,7 +115,7 @@ public class BdAwardsController extends BaseController {
|
|||
LambdaQueryWrapper<BdAwards> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(BdAwards::getPkCountry, SecurityUtils.getPkCountry());
|
||||
queryWrapper.orderByAsc(BdAwards::getAwardsValue);
|
||||
List<BdAwards> list = awardsService.list(queryWrapper);
|
||||
List<BdAwards> list = iBdAwardsService.list(queryWrapper);
|
||||
List<BdAwardsExt> listExt = new ArrayList<>();
|
||||
for (BdAwards ba : list) {
|
||||
BdAwardsExt baExt = new BdAwardsExt();
|
||||
|
@ -148,19 +128,15 @@ public class BdAwardsController extends BaseController {
|
|||
}
|
||||
|
||||
/**
|
||||
* @description: 辅导分红列表
|
||||
* @author: zhang jing
|
||||
* @date: 2022/10/27 10:15
|
||||
* @param: [awards]
|
||||
* @return: com.hzs.common.core.web.page.TableDataInfo
|
||||
* 辅导分红列表
|
||||
**/
|
||||
@Log(module = EOperationModule.LEVEL_CONFIG, business = EOperationBusiness.AWARD_CONTROL, method = EOperationMethod.SELECT)
|
||||
@GetMapping("/coachBonusList")
|
||||
public TableDataInfo coachBonusList(BdAwards awards) {
|
||||
public TableDataInfo coachBonusList() {
|
||||
LambdaQueryWrapper<BdAwards> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(BdAwards::getPkCountry, SecurityUtils.getPkCountry());
|
||||
queryWrapper.orderByAsc(BdAwards::getAwardsValue);
|
||||
List<BdAwards> list = awardsService.list(queryWrapper);
|
||||
List<BdAwards> list = iBdAwardsService.list(queryWrapper);
|
||||
List<BdAwardsExt> listExt = new ArrayList<>();
|
||||
for (BdAwards ba : list) {
|
||||
BdAwardsExt baExt = new BdAwardsExt();
|
||||
|
@ -169,17 +145,14 @@ public class BdAwardsController extends BaseController {
|
|||
baExt.setCoachAlgebra(ba.getCoachAlgebra());
|
||||
baExt.setCoachRatio(ba.getCoachRatio());
|
||||
baExt.setAbonusRatio(ba.getAbonusRatio());
|
||||
baExt.setSmallAssess(ba.getSmallAssess());
|
||||
listExt.add(baExt);
|
||||
}
|
||||
return getDataTable(listExt);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 环球积分列表+车奖积分列表
|
||||
* @author: zhang jing
|
||||
* @date: 2022/11/2 9:16
|
||||
* @param: [awards]
|
||||
* @return: com.hzs.common.core.web.page.TableDataInfo
|
||||
* 环球积分列表+车奖积分列表
|
||||
**/
|
||||
@Log(module = EOperationModule.LEVEL_CONFIG, business = EOperationBusiness.AWARD_CONTROL, method = EOperationMethod.SELECT)
|
||||
@GetMapping("/integralList")
|
||||
|
@ -187,7 +160,7 @@ public class BdAwardsController extends BaseController {
|
|||
LambdaQueryWrapper<BdAwards> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(BdAwards::getPkCountry, SecurityUtils.getPkCountry());
|
||||
queryWrapper.orderByAsc(BdAwards::getAwardsValue);
|
||||
List<BdAwards> list = awardsService.list(queryWrapper);
|
||||
List<BdAwards> list = iBdAwardsService.list(queryWrapper);
|
||||
List<BdAwardsExt> listExt = new ArrayList<>();
|
||||
if (CollectionUtil.isNotEmpty(list)) {
|
||||
for (BdAwards ba : list) {
|
||||
|
@ -204,11 +177,7 @@ public class BdAwardsController extends BaseController {
|
|||
|
||||
|
||||
/**
|
||||
* @description: 新增奖衔配置
|
||||
* @author: zhang jing
|
||||
* @date: 2022/8/30 10:21
|
||||
* @param: [awards]
|
||||
* @return: com.hzs.common.core.web.domain.AjaxResult
|
||||
* 新增奖衔配置
|
||||
**/
|
||||
@Log(module = EOperationModule.LEVEL_CONFIG, business = EOperationBusiness.AWARD_CONTROL, method = EOperationMethod.INSERT)
|
||||
@PostMapping("/generate")
|
||||
|
@ -246,7 +215,7 @@ public class BdAwardsController extends BaseController {
|
|||
LambdaQueryWrapper<BdAwards> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(BdAwards::getPkCountry, SecurityUtils.getPkCountry());
|
||||
queryWrapper.eq(BdAwards::getAwardsValue, awards.getAwardsValue());
|
||||
List<BdAwards> list1 = awardsService.list(queryWrapper);
|
||||
List<BdAwards> list1 = iBdAwardsService.list(queryWrapper);
|
||||
if (CollectionUtil.isNotEmpty(list1)) {
|
||||
return AjaxResult.error((ConfigMsgConstants.DATA_REPEAT));
|
||||
}
|
||||
|
@ -255,17 +224,12 @@ public class BdAwardsController extends BaseController {
|
|||
awards.getAwardsName(), EYesNo.YES, EYesNo.NO);
|
||||
awards.setPkTransaction(pkTransaction.getData());
|
||||
redisService.deleteObjectByKey(CacheConstants.BD_AWARDS + pkCountry);
|
||||
awardsService.save(awards);
|
||||
iBdAwardsService.save(awards);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @description: 修改奖衔配置
|
||||
* @author: zhang jing
|
||||
* @date: 2022/8/30 10:21
|
||||
* @param: [awards]
|
||||
* @return: com.hzs.common.core.web.domain.AjaxResult
|
||||
* 修改奖衔配置
|
||||
**/
|
||||
@Log(module = EOperationModule.LEVEL_CONFIG, business = EOperationBusiness.AWARD_CONTROL, method = EOperationMethod.UPDATE)
|
||||
@PostMapping("/update")
|
||||
|
@ -300,7 +264,7 @@ public class BdAwardsController extends BaseController {
|
|||
queryWrapper.eq(BdAwards::getPkCountry, SecurityUtils.getPkCountry());
|
||||
queryWrapper.eq(BdAwards::getAwardsValue, awards.getAwardsValue());
|
||||
queryWrapper.ne(BdAwards::getPkId, awards.getPkId());
|
||||
List<BdAwards> list1 = awardsService.list(queryWrapper);
|
||||
List<BdAwards> list1 = iBdAwardsService.list(queryWrapper);
|
||||
if (CollectionUtil.isNotEmpty(list1)) {
|
||||
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.DATA_REPEAT));
|
||||
}
|
||||
|
@ -317,15 +281,11 @@ public class BdAwardsController extends BaseController {
|
|||
awards.setPkModified(SecurityUtils.getUserId());
|
||||
awards.setModifiedTime(new Date());
|
||||
redisService.deleteObjectByKey(CacheConstants.BD_AWARDS + pkCountry);
|
||||
return toAjax(awardsService.updateById(awards));
|
||||
return toAjax(iBdAwardsService.updateById(awards));
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 修改启用禁用
|
||||
* @author: zhang jing
|
||||
* @date: 2023/4/24 14:30
|
||||
* @param: [gradeExt]
|
||||
* @return: com.hzs.common.core.web.domain.AjaxResult
|
||||
* 修改启用禁用
|
||||
**/
|
||||
@Log(module = EOperationModule.LEVEL_CONFIG, business = EOperationBusiness.AWARD_CONTROL, method = EOperationMethod.UPDATE)
|
||||
@PostMapping("/updateState")
|
||||
|
@ -341,17 +301,13 @@ public class BdAwardsController extends BaseController {
|
|||
updateWrapper.eq(BdAwards::getPkId, awards.getPkId());
|
||||
updateWrapper.set(BdAwards::getPkModified, SecurityUtils.getUserId());
|
||||
updateWrapper.set(BdAwards::getModifiedTime, new Date());
|
||||
awardsService.update(updateWrapper);
|
||||
iBdAwardsService.update(updateWrapper);
|
||||
redisService.deleteObjectByKey(CacheConstants.BD_AWARDS + SecurityUtils.getPkCountry());
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 修改辅导分红
|
||||
* @author: zhang jing
|
||||
* @date: 2022/10/31 19:39
|
||||
* @param: [awards]
|
||||
* @return: com.hzs.common.core.web.domain.AjaxResult
|
||||
* 修改辅导分红
|
||||
**/
|
||||
@Log(module = EOperationModule.LEVEL_CONFIG, business = EOperationBusiness.AWARD_CONTROL, method = EOperationMethod.UPDATE)
|
||||
@PostMapping("/updateCoachBonus")
|
||||
|
@ -359,7 +315,7 @@ public class BdAwardsController extends BaseController {
|
|||
List<BdAwards> awardsList = new ArrayList<>();
|
||||
if (CollectionUtil.isNotEmpty(awardsExt.getAwardsList())) {
|
||||
for (BdAwards awards : awardsExt.getAwardsList()) {
|
||||
BdAwards awardsOld = awardsService.getById(awards.getPkId());
|
||||
BdAwards awardsOld = iBdAwardsService.getById(awards.getPkId());
|
||||
if (StringUtils.isNull(awards.getPkId())) {
|
||||
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.PK_GRADE_AWARDS_NOT_NULL));
|
||||
}
|
||||
|
@ -372,9 +328,13 @@ public class BdAwardsController extends BaseController {
|
|||
if (StringUtils.isNull(awards.getAbonusRatio())) {
|
||||
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.ABONUS_RATIO_NOT_NULL));
|
||||
}
|
||||
if (StringUtils.isNull(awards.getSmallAssess())) {
|
||||
return AjaxResult.error("小区月度新増业绩");
|
||||
}
|
||||
awardsOld.setCoachAlgebra(awards.getCoachAlgebra());
|
||||
awardsOld.setCoachRatio(awards.getCoachRatio());
|
||||
awardsOld.setAbonusRatio(awards.getAbonusRatio());
|
||||
awardsOld.setSmallAssess(awards.getSmallAssess());
|
||||
awardsOld.setPkCountry(SecurityUtils.getPkCountry());
|
||||
awardsOld.setPkModified(SecurityUtils.getUserId());
|
||||
awardsOld.setModifiedTime(new Date());
|
||||
|
@ -382,18 +342,14 @@ public class BdAwardsController extends BaseController {
|
|||
}
|
||||
awardsExt.setAwardsList(awardsList);
|
||||
redisService.deleteObjectByKey(CacheConstants.BD_AWARDS_COACH + SecurityUtils.getPkCountry());
|
||||
return AjaxResult.success(awardsService.updateAwards(awardsExt));
|
||||
return AjaxResult.success(iBdAwardsService.updateAwards(awardsExt));
|
||||
} else {
|
||||
return AjaxResult.error();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 修改环球积分
|
||||
* @author: zhang jing
|
||||
* @date: 2022/11/2 9:38
|
||||
* @param: [awardsExt]
|
||||
* @return: com.hzs.common.core.web.domain.AjaxResult
|
||||
* 修改环球积分
|
||||
**/
|
||||
@Log(module = EOperationModule.LEVEL_CONFIG, business = EOperationBusiness.AWARD_CONTROL, method = EOperationMethod.UPDATE)
|
||||
@PostMapping("/updategLobalIntegral")
|
||||
|
@ -411,18 +367,14 @@ public class BdAwardsController extends BaseController {
|
|||
awards.setPkModified(SecurityUtils.getUserId());
|
||||
awards.setModifiedTime(new Date());
|
||||
}
|
||||
return AjaxResult.success(awardsService.updateLobalIntegral(awardsExt));
|
||||
return AjaxResult.success(iBdAwardsService.updateLobalIntegral(awardsExt));
|
||||
} else {
|
||||
return AjaxResult.error();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 修改车奖积分
|
||||
* @author: zhang jing
|
||||
* @date: 2022/11/2 9:38
|
||||
* @param: [awardsExt]
|
||||
* @return: com.hzs.common.core.web.domain.AjaxResult
|
||||
* 修改车奖积分
|
||||
**/
|
||||
@Log(module = EOperationModule.LEVEL_CONFIG, business = EOperationBusiness.AWARD_CONTROL, method = EOperationMethod.UPDATE)
|
||||
@PostMapping("/updategCarAwardPoints")
|
||||
|
@ -440,7 +392,7 @@ public class BdAwardsController extends BaseController {
|
|||
awards.setPkModified(SecurityUtils.getUserId());
|
||||
awards.setModifiedTime(new Date());
|
||||
}
|
||||
return AjaxResult.success(awardsService.updateGlobalIntegral(awardsExt));
|
||||
return AjaxResult.success(iBdAwardsService.updateGlobalIntegral(awardsExt));
|
||||
} else {
|
||||
return AjaxResult.error();
|
||||
}
|
||||
|
@ -448,26 +400,18 @@ public class BdAwardsController extends BaseController {
|
|||
|
||||
|
||||
/**
|
||||
* @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.AWARD_CONTROL, method = EOperationMethod.SELECT)
|
||||
@GetMapping("/getOne/{pkId}")
|
||||
public AjaxResult getOne(@PathVariable Long pkId) {
|
||||
BdAwards awards = awardsService.getById(pkId);
|
||||
BdAwards awards = iBdAwardsService.getById(pkId);
|
||||
return AjaxResult.success(awards);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @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.AWARD_CONTROL, method = EOperationMethod.DELETE)
|
||||
@DeleteMapping("/{pkId}")
|
||||
|
@ -479,11 +423,11 @@ public class BdAwardsController extends BaseController {
|
|||
updateWrapper.set(BdAwards::getModifiedTime, new Date());
|
||||
redisService.deleteObjectByKey(CacheConstants.BD_AWARDS + SecurityUtils.getPkCountry());
|
||||
redisService.deleteObjectByKey(CacheConstants.BD_AWARDS_COACH + SecurityUtils.getPkCountry());
|
||||
Integer count = awardsService.checkGradeAwards(null, null, pkId);
|
||||
Integer count = iBdAwardsService.checkGradeAwards(null, null, pkId);
|
||||
if (count > 0) {
|
||||
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.ENABLE_STATE_NOT_DELETE));
|
||||
}
|
||||
return AjaxResult.success(awardsService.update(updateWrapper));
|
||||
return AjaxResult.success(iBdAwardsService.update(updateWrapper));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue