增加顺序字段

增加后缀选择
解决查询条件未生效问题
This commit is contained in:
SGK\17962 2025-09-20 11:02:47 +08:00
parent 4c422c9110
commit f876c852eb
16 changed files with 321 additions and 51 deletions

View File

@ -436,6 +436,7 @@ const local: App.I18n.Schema = {
categoryName: '类目名称',
parentCategoryName: '上级类目',
status: '状态',
entryStatus: '录入状态',
add: '添加业务类目',
refresh: '刷新',
form: {

View File

@ -51,3 +51,11 @@ export function fetchUpdateSubcategoryStatus(data: Api.Business.SubcategoryOpera
data
});
}
/** 修改业务类型录入状态 */
export function fetchUpdateSubcategoryEntryStatus(data: Api.Business.SubcategoryOperateParams) {
return request<boolean>({
url: '/business/subcategory/changeEntryStatus',
method: 'put',
data
});
}

View File

@ -17,8 +17,14 @@ declare namespace Api {
name: string;
/** 业务子类状态 */
status: string;
/** 业务子类录入状态 */
entryStatus: string;
/** 计价规则说明 */
pricingRule: string;
/** 业务子类后缀类型 */
suffixType: string;
/** 业务子类排序 */
sortId: number;
}>;
/** subcategory search params */
@ -29,6 +35,7 @@ declare namespace Api {
| 'typeId'
| 'name'
| 'status'
| 'entryStatus'
| 'pricingRule'
> &
Api.Common.CommonSearchParams
@ -43,7 +50,10 @@ declare namespace Api {
| 'typeId'
| 'name'
| 'status'
| 'entryStatus'
| 'pricingRule'
| 'suffixType'
| 'sortId'
>
>;

View File

@ -491,6 +491,7 @@ declare namespace App {
categoryName: string;
parentCategoryName: string;
status: string;
entryStatus: string;
add: string;
refresh: string;
form: {

View File

@ -1,11 +1,11 @@
<script setup lang="tsx">
import { ref, watch } from 'vue';
import type { TreeOption } from 'naive-ui';
import { NDivider,NEllipsis, NEmpty, NInput, NSpin, NTooltip,NTree } from 'naive-ui';
import { NDivider,NEllipsis, NEmpty, NInput,NSelect, NSpin, NTooltip,NTree } from 'naive-ui';
import {fetchBatchDeleteCategory, fetchGetCategoryOption} from "@/service/api/business/category";
import {
fetchBatchDeleteSubcategory,
fetchGetSubcategoryList,
fetchGetSubcategoryList, fetchUpdateSubcategoryEntryStatus,
fetchUpdateSubcategoryStatus
} from "@/service/api/business/subcategory";
import { useAppStore } from '@/store/modules/app';
@ -19,6 +19,7 @@ import CategoryOperateDrawer from "@/views/business/category/modules/category-op
import SubcategoryOperateDrawer from './modules/subcategory-operate-drawer.vue';
import SubcategorySearch from './modules/subcategory-search.vue';
import {useBoolean, useLoading} from '~/packages/hooks';
import {useDict} from "@/hooks/business/dict";
defineOptions({
name: 'SubcategoryList'
@ -28,6 +29,7 @@ const appStore = useAppStore();
const { download } = useDownload();
const { hasAuth } = useAuth();
// const { bool: importVisible, setTrue: openImportModal } = useBoolean();
const { options: mps_price_suffix } = useDict('mps_price_suffix');
// category
const categoryPattern = ref<string>();
@ -51,6 +53,7 @@ const {
searchParams,
resetSearchParams
} = useTable({
immediate: undefined,
apiFn: fetchGetSubcategoryList,
apiParams: {
pageNum: 1,
@ -58,6 +61,7 @@ const {
categoryId: null,
name: null,
status: null,
entryStatus: null,
pricingRule: null,
params: {}
},
@ -68,10 +72,11 @@ const {
width: 48
},
{
key: 'index',
title: $t('common.index'),
key: 'sortId',
title: '排序',
align: 'center',
width: 64,
ellipsis: true,
resizable: true
},
// {
@ -122,6 +127,22 @@ const {
);
}
},
{
key: 'entryStatus',
title: $t('page.business.category.entryStatus'),
align: 'center',
minWidth: 80,
resizable: true,
render(row) {
return (
<StatusSwitch
v-model:value={row.entryStatus}
info={row.name}
onSubmitted={(value, callback) => handleEntryStatusChange(row, value, callback)}
/>
);
}
},
{
key: 'pricingRule',
title: '计价规则说明',
@ -131,23 +152,10 @@ const {
resizable: true,
render: (row) => {
if (!row.pricingRule) return '';
const suffixMap = {
'BIZ032': ' * 交易金额',
'BIZ031': ' * 交易金额',
'default': '元/条'
};
let formattedValue;
if(row.typeId !== 'BIZ032' && row.typeId !== 'BIZ031' ){
formattedValue = parseFloat(row.pricingRule).toFixed(2);
}else{
formattedValue = row.pricingRule;
}
const suffix = suffixMap[row.typeId] || suffixMap.default;
const selectedSuffix = mps_price_suffix.value.find(option => option.value === row.suffixType)?.label;
return (
<NEllipsis style="width: 100%;" tooltip={true}>
{`${formattedValue}${suffix}`}
</NEllipsis>
);
row.pricingRule + selectedSuffix
);
}
},
{
@ -223,6 +231,24 @@ async function handleStatusChange(
getData();
}
}
/** 处理录入状态切换 */
async function handleEntryStatusChange(
row: Api.Business.Subcategory,
value: Api.Common.EnableStatus,
callback: (flag: boolean) => void
) {
const { error } = await fetchUpdateSubcategoryEntryStatus({
id: row.id,
entryStatus: value
});
callback(!error);
if (!error) {
window.$message?.success($t('page.system.user.statusChangeSuccess'));
getData();
}
}
const { loading: treeLoading, startLoading: startTreeLoading, endLoading: endTreeLoading } = useLoading();
const categoryOperateType = ref<NaiveUI.TableOperateType>('add');
@ -388,7 +414,11 @@ function handleExport() {
<!-- 左侧树结构 -->
<template #sider>
<NInput v-model:value="categoryPattern" clearable placeholder="请输入关键字搜索" />
<NInput
v-model:value="categoryPattern"
clearable
placeholder="请输入关键字搜索"
/>
<NSpin class="category-tree" :show="treeLoading">
<NTree
block-node
@ -406,16 +436,30 @@ function handleExport() {
@update:selected-keys="handleClickCategory"
>
<template #empty>
<NEmpty description="暂无分类数据" class="h-full min-h-200px justify-center" />
<NEmpty
description="暂无分类数据"
class="h-full min-h-200px justify-center"
/>
</template>
</NTree>
</NSpin>
</template>
<!-- 右侧表格区域 -->
<div class="h-full flex-col-stretch gap-16px overflow-hidden lt-sm:overflow-auto">
<SubcategorySearch v-model:model="searchParams" @reset="resetSearchParams" @search="getDataByPage" />
<NCard title="业务子类列表" :bordered="false" size="small" class="card-wrapper sm:flex-1-hidden">
<div
class="h-full flex-col-stretch gap-16px overflow-hidden lt-sm:overflow-auto"
>
<SubcategorySearch
v-model:model="searchParams"
@reset="resetSearchParams"
@search="getDataByPage"
/>
<NCard
title="业务子类列表"
:bordered="false"
size="small"
class="card-wrapper sm:flex-1-hidden"
>
<template #header-extra>
<TableHeaderOperation
v-model:columns="columnChecks"
@ -442,7 +486,7 @@ function handleExport() {
:scroll-x="scrollX"
:loading="loading"
remote
:row-key="row => row.id"
:row-key="(row) => row.id"
:pagination="mobilePagination"
class="sm:h-full"
@update-resize-widths="scrollX = calculateTotalWidth()"

View File

@ -33,6 +33,8 @@ const visible = defineModel<boolean>('visible', {
const { formRef, validate, restoreValidation } = useNaiveForm();
const { createRequiredRule } = useFormRules();
const { options: mps_price_suffix } = useDict('mps_price_suffix');
const title = computed(() => {
const titles: Record<NaiveUI.TableOperateType, string> = {
@ -52,13 +54,17 @@ function createDefaultModel(): Model {
name: '',
typeId: '',
status: '0',
entryStatus: '0',
pricingRule: '',
suffixType: '1',
sortId: null
};
}
type RuleKey = Extract<
keyof Model,
| 'status'
| 'entryStatus'
| 'name'
| 'typeId'
| 'pricingRule'
@ -73,6 +79,7 @@ const typeIdPatternRule = {
const rules: Record<RuleKey, App.Global.FormRule | App.Global.FormRule[]> = {
status: createRequiredRule('状态不能为空'),
entryStatus: createRequiredRule('状态不能为空'),
pricingRule: createRequiredRule('计价规则说明不能为空'),
typeId: [createRequiredRule('业务子类类型不能为空'), typeIdPatternRule],
name: createRequiredRule('业务子类名称不能为空'),
@ -96,16 +103,16 @@ function closeDrawer() {
async function handleSubmit() {
await validate();
const { id, categoryId, name,typeId, status,pricingRule } = model;
const { id, categoryId, name,typeId, status,entryStatus,suffixType,sortId,pricingRule } = model;
// request
if (props.operateType === 'add') {
const { error } = await fetchCreateSubcategory({ categoryId, name,typeId, status,pricingRule });
const { error } = await fetchCreateSubcategory({ categoryId, name,typeId, status,entryStatus,suffixType,sortId,pricingRule });
if (error) return;
}
if (props.operateType === 'edit') {
const { error } = await fetchUpdateSubcategory({ id, categoryId, name,typeId, status,pricingRule });
const { error } = await fetchUpdateSubcategory({ id, categoryId, name,typeId, status,entryStatus,suffixType,sortId,pricingRule });
if (error) return;
}
@ -140,21 +147,28 @@ watch(visible, () => {
<NFormItem label="业务子类id" path="typeId">
<NInput v-model:value="model.typeId" :disabled="props.operateType === 'edit'" placeholder="请输入业务子类id" />
</NFormItem>
<NFormItem label="排序" path="sortId">
<NInputNumber v-model:value="model.sortId" placeholder="请输入排序" />
</NFormItem>
<NFormItem label="状态" path="status">
<DictRadio v-model:value="model.status" dict-code="sys_normal_disable" />
</NFormItem>
<NFormItem label="录入状态" path="entryStatus">
<DictRadio v-model:value="model.entryStatus" dict-code="sys_normal_disable" />
</NFormItem>
<NFormItem label="计价规则说明" path="pricingRule">
<NInput
v-model:value="model.pricingRule"
:rows="3"
placeholder="请输入计价规则说明"
>
<template v-if="model.typeId === 'BIZ032' || model.typeId === 'BIZ031' " #suffix>
* 交易金额
</template>
<template else #suffix>
/
</template>
<template #suffix>
<NSelect
v-model:value="model.suffixType"
:options="mps_price_suffix"
style="width: 120px; margin-right: -12px;"
/>
</template>
</NInput>
</NFormItem>
</NForm>

View File

@ -50,9 +50,12 @@ async function search() {
<!-- <NFormItemGi span="24 s:12 m:8" label="业务子类名称" path="name" class="pr-24px">-->
<!-- <NInput v-model:value="model.name" placeholder="请输入业务子类名称" />-->
<!-- </NFormItemGi>-->
<NFormItemGi span="24 s:12 m:8" label="状态" path="pricingRule" class="pr-24px">
<NFormItemGi span="24 s:12 m:8" label="状态" path="status" class="pr-24px">
<NSelect v-model:value="model.status" :options="statusOptions" placeholder="请选择状态" />
</NFormItemGi>
<NFormItemGi span="24 s:12 m:8" label="录入状态" path="entryStatus" class="pr-24px">
<NSelect v-model:value="model.entryStatus" :options="statusOptions" placeholder="请选择状态" />
</NFormItemGi>
<!-- <NFormItemGi span="24 s:12 m:8" label="计价规则说明" path="pricingRule" class="pr-24px">-->
<!-- <NInput v-model:value="model.pricingRule" placeholder="请输入计价规则说明" />-->
<!-- </NFormItemGi>-->

View File

@ -695,7 +695,7 @@ watch(
</NFormItem>
</NGridItem>
<NGridItem :span="12">
<NFormItem label="日期" path="date">
<NFormItem label="业务日期" path="date">
<NDatePicker
v-model:formatted-value="model.date"
:disabled="operateType === 'edit'"
@ -745,7 +745,7 @@ watch(
</NGridItem>
<NGridItem v-if="showCustFields" :span="12">
<NFormItem label="客户身份证号:" path="custId">
<NInput v-model:value="model.custId" :disabled="model.subcategoryId === 'BIZ013'" placeholder="请输入客户身份证号" clearable />
<NInput v-model:value="model.custId" :disabled="operateType === 'edit' && model.subcategoryId === 'BIZ013'" placeholder="请输入客户身份证号" clearable />
</NFormItem>
</NGridItem>
</NGrid>

View File

@ -140,8 +140,7 @@ public class BusinessSubcategoryController extends BaseController {
@GetMapping("/selList")
public R<List<BusinessSubcategoryVo>> selList() {
BusinessSubcategoryBo bo = new BusinessSubcategoryBo();
bo.setStatus("0");
List<BusinessSubcategoryVo> list = businessSubcategoryService.queryList(bo);
List<BusinessSubcategoryVo> list = businessSubcategoryService.selectSelSubcategoryList();
return R.ok(list);
// return R.ok(businessSubcategoryService.selectSelSubcategoryList());
}

View File

@ -52,5 +52,27 @@ public class BusinessSubcategory extends TenantEntity {
*/
private String status;
/**
* 业务子类录入状态0正常 1停用
*/
private String entryStatus;
/**
* 业务子类排序
*/
private Integer sortId;
/**
* 计价规则后缀类型
*/
private String suffixType;
/**
* 备注
*/
private String remark1;
private String remark2;
private String remark3;
}

View File

@ -49,6 +49,31 @@ public class BusinessSubcategoryBo extends BaseEntity {
@NotBlank(message = "业务子类状态不能为空", groups = { AddGroup.class, EditGroup.class })
private String status;
/**
* 业务子类录入状态0正常 1停用
*/
@NotBlank(message = "业务子类录入状态不能为空", groups = { AddGroup.class, EditGroup.class })
private String entryStatus;
/**
* 业务子类排序
*/
@NotNull(message = "业务子类排序不能为空", groups = { AddGroup.class, EditGroup.class })
private Integer sortId;
/**
* 计价规则后缀类型
*/
@NotBlank(message = "计价规则后缀类型不能为空", groups = { AddGroup.class, EditGroup.class })
private String suffixType;
/**
* 备注
*/
private String remark1;
private String remark2;
private String remark3;
/**
* 计价规则说明
*/

View File

@ -57,6 +57,34 @@ public class BusinessSubcategoryImportVo implements Serializable {
@ExcelProperty(value = "业务子类状态0正常 1停用")
private String status;
/**
* 业务子类录入状态0正常 1停用
*/
@ExcelProperty(value = "业务子类录入状态0正常 1停用")
private String entryStatus;
/**
* 业务子类排序
*/
@ExcelProperty(value = "业务子类排序")
private Integer sortId;
/**
* 计价规则后缀类型
*/
@ExcelProperty(value = "计价规则后缀类型", converter = ExcelDictConvert.class)
private String suffixType;
/**
* 备注
*/
@ExcelProperty(value = "备注1")
private String remark1;
@ExcelProperty(value = "备注2")
private String remark2;
@ExcelProperty(value = "备注3")
private String remark3;
/**
* 计价规则说明
*/

View File

@ -58,6 +58,34 @@ public class BusinessSubcategoryVo implements Serializable {
@ExcelProperty(value = "业务子类状态0正常 1停用")
private String status;
/**
* 业务子类录入状态0正常 1停用
*/
@ExcelProperty(value = "业务子类录入状态0正常 1停用")
private String entryStatus;
/**
* 业务子类排序
*/
@ExcelProperty(value = "业务子类排序")
private Integer sortId;
/**
* 计价规则后缀类型
*/
@ExcelProperty(value = "计价规则后缀类型", converter = ExcelDictConvert.class)
private String suffixType;
/**
* 备注
*/
@ExcelProperty(value = "备注1")
private String remark1;
@ExcelProperty(value = "备注2")
private String remark2;
@ExcelProperty(value = "备注3")
private String remark3;
/**
* 计价规则说明
*/

View File

@ -166,10 +166,10 @@ public class BusinessSubcategoryServiceImpl implements IBusinessSubcategoryServi
@Override
public List<BusinessSubcategoryVo> selectSelSubcategoryList() {
return baseMapper.selectSubcategoryList(new LambdaQueryWrapper<BusinessSubcategory>()
//.select(SysUser::getUserId, SysUser::getMktNo, SysUser::getNickName)
.select(BusinessSubcategory::getId, BusinessSubcategory::getName)
// .ne( BusinessSubcategory::getTypeId, "BIZ006")//BIZ006 新增综合收单商户留存率提升当季不录入
.eq(BusinessSubcategory::getStatus, "0"));
.eq(BusinessSubcategory::getEntryStatus, "0")//BIZ006 新增综合收单商户留存率提升当季不录入
.eq(BusinessSubcategory::getStatus, "0")
.orderByAsc(BusinessSubcategory::getSortId));
}
@Override

View File

@ -229,6 +229,7 @@ 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");//新开有效社保卡
@ -242,7 +243,7 @@ public class MpsMarketServiceImpl implements IMpsMarketService {
MpsMarket bo = new MpsMarket();
bo.setCustId(entity.getCustId());
LambdaQueryWrapper<MpsMarket> lqw = new LambdaQueryWrapper<>(bo);
lqw.in(StringUtils.isNotBlank(bo.getSubcategoryId()), MpsMarket::getSubcategoryId, set1);
lqw.in(MpsMarket::getSubcategoryId, set1);
List<MpsMarketVo> result = baseMapper.selectVoList(lqw);
if (!result.isEmpty()) {
throw new ServiceException("该营销记录已存在!");
@ -270,13 +271,9 @@ public class MpsMarketServiceImpl implements IMpsMarketService {
}
}
/**
* 根据业务类型判断非空,
*
*
* 根据业务类型判断非空,业务验重
*
*/
switch (entity.getSubcategoryId()) {
case "BIZ032":{
//公积金缴纳账户
@ -392,6 +389,15 @@ 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

@ -1,7 +1,88 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.dromara.mps.mapper.MpsMarketMapper">
<!--mysql写法,达梦兼容-->
<insert id="batchInsert">
INSERT INTO mps_market
(
data_id,
subcategory_id,
subcategory_name,
yx_name,
jb_name,
yx_id,
jb_id,
date,
dept_name,
dept_id,
cust_type,
cust_id,
cust_name,
cust_acct_no,
cust_phone_no,
magnetic_card_id,
acquiring_name,
acquiring_id,
internet_channel,
traffic_id,
workplace,
surplus_account_name,
heating_no,
check_flag,
check_time,
check_user,
check_type,
check_msg,
tenant_id,
create_dept,
create_by,
create_time,
update_by,
update_time,
del_flag
)
VALUES
<foreach collection="list" item="item" separator=",">
(
#{item.dataId},
#{item.subcategoryId},
#{item.subcategoryName},
#{item.yxName},
#{item.jbName},
#{item.yxId},
#{item.jbId},
#{item.date},
#{item.deptName},
#{item.deptId},
#{item.custType},
#{item.custId},
#{item.custName},
#{item.custAcctNo},
#{item.custPhoneNo},
#{item.magneticCardId},
#{item.acquiringName},
#{item.acquiringId},
#{item.internetChannel},
#{item.trafficId},
#{item.workplace},
#{item.surplusAccountName},
#{item.heatingNo},
#{item.checkFlag},
#{item.checkTime},
#{item.checkUser},
#{item.checkType},
#{item.checkMsg},
#{item.tenantId},
#{item.createDept},
#{item.createBy},
#{item.createTime},
#{item.updateBy},
#{item.updateTime},
#{item.delFlag}
)
</foreach>
</insert>
</mapper>