录入网上支付开通渠道的问题,业务类型搜索简化

This commit is contained in:
SGK\17962 2025-08-25 08:41:23 +08:00
parent 2f0a10d5e7
commit 67069b58a9
13 changed files with 123 additions and 90 deletions

View File

@ -1,7 +1,6 @@
const local: App.I18n.Schema = { const local: App.I18n.Schema = {
mps: { mps: {
common: '模板', common: '模板',
zytgr: '智E通个人', zytgr: '智E通个人',
zytqy: '智E通企业', zytqy: '智E通企业',
zyf: '智e付', zyf: '智e付',
@ -446,6 +445,7 @@ const local: App.I18n.Schema = {
}, },
status: { status: {
required: '请选择状态', required: '请选择状态',
invalid: '状态不能为空'
} }
} }
} }

View File

@ -51,7 +51,7 @@ declare namespace Api {
/** 综合收单商户号 */ /** 综合收单商户号 */
acquiringId: CommonType.IdType; acquiringId: CommonType.IdType;
/** 网上支付开通渠道 */ /** 网上支付开通渠道 */
internetChannel: string; internetChannel: string[];
/** 交警处罚决定书 */ /** 交警处罚决定书 */
trafficId: CommonType.IdType; trafficId: CommonType.IdType;
trafficList: { trafficNo: string; trafficAmt: number }[]; trafficList: { trafficNo: string; trafficAmt: number }[];

View File

@ -485,6 +485,21 @@ declare namespace App {
remark: FormMsg; remark: FormMsg;
}; };
}; };
business: {
category: {
title: string;
categoryName: string;
parentCategoryName: string;
status: string;
add: string;
refresh: string;
form: {
categoryName: FormMsg;
parentCategoryName: FormMsg;
status: FormMsg;
};
};
};
login: { login: {
common: { common: {
loginOrRegister: string; loginOrRegister: string;

View File

@ -57,6 +57,7 @@ const {
pageSize: 10, pageSize: 10,
categoryId: null, categoryId: null,
name: null, name: null,
status: null,
pricingRule: null, pricingRule: null,
params: {} params: {}
}, },
@ -107,7 +108,7 @@ const {
}, },
{ {
key: 'status', key: 'status',
title: $t('page.system.user.status'), title: $t('page.business.category.status'),
align: 'center', align: 'center',
minWidth: 80, minWidth: 80,
resizable: true, resizable: true,

View File

@ -2,6 +2,7 @@
import { ref } from 'vue'; import { ref } from 'vue';
import { useNaiveForm } from '@/hooks/common/form'; import { useNaiveForm } from '@/hooks/common/form';
import { $t } from '@/locales'; import { $t } from '@/locales';
import {useDict} from "@/hooks/business/dict";
defineOptions({ defineOptions({
name: 'SubcategorySearch' name: 'SubcategorySearch'
@ -15,12 +16,14 @@ interface Emits {
const emit = defineEmits<Emits>(); const emit = defineEmits<Emits>();
const { formRef, validate, restoreValidation } = useNaiveForm(); const { formRef, validate, restoreValidation } = useNaiveForm();
const {options: statusOptions} = useDict('sys_normal_disable');
const model = defineModel<Api.Business.SubcategorySearchParams>('model', { required: true }); const model = defineModel<Api.Business.SubcategorySearchParams>('model', { required: true });
async function reset() { async function reset() {
debugger;
// Object.assign(model.value.params!, {});
Object.assign(model.value.params!, {}); Object.assign(model.value.params!, {});
await restoreValidation(); await restoreValidation();
emit('reset'); emit('reset');
@ -38,19 +41,22 @@ async function search() {
<NCollapseItem :title="$t('common.search')" name="user-search"> <NCollapseItem :title="$t('common.search')" name="user-search">
<NForm ref="formRef" :model="model" label-placement="left" :label-width="100"> <NForm ref="formRef" :model="model" label-placement="left" :label-width="100">
<NGrid responsive="screen" item-responsive> <NGrid responsive="screen" item-responsive>
<NFormItemGi v-if="false" span="24 s:12 m:6" label="所属大类ID" path="categoryId" class="pr-24px"> <!-- <NFormItemGi v-if="false" span="24 s:12 m:6" label="所属大类ID" path="categoryId" class="pr-24px">-->
<NInput v-model:value="model.categoryId" placeholder="请输入所属大类ID" /> <!-- <NInput v-model:value="model.categoryId" placeholder="请输入所属大类ID" />-->
<!-- </NFormItemGi>-->
<!-- <NFormItemGi span="24 s:12 m:8" label="业务子类ID" path="typeId" class="pr-24px">-->
<!-- <NInput v-model:value="model.typeId" placeholder="请输入业务类型ID" />-->
<!-- </NFormItemGi>-->
<!-- <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">
<NSelect v-model:value="model.status" :options="statusOptions" placeholder="请选择状态" />
</NFormItemGi> </NFormItemGi>
<NFormItemGi span="24 s:12 m:8" label="业务子类ID" path="typeId" class="pr-24px"> <!-- <NFormItemGi span="24 s:12 m:8" label="计价规则说明" path="pricingRule" class="pr-24px">-->
<NInput v-model:value="model.typeId" placeholder="请输入业务类型ID" /> <!-- <NInput v-model:value="model.pricingRule" placeholder="请输入计价规则说明" />-->
</NFormItemGi> <!-- </NFormItemGi>-->
<NFormItemGi span="24 s:12 m:8" label="业务子类名称" path="name" class="pr-24px"> <NFormItemGi span="24 s:12 m:8" class="pr-24px">
<NInput v-model:value="model.name" placeholder="请输入业务子类名称" />
</NFormItemGi>
<NFormItemGi span="24 s:12 m:8" label="计价规则说明" path="pricingRule" class="pr-24px">
<NInput v-model:value="model.pricingRule" placeholder="请输入计价规则说明" />
</NFormItemGi>
<NFormItemGi span="24" class="pr-24px">
<NSpace class="w-full" justify="end"> <NSpace class="w-full" justify="end">
<NButton @click="reset"> <NButton @click="reset">
<template #icon> <template #icon>

View File

@ -401,9 +401,9 @@ const {
}; };
// checkType'9' // checkType'9'
if (row.checkFlag !== '9') { // if (row.checkFlag !== '9') {
return null; // return null;
} // }
return ( return (
<div class="flex-center gap-8px"> <div class="flex-center gap-8px">
{editBtn()} {editBtn()}

View File

@ -73,7 +73,7 @@ function createDefaultModel(): Model {
magneticCardList: [], magneticCardList: [],
acquiringName: '', acquiringName: '',
acquiringId: '', acquiringId: '',
internetChannel: '', internetChannel: [],
trafficId: null, trafficId: null,
trafficList: [], trafficList: [],
workplace: '', workplace: '',
@ -87,7 +87,7 @@ function createDefaultModel(): Model {
}; };
} }
type RuleKey = Extract<keyof Model, 'subcategoryId' | 'jbName' | 'jbId' | 'subcategoryName' | 'date' | 'custPhoneNo' | 'custId' | 'custAcctNo' | 'custType'>;// type RuleKey = Extract<keyof Model, 'subcategoryId' | 'jbName' | 'jbId' | 'subcategoryName' | 'date' | 'custPhoneNo' | 'custId' | 'custAcctNo' | 'custType'| 'acquiringId' | 'heatingNo' >;//
const phonePatternRule = { const phonePatternRule = {
pattern: /^1[3-9]\d{9}$/, pattern: /^1[3-9]\d{9}$/,
message: '请输入正确的手机号', message: '请输入正确的手机号',
@ -108,6 +108,13 @@ const accountPatternRule = {
trigger: 'change' trigger: 'change'
}; };
//
const acquiringIdPatternRule = {
pattern: /^[a-zA-Z0-9]+$/,
message: '综合收单商户号只能包含数字',
trigger: 'change'
};
const custTypeRule = computed(() => { const custTypeRule = computed(() => {
// "" // ""
if (model.subcategoryName !== '公积金缴纳账户') { if (model.subcategoryName !== '公积金缴纳账户') {
@ -125,7 +132,8 @@ const rules: Record<RuleKey, App.Global.FormRule | App.Global.FormRule[]> = {
custPhoneNo: phonePatternRule, custPhoneNo: phonePatternRule,
custId: idCardPatternRule, custId: idCardPatternRule,
custAcctNo: accountPatternRule, custAcctNo: accountPatternRule,
custType: custTypeRule.value custType: custTypeRule.value,
acquiringId: acquiringIdPatternRule
}; };
const showMarketingFields = ref(false); const showMarketingFields = ref(false);
@ -147,6 +155,14 @@ function handleUpdateModelWhenEdit() {
trafficAmt: item.trafficAmt !== undefined ? Number(item.trafficAmt) : 0 trafficAmt: item.trafficAmt !== undefined ? Number(item.trafficAmt) : 0
})); }));
} }
// rowData internetChannel
if (typeof props.rowData.internetChannel === 'string') {
//
props.rowData.internetChannel = props.rowData.internetChannel
.split(',')
.map(item => item.trim())
.filter(item => item.length > 0);
}
Object.assign(model, createDefaultModel(), props.rowData); Object.assign(model, createDefaultModel(), props.rowData);
// //
if (model.yxName || model.yxId) { if (model.yxName || model.yxId) {
@ -154,35 +170,6 @@ function handleUpdateModelWhenEdit() {
} else { } else {
showMarketingFields.value = false; showMarketingFields.value = false;
} }
// trafficListtrafficAmt
// if (props.rowData.trafficList && Array.isArray(props.rowData.trafficList)) {
// const processedTrafficList = props.rowData.trafficList.map(item => ({
// ...item,
// trafficAmt: item.trafficAmt !== undefined ? Number(item.trafficAmt) : 0
// }));
// // 使splice
// model.trafficList.splice(0, model.trafficList.length, ...processedTrafficList);
// }
//
// // magneticCardList
// if (props.rowData.magneticCardList && Array.isArray(props.rowData.magneticCardList)) {
// // 使splice
// model.magneticCardList.splice(0, model.magneticCardList.length, ...props.rowData.magneticCardList);
// }
//
// if (props.rowData.magneticCardList) {
// model.magneticCardList = JSON.parse(JSON.stringify(props.rowData.magneticCardList));
// }
//
// if (props.rowData.trafficList) {
// model.trafficList = JSON.parse(JSON.stringify(props.rowData.trafficList));
// // trafficAmt
// model.trafficList = model.trafficList.map(item => ({
// ...item,
// trafficAmt: item.trafficAmt !== undefined ? Number(item.trafficAmt) : 0
// }));
// }
} }
} }

View File

@ -98,6 +98,7 @@ public class BusinessSubcategoryServiceImpl implements IBusinessSubcategoryServi
lqw.orderByAsc(BusinessSubcategory::getId); lqw.orderByAsc(BusinessSubcategory::getId);
lqw.eq(bo.getCategoryId() != null, BusinessSubcategory::getCategoryId, bo.getCategoryId()); lqw.eq(bo.getCategoryId() != null, BusinessSubcategory::getCategoryId, bo.getCategoryId());
lqw.eq(StringUtils.isNotBlank(bo.getTypeId()), BusinessSubcategory::getTypeId, bo.getTypeId()); lqw.eq(StringUtils.isNotBlank(bo.getTypeId()), BusinessSubcategory::getTypeId, bo.getTypeId());
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), BusinessSubcategory::getStatus, bo.getStatus());
lqw.like(StringUtils.isNotBlank(bo.getName()), BusinessSubcategory::getName, bo.getName()); lqw.like(StringUtils.isNotBlank(bo.getName()), BusinessSubcategory::getName, bo.getName());
lqw.eq(StringUtils.isNotBlank(bo.getPricingRule()), BusinessSubcategory::getPricingRule, bo.getPricingRule()); lqw.eq(StringUtils.isNotBlank(bo.getPricingRule()), BusinessSubcategory::getPricingRule, bo.getPricingRule());
return lqw; return lqw;

View File

@ -1,9 +1,16 @@
package org.dromara.mps.domain; package org.dromara.mps.domain;
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.service.convert.StringToList;
import org.mapstruct.Mapping;
import org.redisson.client.protocol.convertor.StringToListConvertor;
import java.util.Date; import java.util.Date;
import java.io.Serial; import java.io.Serial;
@ -18,6 +25,7 @@ import java.util.List;
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@TableName("mps_market") @TableName("mps_market")
@AutoMapper(target = MpsMarketVo.class, reverseConvertGenerate = false)
public class MpsMarket extends TenantEntity { public class MpsMarket extends TenantEntity {
@Serial @Serial

View File

@ -1,6 +1,7 @@
package org.dromara.mps.domain.bo; package org.dromara.mps.domain.bo;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import io.github.linpeilie.annotations.AutoMapping;
import org.dromara.mps.domain.MpsMarket; import org.dromara.mps.domain.MpsMarket;
import org.dromara.common.mybatis.core.domain.BaseEntity; import org.dromara.common.mybatis.core.domain.BaseEntity;
import org.dromara.common.core.validate.AddGroup; import org.dromara.common.core.validate.AddGroup;
@ -9,6 +10,8 @@ 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 java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -127,7 +130,8 @@ public class MpsMarketBo extends BaseEntity {
/** /**
* 网上支付开通渠道 * 网上支付开通渠道
*/ */
private String internetChannel; @AutoMapping(target = "internetChannel", expression = "java(java.lang.String.join(\",\", source.getInternetChannel()))")
private List<String> internetChannel;
/** /**
* 交警处罚决定书 * 交警处罚决定书

View File

@ -6,17 +6,14 @@ import cn.idev.excel.annotation.ExcelIgnore;
import cn.idev.excel.annotation.format.DateTimeFormat; import cn.idev.excel.annotation.format.DateTimeFormat;
import cn.idev.excel.annotation.format.NumberFormat; import cn.idev.excel.annotation.format.NumberFormat;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.dromara.mps.domain.MpsMarket;
import cn.idev.excel.annotation.ExcelIgnoreUnannotated; import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
import cn.idev.excel.annotation.ExcelProperty; import cn.idev.excel.annotation.ExcelProperty;
import org.dromara.common.excel.annotation.ExcelDictFormat; import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert; import org.dromara.common.excel.convert.ExcelDictConvert;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data; import lombok.Data;
import java.io.Serial; import java.io.Serial;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date;
import java.util.List; import java.util.List;
@ -28,7 +25,6 @@ import java.util.List;
*/ */
@Data @Data
@ExcelIgnoreUnannotated @ExcelIgnoreUnannotated
@AutoMapper(target = MpsMarket.class)
public class MpsMarketVo implements Serializable { public class MpsMarketVo implements Serializable {
@Serial @Serial

View File

@ -0,0 +1,18 @@
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+"]";
}
}

View File

@ -7,7 +7,6 @@ import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.core.utils.StringUtils; import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.core.exception.ServiceException; import org.dromara.common.core.exception.ServiceException;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
import org.dromara.common.mybatis.core.page.TableDataInfo; import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.mybatis.core.page.PageQuery; import org.dromara.common.mybatis.core.page.PageQuery;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -17,8 +16,6 @@ import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.dromara.mps.domain.MpsMagneticcard; import org.dromara.mps.domain.MpsMagneticcard;
import org.dromara.mps.domain.MpsTraffic; import org.dromara.mps.domain.MpsTraffic;
import org.dromara.mps.domain.bo.MpsMagneticcardBo;
import org.dromara.mps.domain.bo.MpsTrafficBo;
import org.dromara.mps.domain.vo.MpsMagneticcardVo; import org.dromara.mps.domain.vo.MpsMagneticcardVo;
import org.dromara.mps.domain.vo.MpsTrafficVo; import org.dromara.mps.domain.vo.MpsTrafficVo;
import org.dromara.mps.mapper.MpsMagneticcardMapper; import org.dromara.mps.mapper.MpsMagneticcardMapper;
@ -28,10 +25,10 @@ import org.dromara.mps.domain.bo.MpsMarketBo;
import org.dromara.mps.domain.vo.MpsMarketVo; import org.dromara.mps.domain.vo.MpsMarketVo;
import org.dromara.mps.domain.MpsMarket; import org.dromara.mps.domain.MpsMarket;
import org.dromara.mps.mapper.MpsMarketMapper; import org.dromara.mps.mapper.MpsMarketMapper;
import org.dromara.mps.service.IMpsMarketService; import org.dromara.mps.service.IMpsMarketService;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.*; import java.util.*;
/** /**
@ -50,6 +47,7 @@ public class MpsMarketServiceImpl implements IMpsMarketService {
private final MpsMagneticcardMapper magneticcardMapper; private final MpsMagneticcardMapper magneticcardMapper;
private final MpsTrafficMapper TrafficMapper; private final MpsTrafficMapper TrafficMapper;
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void batchInsertOrUpdate(Collection<MpsMarket> list, Boolean isUpdateSupport) { public void batchInsertOrUpdate(Collection<MpsMarket> list, Boolean isUpdateSupport) {
@ -101,6 +99,7 @@ public class MpsMarketServiceImpl implements IMpsMarketService {
@Override @Override
public TableDataInfo<MpsMarketVo> queryPageList(MpsMarketBo bo, PageQuery pageQuery) { public TableDataInfo<MpsMarketVo> queryPageList(MpsMarketBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<MpsMarket> lqw = buildQueryWrapper(bo); LambdaQueryWrapper<MpsMarket> lqw = buildQueryWrapper(bo);
// PageDTO<MpsMarketVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
Page<MpsMarketVo> result = baseMapper.selectPageMpsMarketList(pageQuery.build(), lqw); Page<MpsMarketVo> result = baseMapper.selectPageMpsMarketList(pageQuery.build(), lqw);
result.getRecords().forEach(r -> r.setMagneticCardList(magneticcardMapper.selectVoList(new LambdaQueryWrapper<MpsMagneticcard>().eq(MpsMagneticcard::getMagneticCardId, r.getMagneticCardId())))); result.getRecords().forEach(r -> r.setMagneticCardList(magneticcardMapper.selectVoList(new LambdaQueryWrapper<MpsMagneticcard>().eq(MpsMagneticcard::getMagneticCardId, r.getMagneticCardId()))));
result.getRecords().forEach(r -> r.setTrafficList(TrafficMapper.selectVoList(new LambdaQueryWrapper<MpsTraffic>().eq(MpsTraffic::getTrafficId, r.getTrafficId())))); result.getRecords().forEach(r -> r.setTrafficList(TrafficMapper.selectVoList(new LambdaQueryWrapper<MpsTraffic>().eq(MpsTraffic::getTrafficId, r.getTrafficId()))));
@ -140,7 +139,6 @@ public class MpsMarketServiceImpl implements IMpsMarketService {
lqw.eq(bo.getMagneticCardId() != null, MpsMarket::getMagneticCardId, bo.getMagneticCardId()); lqw.eq(bo.getMagneticCardId() != null, MpsMarket::getMagneticCardId, bo.getMagneticCardId());
lqw.like(StringUtils.isNotBlank(bo.getAcquiringName()), MpsMarket::getAcquiringName, bo.getAcquiringName()); lqw.like(StringUtils.isNotBlank(bo.getAcquiringName()), MpsMarket::getAcquiringName, bo.getAcquiringName());
lqw.eq(StringUtils.isNotBlank(bo.getAcquiringId()), MpsMarket::getAcquiringId, bo.getAcquiringId()); lqw.eq(StringUtils.isNotBlank(bo.getAcquiringId()), MpsMarket::getAcquiringId, bo.getAcquiringId());
lqw.eq(StringUtils.isNotBlank(bo.getInternetChannel()), MpsMarket::getInternetChannel, bo.getInternetChannel());
lqw.eq(bo.getTrafficId() != null, MpsMarket::getTrafficId, bo.getTrafficId()); lqw.eq(bo.getTrafficId() != null, MpsMarket::getTrafficId, bo.getTrafficId());
lqw.eq(StringUtils.isNotBlank(bo.getWorkplace()), MpsMarket::getWorkplace, bo.getWorkplace()); lqw.eq(StringUtils.isNotBlank(bo.getWorkplace()), MpsMarket::getWorkplace, bo.getWorkplace());
lqw.like(StringUtils.isNotBlank(bo.getSurplusAccountName()), MpsMarket::getSurplusAccountName, bo.getSurplusAccountName()); lqw.like(StringUtils.isNotBlank(bo.getSurplusAccountName()), MpsMarket::getSurplusAccountName, bo.getSurplusAccountName());
@ -161,6 +159,11 @@ public class MpsMarketServiceImpl implements IMpsMarketService {
*/ */
@Override @Override
public Boolean insertByBo(MpsMarketBo bo) { 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); MpsMarket add = MapstructUtils.convert(bo, MpsMarket.class);
validEntityBeforeAdd(add); validEntityBeforeAdd(add);
System.out.println("add:--->"+add); System.out.println("add:--->"+add);
@ -189,20 +192,17 @@ public class MpsMarketServiceImpl implements IMpsMarketService {
*/ */
private void validEntityBeforeAdd(MpsMarket entity){ private void validEntityBeforeAdd(MpsMarket entity){
//TODO 做一些数据校验,如唯一约束,非空校验 //TODO 做一些数据校验,如唯一约束,非空校验
if (entity.getSubcategoryName() == null) { if (StringUtils.isEmpty(entity.getSubcategoryName())) {
throw new ServiceException("请填写子类名称"); throw new ServiceException("请填写业务子类名称");
} }
if (entity.getYxName() == null) { if (null == entity.getSubcategoryId()) {
throw new ServiceException("请填写营销名称"); throw new ServiceException("请填写业务子类ID");
} }
if (entity.getJbName() == null) { if (StringUtils.isEmpty(entity.getJbName())) {
throw new ServiceException("请填写缴别名称"); throw new ServiceException("请填写经办人员名称");
} }
if (entity.getYxId() == null) { if (StringUtils.isEmpty(entity.getJbId())) {
throw new ServiceException("请填写营销ID"); throw new ServiceException("请填写经办人员ID");
}
if (entity.getJbId() == null) {
throw new ServiceException("请填写经办ID");
} }
if (entity.getDate() == null) { if (entity.getDate() == null) {
throw new ServiceException("请填写日期"); throw new ServiceException("请填写日期");
@ -232,7 +232,7 @@ public class MpsMarketServiceImpl implements IMpsMarketService {
} }
switch (entity.getSubcategoryName()) { switch (entity.getSubcategoryName()) {
case "公积金缴纳账户": case "公积金缴纳账户":
if (entity.getSurplusAccountName() == null) { if (StringUtils.isEmpty(entity.getSurplusAccountName())) {
throw new ServiceException("请填写公积金账户名称"); throw new ServiceException("请填写公积金账户名称");
} }
MpsMarket bo = new MpsMarket(); MpsMarket bo = new MpsMarket();
@ -311,25 +311,25 @@ public class MpsMarketServiceImpl implements IMpsMarketService {
TrafficMapper.insertBatch(entity.getTrafficList()); TrafficMapper.insertBatch(entity.getTrafficList());
break; break;
case "新增综合收单商户(首月)": case "新增综合收单商户(首月)":
if (entity.getAcquiringId() == null) { if (StringUtils.isEmpty(entity.getAcquiringId())) {
throw new ServiceException("请填写收单机构ID"); throw new ServiceException("请填写收单机构ID");
} }
if (entity.getAcquiringName() == null) { if (StringUtils.isEmpty(entity.getAcquiringName())) {
throw new ServiceException("请填写收单机构名称"); throw new ServiceException("请填写收单机构名称");
} }
break; break;
case "网上支付客户": case "网上支付客户":
if (entity.getInternetChannel() == null) { if (StringUtils.isEmpty(entity.getInternetChannel())) {
throw new ServiceException("请填写网上支付渠道"); throw new ServiceException("请填写网上支付渠道");
} }
break; break;
case "营销职工社保卡": case "营销职工社保卡":
if (entity.getWorkplace() == null) { if (StringUtils.isEmpty(entity.getWorkplace())) {
throw new ServiceException("请填写营销职工社保卡工作单位"); throw new ServiceException("请填写营销职工社保卡工作单位");
} }
break; break;
case "取暖费": case "取暖费":
if (entity.getHeatingNo() == null) { if (StringUtils.isEmpty(entity.getHeatingNo())) {
throw new ServiceException("请填写取暖费编号"); throw new ServiceException("请填写取暖费编号");
} }
break; break;
@ -344,27 +344,24 @@ public class MpsMarketServiceImpl implements IMpsMarketService {
*/ */
private void validEntityBeforeUpdate(MpsMarket entity){ private void validEntityBeforeUpdate(MpsMarket entity){
//TODO 做一些数据校验,如唯一约束,非空校验 //TODO 做一些数据校验,如唯一约束,非空校验
if (entity.getSubcategoryName() == null) { if (StringUtils.isEmpty(entity.getSubcategoryName())) {
throw new ServiceException("请填写子类名称"); throw new ServiceException("请填写业务子类名称");
} }
if (entity.getYxName() == null) { if (null == entity.getSubcategoryId()) {
throw new ServiceException("请填写营销名称"); throw new ServiceException("请填写业务子类ID");
} }
if (entity.getJbName() == null) { if (StringUtils.isEmpty(entity.getJbName())) {
throw new ServiceException("请填写缴别名称"); throw new ServiceException("请填写经办人员名称");
} }
if (entity.getYxId() == null) { if (StringUtils.isEmpty(entity.getJbId())) {
throw new ServiceException("请填写营销ID"); throw new ServiceException("请填写经办人员ID");
}
if (entity.getJbId() == null) {
throw new ServiceException("请填写经办ID");
} }
if (entity.getDate() == null) { if (entity.getDate() == null) {
throw new ServiceException("请填写日期"); throw new ServiceException("请填写日期");
} }
switch (entity.getSubcategoryName()) { switch (entity.getSubcategoryName()) {
case "公积金缴纳账户": case "公积金缴纳账户":
if (entity.getSurplusAccountName() == null) { if (StringUtils.isEmpty(entity.getSurplusAccountName())) {
throw new ServiceException("请填写公积金账户名称"); throw new ServiceException("请填写公积金账户名称");
} }
break; break;