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

xignzi006 发布系统代码

上级 18452399
package cn.ibizlab.businesscentral.core.extensions.service;
import cn.ibizlab.businesscentral.core.odoo_base.service.impl.Res_supplierServiceImpl;
import lombok.extern.slf4j.Slf4j;
import cn.ibizlab.businesscentral.core.odoo_base.domain.Res_supplier;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Primary;
import java.util.*;
/**
* 实体[供应商] 自定义服务对象
*/
@Slf4j
@Primary
@Service("Res_supplierExService")
public class Res_supplierExService extends Res_supplierServiceImpl {
@Override
protected Class currentModelClass() {
return com.baomidou.mybatisplus.core.toolkit.ReflectionKit.getSuperClassGenericType(this.getClass().getSuperclass(), 1);
}
/**
* 自定义行为[MasterTabCount]用户扩展
* @param et
* @return
*/
@Override
@Transactional
public Res_supplier masterTabCount(Res_supplier et) {
return super.masterTabCount(et);
}
}
......@@ -35,6 +35,7 @@ public interface IRes_supplierService extends IService<Res_supplier>{
Res_supplier get(Long key) ;
Res_supplier getDraft(Res_supplier et) ;
boolean checkKey(Res_supplier et) ;
Res_supplier masterTabCount(Res_supplier et) ;
boolean save(Res_supplier et) ;
void saveBatch(List<Res_supplier> list) ;
Page<Res_supplier> searchDefault(Res_supplierSearchContext context) ;
......
......@@ -162,6 +162,13 @@ public class Res_supplierServiceImpl extends EBSServiceImpl<Res_supplierMapper,
public boolean checkKey(Res_supplier et) {
return (!ObjectUtils.isEmpty(et.getId()))&&(!Objects.isNull(this.getById(et.getId())));
}
@Override
@Transactional
public Res_supplier masterTabCount(Res_supplier et) {
//自定义代码
return et;
}
@Override
@Transactional
public boolean save(Res_supplier et) {
......
......@@ -120,6 +120,17 @@ public class Res_supplierResource {
return ResponseEntity.status(HttpStatus.OK).body(res_supplierService.checkKey(res_supplierMapping.toDomain(res_supplierdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Res_supplier-MasterTabCount-all')")
@ApiOperation(value = "MasterTabCount", tags = {"供应商" }, notes = "MasterTabCount")
@RequestMapping(method = RequestMethod.POST, value = "/res_suppliers/{res_supplier_id}/mastertabcount")
public ResponseEntity<Res_supplierDTO> masterTabCount(@PathVariable("res_supplier_id") Long res_supplier_id, @RequestBody Res_supplierDTO res_supplierdto) {
Res_supplier domain = res_supplierMapping.toDomain(res_supplierdto);
domain.setId(res_supplier_id);
domain = res_supplierService.masterTabCount(domain);
res_supplierdto = res_supplierMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(res_supplierdto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Res_supplier-Save-all')")
@ApiOperation(value = "保存供应商", tags = {"供应商" }, notes = "保存供应商")
@RequestMapping(method = RequestMethod.POST, value = "/res_suppliers/save")
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册