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

xignzi006 发布系统代码

上级 47d9aa88
......@@ -9,26 +9,14 @@
<i-col v-show="detailsModel.n_customertype_eq.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='n_customertype_eq' :itemRules="this.rules.n_customertype_eq" class='' :caption="$t('entities.incidentcustomer.default_searchform.details.n_customertype_eq')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.n_customertype_eq.error" :isEmptyCaption="false" labelPos="TOP">
<dropdown-list
v-model="data.n_customertype_eq"
:data="data"
:context="context"
:viewparams="viewparams"
:localContext ='{ }'
:localParam ='{ }'
:disabled="detailsModel.n_customertype_eq.disabled"
valueType="string"
tag='IncidentCustomer'
codelistType='STATIC'
placeholder='请选择...'
/>
<app-span name='n_customertype_eq' :value="data.n_customertype_eq" tag='IncidentCustomer' codelistType='STATIC' :data="data" :context="context" :viewparams="viewparams" :localContext ='{ }' :localParam ='{ }' style=""></app-span>
</app-form-item>
</i-col>
<i-col v-show="detailsModel.n_customername_like.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='n_customername_like' :itemRules="this.rules.n_customername_like" class='' :caption="$t('entities.incidentcustomer.default_searchform.details.n_customername_like')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.n_customername_like.error" :isEmptyCaption="false" labelPos="TOP">
<input-box v-model="data.n_customername_like" @enter="onEnter($event)" :disabled="detailsModel.n_customername_like.disabled" type='text' style=""></input-box>
<app-span name='n_customername_like' :value="data.n_customername_like" :data="data" :context="context" :viewparams="viewparams" :localContext ='{ }' :localParam ='{ }' style=""></app-span>
</app-form-item>
</i-col>
......
......@@ -36,6 +36,11 @@ export default class MainModel {
prop: 'customername',
dataType: 'TEXT',
},
{
name: 'srfdatatype',
prop: 'customertype',
dataType: 'SSCODELIST',
},
{
name: 'srfdataaccaction',
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);
}
package cn.ibizlab.businesscentral.core.base.mapping;
import org.mapstruct.*;
import cn.ibizlab.businesscentral.core.base.domain.Contact;
import cn.ibizlab.businesscentral.core.service.domain.IncidentCustomer;
import java.util.List;
@Mapper(componentModel = "spring", uses = {})
public interface ContactInheritMapping {
@Mappings({
@Mapping(source ="contactid",target = "customerid"),
@Mapping(source ="fullname",target = "customername"),
@Mapping(target ="focusNull",ignore = true),
})
IncidentCustomer toIncidentcustomer(Contact contact);
@Mappings({
@Mapping(source ="customerid" ,target = "contactid"),
@Mapping(source ="customername" ,target = "fullname"),
@Mapping(target ="focusNull",ignore = true),
})
Contact toContact(IncidentCustomer incidentcustomer);
List<IncidentCustomer> toIncidentcustomer(List<Contact> contact);
List<Contact> toContact(List<IncidentCustomer> incidentcustomer);
}
......@@ -101,6 +101,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
@Transactional
public boolean create(Account et) {
fillParentData(et);
createIndexMajorEntityData(et);
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getAccountid()),et);
......@@ -117,6 +118,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
@Transactional
public boolean update(Account et) {
fillParentData(et);
incidentcustomerService.update(accountInheritMapping.toIncidentcustomer(et));
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("accountid",et.getAccountid())))
return false;
CachedBeanCopier.copy(get(et.getAccountid()),et);
......@@ -133,6 +135,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
incidentcustomerService.remove(key);
return result ;
}
......@@ -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
public List<JSONObject> select(String sql, Map param){
......
......@@ -95,6 +95,7 @@ public class ContactServiceImpl extends ServiceImpl<ContactMapper, Contact> impl
@Transactional
public boolean create(Contact et) {
fillParentData(et);
createIndexMajorEntityData(et);
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getContactid()),et);
......@@ -111,6 +112,7 @@ public class ContactServiceImpl extends ServiceImpl<ContactMapper, Contact> impl
@Transactional
public boolean update(Contact et) {
fillParentData(et);
incidentcustomerService.update(contactInheritMapping.toIncidentcustomer(et));
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("contactid",et.getContactid())))
return false;
CachedBeanCopier.copy(get(et.getContactid()),et);
......@@ -127,6 +129,7 @@ public class ContactServiceImpl extends ServiceImpl<ContactMapper, Contact> impl
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
incidentcustomerService.remove(key);
return result ;
}
......@@ -399,6 +402,23 @@ public class ContactServiceImpl extends ServiceImpl<ContactMapper, Contact> impl
@Autowired
cn.ibizlab.businesscentral.core.base.mapping.ContactInheritMapping contactInheritMapping;
@Autowired
@Lazy
protected cn.ibizlab.businesscentral.core.service.service.IIncidentCustomerService incidentcustomerService;
/**
* 创建索引主实体数据
* @param et
*/
private void createIndexMajorEntityData(Contact et){
if(ObjectUtils.isEmpty(et.getContactid()))
et.setContactid((String)et.getDefaultKey(true));
cn.ibizlab.businesscentral.core.service.domain.IncidentCustomer incidentcustomer =contactInheritMapping.toIncidentcustomer(et);
incidentcustomer.set("customertype","CONTACT");
incidentcustomerService.create(incidentcustomer);
}
@Override
public List<JSONObject> select(String sql, Map param){
......
......@@ -24,36 +24,42 @@ import org.springframework.data.annotation.Transient;
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
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class IncidentCustomer extends EntityBase implements Serializable {
@JsonIgnoreProperties(value = "handler")
@TableName(value = "INCIDENTCUSTOMER",resultMap = "IncidentCustomerResultMap")
public class IncidentCustomer extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 客户
*/
@DEField(isKeyField=true)
@JSONField(name = "customerId")
@JsonProperty("customerId")
@TableId(value= "customerid",type=IdType.ASSIGN_UUID)
@JSONField(name = "customerid")
@JsonProperty("customerid")
private String customerid;
/**
* 客户类型
*/
@JSONField(name = "customerType")
@JsonProperty("customerType")
@TableField(exist = false)
@JSONField(name = "customertype")
@JsonProperty("customertype")
private String customertype;
/**
* 客户
*/
@JSONField(name = "customerName")
@JsonProperty("customerName")
@TableField(exist = false)
@JSONField(name = "customername")
@JsonProperty("customername")
private String customername;
......
......@@ -17,19 +17,45 @@ import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import cn.ibizlab.businesscentral.util.filter.SearchContextBase;
import cn.ibizlab.businesscentral.util.filter.QueryWrapperContext;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.ibizlab.businesscentral.core.service.domain.IncidentCustomer;
/**
* ServiceApi数据实体[IncidentCustomer] 查询条件对象
* 关系型数据实体[IncidentCustomer] 查询条件对象
*/
@Slf4j
@Data
public class IncidentCustomerSearchContext extends SearchContextBase {
private String n_customertype_eq;//[客户类型]
public class IncidentCustomerSearchContext extends QueryWrapperContext<IncidentCustomer> {
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;//[客户]
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)
);
}
}
}
package cn.ibizlab.businesscentral.core.service.mapper;
import java.util.List;
import org.apache.ibatis.annotations.*;
import java.util.Map;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import java.util.HashMap;
import org.apache.ibatis.annotations.Select;
import cn.ibizlab.businesscentral.core.service.domain.IncidentCustomer;
import cn.ibizlab.businesscentral.core.service.filter.IncidentCustomerSearchContext;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import java.io.Serializable;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.alibaba.fastjson.JSONObject;
public interface IncidentCustomerMapper extends BaseMapper<IncidentCustomer>{
Page<IncidentCustomer> searchDefault(IPage page, @Param("srf") IncidentCustomerSearchContext context, @Param("ew") Wrapper<IncidentCustomer> wrapper) ;
@Override
IncidentCustomer selectById(Serializable id);
@Override
int insert(IncidentCustomer entity);
@Override
int updateById(@Param(Constants.ENTITY) IncidentCustomer entity);
@Override
int update(@Param(Constants.ENTITY) IncidentCustomer entity, @Param("ew") Wrapper<IncidentCustomer> updateWrapper);
@Override
int deleteById(Serializable id);
/**
* 自定义查询SQL
* @param sql
* @return
*/
@Select("${sql}")
List<JSONObject> selectBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义更新SQL
* @param sql
* @return
*/
@Update("${sql}")
boolean updateBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义插入SQL
* @param sql
* @return
*/
@Insert("${sql}")
boolean insertBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义删除SQL
* @param sql
* @return
*/
@Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
}
......@@ -18,10 +18,12 @@ import cn.ibizlab.businesscentral.core.service.domain.IncidentCustomer;
import cn.ibizlab.businesscentral.core.service.filter.IncidentCustomerSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[IncidentCustomer] 服务对象接口
*/
public interface IIncidentCustomerService{
public interface IIncidentCustomerService extends IService<IncidentCustomer>{
boolean create(IncidentCustomer et) ;
void createBatch(List<IncidentCustomer> list) ;
......@@ -35,8 +37,21 @@ public interface IIncidentCustomerService{
boolean save(IncidentCustomer et) ;
void saveBatch(List<IncidentCustomer> list) ;
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,44 +30,73 @@ import cn.ibizlab.businesscentral.core.service.service.IIncidentCustomerService;
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
@Service
public class IncidentCustomerServiceImpl implements IIncidentCustomerService {
@Service("IncidentCustomerServiceImpl")
public class IncidentCustomerServiceImpl extends ServiceImpl<IncidentCustomerMapper, IncidentCustomer> implements IIncidentCustomerService {
protected int batchSize = 500;
@Override
@Transactional
public boolean create(IncidentCustomer et) {
//代码实现
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getCustomerid()),et);
return true;
}
public void createBatch(List<IncidentCustomer> list){
@Override
public void createBatch(List<IncidentCustomer> list) {
this.saveBatch(list,batchSize);
}
@Override
@Transactional
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;
}
public void updateBatch(List<IncidentCustomer> list){
@Override
public void updateBatch(List<IncidentCustomer> list) {
updateBatchById(list,batchSize);
}
@Override
@Transactional
public boolean remove(String key) {
return true;
boolean result=removeById(key);
return result ;
}
public void removeBatch(Collection<String> idList){
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
}
@Override
@Transactional
public IncidentCustomer get(String key) {
IncidentCustomer et = new IncidentCustomer();
IncidentCustomer et = getById(key);
if(et==null){
et=new IncidentCustomer();
et.setCustomerid(key);
}
else{
}
return et;
}
......@@ -78,20 +107,38 @@ public class IncidentCustomerServiceImpl implements IIncidentCustomerService {
@Override
public boolean checkKey(IncidentCustomer et) {
return false;
return (!ObjectUtils.isEmpty(et.getCustomerid()))&&(!Objects.isNull(this.getById(et.getCustomerid())));
}
@Override
@Transactional
public boolean save(IncidentCustomer et) {
//代码实现
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
public void saveBatch(List<IncidentCustomer> list) {
@Transactional(
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);
}
......@@ -100,9 +147,41 @@ public class IncidentCustomerServiceImpl implements IIncidentCustomerService {
*/
@Override
public Page<IncidentCustomer> searchDefault(IncidentCustomerSearchContext context) {
return new PageImpl<IncidentCustomer>(new ArrayList(),context.getPageable(),0);
com.baomidou.mybatisplus.extension.plugins.pagination.Page<IncidentCustomer> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
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;
}
}
<?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">
<mapper namespace="cn.ibizlab.businesscentral.core.service.mapper.IncidentCustomerMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="IncidentCustomerResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`CUSTOMERID`, t1.`CUSTOMERNAME`, t1.`CUSTOMERTYPE` FROM (SELECT 'ACCOUNT' AS `CUSTOMERTYPE`,v1.`ACCOUNTID` AS `CUSTOMERID` ,v1.`ACCOUNTNAME` AS `CUSTOMERNAME` FROM (SELECT t1.`ACCOUNTID`, t1.`ACCOUNTNAME` FROM `ACCOUNT` t1 ) v1 UNION ALL SELECT 'CONTACT' AS `CUSTOMERTYPE`,v2.`CONTACTID` AS `CUSTOMERID` ,v2.`FULLNAME` AS `CUSTOMERNAME` FROM (SELECT t1.`CONTACTID`, t1.`FULLNAME` FROM `CONTACT` t1 ) v2 ) t1 ) t1 where customerid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="IncidentCustomerResultMap" type="cn.ibizlab.businesscentral.core.service.domain.IncidentCustomer" autoMapping="true">
<id property="customerid" column="customerid" /><!--主键字段映射-->
</resultMap>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.businesscentral.core.service.filter.IncidentCustomerSearchContext" resultMap="IncidentCustomerResultMap">
select t1.* from (
<include refid="Default" />
)t1
<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据查询[Account]-->
<sql id="Account" databaseId="mysql">
<![CDATA[ select accountid as customerid, accountname as customername, 'ACCOUNT' as customertype from account
]]>
</sql>
<!--数据查询[Contact]-->
<sql id="Contact" databaseId="mysql">
<![CDATA[ select contactid as customerid, fullname as customername, 'CONTACT' as customertype from contact
]]>
</sql>
<!--数据查询[Default]-->
<sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.`CUSTOMERID`, t1.`CUSTOMERNAME`, t1.`CUSTOMERTYPE` FROM (SELECT 'ACCOUNT' AS `CUSTOMERTYPE`,v1.`ACCOUNTID` AS `CUSTOMERID` ,v1.`ACCOUNTNAME` AS `CUSTOMERNAME` FROM (SELECT t1.`ACCOUNTID`, t1.`ACCOUNTNAME` FROM `ACCOUNT` t1 ) v1 UNION ALL SELECT 'CONTACT' AS `CUSTOMERTYPE`,v2.`CONTACTID` AS `CUSTOMERID` ,v2.`FULLNAME` AS `CUSTOMERNAME` FROM (SELECT t1.`CONTACTID`, t1.`FULLNAME` FROM `CONTACT` t1 ) v2 ) t1
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`CUSTOMERID`, t1.`CUSTOMERNAME`, t1.`CUSTOMERTYPE` FROM (SELECT 'ACCOUNT' AS `CUSTOMERTYPE`,v1.`ACCOUNTID` AS `CUSTOMERID` ,v1.`ACCOUNTNAME` AS `CUSTOMERNAME` FROM (SELECT t1.`ACCOUNTID`, t1.`ACCOUNTNAME` FROM `ACCOUNT` t1 ) v1 UNION ALL SELECT 'CONTACT' AS `CUSTOMERTYPE`,v2.`CONTACTID` AS `CUSTOMERID` ,v2.`FULLNAME` AS `CUSTOMERNAME` FROM (SELECT t1.`CONTACTID`, t1.`FULLNAME` FROM `CONTACT` t1 ) v2 ) t1
]]>
</sql>
</mapper>
......@@ -48,22 +48,6 @@ public class IncidentCustomerDTO extends DTOBase implements Serializable {
private String customername;
/**
* 设置 [CUSTOMERTYPE]
*/
public void setCustomertype(String customertype){
this.customertype = customertype ;
this.modify("customertype",customertype);
}
/**
* 设置 [CUSTOMERNAME]
*/
public void setCustomername(String customername){
this.customername = customername ;
this.modify("customername",customername);
}
}
......@@ -47,6 +47,7 @@ public class IncidentCustomerResource {
@Lazy
public IncidentCustomerMapping incidentcustomerMapping;
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-IncidentCustomer-Create-all')")
@ApiOperation(value = "新建案例客户", tags = {"案例客户" }, notes = "新建案例客户")
@RequestMapping(method = RequestMethod.POST, value = "/incidentcustomers")
@Transactional
......@@ -57,6 +58,7 @@ public class IncidentCustomerResource {
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-IncidentCustomer-Create-all')")
@ApiOperation(value = "批量新建案例客户", tags = {"案例客户" }, notes = "批量新建案例客户")
@RequestMapping(method = RequestMethod.POST, value = "/incidentcustomers/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<IncidentCustomerDTO> incidentcustomerdtos) {
......@@ -64,6 +66,7 @@ public class IncidentCustomerResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-IncidentCustomer-Update-all')")
@ApiOperation(value = "更新案例客户", tags = {"案例客户" }, notes = "更新案例客户")
@RequestMapping(method = RequestMethod.PUT, value = "/incidentcustomers/{incidentcustomer_id}")
@Transactional
......@@ -75,6 +78,7 @@ public class IncidentCustomerResource {
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-IncidentCustomer-Update-all')")
@ApiOperation(value = "批量更新案例客户", tags = {"案例客户" }, notes = "批量更新案例客户")
@RequestMapping(method = RequestMethod.PUT, value = "/incidentcustomers/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<IncidentCustomerDTO> incidentcustomerdtos) {
......@@ -82,6 +86,7 @@ public class IncidentCustomerResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-IncidentCustomer-Remove-all')")
@ApiOperation(value = "删除案例客户", tags = {"案例客户" }, notes = "删除案例客户")
@RequestMapping(method = RequestMethod.DELETE, value = "/incidentcustomers/{incidentcustomer_id}")
@Transactional
......@@ -89,6 +94,7 @@ public class IncidentCustomerResource {
return ResponseEntity.status(HttpStatus.OK).body(incidentcustomerService.remove(incidentcustomer_id));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-IncidentCustomer-Remove-all')")
@ApiOperation(value = "批量删除案例客户", tags = {"案例客户" }, notes = "批量删除案例客户")
@RequestMapping(method = RequestMethod.DELETE, value = "/incidentcustomers/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
......@@ -96,6 +102,7 @@ public class IncidentCustomerResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-IncidentCustomer-Get-all')")
@ApiOperation(value = "获取案例客户", tags = {"案例客户" }, notes = "获取案例客户")
@RequestMapping(method = RequestMethod.GET, value = "/incidentcustomers/{incidentcustomer_id}")
public ResponseEntity<IncidentCustomerDTO> get(@PathVariable("incidentcustomer_id") String incidentcustomer_id) {
......@@ -116,12 +123,14 @@ public class IncidentCustomerResource {
return ResponseEntity.status(HttpStatus.OK).body(incidentcustomerService.checkKey(incidentcustomerMapping.toDomain(incidentcustomerdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-IncidentCustomer-Save-all')")
@ApiOperation(value = "保存案例客户", tags = {"案例客户" }, notes = "保存案例客户")
@RequestMapping(method = RequestMethod.POST, value = "/incidentcustomers/save")
public ResponseEntity<Boolean> save(@RequestBody IncidentCustomerDTO incidentcustomerdto) {
return ResponseEntity.status(HttpStatus.OK).body(incidentcustomerService.save(incidentcustomerMapping.toDomain(incidentcustomerdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-IncidentCustomer-Save-all')")
@ApiOperation(value = "批量保存案例客户", tags = {"案例客户" }, notes = "批量保存案例客户")
@RequestMapping(method = RequestMethod.POST, value = "/incidentcustomers/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<IncidentCustomerDTO> incidentcustomerdtos) {
......@@ -129,6 +138,7 @@ public class IncidentCustomerResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-IncidentCustomer-searchDefault-all')")
@ApiOperation(value = "获取DEFAULT", tags = {"案例客户" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/incidentcustomers/fetchdefault")
public ResponseEntity<List<IncidentCustomerDTO>> fetchDefault(IncidentCustomerSearchContext context) {
......@@ -141,6 +151,7 @@ public class IncidentCustomerResource {
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-IncidentCustomer-searchDefault-all')")
@ApiOperation(value = "查询DEFAULT", tags = {"案例客户" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/incidentcustomers/searchdefault")
public ResponseEntity<Page<IncidentCustomerDTO>> searchDefault(@RequestBody IncidentCustomerSearchContext context) {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册