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

lab_gzf 发布系统代码

上级 5037e844
...@@ -159,5 +159,395 @@ public class Product_supplierinfoResource { ...@@ -159,5 +159,395 @@ public class Product_supplierinfoResource {
} }
@PreAuthorize("hasPermission(this.product_supplierinfoMapping.toDomain(#product_supplierinfodto),'iBizBusinessCentral-Product_supplierinfo-Create')")
@ApiOperation(value = "根据产品建立供应商价格表", tags = {"供应商价格表" }, notes = "根据产品建立供应商价格表")
@RequestMapping(method = RequestMethod.POST, value = "/product_products/{product_product_id}/product_supplierinfos")
public ResponseEntity<Product_supplierinfoDTO> createByProduct_product(@PathVariable("product_product_id") Long product_product_id, @RequestBody Product_supplierinfoDTO product_supplierinfodto) {
Product_supplierinfo domain = product_supplierinfoMapping.toDomain(product_supplierinfodto);
domain.setProductId(product_product_id);
product_supplierinfoService.create(domain);
Product_supplierinfoDTO dto = product_supplierinfoMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.product_supplierinfoMapping.toDomain(#product_supplierinfodtos),'iBizBusinessCentral-Product_supplierinfo-Create')")
@ApiOperation(value = "根据产品批量建立供应商价格表", tags = {"供应商价格表" }, notes = "根据产品批量建立供应商价格表")
@RequestMapping(method = RequestMethod.POST, value = "/product_products/{product_product_id}/product_supplierinfos/batch")
public ResponseEntity<Boolean> createBatchByProduct_product(@PathVariable("product_product_id") Long product_product_id, @RequestBody List<Product_supplierinfoDTO> product_supplierinfodtos) {
List<Product_supplierinfo> domainlist=product_supplierinfoMapping.toDomain(product_supplierinfodtos);
for(Product_supplierinfo domain:domainlist){
domain.setProductId(product_product_id);
}
product_supplierinfoService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "product_supplierinfo" , versionfield = "writeDate")
@PreAuthorize("hasPermission(this.product_supplierinfoService.get(#product_supplierinfo_id),'iBizBusinessCentral-Product_supplierinfo-Update')")
@ApiOperation(value = "根据产品更新供应商价格表", tags = {"供应商价格表" }, notes = "根据产品更新供应商价格表")
@RequestMapping(method = RequestMethod.PUT, value = "/product_products/{product_product_id}/product_supplierinfos/{product_supplierinfo_id}")
public ResponseEntity<Product_supplierinfoDTO> updateByProduct_product(@PathVariable("product_product_id") Long product_product_id, @PathVariable("product_supplierinfo_id") Long product_supplierinfo_id, @RequestBody Product_supplierinfoDTO product_supplierinfodto) {
Product_supplierinfo domain = product_supplierinfoMapping.toDomain(product_supplierinfodto);
domain.setProductId(product_product_id);
domain.setId(product_supplierinfo_id);
product_supplierinfoService.update(domain);
Product_supplierinfoDTO dto = product_supplierinfoMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.product_supplierinfoService.getProductSupplierinfoByEntities(this.product_supplierinfoMapping.toDomain(#product_supplierinfodtos)),'iBizBusinessCentral-Product_supplierinfo-Update')")
@ApiOperation(value = "根据产品批量更新供应商价格表", tags = {"供应商价格表" }, notes = "根据产品批量更新供应商价格表")
@RequestMapping(method = RequestMethod.PUT, value = "/product_products/{product_product_id}/product_supplierinfos/batch")
public ResponseEntity<Boolean> updateBatchByProduct_product(@PathVariable("product_product_id") Long product_product_id, @RequestBody List<Product_supplierinfoDTO> product_supplierinfodtos) {
List<Product_supplierinfo> domainlist=product_supplierinfoMapping.toDomain(product_supplierinfodtos);
for(Product_supplierinfo domain:domainlist){
domain.setProductId(product_product_id);
}
product_supplierinfoService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.product_supplierinfoService.get(#product_supplierinfo_id),'iBizBusinessCentral-Product_supplierinfo-Remove')")
@ApiOperation(value = "根据产品删除供应商价格表", tags = {"供应商价格表" }, notes = "根据产品删除供应商价格表")
@RequestMapping(method = RequestMethod.DELETE, value = "/product_products/{product_product_id}/product_supplierinfos/{product_supplierinfo_id}")
public ResponseEntity<Boolean> removeByProduct_product(@PathVariable("product_product_id") Long product_product_id, @PathVariable("product_supplierinfo_id") Long product_supplierinfo_id) {
return ResponseEntity.status(HttpStatus.OK).body(product_supplierinfoService.remove(product_supplierinfo_id));
}
@PreAuthorize("hasPermission(this.product_supplierinfoService.getProductSupplierinfoByIds(#ids),'iBizBusinessCentral-Product_supplierinfo-Remove')")
@ApiOperation(value = "根据产品批量删除供应商价格表", tags = {"供应商价格表" }, notes = "根据产品批量删除供应商价格表")
@RequestMapping(method = RequestMethod.DELETE, value = "/product_products/{product_product_id}/product_supplierinfos/batch")
public ResponseEntity<Boolean> removeBatchByProduct_product(@RequestBody List<Long> ids) {
product_supplierinfoService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.product_supplierinfoMapping.toDomain(returnObject.body),'iBizBusinessCentral-Product_supplierinfo-Get')")
@ApiOperation(value = "根据产品获取供应商价格表", tags = {"供应商价格表" }, notes = "根据产品获取供应商价格表")
@RequestMapping(method = RequestMethod.GET, value = "/product_products/{product_product_id}/product_supplierinfos/{product_supplierinfo_id}")
public ResponseEntity<Product_supplierinfoDTO> getByProduct_product(@PathVariable("product_product_id") Long product_product_id, @PathVariable("product_supplierinfo_id") Long product_supplierinfo_id) {
Product_supplierinfo domain = product_supplierinfoService.get(product_supplierinfo_id);
Product_supplierinfoDTO dto = product_supplierinfoMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据产品获取供应商价格表草稿", tags = {"供应商价格表" }, notes = "根据产品获取供应商价格表草稿")
@RequestMapping(method = RequestMethod.GET, value = "/product_products/{product_product_id}/product_supplierinfos/getdraft")
public ResponseEntity<Product_supplierinfoDTO> getDraftByProduct_product(@PathVariable("product_product_id") Long product_product_id) {
Product_supplierinfo domain = new Product_supplierinfo();
domain.setProductId(product_product_id);
return ResponseEntity.status(HttpStatus.OK).body(product_supplierinfoMapping.toDto(product_supplierinfoService.getDraft(domain)));
}
@ApiOperation(value = "根据产品检查供应商价格表", tags = {"供应商价格表" }, notes = "根据产品检查供应商价格表")
@RequestMapping(method = RequestMethod.POST, value = "/product_products/{product_product_id}/product_supplierinfos/checkkey")
public ResponseEntity<Boolean> checkKeyByProduct_product(@PathVariable("product_product_id") Long product_product_id, @RequestBody Product_supplierinfoDTO product_supplierinfodto) {
return ResponseEntity.status(HttpStatus.OK).body(product_supplierinfoService.checkKey(product_supplierinfoMapping.toDomain(product_supplierinfodto)));
}
@PreAuthorize("hasPermission(this.product_supplierinfoMapping.toDomain(#product_supplierinfodto),'iBizBusinessCentral-Product_supplierinfo-Save')")
@ApiOperation(value = "根据产品保存供应商价格表", tags = {"供应商价格表" }, notes = "根据产品保存供应商价格表")
@RequestMapping(method = RequestMethod.POST, value = "/product_products/{product_product_id}/product_supplierinfos/save")
public ResponseEntity<Boolean> saveByProduct_product(@PathVariable("product_product_id") Long product_product_id, @RequestBody Product_supplierinfoDTO product_supplierinfodto) {
Product_supplierinfo domain = product_supplierinfoMapping.toDomain(product_supplierinfodto);
domain.setProductId(product_product_id);
return ResponseEntity.status(HttpStatus.OK).body(product_supplierinfoService.save(domain));
}
@PreAuthorize("hasPermission(this.product_supplierinfoMapping.toDomain(#product_supplierinfodtos),'iBizBusinessCentral-Product_supplierinfo-Save')")
@ApiOperation(value = "根据产品批量保存供应商价格表", tags = {"供应商价格表" }, notes = "根据产品批量保存供应商价格表")
@RequestMapping(method = RequestMethod.POST, value = "/product_products/{product_product_id}/product_supplierinfos/savebatch")
public ResponseEntity<Boolean> saveBatchByProduct_product(@PathVariable("product_product_id") Long product_product_id, @RequestBody List<Product_supplierinfoDTO> product_supplierinfodtos) {
List<Product_supplierinfo> domainlist=product_supplierinfoMapping.toDomain(product_supplierinfodtos);
for(Product_supplierinfo domain:domainlist){
domain.setProductId(product_product_id);
}
product_supplierinfoService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Product_supplierinfo-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Product_supplierinfo-Get')")
@ApiOperation(value = "根据产品获取数据集", tags = {"供应商价格表" } ,notes = "根据产品获取数据集")
@RequestMapping(method= RequestMethod.GET , value="/product_products/{product_product_id}/product_supplierinfos/fetchdefault")
public ResponseEntity<List<Product_supplierinfoDTO>> fetchProduct_supplierinfoDefaultByProduct_product(@PathVariable("product_product_id") Long product_product_id,Product_supplierinfoSearchContext context) {
context.setN_product_id_eq(product_product_id);
Page<Product_supplierinfo> domains = product_supplierinfoService.searchDefault(context) ;
List<Product_supplierinfoDTO> list = product_supplierinfoMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Product_supplierinfo-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Product_supplierinfo-Get')")
@ApiOperation(value = "根据产品查询数据集", tags = {"供应商价格表" } ,notes = "根据产品查询数据集")
@RequestMapping(method= RequestMethod.POST , value="/product_products/{product_product_id}/product_supplierinfos/searchdefault")
public ResponseEntity<Page<Product_supplierinfoDTO>> searchProduct_supplierinfoDefaultByProduct_product(@PathVariable("product_product_id") Long product_product_id, @RequestBody Product_supplierinfoSearchContext context) {
context.setN_product_id_eq(product_product_id);
Page<Product_supplierinfo> domains = product_supplierinfoService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(product_supplierinfoMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.product_supplierinfoMapping.toDomain(#product_supplierinfodto),'iBizBusinessCentral-Product_supplierinfo-Create')")
@ApiOperation(value = "根据产品模板建立供应商价格表", tags = {"供应商价格表" }, notes = "根据产品模板建立供应商价格表")
@RequestMapping(method = RequestMethod.POST, value = "/product_templates/{product_template_id}/product_supplierinfos")
public ResponseEntity<Product_supplierinfoDTO> createByProduct_template(@PathVariable("product_template_id") Long product_template_id, @RequestBody Product_supplierinfoDTO product_supplierinfodto) {
Product_supplierinfo domain = product_supplierinfoMapping.toDomain(product_supplierinfodto);
domain.setProductTmplId(product_template_id);
product_supplierinfoService.create(domain);
Product_supplierinfoDTO dto = product_supplierinfoMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.product_supplierinfoMapping.toDomain(#product_supplierinfodtos),'iBizBusinessCentral-Product_supplierinfo-Create')")
@ApiOperation(value = "根据产品模板批量建立供应商价格表", tags = {"供应商价格表" }, notes = "根据产品模板批量建立供应商价格表")
@RequestMapping(method = RequestMethod.POST, value = "/product_templates/{product_template_id}/product_supplierinfos/batch")
public ResponseEntity<Boolean> createBatchByProduct_template(@PathVariable("product_template_id") Long product_template_id, @RequestBody List<Product_supplierinfoDTO> product_supplierinfodtos) {
List<Product_supplierinfo> domainlist=product_supplierinfoMapping.toDomain(product_supplierinfodtos);
for(Product_supplierinfo domain:domainlist){
domain.setProductTmplId(product_template_id);
}
product_supplierinfoService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "product_supplierinfo" , versionfield = "writeDate")
@PreAuthorize("hasPermission(this.product_supplierinfoService.get(#product_supplierinfo_id),'iBizBusinessCentral-Product_supplierinfo-Update')")
@ApiOperation(value = "根据产品模板更新供应商价格表", tags = {"供应商价格表" }, notes = "根据产品模板更新供应商价格表")
@RequestMapping(method = RequestMethod.PUT, value = "/product_templates/{product_template_id}/product_supplierinfos/{product_supplierinfo_id}")
public ResponseEntity<Product_supplierinfoDTO> updateByProduct_template(@PathVariable("product_template_id") Long product_template_id, @PathVariable("product_supplierinfo_id") Long product_supplierinfo_id, @RequestBody Product_supplierinfoDTO product_supplierinfodto) {
Product_supplierinfo domain = product_supplierinfoMapping.toDomain(product_supplierinfodto);
domain.setProductTmplId(product_template_id);
domain.setId(product_supplierinfo_id);
product_supplierinfoService.update(domain);
Product_supplierinfoDTO dto = product_supplierinfoMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.product_supplierinfoService.getProductSupplierinfoByEntities(this.product_supplierinfoMapping.toDomain(#product_supplierinfodtos)),'iBizBusinessCentral-Product_supplierinfo-Update')")
@ApiOperation(value = "根据产品模板批量更新供应商价格表", tags = {"供应商价格表" }, notes = "根据产品模板批量更新供应商价格表")
@RequestMapping(method = RequestMethod.PUT, value = "/product_templates/{product_template_id}/product_supplierinfos/batch")
public ResponseEntity<Boolean> updateBatchByProduct_template(@PathVariable("product_template_id") Long product_template_id, @RequestBody List<Product_supplierinfoDTO> product_supplierinfodtos) {
List<Product_supplierinfo> domainlist=product_supplierinfoMapping.toDomain(product_supplierinfodtos);
for(Product_supplierinfo domain:domainlist){
domain.setProductTmplId(product_template_id);
}
product_supplierinfoService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.product_supplierinfoService.get(#product_supplierinfo_id),'iBizBusinessCentral-Product_supplierinfo-Remove')")
@ApiOperation(value = "根据产品模板删除供应商价格表", tags = {"供应商价格表" }, notes = "根据产品模板删除供应商价格表")
@RequestMapping(method = RequestMethod.DELETE, value = "/product_templates/{product_template_id}/product_supplierinfos/{product_supplierinfo_id}")
public ResponseEntity<Boolean> removeByProduct_template(@PathVariable("product_template_id") Long product_template_id, @PathVariable("product_supplierinfo_id") Long product_supplierinfo_id) {
return ResponseEntity.status(HttpStatus.OK).body(product_supplierinfoService.remove(product_supplierinfo_id));
}
@PreAuthorize("hasPermission(this.product_supplierinfoService.getProductSupplierinfoByIds(#ids),'iBizBusinessCentral-Product_supplierinfo-Remove')")
@ApiOperation(value = "根据产品模板批量删除供应商价格表", tags = {"供应商价格表" }, notes = "根据产品模板批量删除供应商价格表")
@RequestMapping(method = RequestMethod.DELETE, value = "/product_templates/{product_template_id}/product_supplierinfos/batch")
public ResponseEntity<Boolean> removeBatchByProduct_template(@RequestBody List<Long> ids) {
product_supplierinfoService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.product_supplierinfoMapping.toDomain(returnObject.body),'iBizBusinessCentral-Product_supplierinfo-Get')")
@ApiOperation(value = "根据产品模板获取供应商价格表", tags = {"供应商价格表" }, notes = "根据产品模板获取供应商价格表")
@RequestMapping(method = RequestMethod.GET, value = "/product_templates/{product_template_id}/product_supplierinfos/{product_supplierinfo_id}")
public ResponseEntity<Product_supplierinfoDTO> getByProduct_template(@PathVariable("product_template_id") Long product_template_id, @PathVariable("product_supplierinfo_id") Long product_supplierinfo_id) {
Product_supplierinfo domain = product_supplierinfoService.get(product_supplierinfo_id);
Product_supplierinfoDTO dto = product_supplierinfoMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据产品模板获取供应商价格表草稿", tags = {"供应商价格表" }, notes = "根据产品模板获取供应商价格表草稿")
@RequestMapping(method = RequestMethod.GET, value = "/product_templates/{product_template_id}/product_supplierinfos/getdraft")
public ResponseEntity<Product_supplierinfoDTO> getDraftByProduct_template(@PathVariable("product_template_id") Long product_template_id) {
Product_supplierinfo domain = new Product_supplierinfo();
domain.setProductTmplId(product_template_id);
return ResponseEntity.status(HttpStatus.OK).body(product_supplierinfoMapping.toDto(product_supplierinfoService.getDraft(domain)));
}
@ApiOperation(value = "根据产品模板检查供应商价格表", tags = {"供应商价格表" }, notes = "根据产品模板检查供应商价格表")
@RequestMapping(method = RequestMethod.POST, value = "/product_templates/{product_template_id}/product_supplierinfos/checkkey")
public ResponseEntity<Boolean> checkKeyByProduct_template(@PathVariable("product_template_id") Long product_template_id, @RequestBody Product_supplierinfoDTO product_supplierinfodto) {
return ResponseEntity.status(HttpStatus.OK).body(product_supplierinfoService.checkKey(product_supplierinfoMapping.toDomain(product_supplierinfodto)));
}
@PreAuthorize("hasPermission(this.product_supplierinfoMapping.toDomain(#product_supplierinfodto),'iBizBusinessCentral-Product_supplierinfo-Save')")
@ApiOperation(value = "根据产品模板保存供应商价格表", tags = {"供应商价格表" }, notes = "根据产品模板保存供应商价格表")
@RequestMapping(method = RequestMethod.POST, value = "/product_templates/{product_template_id}/product_supplierinfos/save")
public ResponseEntity<Boolean> saveByProduct_template(@PathVariable("product_template_id") Long product_template_id, @RequestBody Product_supplierinfoDTO product_supplierinfodto) {
Product_supplierinfo domain = product_supplierinfoMapping.toDomain(product_supplierinfodto);
domain.setProductTmplId(product_template_id);
return ResponseEntity.status(HttpStatus.OK).body(product_supplierinfoService.save(domain));
}
@PreAuthorize("hasPermission(this.product_supplierinfoMapping.toDomain(#product_supplierinfodtos),'iBizBusinessCentral-Product_supplierinfo-Save')")
@ApiOperation(value = "根据产品模板批量保存供应商价格表", tags = {"供应商价格表" }, notes = "根据产品模板批量保存供应商价格表")
@RequestMapping(method = RequestMethod.POST, value = "/product_templates/{product_template_id}/product_supplierinfos/savebatch")
public ResponseEntity<Boolean> saveBatchByProduct_template(@PathVariable("product_template_id") Long product_template_id, @RequestBody List<Product_supplierinfoDTO> product_supplierinfodtos) {
List<Product_supplierinfo> domainlist=product_supplierinfoMapping.toDomain(product_supplierinfodtos);
for(Product_supplierinfo domain:domainlist){
domain.setProductTmplId(product_template_id);
}
product_supplierinfoService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Product_supplierinfo-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Product_supplierinfo-Get')")
@ApiOperation(value = "根据产品模板获取数据集", tags = {"供应商价格表" } ,notes = "根据产品模板获取数据集")
@RequestMapping(method= RequestMethod.GET , value="/product_templates/{product_template_id}/product_supplierinfos/fetchdefault")
public ResponseEntity<List<Product_supplierinfoDTO>> fetchProduct_supplierinfoDefaultByProduct_template(@PathVariable("product_template_id") Long product_template_id,Product_supplierinfoSearchContext context) {
context.setN_product_tmpl_id_eq(product_template_id);
Page<Product_supplierinfo> domains = product_supplierinfoService.searchDefault(context) ;
List<Product_supplierinfoDTO> list = product_supplierinfoMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Product_supplierinfo-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Product_supplierinfo-Get')")
@ApiOperation(value = "根据产品模板查询数据集", tags = {"供应商价格表" } ,notes = "根据产品模板查询数据集")
@RequestMapping(method= RequestMethod.POST , value="/product_templates/{product_template_id}/product_supplierinfos/searchdefault")
public ResponseEntity<Page<Product_supplierinfoDTO>> searchProduct_supplierinfoDefaultByProduct_template(@PathVariable("product_template_id") Long product_template_id, @RequestBody Product_supplierinfoSearchContext context) {
context.setN_product_tmpl_id_eq(product_template_id);
Page<Product_supplierinfo> domains = product_supplierinfoService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(product_supplierinfoMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.product_supplierinfoMapping.toDomain(#product_supplierinfodto),'iBizBusinessCentral-Product_supplierinfo-Create')")
@ApiOperation(value = "根据联系人建立供应商价格表", tags = {"供应商价格表" }, notes = "根据联系人建立供应商价格表")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/product_supplierinfos")
public ResponseEntity<Product_supplierinfoDTO> createByRes_partner(@PathVariable("res_partner_id") Long res_partner_id, @RequestBody Product_supplierinfoDTO product_supplierinfodto) {
Product_supplierinfo domain = product_supplierinfoMapping.toDomain(product_supplierinfodto);
domain.setName(res_partner_id);
product_supplierinfoService.create(domain);
Product_supplierinfoDTO dto = product_supplierinfoMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.product_supplierinfoMapping.toDomain(#product_supplierinfodtos),'iBizBusinessCentral-Product_supplierinfo-Create')")
@ApiOperation(value = "根据联系人批量建立供应商价格表", tags = {"供应商价格表" }, notes = "根据联系人批量建立供应商价格表")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/product_supplierinfos/batch")
public ResponseEntity<Boolean> createBatchByRes_partner(@PathVariable("res_partner_id") Long res_partner_id, @RequestBody List<Product_supplierinfoDTO> product_supplierinfodtos) {
List<Product_supplierinfo> domainlist=product_supplierinfoMapping.toDomain(product_supplierinfodtos);
for(Product_supplierinfo domain:domainlist){
domain.setName(res_partner_id);
}
product_supplierinfoService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "product_supplierinfo" , versionfield = "writeDate")
@PreAuthorize("hasPermission(this.product_supplierinfoService.get(#product_supplierinfo_id),'iBizBusinessCentral-Product_supplierinfo-Update')")
@ApiOperation(value = "根据联系人更新供应商价格表", tags = {"供应商价格表" }, notes = "根据联系人更新供应商价格表")
@RequestMapping(method = RequestMethod.PUT, value = "/res_partners/{res_partner_id}/product_supplierinfos/{product_supplierinfo_id}")
public ResponseEntity<Product_supplierinfoDTO> updateByRes_partner(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("product_supplierinfo_id") Long product_supplierinfo_id, @RequestBody Product_supplierinfoDTO product_supplierinfodto) {
Product_supplierinfo domain = product_supplierinfoMapping.toDomain(product_supplierinfodto);
domain.setName(res_partner_id);
domain.setId(product_supplierinfo_id);
product_supplierinfoService.update(domain);
Product_supplierinfoDTO dto = product_supplierinfoMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.product_supplierinfoService.getProductSupplierinfoByEntities(this.product_supplierinfoMapping.toDomain(#product_supplierinfodtos)),'iBizBusinessCentral-Product_supplierinfo-Update')")
@ApiOperation(value = "根据联系人批量更新供应商价格表", tags = {"供应商价格表" }, notes = "根据联系人批量更新供应商价格表")
@RequestMapping(method = RequestMethod.PUT, value = "/res_partners/{res_partner_id}/product_supplierinfos/batch")
public ResponseEntity<Boolean> updateBatchByRes_partner(@PathVariable("res_partner_id") Long res_partner_id, @RequestBody List<Product_supplierinfoDTO> product_supplierinfodtos) {
List<Product_supplierinfo> domainlist=product_supplierinfoMapping.toDomain(product_supplierinfodtos);
for(Product_supplierinfo domain:domainlist){
domain.setName(res_partner_id);
}
product_supplierinfoService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.product_supplierinfoService.get(#product_supplierinfo_id),'iBizBusinessCentral-Product_supplierinfo-Remove')")
@ApiOperation(value = "根据联系人删除供应商价格表", tags = {"供应商价格表" }, notes = "根据联系人删除供应商价格表")
@RequestMapping(method = RequestMethod.DELETE, value = "/res_partners/{res_partner_id}/product_supplierinfos/{product_supplierinfo_id}")
public ResponseEntity<Boolean> removeByRes_partner(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("product_supplierinfo_id") Long product_supplierinfo_id) {
return ResponseEntity.status(HttpStatus.OK).body(product_supplierinfoService.remove(product_supplierinfo_id));
}
@PreAuthorize("hasPermission(this.product_supplierinfoService.getProductSupplierinfoByIds(#ids),'iBizBusinessCentral-Product_supplierinfo-Remove')")
@ApiOperation(value = "根据联系人批量删除供应商价格表", tags = {"供应商价格表" }, notes = "根据联系人批量删除供应商价格表")
@RequestMapping(method = RequestMethod.DELETE, value = "/res_partners/{res_partner_id}/product_supplierinfos/batch")
public ResponseEntity<Boolean> removeBatchByRes_partner(@RequestBody List<Long> ids) {
product_supplierinfoService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.product_supplierinfoMapping.toDomain(returnObject.body),'iBizBusinessCentral-Product_supplierinfo-Get')")
@ApiOperation(value = "根据联系人获取供应商价格表", tags = {"供应商价格表" }, notes = "根据联系人获取供应商价格表")
@RequestMapping(method = RequestMethod.GET, value = "/res_partners/{res_partner_id}/product_supplierinfos/{product_supplierinfo_id}")
public ResponseEntity<Product_supplierinfoDTO> getByRes_partner(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("product_supplierinfo_id") Long product_supplierinfo_id) {
Product_supplierinfo domain = product_supplierinfoService.get(product_supplierinfo_id);
Product_supplierinfoDTO dto = product_supplierinfoMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据联系人获取供应商价格表草稿", tags = {"供应商价格表" }, notes = "根据联系人获取供应商价格表草稿")
@RequestMapping(method = RequestMethod.GET, value = "/res_partners/{res_partner_id}/product_supplierinfos/getdraft")
public ResponseEntity<Product_supplierinfoDTO> getDraftByRes_partner(@PathVariable("res_partner_id") Long res_partner_id) {
Product_supplierinfo domain = new Product_supplierinfo();
domain.setName(res_partner_id);
return ResponseEntity.status(HttpStatus.OK).body(product_supplierinfoMapping.toDto(product_supplierinfoService.getDraft(domain)));
}
@ApiOperation(value = "根据联系人检查供应商价格表", tags = {"供应商价格表" }, notes = "根据联系人检查供应商价格表")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/product_supplierinfos/checkkey")
public ResponseEntity<Boolean> checkKeyByRes_partner(@PathVariable("res_partner_id") Long res_partner_id, @RequestBody Product_supplierinfoDTO product_supplierinfodto) {
return ResponseEntity.status(HttpStatus.OK).body(product_supplierinfoService.checkKey(product_supplierinfoMapping.toDomain(product_supplierinfodto)));
}
@PreAuthorize("hasPermission(this.product_supplierinfoMapping.toDomain(#product_supplierinfodto),'iBizBusinessCentral-Product_supplierinfo-Save')")
@ApiOperation(value = "根据联系人保存供应商价格表", tags = {"供应商价格表" }, notes = "根据联系人保存供应商价格表")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/product_supplierinfos/save")
public ResponseEntity<Boolean> saveByRes_partner(@PathVariable("res_partner_id") Long res_partner_id, @RequestBody Product_supplierinfoDTO product_supplierinfodto) {
Product_supplierinfo domain = product_supplierinfoMapping.toDomain(product_supplierinfodto);
domain.setName(res_partner_id);
return ResponseEntity.status(HttpStatus.OK).body(product_supplierinfoService.save(domain));
}
@PreAuthorize("hasPermission(this.product_supplierinfoMapping.toDomain(#product_supplierinfodtos),'iBizBusinessCentral-Product_supplierinfo-Save')")
@ApiOperation(value = "根据联系人批量保存供应商价格表", tags = {"供应商价格表" }, notes = "根据联系人批量保存供应商价格表")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/product_supplierinfos/savebatch")
public ResponseEntity<Boolean> saveBatchByRes_partner(@PathVariable("res_partner_id") Long res_partner_id, @RequestBody List<Product_supplierinfoDTO> product_supplierinfodtos) {
List<Product_supplierinfo> domainlist=product_supplierinfoMapping.toDomain(product_supplierinfodtos);
for(Product_supplierinfo domain:domainlist){
domain.setName(res_partner_id);
}
product_supplierinfoService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Product_supplierinfo-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Product_supplierinfo-Get')")
@ApiOperation(value = "根据联系人获取数据集", tags = {"供应商价格表" } ,notes = "根据联系人获取数据集")
@RequestMapping(method= RequestMethod.GET , value="/res_partners/{res_partner_id}/product_supplierinfos/fetchdefault")
public ResponseEntity<List<Product_supplierinfoDTO>> fetchProduct_supplierinfoDefaultByRes_partner(@PathVariable("res_partner_id") Long res_partner_id,Product_supplierinfoSearchContext context) {
context.setN_name_eq(res_partner_id);
Page<Product_supplierinfo> domains = product_supplierinfoService.searchDefault(context) ;
List<Product_supplierinfoDTO> list = product_supplierinfoMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Product_supplierinfo-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Product_supplierinfo-Get')")
@ApiOperation(value = "根据联系人查询数据集", tags = {"供应商价格表" } ,notes = "根据联系人查询数据集")
@RequestMapping(method= RequestMethod.POST , value="/res_partners/{res_partner_id}/product_supplierinfos/searchdefault")
public ResponseEntity<Page<Product_supplierinfoDTO>> searchProduct_supplierinfoDefaultByRes_partner(@PathVariable("res_partner_id") Long res_partner_id, @RequestBody Product_supplierinfoSearchContext context) {
context.setN_name_eq(res_partner_id);
Page<Product_supplierinfo> domains = product_supplierinfoService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(product_supplierinfoMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
} }
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册