录入状态接口

修复新增用户可以查到已删除的角色问题
营销数据验重增加月份条件
This commit is contained in:
SGK\17962 2025-09-22 17:44:46 +08:00
parent f5667f7105
commit b551ab60f5
8 changed files with 59 additions and 41 deletions

View File

@ -1,5 +1,5 @@
<script setup lang="tsx">
import {onMounted,ref, watch} from "vue";
import {onActivated, onMounted, ref, watch} from "vue";
import { NButton,NDivider,NEllipsis } from 'naive-ui';
import { fetchBatchDeleteMarket, fetchGetMarketList } from '@/service/api/mps/market';
import { fetchGetSubcategorySelect } from '@/service/api/business/subcategory';
@ -82,11 +82,11 @@ const {
params: {}
},
columns: () => [
{
type: 'selection',
align: 'center',
width: 48
},
// {
// type: 'selection',
// align: 'center',
// width: 48
// },
{
key: 'index',
title: $t('common.index'),
@ -189,6 +189,7 @@ const {
key: 'custId',
title: '客户身份证号',
align: 'center',
width: 180,
minWidth: 120,
ellipsis: true,
resizable: true
@ -205,6 +206,7 @@ const {
key: 'custAcctNo',
title: '客户账号/卡号',
align: 'center',
width: 180,
minWidth: 120,
ellipsis: true,
resizable: true
@ -510,7 +512,7 @@ const { startLoading, endLoading } = useLoading();
const subcategoryIdOptions = ref<CommonType.Option<CommonType.IdType>[]>([]);
onMounted(() => {
onActivated(() => {
getSubcategoryOptions();
});

View File

@ -155,7 +155,7 @@ const rules: Record<RuleKey, App.Global.FormRule | App.Global.FormRule[]> = {
yxName: createRequiredRule('营销人员名称不能为空'),
yxId: createRequiredRule('营销人员营销号不能为空'),
subcategoryName: createRequiredRule('业务类型名称不能为空'),
date: createRequiredRule('数据日期不能为空'),
date: createRequiredRule('业务日期不能为空'),
custName: createRequiredRule('客户名称不能为空'),
custPhoneNo: [phonePatternRule,createRequiredRule('客户手机号不能为空')],
custId: [idCardPatternRule,createRequiredRule('客户身份证号不能为空')],
@ -702,6 +702,7 @@ watch(
type="date"
value-format="yyyy-MM-dd"
clearable
:input-readonly="true"
:is-date-disabled="date => date < dateRange.startDate || date > dateRange.endDate"
/>
</NFormItem>

View File

@ -191,6 +191,7 @@ watch(visible, () => {
v-model:formatted-value="model.transferDate"
type="date"
value-format="yyyy-MM-dd"
:input-readonly="true"
:is-date-disabled="disablePreviousDate"
clearable
/>

View File

@ -154,4 +154,14 @@ public class BusinessSubcategoryController extends BaseController {
public R<Void> changeStatus(@RequestBody BusinessSubcategoryBo bo) {
return toAjax(businessSubcategoryService.updateSubcategoryStatus(bo.getId(), bo.getStatus()));
}
/**
* 录入状态修改
*/
@SaCheckPermission("business:subcategory:edit")
@Log(title = "业务子类管理", businessType = BusinessType.UPDATE)
@PutMapping("/changeEntryStatus")
public R<Void> changeEntryStatus(@RequestBody BusinessSubcategoryBo bo) {
return toAjax(businessSubcategoryService.updateSubcategoryEntryStatus(bo.getId(), bo.getEntryStatus()));
}
}

View File

@ -69,4 +69,6 @@ public interface IBusinessSubcategoryService {
List<BusinessSubcategoryVo> selectSelSubcategoryList();
int updateSubcategoryStatus(Long id, String status);
int updateSubcategoryEntryStatus(Long id, String entryStatus);
}

View File

@ -178,4 +178,12 @@ public class BusinessSubcategoryServiceImpl implements IBusinessSubcategoryServi
.set(BusinessSubcategory::getStatus, status)
.eq(BusinessSubcategory::getId, id));
}
@Override
public int updateSubcategoryEntryStatus(Long id, String entryStatus) {
return baseMapper.update(null,
new LambdaUpdateWrapper<BusinessSubcategory>()
.set(BusinessSubcategory::getEntryStatus, entryStatus)
.eq(BusinessSubcategory::getId, id));
}
}

View File

@ -175,11 +175,6 @@ public class MpsMarketServiceImpl implements IMpsMarketService {
*/
@Override
public Boolean insertByBo(MpsMarketBo bo) {
// if (bo.getInternetChannel().size() > 0) {
// String internetChannel = String.join(",", bo.getInternetChannel());
// bo.setInternetChannel(internetChannel);
// }
// MpsMarket add = mpsMarketConverter.convert(bo);
MpsMarket add = MapstructUtils.convert(bo, MpsMarket.class);
add.setEntryDate(DateUtils.format(new Date(), "yyyy-MM-dd"));
validEntityBefore(add);
@ -207,15 +202,16 @@ public class MpsMarketServiceImpl implements IMpsMarketService {
}
/**
* 新增前的数据校验
* 数据校验
*/
private void validEntityBefore(MpsMarket entity){
/**
* 判重
* 客户类型1-个人2-对公
* 个人判断身份证号对公判断账户号
* (个人判断身份证号对公判断账户号)+录入月份取entry_date前7位
* 取暖费身份证可以重复户号+年份不能重,年份取entry_date前四位
*
* 公积金缴纳账户代收交警罚没款代收水费代收电费允许多次录入,不验重
* 公积金缴纳账户代收交警罚没款磁条卡更换登记代收水费代收电费允许多次录入,不验重
*
* 以下业务类型只能有一个
* BIZ010 新开有效银行卡
@ -229,7 +225,6 @@ public class MpsMarketServiceImpl implements IMpsMarketService {
set.add("BIZ022");//代收水费
set.add("BIZ021");//代收电费
set.add("BIZ009");//磁条卡更换登记
set.add("BIZ034");//取暖费
Set<String> set1 = new HashSet<>();
set1.add("BIZ010");//新开有效银行卡
set1.add("BIZ011");//新开有效社保卡
@ -237,12 +232,23 @@ public class MpsMarketServiceImpl implements IMpsMarketService {
set1.add("BIZ013");//营销职工社保卡
if (set.contains(entity.getSubcategoryId())) {
//不处理
}else if (set1.contains(entity.getSubcategoryId())) {
//在set1中的业务类型身份证号不能重复
} else if ("BIZ034".equals(entity.getSubcategoryId())) {
//取暖费身份证可以重复户号+年份不能重,年份取entry_date前四位
MpsMarket mpsMarket = new MpsMarket();
mpsMarket.setHeatingNo(entity.getHeatingNo());
LambdaQueryWrapper<MpsMarket> lqw = new LambdaQueryWrapper<>(mpsMarket);
lqw.like(StringUtils.isNotEmpty(entity.getEntryDate()), MpsMarket::getEntryDate, entity.getEntryDate().substring(0,4));
List<MpsMarketVo> result = baseMapper.selectVoList(lqw);
if (!result.isEmpty()) {
throw new ServiceException("当前年度该取暖费户号已存在!");
}
} else if (set1.contains(entity.getSubcategoryId())) {
//在set1中的业务类型身份证号+月份不能重复
//没有对公业务不判断custtype
MpsMarket bo = new MpsMarket();
bo.setCustId(entity.getCustId());
LambdaQueryWrapper<MpsMarket> lqw = new LambdaQueryWrapper<>(bo);
lqw.like(MpsMarket::getEntryDate, entity.getEntryDate().substring(0,7));
lqw.in(MpsMarket::getSubcategoryId, set1);
List<MpsMarketVo> result = baseMapper.selectVoList(lqw);
if (!result.isEmpty()) {
@ -254,6 +260,7 @@ public class MpsMarketServiceImpl implements IMpsMarketService {
bo.setSubcategoryId(entity.getSubcategoryId());
bo.setCustId(entity.getCustId());
LambdaQueryWrapper<MpsMarket> lqw = new LambdaQueryWrapper<>(bo);
lqw.like(MpsMarket::getEntryDate, entity.getEntryDate().substring(0,7));
List<MpsMarketVo> result = baseMapper.selectVoList(lqw);
if (!result.isEmpty()) {
throw new ServiceException("该营销记录已存在!");
@ -264,6 +271,7 @@ public class MpsMarketServiceImpl implements IMpsMarketService {
bo.setSubcategoryId(entity.getSubcategoryId());
bo.setCustAcctNo(entity.getCustAcctNo());
LambdaQueryWrapper<MpsMarket> lqw = new LambdaQueryWrapper<>(bo);
lqw.like(MpsMarket::getEntryDate, entity.getEntryDate().substring(0,7));
List<MpsMarketVo> result = baseMapper.selectVoList(lqw);
if (!result.isEmpty()) {
throw new ServiceException("该营销记录已存在!");
@ -271,8 +279,8 @@ public class MpsMarketServiceImpl implements IMpsMarketService {
}
}
/**
* 根据业务类型判断非空,业务验重
*
* 根据业务类型判断非空
* 处理磁条卡更换金融IC卡和代收交警罚没款表的插入
*/
switch (entity.getSubcategoryId()) {
case "BIZ032":{
@ -280,15 +288,6 @@ public class MpsMarketServiceImpl implements IMpsMarketService {
if (StringUtils.isEmpty(entity.getSurplusAccountName())) {
throw new ServiceException("请填写公积金账户名称");
}
// MpsMarket bo = new MpsMarket();
// bo.setSubcategoryId(entity.getSubcategoryId());
// bo.setSurplusAccountName(entity.getSurplusAccountName());
// LambdaQueryWrapper<MpsMarket> lqw = new LambdaQueryWrapper<>(bo);
// lqw.ne( MpsMarket::getDataId, entity.getDataId());
// List<MpsMarketVo> result = baseMapper.selectVoList(lqw);
// if (!result.isEmpty()) {
// throw new ServiceException("该公积金缴纳账户已存在");
// }
break;
}
case "BIZ009":{
@ -389,15 +388,7 @@ public class MpsMarketServiceImpl implements IMpsMarketService {
if (StringUtils.isEmpty(entity.getHeatingNo())) {
throw new ServiceException("请填写取暖费编号");
}
//取暖费身份证可以重复户号+年份不能重,年份取entry_date前四位
MpsMarket mpsMarket = new MpsMarket();
mpsMarket.setHeatingNo(entity.getHeatingNo());
LambdaQueryWrapper<MpsMarket> lqw = new LambdaQueryWrapper<>(mpsMarket);
lqw.like(StringUtils.isNotEmpty(entity.getEntryDate()), MpsMarket::getEntryDate, entity.getEntryDate().substring(0,4));
List<MpsMarketVo> result = baseMapper.selectVoList(lqw);
if (!result.isEmpty()) {
throw new ServiceException("当前年度该取暖费户号已存在!");
}
break;
default:
break;

View File

@ -72,7 +72,7 @@ public class SysRoleServiceImpl implements ISysRoleService, RoleService {
return baseMapper.selectRoleList(this.buildQueryWrapper(role));
}
private Wrapper<SysRole> buildQueryWrapper(SysRoleBo bo) {
private QueryWrapper<SysRole> buildQueryWrapper(SysRoleBo bo) {
Map<String, Object> params = bo.getParams();
QueryWrapper<SysRole> wrapper = Wrappers.query();
wrapper.eq("r.del_flag", SystemConstants.NORMAL)
@ -176,9 +176,12 @@ public class SysRoleServiceImpl implements ISysRoleService, RoleService {
*/
@Override
public List<SysRoleVo> selectRoleByIds(List<Long> roleIds) {
return baseMapper.selectRoleList(new QueryWrapper<SysRole>()
return baseMapper.selectRoleList(this.buildQueryWrapper(new SysRoleBo())
.eq("r.status", SystemConstants.NORMAL)
.in(CollUtil.isNotEmpty(roleIds), "r.role_id", roleIds));
// return baseMapper.selectVoList( new LambdaQueryWrapper<SysRole>()
// .eq(SysRole::getStatus, SystemConstants.NORMAL)
// .in(CollUtil.isNotEmpty(roleIds), SysRole::getRoleId, roleIds));
}
/**