录入界面规则完善;
启用业务子类id
This commit is contained in:
parent
8a70b649a2
commit
92d58ca3a5
@ -50,6 +50,7 @@ function createDefaultModel(): Model {
|
|||||||
return {
|
return {
|
||||||
categoryId: props.categoryId,
|
categoryId: props.categoryId,
|
||||||
name: '',
|
name: '',
|
||||||
|
typeId: '',
|
||||||
status: '0',
|
status: '0',
|
||||||
pricingRule: '',
|
pricingRule: '',
|
||||||
};
|
};
|
||||||
@ -58,21 +59,23 @@ function createDefaultModel(): Model {
|
|||||||
type RuleKey = Extract<
|
type RuleKey = Extract<
|
||||||
keyof Model,
|
keyof Model,
|
||||||
| 'status'
|
| 'status'
|
||||||
|
| 'name'
|
||||||
|
| 'typeId'
|
||||||
| 'pricingRule'
|
| 'pricingRule'
|
||||||
| 'createDept'
|
|
||||||
| 'createBy'
|
|
||||||
| 'createTime'
|
|
||||||
| 'updateBy'
|
|
||||||
| 'updateTime'
|
|
||||||
>;
|
>;
|
||||||
|
|
||||||
const rules: Record<RuleKey, App.Global.FormRule> = {
|
// 添加typeId的字母数字验证规则
|
||||||
|
const typeIdPatternRule = {
|
||||||
|
pattern: /^[a-zA-Z0-9]+$/,
|
||||||
|
message: '业务子类ID只能包含字母和数字',
|
||||||
|
trigger: 'change'
|
||||||
|
};
|
||||||
|
|
||||||
|
const rules: Record<RuleKey, App.Global.FormRule | App.Global.FormRule[]> = {
|
||||||
|
status: createRequiredRule('状态不能为空'),
|
||||||
pricingRule: createRequiredRule('计价规则说明不能为空'),
|
pricingRule: createRequiredRule('计价规则说明不能为空'),
|
||||||
createDept: createRequiredRule('创建部门不能为空'),
|
typeId: [createRequiredRule('业务子类类型不能为空'), typeIdPatternRule],
|
||||||
createBy: createRequiredRule('创建人不能为空'),
|
name: createRequiredRule('业务子类名称不能为空'),
|
||||||
createTime: createRequiredRule('创建时间不能为空'),
|
|
||||||
updateBy: createRequiredRule('更新人不能为空'),
|
|
||||||
updateTime: createRequiredRule('更新时间不能为空')
|
|
||||||
};
|
};
|
||||||
|
|
||||||
function handleUpdateModelWhenEdit() {
|
function handleUpdateModelWhenEdit() {
|
||||||
@ -134,6 +137,9 @@ watch(visible, () => {
|
|||||||
<NFormItem label="业务子类名称" path="name">
|
<NFormItem label="业务子类名称" path="name">
|
||||||
<NInput v-model:value="model.name" placeholder="请输入业务子类名称" />
|
<NInput v-model:value="model.name" placeholder="请输入业务子类名称" />
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
|
<NFormItem label="业务子类id" path="typeId">
|
||||||
|
<NInput v-model:value="model.typeId" placeholder="请输入业务子类id" />
|
||||||
|
</NFormItem>
|
||||||
<NFormItem label="状态" path="status">
|
<NFormItem label="状态" path="status">
|
||||||
<DictRadio v-model:value="model.status" dict-code="sys_normal_disable" />
|
<DictRadio v-model:value="model.status" dict-code="sys_normal_disable" />
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<script setup lang="tsx">
|
<script setup lang="tsx">
|
||||||
import {onMounted,ref, watch} from "vue";
|
import {onMounted,ref, watch} from "vue";
|
||||||
import { NButton,NDivider } from 'naive-ui';
|
import { NButton,NDivider,NEllipsis } from 'naive-ui';
|
||||||
import { fetchBatchDeleteMarket, fetchGetMarketList } from '@/service/api/mps/market';
|
import { fetchBatchDeleteMarket, fetchGetMarketList } from '@/service/api/mps/market';
|
||||||
import { fetchGetSubcategorySelect } from '@/service/api/business/subcategory';
|
import { fetchGetSubcategorySelect } from '@/service/api/business/subcategory';
|
||||||
import { useAppStore } from '@/store/modules/app';
|
import { useAppStore } from '@/store/modules/app';
|
||||||
@ -262,7 +262,15 @@ const {
|
|||||||
align: 'center',
|
align: 'center',
|
||||||
minWidth: 120,
|
minWidth: 120,
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
resizable: true
|
resizable: true,
|
||||||
|
render: (row) => {
|
||||||
|
if (!row.internetChannel) return '';
|
||||||
|
return (
|
||||||
|
<NEllipsis style="width: 100%;" tooltip={true}>
|
||||||
|
{row.internetChannel}
|
||||||
|
</NEllipsis>
|
||||||
|
);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'trafficId',
|
key: 'trafficId',
|
||||||
@ -499,7 +507,7 @@ async function getSubcategoryOptions() {
|
|||||||
if (!error) {
|
if (!error) {
|
||||||
subcategoryIdOptions.value = data.map(item => ({
|
subcategoryIdOptions.value = data.map(item => ({
|
||||||
label: item.name,
|
label: item.name,
|
||||||
value: item.id
|
value: item.typeId
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
endLoading();
|
endLoading();
|
||||||
|
@ -699,10 +699,20 @@ watch(visible, () => {
|
|||||||
<tbody>
|
<tbody>
|
||||||
<tr v-for="(item, index) in model.magneticCardList" :key="index">
|
<tr v-for="(item, index) in model.magneticCardList" :key="index">
|
||||||
<td>
|
<td>
|
||||||
<NInput v-model:value="item.oldCardNo" placeholder="请输入老卡号" />
|
<NInputNumber
|
||||||
|
v-model:value="item.oldCardNo"
|
||||||
|
placeholder="请输入老卡号"
|
||||||
|
:show-button="false"
|
||||||
|
:controls="false" style="width: 100%"
|
||||||
|
/>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<NInput v-model:value="item.newCardNo" placeholder="请输入新卡号" />
|
<NInputNumber
|
||||||
|
v-model:value="item.newCardNo"
|
||||||
|
placeholder="请输入新卡号"
|
||||||
|
:show-button="false"
|
||||||
|
:controls="false" style="width: 100%"
|
||||||
|
/>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<NButton text type="error" @click="removeMagneticCardItem(index)">删除</NButton>
|
<NButton text type="error" @click="removeMagneticCardItem(index)">删除</NButton>
|
||||||
@ -747,10 +757,16 @@ watch(visible, () => {
|
|||||||
<tbody>
|
<tbody>
|
||||||
<tr v-for="(item, index) in model.trafficList || []" :key="index">
|
<tr v-for="(item, index) in model.trafficList || []" :key="index">
|
||||||
<td>
|
<td>
|
||||||
<NInput v-model:value="item.trafficNo" placeholder="请输入决定书编号" />
|
<NInputNumber
|
||||||
|
v-model:value="item.trafficNo"
|
||||||
|
placeholder="请输入决定书编号"
|
||||||
|
:show-button="false"
|
||||||
|
:controls="false"
|
||||||
|
style="width: 100%"
|
||||||
|
/>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<NInputNumber v-model:value="item.trafficAmt" placeholder="请输入处罚金额" style="width: 100%" />
|
<NInputNumber v-model:value="item.trafficAmt" placeholder="请输入处罚金额" :min="0" style="width: 100%" />
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<NButton text type="error" @click="removeTrafficItem(index)">删除</NButton>
|
<NButton text type="error" @click="removeTrafficItem(index)">删除</NButton>
|
||||||
|
@ -270,3 +270,6 @@ justauth:
|
|||||||
client-id: 10**********6
|
client-id: 10**********6
|
||||||
client-secret: 1f7d08**********5b7**********29e
|
client-secret: 1f7d08**********5b7**********29e
|
||||||
redirect-uri: ${justauth.address}/social-callback?source=gitea
|
redirect-uri: ${justauth.address}/social-callback?source=gitea
|
||||||
|
mapstruct-plus :
|
||||||
|
processor :
|
||||||
|
trim-string : true
|
||||||
|
@ -139,7 +139,11 @@ public class BusinessSubcategoryController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@GetMapping("/selList")
|
@GetMapping("/selList")
|
||||||
public R<List<BusinessSubcategoryVo>> selList() {
|
public R<List<BusinessSubcategoryVo>> selList() {
|
||||||
return R.ok(businessSubcategoryService.selectSelSubcategoryList());
|
BusinessSubcategoryBo bo = new BusinessSubcategoryBo();
|
||||||
|
bo.setStatus("0");
|
||||||
|
List<BusinessSubcategoryVo> list = businessSubcategoryService.queryList(bo);
|
||||||
|
return R.ok(list);
|
||||||
|
// return R.ok(businessSubcategoryService.selectSelSubcategoryList());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -28,21 +28,25 @@ public class BusinessSubcategoryBo extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 所属大类ID
|
* 所属大类ID
|
||||||
*/
|
*/
|
||||||
|
@NotNull(message = "所属大类ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private Long categoryId;
|
private Long categoryId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 业务类型ID
|
* 业务类型ID
|
||||||
*/
|
*/
|
||||||
|
@NotBlank(message = "业务类型ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private String typeId;
|
private String typeId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 业务子类名称
|
* 业务子类名称
|
||||||
*/
|
*/
|
||||||
|
@NotBlank(message = "业务子类名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 业务子类状态(0正常 1停用)
|
* 业务子类状态(0正常 1停用)
|
||||||
*/
|
*/
|
||||||
|
@NotBlank(message = "业务子类状态不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -33,7 +33,7 @@ public class MpsDetailEntry extends TenantEntity {
|
|||||||
/**
|
/**
|
||||||
* 业务类型id
|
* 业务类型id
|
||||||
*/
|
*/
|
||||||
private BigDecimal subcategoryId;
|
private String subcategoryId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 业务类型名称
|
* 业务类型名称
|
||||||
|
@ -1,15 +1,11 @@
|
|||||||
package org.dromara.mps.domain;
|
package org.dromara.mps.domain;
|
||||||
|
|
||||||
import io.github.linpeilie.annotations.AutoMapper;
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
import io.github.linpeilie.annotations.AutoMapping;
|
|
||||||
import org.dromara.common.tenant.core.TenantEntity;
|
import org.dromara.common.tenant.core.TenantEntity;
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import org.dromara.mps.domain.vo.MpsMarketVo;
|
import org.dromara.mps.domain.vo.MpsMarketVo;
|
||||||
import org.dromara.mps.service.convert.StringToList;
|
|
||||||
import org.mapstruct.Mapping;
|
|
||||||
import org.redisson.client.protocol.convertor.StringToListConvertor;
|
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@ -40,7 +36,7 @@ public class MpsMarket extends TenantEntity {
|
|||||||
/**
|
/**
|
||||||
* 业务类型id
|
* 业务类型id
|
||||||
*/
|
*/
|
||||||
private Long subcategoryId;
|
private String subcategoryId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 业务类型名称
|
* 业务类型名称
|
||||||
|
@ -32,7 +32,7 @@ public class MpsDetailEntryBo extends BaseEntity {
|
|||||||
* 业务类型id
|
* 业务类型id
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "业务类型id不能为空", groups = { AddGroup.class, EditGroup.class })
|
@NotNull(message = "业务类型id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private BigDecimal subcategoryId;
|
private String subcategoryId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 业务类型名称
|
* 业务类型名称
|
||||||
|
@ -10,7 +10,7 @@ import io.github.linpeilie.annotations.AutoMapper;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import jakarta.validation.constraints.*;
|
import jakarta.validation.constraints.*;
|
||||||
import org.dromara.mps.service.convert.StringToList;
|
import org.dromara.mps.service.convert.StringTrimConverter;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -23,7 +23,7 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@AutoMapper(target = MpsMarket.class, reverseConvertGenerate = false)
|
@AutoMapper(target = MpsMarket.class, reverseConvertGenerate = false, uses = StringTrimConverter.class)
|
||||||
public class MpsMarketBo extends BaseEntity {
|
public class MpsMarketBo extends BaseEntity {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -34,8 +34,8 @@ public class MpsMarketBo extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 业务类型id
|
* 业务类型id
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "业务类型ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
@NotBlank(message = "业务类型ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private Long subcategoryId;
|
private String subcategoryId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 业务类型名称
|
* 业务类型名称
|
||||||
@ -97,6 +97,7 @@ public class MpsMarketBo extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 客户姓名
|
* 客户姓名
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private String custName;
|
private String custName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -41,7 +41,7 @@ public class MpsDetailEntryImportVo implements Serializable {
|
|||||||
* 业务类型id
|
* 业务类型id
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "业务类型id")
|
@ExcelProperty(value = "业务类型id")
|
||||||
private BigDecimal subcategoryId;
|
private String subcategoryId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 业务类型名称
|
* 业务类型名称
|
||||||
|
@ -43,7 +43,7 @@ public class MpsDetailEntryVo implements Serializable {
|
|||||||
* 业务类型id
|
* 业务类型id
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "业务类型id")
|
@ExcelProperty(value = "业务类型id")
|
||||||
private BigDecimal subcategoryId;
|
private String subcategoryId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 业务类型名称
|
* 业务类型名称
|
||||||
|
@ -41,7 +41,7 @@ public class MpsMarketImportVo implements Serializable {
|
|||||||
* 业务类型id
|
* 业务类型id
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "业务类型id")
|
@ExcelProperty(value = "业务类型id")
|
||||||
private Long subcategoryId;
|
private String subcategoryId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 业务类型名称
|
* 业务类型名称
|
||||||
|
@ -42,7 +42,7 @@ public class MpsMarketVo implements Serializable {
|
|||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "业务类型id")
|
@ExcelProperty(value = "业务类型id")
|
||||||
@NumberFormat("#")
|
@NumberFormat("#")
|
||||||
private Long subcategoryId;
|
private String subcategoryId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 业务类型名称
|
* 业务类型名称
|
||||||
|
@ -1,18 +0,0 @@
|
|||||||
package org.dromara.mps.service.convert;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Component
|
|
||||||
public class StringToList {
|
|
||||||
public String stringToList(String s) {
|
|
||||||
if (StringUtils.isEmpty(s)) {
|
|
||||||
return "[]";
|
|
||||||
}
|
|
||||||
// String[] list = StringUtils.split(s, ",");
|
|
||||||
return "["+s+"]";
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,13 @@
|
|||||||
|
package org.dromara.mps.service.convert;
|
||||||
|
|
||||||
|
import org.springframework.core.convert.converter.Converter;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class StringTrimConverter implements Converter<String, String> {
|
||||||
|
@Override
|
||||||
|
public String convert(String source) {
|
||||||
|
return source != null ? source.trim() : null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -115,7 +115,7 @@ public class MpsDetailEntryServiceImpl implements IMpsDetailEntryService {
|
|||||||
Map<String, Object> params = bo.getParams();
|
Map<String, Object> params = bo.getParams();
|
||||||
LambdaQueryWrapper<MpsDetailEntry> lqw = Wrappers.lambdaQuery();
|
LambdaQueryWrapper<MpsDetailEntry> lqw = Wrappers.lambdaQuery();
|
||||||
lqw.orderByAsc(MpsDetailEntry::getDataId);
|
lqw.orderByAsc(MpsDetailEntry::getDataId);
|
||||||
lqw.eq(bo.getSubcategoryId() != null, MpsDetailEntry::getSubcategoryId, bo.getSubcategoryId());
|
lqw.eq(StringUtils.isNotBlank(bo.getSubcategoryId()), MpsDetailEntry::getSubcategoryId, bo.getSubcategoryId());
|
||||||
lqw.like(StringUtils.isNotBlank(bo.getSubcategoryName()), MpsDetailEntry::getSubcategoryName, bo.getSubcategoryName());
|
lqw.like(StringUtils.isNotBlank(bo.getSubcategoryName()), MpsDetailEntry::getSubcategoryName, bo.getSubcategoryName());
|
||||||
lqw.like(StringUtils.isNotBlank(bo.getYxName()), MpsDetailEntry::getYxName, bo.getYxName());
|
lqw.like(StringUtils.isNotBlank(bo.getYxName()), MpsDetailEntry::getYxName, bo.getYxName());
|
||||||
lqw.like(StringUtils.isNotBlank(bo.getJbName()), MpsDetailEntry::getJbName, bo.getJbName());
|
lqw.like(StringUtils.isNotBlank(bo.getJbName()), MpsDetailEntry::getJbName, bo.getJbName());
|
||||||
|
@ -135,7 +135,7 @@ public class MpsMarketServiceImpl implements IMpsMarketService {
|
|||||||
Map<String, Object> params = bo.getParams();
|
Map<String, Object> params = bo.getParams();
|
||||||
LambdaQueryWrapper<MpsMarket> lqw = Wrappers.lambdaQuery();
|
LambdaQueryWrapper<MpsMarket> lqw = Wrappers.lambdaQuery();
|
||||||
lqw.orderByAsc(MpsMarket::getDataId);
|
lqw.orderByAsc(MpsMarket::getDataId);
|
||||||
lqw.eq(bo.getSubcategoryId() != null, MpsMarket::getSubcategoryId, bo.getSubcategoryId());
|
lqw.eq(StringUtils.isNotBlank(bo.getSubcategoryId()), MpsMarket::getSubcategoryId, bo.getSubcategoryId());
|
||||||
lqw.like(StringUtils.isNotBlank(bo.getSubcategoryName()), MpsMarket::getSubcategoryName, bo.getSubcategoryName());
|
lqw.like(StringUtils.isNotBlank(bo.getSubcategoryName()), MpsMarket::getSubcategoryName, bo.getSubcategoryName());
|
||||||
lqw.like(StringUtils.isNotBlank(bo.getYxName()), MpsMarket::getYxName, bo.getYxName());
|
lqw.like(StringUtils.isNotBlank(bo.getYxName()), MpsMarket::getYxName, bo.getYxName());
|
||||||
lqw.like(StringUtils.isNotBlank(bo.getJbName()), MpsMarket::getJbName, bo.getJbName());
|
lqw.like(StringUtils.isNotBlank(bo.getJbName()), MpsMarket::getJbName, bo.getJbName());
|
||||||
@ -357,21 +357,6 @@ public class MpsMarketServiceImpl implements IMpsMarketService {
|
|||||||
*/
|
*/
|
||||||
private void validEntityBeforeUpdate(MpsMarket entity){
|
private void validEntityBeforeUpdate(MpsMarket entity){
|
||||||
//TODO 做一些数据校验,如唯一约束,非空校验
|
//TODO 做一些数据校验,如唯一约束,非空校验
|
||||||
if (StringUtils.isEmpty(entity.getSubcategoryName())) {
|
|
||||||
throw new ServiceException("请填写业务子类名称");
|
|
||||||
}
|
|
||||||
if (null == entity.getSubcategoryId()) {
|
|
||||||
throw new ServiceException("请填写业务子类ID");
|
|
||||||
}
|
|
||||||
if (StringUtils.isEmpty(entity.getJbName())) {
|
|
||||||
throw new ServiceException("请填写经办人员名称");
|
|
||||||
}
|
|
||||||
if (StringUtils.isEmpty(entity.getJbId())) {
|
|
||||||
throw new ServiceException("请填写经办人员ID");
|
|
||||||
}
|
|
||||||
if (entity.getDate() == null) {
|
|
||||||
throw new ServiceException("请填写日期");
|
|
||||||
}
|
|
||||||
switch (entity.getSubcategoryName()) {
|
switch (entity.getSubcategoryName()) {
|
||||||
case "公积金缴纳账户":
|
case "公积金缴纳账户":
|
||||||
if (StringUtils.isEmpty(entity.getSurplusAccountName())) {
|
if (StringUtils.isEmpty(entity.getSurplusAccountName())) {
|
||||||
|
Loading…
Reference in New Issue
Block a user