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

xignzi006 发布系统代码 [Spring Boot]

上级 69779a5c
......@@ -499,7 +499,7 @@ public class Purchase_order extends EntityMP implements Serializable {
/**
* 公司
*/
@DEField(name = "company_id")
@DEField(name = "company_id" , preType = DEPredefinedFieldType.ORGID)
@TableField(value = "company_id")
@JSONField(name = "company_id")
@JsonProperty("company_id")
......@@ -863,14 +863,6 @@ public class Purchase_order extends EntityMP implements Serializable {
this.modify("dest_address_id",destAddressId);
}
/**
* 设置 [公司]
*/
public void setCompanyId(Long companyId){
this.companyId = companyId ;
this.modify("company_id",companyId);
}
/**
* 设置 [币种]
*/
......
......@@ -568,7 +568,6 @@ public class Purchase_orderDTO extends DTOBase implements Serializable {
@JSONField(name = "company_id")
@JsonProperty("company_id")
@JsonSerialize(using = ToStringSerializer.class)
@NotNull(message = "[公司]不允许为空!")
private Long companyId;
/**
......@@ -817,14 +816,6 @@ public class Purchase_orderDTO extends DTOBase implements Serializable {
this.modify("dest_address_id",destAddressId);
}
/**
* 设置 [COMPANY_ID]
*/
public void setCompanyId(Long companyId){
this.companyId = companyId ;
this.modify("company_id",companyId);
}
/**
* 设置 [CURRENCY_ID]
*/
......
......@@ -159,5 +159,135 @@ public class Res_partnerResource {
}
@PreAuthorize("hasPermission(this.res_partnerMapping.toDomain(#res_partnerdto),'iBizBusinessCentral-Res_partner-Create')")
@ApiOperation(value = "根据供应商建立联系人", tags = {"联系人" }, notes = "根据供应商建立联系人")
@RequestMapping(method = RequestMethod.POST, value = "/res_suppliers/{res_supplier_id}/res_partners")
public ResponseEntity<Res_partnerDTO> createByRes_supplier(@PathVariable("res_supplier_id") Long res_supplier_id, @RequestBody Res_partnerDTO res_partnerdto) {
Res_partner domain = res_partnerMapping.toDomain(res_partnerdto);
domain.setParentId(res_supplier_id);
res_partnerService.create(domain);
Res_partnerDTO dto = res_partnerMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.res_partnerMapping.toDomain(#res_partnerdtos),'iBizBusinessCentral-Res_partner-Create')")
@ApiOperation(value = "根据供应商批量建立联系人", tags = {"联系人" }, notes = "根据供应商批量建立联系人")
@RequestMapping(method = RequestMethod.POST, value = "/res_suppliers/{res_supplier_id}/res_partners/batch")
public ResponseEntity<Boolean> createBatchByRes_supplier(@PathVariable("res_supplier_id") Long res_supplier_id, @RequestBody List<Res_partnerDTO> res_partnerdtos) {
List<Res_partner> domainlist=res_partnerMapping.toDomain(res_partnerdtos);
for(Res_partner domain:domainlist){
domain.setParentId(res_supplier_id);
}
res_partnerService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "res_partner" , versionfield = "writeDate")
@PreAuthorize("hasPermission(this.res_partnerService.get(#res_partner_id),'iBizBusinessCentral-Res_partner-Update')")
@ApiOperation(value = "根据供应商更新联系人", tags = {"联系人" }, notes = "根据供应商更新联系人")
@RequestMapping(method = RequestMethod.PUT, value = "/res_suppliers/{res_supplier_id}/res_partners/{res_partner_id}")
public ResponseEntity<Res_partnerDTO> updateByRes_supplier(@PathVariable("res_supplier_id") Long res_supplier_id, @PathVariable("res_partner_id") Long res_partner_id, @RequestBody Res_partnerDTO res_partnerdto) {
Res_partner domain = res_partnerMapping.toDomain(res_partnerdto);
domain.setParentId(res_supplier_id);
domain.setId(res_partner_id);
res_partnerService.update(domain);
Res_partnerDTO dto = res_partnerMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.res_partnerService.getResPartnerByEntities(this.res_partnerMapping.toDomain(#res_partnerdtos)),'iBizBusinessCentral-Res_partner-Update')")
@ApiOperation(value = "根据供应商批量更新联系人", tags = {"联系人" }, notes = "根据供应商批量更新联系人")
@RequestMapping(method = RequestMethod.PUT, value = "/res_suppliers/{res_supplier_id}/res_partners/batch")
public ResponseEntity<Boolean> updateBatchByRes_supplier(@PathVariable("res_supplier_id") Long res_supplier_id, @RequestBody List<Res_partnerDTO> res_partnerdtos) {
List<Res_partner> domainlist=res_partnerMapping.toDomain(res_partnerdtos);
for(Res_partner domain:domainlist){
domain.setParentId(res_supplier_id);
}
res_partnerService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.res_partnerService.get(#res_partner_id),'iBizBusinessCentral-Res_partner-Remove')")
@ApiOperation(value = "根据供应商删除联系人", tags = {"联系人" }, notes = "根据供应商删除联系人")
@RequestMapping(method = RequestMethod.DELETE, value = "/res_suppliers/{res_supplier_id}/res_partners/{res_partner_id}")
public ResponseEntity<Boolean> removeByRes_supplier(@PathVariable("res_supplier_id") Long res_supplier_id, @PathVariable("res_partner_id") Long res_partner_id) {
return ResponseEntity.status(HttpStatus.OK).body(res_partnerService.remove(res_partner_id));
}
@PreAuthorize("hasPermission(this.res_partnerService.getResPartnerByIds(#ids),'iBizBusinessCentral-Res_partner-Remove')")
@ApiOperation(value = "根据供应商批量删除联系人", tags = {"联系人" }, notes = "根据供应商批量删除联系人")
@RequestMapping(method = RequestMethod.DELETE, value = "/res_suppliers/{res_supplier_id}/res_partners/batch")
public ResponseEntity<Boolean> removeBatchByRes_supplier(@RequestBody List<Long> ids) {
res_partnerService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.res_partnerMapping.toDomain(returnObject.body),'iBizBusinessCentral-Res_partner-Get')")
@ApiOperation(value = "根据供应商获取联系人", tags = {"联系人" }, notes = "根据供应商获取联系人")
@RequestMapping(method = RequestMethod.GET, value = "/res_suppliers/{res_supplier_id}/res_partners/{res_partner_id}")
public ResponseEntity<Res_partnerDTO> getByRes_supplier(@PathVariable("res_supplier_id") Long res_supplier_id, @PathVariable("res_partner_id") Long res_partner_id) {
Res_partner domain = res_partnerService.get(res_partner_id);
Res_partnerDTO dto = res_partnerMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据供应商获取联系人草稿", tags = {"联系人" }, notes = "根据供应商获取联系人草稿")
@RequestMapping(method = RequestMethod.GET, value = "/res_suppliers/{res_supplier_id}/res_partners/getdraft")
public ResponseEntity<Res_partnerDTO> getDraftByRes_supplier(@PathVariable("res_supplier_id") Long res_supplier_id) {
Res_partner domain = new Res_partner();
domain.setParentId(res_supplier_id);
return ResponseEntity.status(HttpStatus.OK).body(res_partnerMapping.toDto(res_partnerService.getDraft(domain)));
}
@ApiOperation(value = "根据供应商检查联系人", tags = {"联系人" }, notes = "根据供应商检查联系人")
@RequestMapping(method = RequestMethod.POST, value = "/res_suppliers/{res_supplier_id}/res_partners/checkkey")
public ResponseEntity<Boolean> checkKeyByRes_supplier(@PathVariable("res_supplier_id") Long res_supplier_id, @RequestBody Res_partnerDTO res_partnerdto) {
return ResponseEntity.status(HttpStatus.OK).body(res_partnerService.checkKey(res_partnerMapping.toDomain(res_partnerdto)));
}
@PreAuthorize("hasPermission(this.res_partnerMapping.toDomain(#res_partnerdto),'iBizBusinessCentral-Res_partner-Save')")
@ApiOperation(value = "根据供应商保存联系人", tags = {"联系人" }, notes = "根据供应商保存联系人")
@RequestMapping(method = RequestMethod.POST, value = "/res_suppliers/{res_supplier_id}/res_partners/save")
public ResponseEntity<Boolean> saveByRes_supplier(@PathVariable("res_supplier_id") Long res_supplier_id, @RequestBody Res_partnerDTO res_partnerdto) {
Res_partner domain = res_partnerMapping.toDomain(res_partnerdto);
domain.setParentId(res_supplier_id);
return ResponseEntity.status(HttpStatus.OK).body(res_partnerService.save(domain));
}
@PreAuthorize("hasPermission(this.res_partnerMapping.toDomain(#res_partnerdtos),'iBizBusinessCentral-Res_partner-Save')")
@ApiOperation(value = "根据供应商批量保存联系人", tags = {"联系人" }, notes = "根据供应商批量保存联系人")
@RequestMapping(method = RequestMethod.POST, value = "/res_suppliers/{res_supplier_id}/res_partners/savebatch")
public ResponseEntity<Boolean> saveBatchByRes_supplier(@PathVariable("res_supplier_id") Long res_supplier_id, @RequestBody List<Res_partnerDTO> res_partnerdtos) {
List<Res_partner> domainlist=res_partnerMapping.toDomain(res_partnerdtos);
for(Res_partner domain:domainlist){
domain.setParentId(res_supplier_id);
}
res_partnerService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Res_partner-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Res_partner-Get')")
@ApiOperation(value = "根据供应商获取数据集", tags = {"联系人" } ,notes = "根据供应商获取数据集")
@RequestMapping(method= RequestMethod.GET , value="/res_suppliers/{res_supplier_id}/res_partners/fetchdefault")
public ResponseEntity<List<Res_partnerDTO>> fetchRes_partnerDefaultByRes_supplier(@PathVariable("res_supplier_id") Long res_supplier_id,Res_partnerSearchContext context) {
context.setN_parent_id_eq(res_supplier_id);
Page<Res_partner> domains = res_partnerService.searchDefault(context) ;
List<Res_partnerDTO> list = res_partnerMapping.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-Res_partner-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Res_partner-Get')")
@ApiOperation(value = "根据供应商查询数据集", tags = {"联系人" } ,notes = "根据供应商查询数据集")
@RequestMapping(method= RequestMethod.POST , value="/res_suppliers/{res_supplier_id}/res_partners/searchdefault")
public ResponseEntity<Page<Res_partnerDTO>> searchRes_partnerDefaultByRes_supplier(@PathVariable("res_supplier_id") Long res_supplier_id, @RequestBody Res_partnerSearchContext context) {
context.setN_parent_id_eq(res_supplier_id);
Page<Res_partner> domains = res_partnerService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(res_partnerMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
......@@ -159,5 +159,135 @@ public class Res_partner_bankResource {
}
@PreAuthorize("hasPermission(this.res_partner_bankMapping.toDomain(#res_partner_bankdto),'iBizBusinessCentral-Res_partner_bank-Create')")
@ApiOperation(value = "根据供应商建立银行账户", tags = {"银行账户" }, notes = "根据供应商建立银行账户")
@RequestMapping(method = RequestMethod.POST, value = "/res_suppliers/{res_supplier_id}/res_partner_banks")
public ResponseEntity<Res_partner_bankDTO> createByRes_supplier(@PathVariable("res_supplier_id") Long res_supplier_id, @RequestBody Res_partner_bankDTO res_partner_bankdto) {
Res_partner_bank domain = res_partner_bankMapping.toDomain(res_partner_bankdto);
domain.setPartnerId(res_supplier_id);
res_partner_bankService.create(domain);
Res_partner_bankDTO dto = res_partner_bankMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.res_partner_bankMapping.toDomain(#res_partner_bankdtos),'iBizBusinessCentral-Res_partner_bank-Create')")
@ApiOperation(value = "根据供应商批量建立银行账户", tags = {"银行账户" }, notes = "根据供应商批量建立银行账户")
@RequestMapping(method = RequestMethod.POST, value = "/res_suppliers/{res_supplier_id}/res_partner_banks/batch")
public ResponseEntity<Boolean> createBatchByRes_supplier(@PathVariable("res_supplier_id") Long res_supplier_id, @RequestBody List<Res_partner_bankDTO> res_partner_bankdtos) {
List<Res_partner_bank> domainlist=res_partner_bankMapping.toDomain(res_partner_bankdtos);
for(Res_partner_bank domain:domainlist){
domain.setPartnerId(res_supplier_id);
}
res_partner_bankService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "res_partner_bank" , versionfield = "writeDate")
@PreAuthorize("hasPermission(this.res_partner_bankService.get(#res_partner_bank_id),'iBizBusinessCentral-Res_partner_bank-Update')")
@ApiOperation(value = "根据供应商更新银行账户", tags = {"银行账户" }, notes = "根据供应商更新银行账户")
@RequestMapping(method = RequestMethod.PUT, value = "/res_suppliers/{res_supplier_id}/res_partner_banks/{res_partner_bank_id}")
public ResponseEntity<Res_partner_bankDTO> updateByRes_supplier(@PathVariable("res_supplier_id") Long res_supplier_id, @PathVariable("res_partner_bank_id") Long res_partner_bank_id, @RequestBody Res_partner_bankDTO res_partner_bankdto) {
Res_partner_bank domain = res_partner_bankMapping.toDomain(res_partner_bankdto);
domain.setPartnerId(res_supplier_id);
domain.setId(res_partner_bank_id);
res_partner_bankService.update(domain);
Res_partner_bankDTO dto = res_partner_bankMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.res_partner_bankService.getResPartnerBankByEntities(this.res_partner_bankMapping.toDomain(#res_partner_bankdtos)),'iBizBusinessCentral-Res_partner_bank-Update')")
@ApiOperation(value = "根据供应商批量更新银行账户", tags = {"银行账户" }, notes = "根据供应商批量更新银行账户")
@RequestMapping(method = RequestMethod.PUT, value = "/res_suppliers/{res_supplier_id}/res_partner_banks/batch")
public ResponseEntity<Boolean> updateBatchByRes_supplier(@PathVariable("res_supplier_id") Long res_supplier_id, @RequestBody List<Res_partner_bankDTO> res_partner_bankdtos) {
List<Res_partner_bank> domainlist=res_partner_bankMapping.toDomain(res_partner_bankdtos);
for(Res_partner_bank domain:domainlist){
domain.setPartnerId(res_supplier_id);
}
res_partner_bankService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.res_partner_bankService.get(#res_partner_bank_id),'iBizBusinessCentral-Res_partner_bank-Remove')")
@ApiOperation(value = "根据供应商删除银行账户", tags = {"银行账户" }, notes = "根据供应商删除银行账户")
@RequestMapping(method = RequestMethod.DELETE, value = "/res_suppliers/{res_supplier_id}/res_partner_banks/{res_partner_bank_id}")
public ResponseEntity<Boolean> removeByRes_supplier(@PathVariable("res_supplier_id") Long res_supplier_id, @PathVariable("res_partner_bank_id") Long res_partner_bank_id) {
return ResponseEntity.status(HttpStatus.OK).body(res_partner_bankService.remove(res_partner_bank_id));
}
@PreAuthorize("hasPermission(this.res_partner_bankService.getResPartnerBankByIds(#ids),'iBizBusinessCentral-Res_partner_bank-Remove')")
@ApiOperation(value = "根据供应商批量删除银行账户", tags = {"银行账户" }, notes = "根据供应商批量删除银行账户")
@RequestMapping(method = RequestMethod.DELETE, value = "/res_suppliers/{res_supplier_id}/res_partner_banks/batch")
public ResponseEntity<Boolean> removeBatchByRes_supplier(@RequestBody List<Long> ids) {
res_partner_bankService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.res_partner_bankMapping.toDomain(returnObject.body),'iBizBusinessCentral-Res_partner_bank-Get')")
@ApiOperation(value = "根据供应商获取银行账户", tags = {"银行账户" }, notes = "根据供应商获取银行账户")
@RequestMapping(method = RequestMethod.GET, value = "/res_suppliers/{res_supplier_id}/res_partner_banks/{res_partner_bank_id}")
public ResponseEntity<Res_partner_bankDTO> getByRes_supplier(@PathVariable("res_supplier_id") Long res_supplier_id, @PathVariable("res_partner_bank_id") Long res_partner_bank_id) {
Res_partner_bank domain = res_partner_bankService.get(res_partner_bank_id);
Res_partner_bankDTO dto = res_partner_bankMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据供应商获取银行账户草稿", tags = {"银行账户" }, notes = "根据供应商获取银行账户草稿")
@RequestMapping(method = RequestMethod.GET, value = "/res_suppliers/{res_supplier_id}/res_partner_banks/getdraft")
public ResponseEntity<Res_partner_bankDTO> getDraftByRes_supplier(@PathVariable("res_supplier_id") Long res_supplier_id) {
Res_partner_bank domain = new Res_partner_bank();
domain.setPartnerId(res_supplier_id);
return ResponseEntity.status(HttpStatus.OK).body(res_partner_bankMapping.toDto(res_partner_bankService.getDraft(domain)));
}
@ApiOperation(value = "根据供应商检查银行账户", tags = {"银行账户" }, notes = "根据供应商检查银行账户")
@RequestMapping(method = RequestMethod.POST, value = "/res_suppliers/{res_supplier_id}/res_partner_banks/checkkey")
public ResponseEntity<Boolean> checkKeyByRes_supplier(@PathVariable("res_supplier_id") Long res_supplier_id, @RequestBody Res_partner_bankDTO res_partner_bankdto) {
return ResponseEntity.status(HttpStatus.OK).body(res_partner_bankService.checkKey(res_partner_bankMapping.toDomain(res_partner_bankdto)));
}
@PreAuthorize("hasPermission(this.res_partner_bankMapping.toDomain(#res_partner_bankdto),'iBizBusinessCentral-Res_partner_bank-Save')")
@ApiOperation(value = "根据供应商保存银行账户", tags = {"银行账户" }, notes = "根据供应商保存银行账户")
@RequestMapping(method = RequestMethod.POST, value = "/res_suppliers/{res_supplier_id}/res_partner_banks/save")
public ResponseEntity<Boolean> saveByRes_supplier(@PathVariable("res_supplier_id") Long res_supplier_id, @RequestBody Res_partner_bankDTO res_partner_bankdto) {
Res_partner_bank domain = res_partner_bankMapping.toDomain(res_partner_bankdto);
domain.setPartnerId(res_supplier_id);
return ResponseEntity.status(HttpStatus.OK).body(res_partner_bankService.save(domain));
}
@PreAuthorize("hasPermission(this.res_partner_bankMapping.toDomain(#res_partner_bankdtos),'iBizBusinessCentral-Res_partner_bank-Save')")
@ApiOperation(value = "根据供应商批量保存银行账户", tags = {"银行账户" }, notes = "根据供应商批量保存银行账户")
@RequestMapping(method = RequestMethod.POST, value = "/res_suppliers/{res_supplier_id}/res_partner_banks/savebatch")
public ResponseEntity<Boolean> saveBatchByRes_supplier(@PathVariable("res_supplier_id") Long res_supplier_id, @RequestBody List<Res_partner_bankDTO> res_partner_bankdtos) {
List<Res_partner_bank> domainlist=res_partner_bankMapping.toDomain(res_partner_bankdtos);
for(Res_partner_bank domain:domainlist){
domain.setPartnerId(res_supplier_id);
}
res_partner_bankService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Res_partner_bank-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Res_partner_bank-Get')")
@ApiOperation(value = "根据供应商获取数据集", tags = {"银行账户" } ,notes = "根据供应商获取数据集")
@RequestMapping(method= RequestMethod.GET , value="/res_suppliers/{res_supplier_id}/res_partner_banks/fetchdefault")
public ResponseEntity<List<Res_partner_bankDTO>> fetchRes_partner_bankDefaultByRes_supplier(@PathVariable("res_supplier_id") Long res_supplier_id,Res_partner_bankSearchContext context) {
context.setN_partner_id_eq(res_supplier_id);
Page<Res_partner_bank> domains = res_partner_bankService.searchDefault(context) ;
List<Res_partner_bankDTO> list = res_partner_bankMapping.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-Res_partner_bank-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Res_partner_bank-Get')")
@ApiOperation(value = "根据供应商查询数据集", tags = {"银行账户" } ,notes = "根据供应商查询数据集")
@RequestMapping(method= RequestMethod.POST , value="/res_suppliers/{res_supplier_id}/res_partner_banks/searchdefault")
public ResponseEntity<Page<Res_partner_bankDTO>> searchRes_partner_bankDefaultByRes_supplier(@PathVariable("res_supplier_id") Long res_supplier_id, @RequestBody Res_partner_bankSearchContext context) {
context.setN_partner_id_eq(res_supplier_id);
Page<Res_partner_bank> domains = res_partner_bankService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(res_partner_bankMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册