提交 c7a79414 编写于 作者: ibizdev's avatar ibizdev

xignzi006 发布系统代码

上级 c28dd6d1
{ {
"opportunitystatetabview": { "opportunitystatetabview": {
"title": "商机状态分页视图", "title": "商机信息",
"caption": "商机", "caption": "商机信息",
"viewtype": "DETABEXPVIEW", "viewtype": "DETABEXPVIEW",
"viewmodule": "Sales", "viewmodule": "Sales",
"viewname": "OpportunityStateTabView", "viewname": "OpportunityStateTabView",
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
"memo": "" "memo": ""
}, },
"salesorderstatetabview": { "salesorderstatetabview": {
"title": "订单状态分页视图", "title": "订单信息",
"caption": "订单", "caption": "订单信息",
"viewtype": "DETABEXPVIEW", "viewtype": "DETABEXPVIEW",
"viewmodule": "Sales", "viewmodule": "Sales",
"viewname": "SalesOrderStateTabView", "viewname": "SalesOrderStateTabView",
...@@ -70,8 +70,8 @@ ...@@ -70,8 +70,8 @@
"memo": "系统自动添加" "memo": "系统自动添加"
}, },
"invoicestatetabview": { "invoicestatetabview": {
"title": "发票状态分页视图", "title": "发票信息",
"caption": "发票", "caption": "发票信息",
"viewtype": "DETABEXPVIEW", "viewtype": "DETABEXPVIEW",
"viewmodule": "Finance", "viewmodule": "Finance",
"viewname": "InvoiceStateTabView", "viewname": "InvoiceStateTabView",
...@@ -2660,8 +2660,8 @@ ...@@ -2660,8 +2660,8 @@
"memo": "系统自动添加" "memo": "系统自动添加"
}, },
"productstatetabview": { "productstatetabview": {
"title": "产品状态分页视图", "title": "产品信息",
"caption": "产品", "caption": "产品信息",
"viewtype": "DETABEXPVIEW", "viewtype": "DETABEXPVIEW",
"viewmodule": "Product", "viewmodule": "Product",
"viewname": "ProductStateTabView", "viewname": "ProductStateTabView",
...@@ -3090,8 +3090,8 @@ ...@@ -3090,8 +3090,8 @@
"memo": "系统自动添加" "memo": "系统自动添加"
}, },
"quotestatetabview": { "quotestatetabview": {
"title": "报价单状态分页视图", "title": "报价单信息",
"caption": "报价单", "caption": "报价单信息",
"viewtype": "DETABEXPVIEW", "viewtype": "DETABEXPVIEW",
"viewmodule": "Sales", "viewmodule": "Sales",
"viewname": "QuoteStateTabView", "viewname": "QuoteStateTabView",
......
...@@ -100,8 +100,8 @@ export default { ...@@ -100,8 +100,8 @@ export default {
title: "发票编辑视图", title: "发票编辑视图",
}, },
statetabview: { statetabview: {
caption: "发票", caption: "发票信息",
title: "发票状态分页视图", title: "发票信息",
}, },
quickcreateview: { quickcreateview: {
caption: "发票", caption: "发票",
......
...@@ -99,8 +99,8 @@ export default { ...@@ -99,8 +99,8 @@ export default {
title: "发票编辑视图", title: "发票编辑视图",
}, },
statetabview: { statetabview: {
caption: "发票", caption: "发票信息",
title: "发票状态分页视图", title: "发票信息",
}, },
quickcreateview: { quickcreateview: {
caption: "发票", caption: "发票",
......
...@@ -115,8 +115,8 @@ export default { ...@@ -115,8 +115,8 @@ export default {
}, },
views: { views: {
statetabview: { statetabview: {
caption: "商机", caption: "商机信息",
title: "商机状态分页视图", title: "商机信息",
}, },
summary: { summary: {
caption: "商机概览", caption: "商机概览",
......
...@@ -114,8 +114,8 @@ export default { ...@@ -114,8 +114,8 @@ export default {
}, },
views: { views: {
statetabview: { statetabview: {
caption: "商机", caption: "商机信息",
title: "商机状态分页视图", title: "商机信息",
}, },
summary: { summary: {
caption: "商机概览", caption: "商机概览",
......
...@@ -112,8 +112,8 @@ export default { ...@@ -112,8 +112,8 @@ export default {
title: "产品数据选择视图", title: "产品数据选择视图",
}, },
statetabview: { statetabview: {
caption: "产品", caption: "产品信息",
title: "产品状态分页视图", title: "产品信息",
}, },
}, },
edit_datapanel_form: { edit_datapanel_form: {
......
...@@ -111,8 +111,8 @@ export default { ...@@ -111,8 +111,8 @@ export default {
title: "产品数据选择视图", title: "产品数据选择视图",
}, },
statetabview: { statetabview: {
caption: "产品", caption: "产品信息",
title: "产品状态分页视图", title: "产品信息",
}, },
}, },
edit_datapanel_form: { edit_datapanel_form: {
......
...@@ -147,8 +147,8 @@ export default { ...@@ -147,8 +147,8 @@ export default {
title: "头部信息编辑", title: "头部信息编辑",
}, },
statetabview: { statetabview: {
caption: "报价单", caption: "报价单信息",
title: "报价单状态分页视图", title: "报价单信息",
}, },
}, },
quickcreate_form: { quickcreate_form: {
......
...@@ -146,8 +146,8 @@ export default { ...@@ -146,8 +146,8 @@ export default {
title: "头部信息编辑", title: "头部信息编辑",
}, },
statetabview: { statetabview: {
caption: "报价单", caption: "报价单信息",
title: "报价单状态分页视图", title: "报价单信息",
}, },
}, },
quickcreate_form: { quickcreate_form: {
......
...@@ -106,8 +106,8 @@ export default { ...@@ -106,8 +106,8 @@ export default {
}, },
views: { views: {
statetabview: { statetabview: {
caption: "订单", caption: "订单信息",
title: "订单状态分页视图", title: "订单信息",
}, },
edit_datapanelview: { edit_datapanelview: {
caption: "订单", caption: "订单",
......
...@@ -105,8 +105,8 @@ export default { ...@@ -105,8 +105,8 @@ export default {
}, },
views: { views: {
statetabview: { statetabview: {
caption: "订单", caption: "订单信息",
title: "订单状态分页视图", title: "订单信息",
}, },
edit_datapanelview: { edit_datapanelview: {
caption: "订单", caption: "订单",
......
...@@ -8,8 +8,8 @@ mock.onGet('./assets/json/view-config.json').reply((config: any) => { ...@@ -8,8 +8,8 @@ mock.onGet('./assets/json/view-config.json').reply((config: any) => {
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
return [status,{ return [status,{
"opportunitystatetabview": { "opportunitystatetabview": {
"title": "商机状态分页视图", "title": "商机信息",
"caption": "商机", "caption": "商机信息",
"viewtype": "DETABEXPVIEW", "viewtype": "DETABEXPVIEW",
"viewmodule": "Sales", "viewmodule": "Sales",
"viewname": "OpportunityStateTabView", "viewname": "OpportunityStateTabView",
...@@ -32,8 +32,8 @@ mock.onGet('./assets/json/view-config.json').reply((config: any) => { ...@@ -32,8 +32,8 @@ mock.onGet('./assets/json/view-config.json').reply((config: any) => {
"viewtag": "00e76d9dd6b3065c8231e9dc15334d05" "viewtag": "00e76d9dd6b3065c8231e9dc15334d05"
}, },
"salesorderstatetabview": { "salesorderstatetabview": {
"title": "订单状态分页视图", "title": "订单信息",
"caption": "订单", "caption": "订单信息",
"viewtype": "DETABEXPVIEW", "viewtype": "DETABEXPVIEW",
"viewmodule": "Sales", "viewmodule": "Sales",
"viewname": "SalesOrderStateTabView", "viewname": "SalesOrderStateTabView",
...@@ -64,8 +64,8 @@ mock.onGet('./assets/json/view-config.json').reply((config: any) => { ...@@ -64,8 +64,8 @@ mock.onGet('./assets/json/view-config.json').reply((config: any) => {
"viewtag": "01c28e25ad9d42977cb91ee890731b64" "viewtag": "01c28e25ad9d42977cb91ee890731b64"
}, },
"invoicestatetabview": { "invoicestatetabview": {
"title": "发票状态分页视图", "title": "发票信息",
"caption": "发票", "caption": "发票信息",
"viewtype": "DETABEXPVIEW", "viewtype": "DETABEXPVIEW",
"viewmodule": "Finance", "viewmodule": "Finance",
"viewname": "InvoiceStateTabView", "viewname": "InvoiceStateTabView",
...@@ -2136,8 +2136,8 @@ mock.onGet('./assets/json/view-config.json').reply((config: any) => { ...@@ -2136,8 +2136,8 @@ mock.onGet('./assets/json/view-config.json').reply((config: any) => {
"viewtag": "c607e5bc2c07ab2aca084e275ce677b7" "viewtag": "c607e5bc2c07ab2aca084e275ce677b7"
}, },
"productstatetabview": { "productstatetabview": {
"title": "产品状态分页视图", "title": "产品信息",
"caption": "产品", "caption": "产品信息",
"viewtype": "DETABEXPVIEW", "viewtype": "DETABEXPVIEW",
"viewmodule": "Product", "viewmodule": "Product",
"viewname": "ProductStateTabView", "viewname": "ProductStateTabView",
...@@ -2480,8 +2480,8 @@ mock.onGet('./assets/json/view-config.json').reply((config: any) => { ...@@ -2480,8 +2480,8 @@ mock.onGet('./assets/json/view-config.json').reply((config: any) => {
"viewtag": "ef9fea872a6a21e7566033fafcc0ccb5" "viewtag": "ef9fea872a6a21e7566033fafcc0ccb5"
}, },
"quotestatetabview": { "quotestatetabview": {
"title": "报价单状态分页视图", "title": "报价单信息",
"caption": "报价单", "caption": "报价单信息",
"viewtype": "DETABEXPVIEW", "viewtype": "DETABEXPVIEW",
"viewmodule": "Sales", "viewmodule": "Sales",
"viewname": "QuoteStateTabView", "viewname": "QuoteStateTabView",
......
...@@ -6,7 +6,7 @@ import TabExpViewEngine from '@engine/view/tab-exp-view-engine'; ...@@ -6,7 +6,7 @@ import TabExpViewEngine from '@engine/view/tab-exp-view-engine';
import InvoiceUIService from '@/uiservice/invoice/invoice-ui-service'; import InvoiceUIService from '@/uiservice/invoice/invoice-ui-service';
/** /**
* 发票状态分页视图视图基类 * 发票信息视图基类
* *
* @export * @export
* @class InvoiceStateTabViewBase * @class InvoiceStateTabViewBase
......
<studio-view-style2 viewName="invoicestatetabview" viewTitle="发票状态分页视图" class='detabexpview invoice-state-tab-view'> <studio-view-style2 viewName="invoicestatetabview" viewTitle="发票信息" class='detabexpview invoice-state-tab-view'>
<view_tabexppanel <view_tabexppanel
:viewState="viewState" :viewState="viewState"
:viewparams="viewparams" :viewparams="viewparams"
......
...@@ -6,7 +6,7 @@ import { InvoiceStateTabViewBase } from './invoice-state-tab-view-base'; ...@@ -6,7 +6,7 @@ import { InvoiceStateTabViewBase } from './invoice-state-tab-view-base';
import view_tabexppanel from '@widgets/invoice/state-tab-viewtabexppanel-tabexppanel/state-tab-viewtabexppanel-tabexppanel.vue'; import view_tabexppanel from '@widgets/invoice/state-tab-viewtabexppanel-tabexppanel/state-tab-viewtabexppanel-tabexppanel.vue';
/** /**
* 发票状态分页视图视图 * 发票信息视图
* *
* @export * @export
* @class InvoiceStateTabView * @class InvoiceStateTabView
......
...@@ -6,7 +6,7 @@ import TabExpViewEngine from '@engine/view/tab-exp-view-engine'; ...@@ -6,7 +6,7 @@ import TabExpViewEngine from '@engine/view/tab-exp-view-engine';
import ProductUIService from '@/uiservice/product/product-ui-service'; import ProductUIService from '@/uiservice/product/product-ui-service';
/** /**
* 产品状态分页视图视图基类 * 产品信息视图基类
* *
* @export * @export
* @class ProductStateTabViewBase * @class ProductStateTabViewBase
......
<studio-view-style2 viewName="productstatetabview" viewTitle="产品状态分页视图" class='detabexpview product-state-tab-view'> <studio-view-style2 viewName="productstatetabview" viewTitle="产品信息" class='detabexpview product-state-tab-view'>
<view_tabexppanel <view_tabexppanel
:viewState="viewState" :viewState="viewState"
:viewparams="viewparams" :viewparams="viewparams"
......
...@@ -6,7 +6,7 @@ import { ProductStateTabViewBase } from './product-state-tab-view-base'; ...@@ -6,7 +6,7 @@ import { ProductStateTabViewBase } from './product-state-tab-view-base';
import view_tabexppanel from '@widgets/product/state-tab-viewtabexppanel-tabexppanel/state-tab-viewtabexppanel-tabexppanel.vue'; import view_tabexppanel from '@widgets/product/state-tab-viewtabexppanel-tabexppanel/state-tab-viewtabexppanel-tabexppanel.vue';
/** /**
* 产品状态分页视图视图 * 产品信息视图
* *
* @export * @export
* @class ProductStateTabView * @class ProductStateTabView
......
...@@ -6,7 +6,7 @@ import TabExpViewEngine from '@engine/view/tab-exp-view-engine'; ...@@ -6,7 +6,7 @@ import TabExpViewEngine from '@engine/view/tab-exp-view-engine';
import OpportunityUIService from '@/uiservice/opportunity/opportunity-ui-service'; import OpportunityUIService from '@/uiservice/opportunity/opportunity-ui-service';
/** /**
* 商机状态分页视图视图基类 * 商机信息视图基类
* *
* @export * @export
* @class OpportunityStateTabViewBase * @class OpportunityStateTabViewBase
......
<studio-view-style2 viewName="opportunitystatetabview" viewTitle="商机状态分页视图" class='detabexpview opportunity-state-tab-view'> <studio-view-style2 viewName="opportunitystatetabview" viewTitle="商机信息" class='detabexpview opportunity-state-tab-view'>
<view_tabexppanel <view_tabexppanel
:viewState="viewState" :viewState="viewState"
:viewparams="viewparams" :viewparams="viewparams"
......
...@@ -6,7 +6,7 @@ import { OpportunityStateTabViewBase } from './opportunity-state-tab-view-base'; ...@@ -6,7 +6,7 @@ import { OpportunityStateTabViewBase } from './opportunity-state-tab-view-base';
import view_tabexppanel from '@widgets/opportunity/state-tab-viewtabexppanel-tabexppanel/state-tab-viewtabexppanel-tabexppanel.vue'; import view_tabexppanel from '@widgets/opportunity/state-tab-viewtabexppanel-tabexppanel/state-tab-viewtabexppanel-tabexppanel.vue';
/** /**
* 商机状态分页视图视图 * 商机信息视图
* *
* @export * @export
* @class OpportunityStateTabView * @class OpportunityStateTabView
......
...@@ -6,7 +6,7 @@ import TabExpViewEngine from '@engine/view/tab-exp-view-engine'; ...@@ -6,7 +6,7 @@ import TabExpViewEngine from '@engine/view/tab-exp-view-engine';
import QuoteUIService from '@/uiservice/quote/quote-ui-service'; import QuoteUIService from '@/uiservice/quote/quote-ui-service';
/** /**
* 报价单状态分页视图视图基类 * 报价单信息视图基类
* *
* @export * @export
* @class QuoteStateTabViewBase * @class QuoteStateTabViewBase
......
<studio-view-style2 viewName="quotestatetabview" viewTitle="报价单状态分页视图" class='detabexpview quote-state-tab-view'> <studio-view-style2 viewName="quotestatetabview" viewTitle="报价单信息" class='detabexpview quote-state-tab-view'>
<view_tabexppanel <view_tabexppanel
:viewState="viewState" :viewState="viewState"
:viewparams="viewparams" :viewparams="viewparams"
......
...@@ -6,7 +6,7 @@ import { QuoteStateTabViewBase } from './quote-state-tab-view-base'; ...@@ -6,7 +6,7 @@ import { QuoteStateTabViewBase } from './quote-state-tab-view-base';
import view_tabexppanel from '@widgets/quote/state-tab-viewtabexppanel-tabexppanel/state-tab-viewtabexppanel-tabexppanel.vue'; import view_tabexppanel from '@widgets/quote/state-tab-viewtabexppanel-tabexppanel/state-tab-viewtabexppanel-tabexppanel.vue';
/** /**
* 报价单状态分页视图视图 * 报价单信息视图
* *
* @export * @export
* @class QuoteStateTabView * @class QuoteStateTabView
......
...@@ -6,7 +6,7 @@ import TabExpViewEngine from '@engine/view/tab-exp-view-engine'; ...@@ -6,7 +6,7 @@ import TabExpViewEngine from '@engine/view/tab-exp-view-engine';
import SalesOrderUIService from '@/uiservice/sales-order/sales-order-ui-service'; import SalesOrderUIService from '@/uiservice/sales-order/sales-order-ui-service';
/** /**
* 订单状态分页视图视图基类 * 订单信息视图基类
* *
* @export * @export
* @class SalesOrderStateTabViewBase * @class SalesOrderStateTabViewBase
......
<studio-view-style2 viewName="salesorderstatetabview" viewTitle="订单状态分页视图" class='detabexpview sales-order-state-tab-view'> <studio-view-style2 viewName="salesorderstatetabview" viewTitle="订单信息" class='detabexpview sales-order-state-tab-view'>
<view_tabexppanel <view_tabexppanel
:viewState="viewState" :viewState="viewState"
:viewparams="viewparams" :viewparams="viewparams"
......
...@@ -6,7 +6,7 @@ import { SalesOrderStateTabViewBase } from './sales-order-state-tab-view-base'; ...@@ -6,7 +6,7 @@ import { SalesOrderStateTabViewBase } from './sales-order-state-tab-view-base';
import view_tabexppanel from '@widgets/sales-order/state-tab-viewtabexppanel-tabexppanel/state-tab-viewtabexppanel-tabexppanel.vue'; import view_tabexppanel from '@widgets/sales-order/state-tab-viewtabexppanel-tabexppanel/state-tab-viewtabexppanel-tabexppanel.vue';
/** /**
* 订单状态分页视图视图 * 订单信息视图
* *
* @export * @export
* @class SalesOrderStateTabView * @class SalesOrderStateTabView
......
...@@ -36,6 +36,11 @@ export default class MainModel { ...@@ -36,6 +36,11 @@ export default class MainModel {
prop: 'customername', prop: 'customername',
dataType: 'TEXT', dataType: 'TEXT',
}, },
{
name: 'srfdatatype',
prop: 'customertype',
dataType: 'SSCODELIST',
},
{ {
name: 'srfdataaccaction', name: 'srfdataaccaction',
prop: 'customerid', prop: 'customerid',
......
package cn.ibizlab.businesscentral.core.base.mapping;
import org.mapstruct.*;
import cn.ibizlab.businesscentral.core.base.domain.Account;
import cn.ibizlab.businesscentral.core.service.domain.IncidentCustomer;
import java.util.List;
@Mapper(componentModel = "spring", uses = {})
public interface AccountInheritMapping {
@Mappings({
@Mapping(source ="accountid",target = "customerid"),
@Mapping(source ="accountname",target = "customername"),
@Mapping(target ="focusNull",ignore = true),
})
IncidentCustomer toIncidentcustomer(Account account);
@Mappings({
@Mapping(source ="customerid" ,target = "accountid"),
@Mapping(source ="customername" ,target = "accountname"),
@Mapping(target ="focusNull",ignore = true),
})
Account toAccount(IncidentCustomer incidentcustomer);
List<IncidentCustomer> toIncidentcustomer(List<Account> account);
List<Account> toAccount(List<IncidentCustomer> incidentcustomer);
}
...@@ -101,6 +101,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl ...@@ -101,6 +101,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
@Transactional @Transactional
public boolean create(Account et) { public boolean create(Account et) {
fillParentData(et); fillParentData(et);
createIndexMajorEntityData(et);
if(!this.retBool(this.baseMapper.insert(et))) if(!this.retBool(this.baseMapper.insert(et)))
return false; return false;
CachedBeanCopier.copy(get(et.getAccountid()),et); CachedBeanCopier.copy(get(et.getAccountid()),et);
...@@ -117,6 +118,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl ...@@ -117,6 +118,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
@Transactional @Transactional
public boolean update(Account et) { public boolean update(Account et) {
fillParentData(et); fillParentData(et);
incidentcustomerService.update(accountInheritMapping.toIncidentcustomer(et));
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("accountid",et.getAccountid()))) if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("accountid",et.getAccountid())))
return false; return false;
CachedBeanCopier.copy(get(et.getAccountid()),et); CachedBeanCopier.copy(get(et.getAccountid()),et);
...@@ -133,6 +135,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl ...@@ -133,6 +135,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
@Transactional @Transactional
public boolean remove(String key) { public boolean remove(String key) {
boolean result=removeById(key); boolean result=removeById(key);
incidentcustomerService.remove(key);
return result ; return result ;
} }
...@@ -456,6 +459,23 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl ...@@ -456,6 +459,23 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
@Autowired
cn.ibizlab.businesscentral.core.base.mapping.AccountInheritMapping accountInheritMapping;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.service.service.IIncidentCustomerService incidentcustomerService;
/**
* 创建索引主实体数据
* @param et
*/
private void createIndexMajorEntityData(Account et){
if(ObjectUtils.isEmpty(et.getAccountid()))
et.setAccountid((String)et.getDefaultKey(true));
cn.ibizlab.businesscentral.core.service.domain.IncidentCustomer incidentcustomer =accountInheritMapping.toIncidentcustomer(et);
incidentcustomer.set("customertype","ACCOUNT");
incidentcustomerService.create(incidentcustomer);
}
@Override @Override
public List<JSONObject> select(String sql, Map param){ public List<JSONObject> select(String sql, Map param){
......
...@@ -24,63 +24,40 @@ import org.springframework.data.annotation.Transient; ...@@ -24,63 +24,40 @@ import org.springframework.data.annotation.Transient;
import cn.ibizlab.businesscentral.util.annotation.Audit; import cn.ibizlab.businesscentral.util.annotation.Audit;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.baomidou.mybatisplus.annotation.*;
import cn.ibizlab.businesscentral.util.domain.EntityMP;
/** /**
* 实体[案例客户] * [案例客户] 对象
*/ */
@Builder
@Getter @Getter
@Setter @Setter
@NoArgsConstructor @NoArgsConstructor
@JsonIgnoreProperties(value = "handler") @AllArgsConstructor
@TableName(value = "INCIDENTCUSTOMER",resultMap = "IncidentCustomerResultMap") public class IncidentCustomer extends EntityBase implements Serializable {
public class IncidentCustomer extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/** /**
* 客户 * 客户
*/ */
@DEField(isKeyField=true) @DEField(isKeyField=true)
@TableId(value= "customerid",type=IdType.ASSIGN_UUID) @JSONField(name = "customerId")
@JSONField(name = "customerid") @JsonProperty("customerId")
@JsonProperty("customerid")
private String customerid; private String customerid;
/** /**
* 客户类型 * 客户类型
*/ */
@TableField(value = "customertype") @JSONField(name = "customerType")
@JSONField(name = "customertype") @JsonProperty("customerType")
@JsonProperty("customertype")
private String customertype; private String customertype;
/** /**
* 客户 * 客户
*/ */
@TableField(value = "customername") @JSONField(name = "customerName")
@JSONField(name = "customername") @JsonProperty("customerName")
@JsonProperty("customername")
private String customername; private String customername;
/**
* 设置 [客户类型]
*/
public void setCustomertype(String customertype){
this.customertype = customertype ;
this.modify("customertype",customertype);
}
/**
* 设置 [客户]
*/
public void setCustomername(String customername){
this.customername = customername ;
this.modify("customername",customername);
}
} }
......
...@@ -17,45 +17,19 @@ import org.springframework.util.ObjectUtils; ...@@ -17,45 +17,19 @@ import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import cn.ibizlab.businesscentral.util.filter.QueryWrapperContext; import cn.ibizlab.businesscentral.util.filter.SearchContextBase;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.ibizlab.businesscentral.core.service.domain.IncidentCustomer;
/** /**
* 关系型数据实体[IncidentCustomer] 查询条件对象 * ServiceApi数据实体[IncidentCustomer] 查询条件对象
*/ */
@Slf4j @Slf4j
@Data @Data
public class IncidentCustomerSearchContext extends QueryWrapperContext<IncidentCustomer> { public class IncidentCustomerSearchContext extends SearchContextBase {
private String n_customertype_eq;//[客户类型] private String n_customertype_eq;//[客户类型]
public void setN_customertype_eq(String n_customertype_eq) {
this.n_customertype_eq = n_customertype_eq;
if(!ObjectUtils.isEmpty(this.n_customertype_eq)){
this.getSearchCond().eq("customertype", n_customertype_eq);
}
}
private String n_customername_like;//[客户] private String n_customername_like;//[客户]
public void setN_customername_like(String n_customername_like) {
this.n_customername_like = n_customername_like;
if(!ObjectUtils.isEmpty(this.n_customername_like)){
this.getSearchCond().like("customername", n_customername_like);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("customername", query)
);
}
}
}
}
...@@ -18,12 +18,10 @@ import cn.ibizlab.businesscentral.core.service.domain.IncidentCustomer; ...@@ -18,12 +18,10 @@ import cn.ibizlab.businesscentral.core.service.domain.IncidentCustomer;
import cn.ibizlab.businesscentral.core.service.filter.IncidentCustomerSearchContext; import cn.ibizlab.businesscentral.core.service.filter.IncidentCustomerSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/** /**
* 实体[IncidentCustomer] 服务对象接口 * 实体[IncidentCustomer] 服务对象接口
*/ */
public interface IIncidentCustomerService extends IService<IncidentCustomer>{ public interface IIncidentCustomerService{
boolean create(IncidentCustomer et) ; boolean create(IncidentCustomer et) ;
void createBatch(List<IncidentCustomer> list) ; void createBatch(List<IncidentCustomer> list) ;
...@@ -37,21 +35,8 @@ public interface IIncidentCustomerService extends IService<IncidentCustomer>{ ...@@ -37,21 +35,8 @@ public interface IIncidentCustomerService extends IService<IncidentCustomer>{
boolean save(IncidentCustomer et) ; boolean save(IncidentCustomer et) ;
void saveBatch(List<IncidentCustomer> list) ; void saveBatch(List<IncidentCustomer> list) ;
Page<IncidentCustomer> searchDefault(IncidentCustomerSearchContext context) ; Page<IncidentCustomer> searchDefault(IncidentCustomerSearchContext context) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return select * from table where id = '1'
*/
List<JSONObject> select(String sql, Map param);
/**
*自定义SQL
* @param sql update table set name ='test' where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return update table set name ='test' where id = '1'
*/
boolean execute(String sql, Map param);
} }
...@@ -30,73 +30,44 @@ import cn.ibizlab.businesscentral.core.service.service.IIncidentCustomerService; ...@@ -30,73 +30,44 @@ import cn.ibizlab.businesscentral.core.service.service.IIncidentCustomerService;
import cn.ibizlab.businesscentral.util.helper.CachedBeanCopier; import cn.ibizlab.businesscentral.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.businesscentral.core.service.mapper.IncidentCustomerMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils;
/** /**
* 实体[案例客户] 服务对象接口实现 * 实体[案例客户] 无存储服务对象接口实现
*/ */
@Slf4j @Slf4j
@Service("IncidentCustomerServiceImpl") @Service
public class IncidentCustomerServiceImpl extends ServiceImpl<IncidentCustomerMapper, IncidentCustomer> implements IIncidentCustomerService { public class IncidentCustomerServiceImpl implements IIncidentCustomerService {
protected int batchSize = 500;
@Override @Override
@Transactional
public boolean create(IncidentCustomer et) { public boolean create(IncidentCustomer et) {
if(!this.retBool(this.baseMapper.insert(et))) //代码实现
return false;
CachedBeanCopier.copy(get(et.getCustomerid()),et);
return true; return true;
} }
@Override public void createBatch(List<IncidentCustomer> list){
public void createBatch(List<IncidentCustomer> list) {
this.saveBatch(list,batchSize);
} }
@Override @Override
@Transactional
public boolean update(IncidentCustomer et) { public boolean update(IncidentCustomer et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("customerid",et.getCustomerid()))) //代码实现
return false;
CachedBeanCopier.copy(get(et.getCustomerid()),et);
return true; return true;
} }
@Override public void updateBatch(List<IncidentCustomer> list){
public void updateBatch(List<IncidentCustomer> list) {
updateBatchById(list,batchSize);
} }
@Override @Override
@Transactional
public boolean remove(String key) { public boolean remove(String key) {
boolean result=removeById(key); return true;
return result ;
} }
@Override public void removeBatch(Collection<String> idList){
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
} }
@Override @Override
@Transactional
public IncidentCustomer get(String key) { public IncidentCustomer get(String key) {
IncidentCustomer et = getById(key); IncidentCustomer et = new IncidentCustomer();
if(et==null){ et.setCustomerid(key);
et=new IncidentCustomer();
et.setCustomerid(key);
}
else{
}
return et; return et;
} }
...@@ -107,38 +78,20 @@ public class IncidentCustomerServiceImpl extends ServiceImpl<IncidentCustomerMap ...@@ -107,38 +78,20 @@ public class IncidentCustomerServiceImpl extends ServiceImpl<IncidentCustomerMap
@Override @Override
public boolean checkKey(IncidentCustomer et) { public boolean checkKey(IncidentCustomer et) {
return (!ObjectUtils.isEmpty(et.getCustomerid()))&&(!Objects.isNull(this.getById(et.getCustomerid()))); return false;
} }
@Override @Override
@Transactional @Transactional
public boolean save(IncidentCustomer et) { public boolean save(IncidentCustomer et) {
if(!saveOrUpdate(et)) //代码实现
return false;
return true; return true;
} }
@Override @Override
@Transactional( public void saveBatch(List<IncidentCustomer> list) {
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(IncidentCustomer et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
} }
@Override
public boolean saveBatch(Collection<IncidentCustomer> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<IncidentCustomer> list) {
saveOrUpdateBatch(list,batchSize);
}
...@@ -147,41 +100,9 @@ public class IncidentCustomerServiceImpl extends ServiceImpl<IncidentCustomerMap ...@@ -147,41 +100,9 @@ public class IncidentCustomerServiceImpl extends ServiceImpl<IncidentCustomerMap
*/ */
@Override @Override
public Page<IncidentCustomer> searchDefault(IncidentCustomerSearchContext context) { public Page<IncidentCustomer> searchDefault(IncidentCustomerSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<IncidentCustomer> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond()); return new PageImpl<IncidentCustomer>(new ArrayList(),context.getPageable(),0);
return new PageImpl<IncidentCustomer>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
@Override
public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql,param);
}
@Override
@Transactional
public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) {
return false;
}
if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql,param);
}
log.warn("暂未支持的SQL语法");
return true;
} }
} }
...@@ -47,7 +47,6 @@ public class IncidentCustomerResource { ...@@ -47,7 +47,6 @@ public class IncidentCustomerResource {
@Lazy @Lazy
public IncidentCustomerMapping incidentcustomerMapping; public IncidentCustomerMapping incidentcustomerMapping;
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-IncidentCustomer-Create-all')")
@ApiOperation(value = "新建案例客户", tags = {"案例客户" }, notes = "新建案例客户") @ApiOperation(value = "新建案例客户", tags = {"案例客户" }, notes = "新建案例客户")
@RequestMapping(method = RequestMethod.POST, value = "/incidentcustomers") @RequestMapping(method = RequestMethod.POST, value = "/incidentcustomers")
@Transactional @Transactional
...@@ -58,7 +57,6 @@ public class IncidentCustomerResource { ...@@ -58,7 +57,6 @@ public class IncidentCustomerResource {
return ResponseEntity.status(HttpStatus.OK).body(dto); return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-IncidentCustomer-Create-all')")
@ApiOperation(value = "批量新建案例客户", tags = {"案例客户" }, notes = "批量新建案例客户") @ApiOperation(value = "批量新建案例客户", tags = {"案例客户" }, notes = "批量新建案例客户")
@RequestMapping(method = RequestMethod.POST, value = "/incidentcustomers/batch") @RequestMapping(method = RequestMethod.POST, value = "/incidentcustomers/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<IncidentCustomerDTO> incidentcustomerdtos) { public ResponseEntity<Boolean> createBatch(@RequestBody List<IncidentCustomerDTO> incidentcustomerdtos) {
...@@ -66,7 +64,6 @@ public class IncidentCustomerResource { ...@@ -66,7 +64,6 @@ public class IncidentCustomerResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-IncidentCustomer-Update-all')")
@ApiOperation(value = "更新案例客户", tags = {"案例客户" }, notes = "更新案例客户") @ApiOperation(value = "更新案例客户", tags = {"案例客户" }, notes = "更新案例客户")
@RequestMapping(method = RequestMethod.PUT, value = "/incidentcustomers/{incidentcustomer_id}") @RequestMapping(method = RequestMethod.PUT, value = "/incidentcustomers/{incidentcustomer_id}")
@Transactional @Transactional
...@@ -78,7 +75,6 @@ public class IncidentCustomerResource { ...@@ -78,7 +75,6 @@ public class IncidentCustomerResource {
return ResponseEntity.status(HttpStatus.OK).body(dto); return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-IncidentCustomer-Update-all')")
@ApiOperation(value = "批量更新案例客户", tags = {"案例客户" }, notes = "批量更新案例客户") @ApiOperation(value = "批量更新案例客户", tags = {"案例客户" }, notes = "批量更新案例客户")
@RequestMapping(method = RequestMethod.PUT, value = "/incidentcustomers/batch") @RequestMapping(method = RequestMethod.PUT, value = "/incidentcustomers/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<IncidentCustomerDTO> incidentcustomerdtos) { public ResponseEntity<Boolean> updateBatch(@RequestBody List<IncidentCustomerDTO> incidentcustomerdtos) {
...@@ -86,7 +82,6 @@ public class IncidentCustomerResource { ...@@ -86,7 +82,6 @@ public class IncidentCustomerResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-IncidentCustomer-Remove-all')")
@ApiOperation(value = "删除案例客户", tags = {"案例客户" }, notes = "删除案例客户") @ApiOperation(value = "删除案例客户", tags = {"案例客户" }, notes = "删除案例客户")
@RequestMapping(method = RequestMethod.DELETE, value = "/incidentcustomers/{incidentcustomer_id}") @RequestMapping(method = RequestMethod.DELETE, value = "/incidentcustomers/{incidentcustomer_id}")
@Transactional @Transactional
...@@ -94,7 +89,6 @@ public class IncidentCustomerResource { ...@@ -94,7 +89,6 @@ public class IncidentCustomerResource {
return ResponseEntity.status(HttpStatus.OK).body(incidentcustomerService.remove(incidentcustomer_id)); return ResponseEntity.status(HttpStatus.OK).body(incidentcustomerService.remove(incidentcustomer_id));
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-IncidentCustomer-Remove-all')")
@ApiOperation(value = "批量删除案例客户", tags = {"案例客户" }, notes = "批量删除案例客户") @ApiOperation(value = "批量删除案例客户", tags = {"案例客户" }, notes = "批量删除案例客户")
@RequestMapping(method = RequestMethod.DELETE, value = "/incidentcustomers/batch") @RequestMapping(method = RequestMethod.DELETE, value = "/incidentcustomers/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) { public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
...@@ -102,7 +96,6 @@ public class IncidentCustomerResource { ...@@ -102,7 +96,6 @@ public class IncidentCustomerResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-IncidentCustomer-Get-all')")
@ApiOperation(value = "获取案例客户", tags = {"案例客户" }, notes = "获取案例客户") @ApiOperation(value = "获取案例客户", tags = {"案例客户" }, notes = "获取案例客户")
@RequestMapping(method = RequestMethod.GET, value = "/incidentcustomers/{incidentcustomer_id}") @RequestMapping(method = RequestMethod.GET, value = "/incidentcustomers/{incidentcustomer_id}")
public ResponseEntity<IncidentCustomerDTO> get(@PathVariable("incidentcustomer_id") String incidentcustomer_id) { public ResponseEntity<IncidentCustomerDTO> get(@PathVariable("incidentcustomer_id") String incidentcustomer_id) {
...@@ -123,14 +116,12 @@ public class IncidentCustomerResource { ...@@ -123,14 +116,12 @@ public class IncidentCustomerResource {
return ResponseEntity.status(HttpStatus.OK).body(incidentcustomerService.checkKey(incidentcustomerMapping.toDomain(incidentcustomerdto))); return ResponseEntity.status(HttpStatus.OK).body(incidentcustomerService.checkKey(incidentcustomerMapping.toDomain(incidentcustomerdto)));
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-IncidentCustomer-Save-all')")
@ApiOperation(value = "保存案例客户", tags = {"案例客户" }, notes = "保存案例客户") @ApiOperation(value = "保存案例客户", tags = {"案例客户" }, notes = "保存案例客户")
@RequestMapping(method = RequestMethod.POST, value = "/incidentcustomers/save") @RequestMapping(method = RequestMethod.POST, value = "/incidentcustomers/save")
public ResponseEntity<Boolean> save(@RequestBody IncidentCustomerDTO incidentcustomerdto) { public ResponseEntity<Boolean> save(@RequestBody IncidentCustomerDTO incidentcustomerdto) {
return ResponseEntity.status(HttpStatus.OK).body(incidentcustomerService.save(incidentcustomerMapping.toDomain(incidentcustomerdto))); return ResponseEntity.status(HttpStatus.OK).body(incidentcustomerService.save(incidentcustomerMapping.toDomain(incidentcustomerdto)));
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-IncidentCustomer-Save-all')")
@ApiOperation(value = "批量保存案例客户", tags = {"案例客户" }, notes = "批量保存案例客户") @ApiOperation(value = "批量保存案例客户", tags = {"案例客户" }, notes = "批量保存案例客户")
@RequestMapping(method = RequestMethod.POST, value = "/incidentcustomers/savebatch") @RequestMapping(method = RequestMethod.POST, value = "/incidentcustomers/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<IncidentCustomerDTO> incidentcustomerdtos) { public ResponseEntity<Boolean> saveBatch(@RequestBody List<IncidentCustomerDTO> incidentcustomerdtos) {
...@@ -138,7 +129,6 @@ public class IncidentCustomerResource { ...@@ -138,7 +129,6 @@ public class IncidentCustomerResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-IncidentCustomer-searchDefault-all')")
@ApiOperation(value = "获取DEFAULT", tags = {"案例客户" } ,notes = "获取DEFAULT") @ApiOperation(value = "获取DEFAULT", tags = {"案例客户" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/incidentcustomers/fetchdefault") @RequestMapping(method= RequestMethod.GET , value="/incidentcustomers/fetchdefault")
public ResponseEntity<List<IncidentCustomerDTO>> fetchDefault(IncidentCustomerSearchContext context) { public ResponseEntity<List<IncidentCustomerDTO>> fetchDefault(IncidentCustomerSearchContext context) {
...@@ -151,7 +141,6 @@ public class IncidentCustomerResource { ...@@ -151,7 +141,6 @@ public class IncidentCustomerResource {
.body(list); .body(list);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-IncidentCustomer-searchDefault-all')")
@ApiOperation(value = "查询DEFAULT", tags = {"案例客户" } ,notes = "查询DEFAULT") @ApiOperation(value = "查询DEFAULT", tags = {"案例客户" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/incidentcustomers/searchdefault") @RequestMapping(method= RequestMethod.POST , value="/incidentcustomers/searchdefault")
public ResponseEntity<Page<IncidentCustomerDTO>> searchDefault(@RequestBody IncidentCustomerSearchContext context) { public ResponseEntity<Page<IncidentCustomerDTO>> searchDefault(@RequestBody IncidentCustomerSearchContext context) {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册