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

xignzi006 发布系统代码

上级 2d457186
......@@ -249,6 +249,16 @@
"viewtag": "29bfcd628ab25e297248ff0524d12908",
"memo": "系统自动添加"
},
"quotesummary": {
"title": "报价单数据看板视图",
"caption": "报价单",
"viewtype": "DEPORTALVIEW",
"viewmodule": "Sales",
"viewname": "QuoteSummary",
"viewfilename": "quote-summary",
"viewtag": "2ac0427fe43e02ce2aade11aad712eb5",
"memo": ""
},
"contactinfo_book": {
"title": "联系人编辑视图",
"caption": "联系人",
......
......@@ -101,6 +101,10 @@ export default {
gridview: {
caption: "报价单",
title: '报价单表格视图',
},
summary: {
caption: "报价单",
title: '报价单数据看板视图',
},
infoabstract: {
caption: "报价单",
......
......@@ -100,6 +100,10 @@ export default {
gridview: {
caption: '报价单',
title: '报价单表格视图',
},
summary: {
caption: '报价单',
title: '报价单数据看板视图',
},
infoabstract: {
caption: '报价单',
......
......@@ -207,6 +207,14 @@ mock.onGet('./assets/json/view-config.json').reply((config: any) => {
"viewname": "AccountPickupView",
"viewtag": "29bfcd628ab25e297248ff0524d12908"
},
"quotesummary": {
"title": "报价单数据看板视图",
"caption": "报价单",
"viewtype": "DEPORTALVIEW",
"viewmodule": "Sales",
"viewname": "QuoteSummary",
"viewtag": "2ac0427fe43e02ce2aade11aad712eb5"
},
"contactinfo_book": {
"title": "联系人编辑视图",
"caption": "联系人",
......
......@@ -92,21 +92,6 @@ export default class AccountServiceBase extends EntityService {
}
}
masterData.contacts = contactsData;
let accountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_accounts'),'undefined')){
accountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_accounts') as any);
if(accountsData && accountsData.length && accountsData.length > 0){
accountsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.accountid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.accounts = accountsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -118,7 +103,6 @@ export default class AccountServiceBase extends EntityService {
let res:any = await Http.getInstance().post(`/accounts`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_accounts',JSON.stringify(res.data.accounts));
return res;
}
......@@ -163,26 +147,10 @@ export default class AccountServiceBase extends EntityService {
}
}
masterData.contacts = contactsData;
let accountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_accounts'),'undefined')){
accountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_accounts') as any);
if(accountsData && accountsData.length && accountsData.length > 0){
accountsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.accountid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.accounts = accountsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts));
this.tempStorage.setItem(context.srfsessionkey+'_accounts',JSON.stringify(res.data.accounts));
return res;
}
......@@ -241,26 +209,10 @@ export default class AccountServiceBase extends EntityService {
}
}
masterData.contacts = contactsData;
let accountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_accounts'),'undefined')){
accountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_accounts') as any);
if(accountsData && accountsData.length && accountsData.length > 0){
accountsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.accountid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.accounts = accountsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts));
this.tempStorage.setItem(context.srfsessionkey+'_accounts',JSON.stringify(res.data.accounts));
return res;
}
......@@ -290,7 +242,6 @@ export default class AccountServiceBase extends EntityService {
let res:any = await Http.getInstance().get(`/accounts/${context.account}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts));
this.tempStorage.setItem(context.srfsessionkey+'_accounts',JSON.stringify(res.data.accounts));
return res;
}
......@@ -309,7 +260,6 @@ export default class AccountServiceBase extends EntityService {
res.data.account = data.account;
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts));
this.tempStorage.setItem(context.srfsessionkey+'_accounts',JSON.stringify(res.data.accounts));
return res;
}
......
......@@ -80,6 +80,7 @@ export default class QuoteUIServiceBase extends UIService {
*/
public initViewMap(){
this.allViewMap.set('MDATAVIEW:',{viewname:'gridview',srfappde:'quotes'});
this.allViewMap.set(':',{viewname:'summary',srfappde:'quotes'});
this.allViewMap.set(':',{viewname:'infoabstract',srfappde:'quotes'});
this.allViewMap.set(':',{viewname:'oppquagridview',srfappde:'quotes'});
this.allViewMap.set(':',{viewname:'optionview',srfappde:'quotes'});
......
......@@ -1262,6 +1262,7 @@ public class Account extends EntityMP implements Serializable {
/**
* 相关客户数量
*/
@DEField(defaultValue = "0")
@TableField(value = "childaccountcount")
@JSONField(name = "childaccountcount")
@JsonProperty("childaccountcount")
......
......@@ -3708,7 +3708,7 @@
<!--输出实体[QUOTE]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-quote-27-46">
<changeSet author="a_LAB01_e85d8801c" id="tab-quote-29-46">
<createTable tableName="QUOTE">
<column name="BILLTO_COUNTRY" remarks="" type="VARCHAR(80)">
</column>
......@@ -4514,7 +4514,7 @@
<!--输出实体[ACCOUNT]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-account-314-54">
<changeSet author="a_LAB01_e85d8801c" id="tab-account-349-54">
<createTable tableName="ACCOUNT">
<column name="ADDRESS1_PRIMARYCONTACTNAME" remarks="" type="VARCHAR(100)">
</column>
......@@ -8087,7 +8087,7 @@
<!--输出实体[COMPETITOR]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-competitor-34-89">
<changeSet author="a_LAB01_e85d8801c" id="tab-competitor-35-89">
<createTable tableName="COMPETITOR">
<column name="ENTITYIMAGE" remarks="" type="VARCHAR(100)">
</column>
......@@ -11072,19 +11072,19 @@
<addForeignKeyConstraint baseColumnNames="TRANSACTIONCURRENCYID" baseTableName="PRICELEVEL" constraintName="DER1N_PRICELEVEL__TRANSACTIONC" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="TRANSACTIONCURRENCYID" referencedTableName="TRANSACTIONCURRENCY" validate="true"/>
</changeSet>
<!--输出实体[QUOTE]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-quote-27-226">
<changeSet author="a_LAB01_e85d8801c" id="fk-quote-29-226">
<addForeignKeyConstraint baseColumnNames="CAMPAIGNID" baseTableName="QUOTE" constraintName="DER1N_QUOTE__CAMPAIGN__CAMPAIG" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="CAMPAIGNID" referencedTableName="CAMPAIGN" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-quote-27-227">
<changeSet author="a_LAB01_e85d8801c" id="fk-quote-29-227">
<addForeignKeyConstraint baseColumnNames="OPPORTUNITYID" baseTableName="QUOTE" constraintName="DER1N_QUOTE__OPPORTUNITY__OPPO" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="OPPORTUNITYID" referencedTableName="OPPORTUNITY" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-quote-27-228">
<changeSet author="a_LAB01_e85d8801c" id="fk-quote-29-228">
<addForeignKeyConstraint baseColumnNames="PRICELEVELID" baseTableName="QUOTE" constraintName="DER1N_QUOTE__PRICELEVEL__PRICE" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="PRICELEVELID" referencedTableName="PRICELEVEL" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-quote-27-229">
<changeSet author="a_LAB01_e85d8801c" id="fk-quote-29-229">
<addForeignKeyConstraint baseColumnNames="SLAID" baseTableName="QUOTE" constraintName="DER1N_QUOTE__SLA__SLAID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="SLAID" referencedTableName="SLA" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-quote-27-230">
<changeSet author="a_LAB01_e85d8801c" id="fk-quote-29-230">
<addForeignKeyConstraint baseColumnNames="TRANSACTIONCURRENCYID" baseTableName="QUOTE" constraintName="DER1N_QUOTE__TRANSACTIONCURREN" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="TRANSACTIONCURRENCYID" referencedTableName="TRANSACTIONCURRENCY" validate="true"/>
</changeSet>
<!--输出实体[BULKDELETEOPERATION]外键关系 -->
......@@ -11137,31 +11137,31 @@
<addForeignKeyConstraint baseColumnNames="METRICID" baseTableName="GOAL" constraintName="DER1N_GOAL__METRIC__METRICID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="METRICID" referencedTableName="METRIC" validate="true"/>
</changeSet>
<!--输出实体[ACCOUNT]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-account-314-255">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-349-255">
<addForeignKeyConstraint baseColumnNames="PARENTACCOUNTID" baseTableName="ACCOUNT" constraintName="DER1N_ACCOUNT__ACCOUNT__PARENT" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ACCOUNTID" referencedTableName="ACCOUNT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-account-314-256">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-349-256">
<addForeignKeyConstraint baseColumnNames="PRIMARYCONTACTID" baseTableName="ACCOUNT" constraintName="DER1N_ACCOUNT__CONTACT__PRIMAR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="CONTACTID" referencedTableName="CONTACT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-account-314-257">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-349-257">
<addForeignKeyConstraint baseColumnNames="PREFERREDEQUIPMENTID" baseTableName="ACCOUNT" constraintName="DER1N_ACCOUNT__EQUIPMENT__PREF" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EQUIPMENTID" referencedTableName="EQUIPMENT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-account-314-258">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-349-258">
<addForeignKeyConstraint baseColumnNames="ORIGINATINGLEADID" baseTableName="ACCOUNT" constraintName="DER1N_ACCOUNT__LEAD__ORIGINATI" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="LEADID" referencedTableName="LEAD" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-account-314-259">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-349-259">
<addForeignKeyConstraint baseColumnNames="DEFAULTPRICELEVELID" baseTableName="ACCOUNT" constraintName="DER1N_ACCOUNT__PRICELEVEL__DEF" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="PRICELEVELID" referencedTableName="PRICELEVEL" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-account-314-260">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-349-260">
<addForeignKeyConstraint baseColumnNames="PREFERREDSERVICEID" baseTableName="ACCOUNT" constraintName="DER1N_ACCOUNT__SERVICE__PREFER" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="SERVICEID" referencedTableName="SERVICE" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-account-314-261">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-349-261">
<addForeignKeyConstraint baseColumnNames="SLAID" baseTableName="ACCOUNT" constraintName="DER1N_ACCOUNT__SLA__SLAID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="SLAID" referencedTableName="SLA" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-account-314-262">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-349-262">
<addForeignKeyConstraint baseColumnNames="TERRITORYID" baseTableName="ACCOUNT" constraintName="DER1N_ACCOUNT__TERRITORY__TERR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="TERRITORYID" referencedTableName="TERRITORY" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-account-314-263">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-349-263">
<addForeignKeyConstraint baseColumnNames="TRANSACTIONCURRENCYID" baseTableName="ACCOUNT" constraintName="DER1N_ACCOUNT__TRANSACTIONCURR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="TRANSACTIONCURRENCYID" referencedTableName="TRANSACTIONCURRENCY" validate="true"/>
</changeSet>
<!--输出实体[KNOWLEDGEARTICLEVIEWS]外键关系 -->
......@@ -11421,7 +11421,7 @@
<!--输出实体[CAMPAIGNLIST]外键关系 -->
<!--输出实体[LISTCONTACT]外键关系 -->
<!--输出实体[COMPETITOR]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-competitor-34-346">
<changeSet author="a_LAB01_e85d8801c" id="fk-competitor-35-346">
<addForeignKeyConstraint baseColumnNames="TRANSACTIONCURRENCYID" baseTableName="COMPETITOR" constraintName="DER1N_COMPETITOR__TRANSACTIONC" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="TRANSACTIONCURRENCYID" referencedTableName="TRANSACTIONCURRENCY" validate="true"/>
</changeSet>
<!--输出实体[PRODUCT]外键关系 -->
......
......@@ -290,5 +290,137 @@ public class ContactResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(contactMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@ApiOperation(value = "根据客户客户检查联系人", tags = {"联系人" }, notes = "根据客户客户检查联系人")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/contacts/checkkey")
public ResponseEntity<Boolean> checkKeyByAccountAccount(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @RequestBody ContactDTO contactdto) {
return ResponseEntity.status(HttpStatus.OK).body(contactService.checkKey(contactMapping.toDomain(contactdto)));
}
@PreAuthorize("hasPermission(this.contactService.get(#contact_id),'iBizBusinessCentral-Contact-Remove')")
@ApiOperation(value = "根据客户客户删除联系人", tags = {"联系人" }, notes = "根据客户客户删除联系人")
@RequestMapping(method = RequestMethod.DELETE, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}")
@Transactional
public ResponseEntity<Boolean> removeByAccountAccount(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id) {
return ResponseEntity.status(HttpStatus.OK).body(contactService.remove(contact_id));
}
@PreAuthorize("hasPermission(this.contactService.getContactByIds(#ids),'iBizBusinessCentral-Contact-Remove')")
@ApiOperation(value = "根据客户客户批量删除联系人", tags = {"联系人" }, notes = "根据客户客户批量删除联系人")
@RequestMapping(method = RequestMethod.DELETE, value = "/accounts/{account_id}/accounts/{account_id}/contacts/batch")
public ResponseEntity<Boolean> removeBatchByAccountAccount(@RequestBody List<String> ids) {
contactService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.contactMapping.toDomain(returnObject.body),'iBizBusinessCentral-Contact-Get')")
@ApiOperation(value = "根据客户客户获取联系人", tags = {"联系人" }, notes = "根据客户客户获取联系人")
@RequestMapping(method = RequestMethod.GET, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}")
public ResponseEntity<ContactDTO> getByAccountAccount(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id) {
Contact domain = contactService.get(contact_id);
ContactDTO dto = contactMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.contactMapping.toDomain(#contactdto),'iBizBusinessCentral-Contact-Save')")
@ApiOperation(value = "根据客户客户保存联系人", tags = {"联系人" }, notes = "根据客户客户保存联系人")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/contacts/save")
public ResponseEntity<Boolean> saveByAccountAccount(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @RequestBody ContactDTO contactdto) {
Contact domain = contactMapping.toDomain(contactdto);
domain.setCustomerid(account_id);
return ResponseEntity.status(HttpStatus.OK).body(contactService.save(domain));
}
@PreAuthorize("hasPermission(this.contactMapping.toDomain(#contactdtos),'iBizBusinessCentral-Contact-Save')")
@ApiOperation(value = "根据客户客户批量保存联系人", tags = {"联系人" }, notes = "根据客户客户批量保存联系人")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/contacts/savebatch")
public ResponseEntity<Boolean> saveBatchByAccountAccount(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @RequestBody List<ContactDTO> contactdtos) {
List<Contact> domainlist=contactMapping.toDomain(contactdtos);
for(Contact domain:domainlist){
domain.setCustomerid(account_id);
}
contactService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.contactService.get(#contact_id),'iBizBusinessCentral-Contact-Update')")
@ApiOperation(value = "根据客户客户更新联系人", tags = {"联系人" }, notes = "根据客户客户更新联系人")
@RequestMapping(method = RequestMethod.PUT, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}")
@Transactional
public ResponseEntity<ContactDTO> updateByAccountAccount(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @RequestBody ContactDTO contactdto) {
Contact domain = contactMapping.toDomain(contactdto);
domain.setCustomerid(account_id);
domain.setContactid(contact_id);
contactService.update(domain);
ContactDTO dto = contactMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.contactService.getContactByEntities(this.contactMapping.toDomain(#contactdtos)),'iBizBusinessCentral-Contact-Update')")
@ApiOperation(value = "根据客户客户批量更新联系人", tags = {"联系人" }, notes = "根据客户客户批量更新联系人")
@RequestMapping(method = RequestMethod.PUT, value = "/accounts/{account_id}/accounts/{account_id}/contacts/batch")
public ResponseEntity<Boolean> updateBatchByAccountAccount(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @RequestBody List<ContactDTO> contactdtos) {
List<Contact> domainlist=contactMapping.toDomain(contactdtos);
for(Contact domain:domainlist){
domain.setCustomerid(account_id);
}
contactService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "根据客户客户获取联系人草稿", tags = {"联系人" }, notes = "根据客户客户获取联系人草稿")
@RequestMapping(method = RequestMethod.GET, value = "/accounts/{account_id}/accounts/{account_id}/contacts/getdraft")
public ResponseEntity<ContactDTO> getDraftByAccountAccount(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id) {
Contact domain = new Contact();
domain.setCustomerid(account_id);
return ResponseEntity.status(HttpStatus.OK).body(contactMapping.toDto(contactService.getDraft(domain)));
}
@PreAuthorize("hasPermission(this.contactMapping.toDomain(#contactdto),'iBizBusinessCentral-Contact-Create')")
@ApiOperation(value = "根据客户客户建立联系人", tags = {"联系人" }, notes = "根据客户客户建立联系人")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/contacts")
@Transactional
public ResponseEntity<ContactDTO> createByAccountAccount(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @RequestBody ContactDTO contactdto) {
Contact domain = contactMapping.toDomain(contactdto);
domain.setCustomerid(account_id);
contactService.create(domain);
ContactDTO dto = contactMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.contactMapping.toDomain(#contactdtos),'iBizBusinessCentral-Contact-Create')")
@ApiOperation(value = "根据客户客户批量建立联系人", tags = {"联系人" }, notes = "根据客户客户批量建立联系人")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/contacts/batch")
public ResponseEntity<Boolean> createBatchByAccountAccount(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @RequestBody List<ContactDTO> contactdtos) {
List<Contact> domainlist=contactMapping.toDomain(contactdtos);
for(Contact domain:domainlist){
domain.setCustomerid(account_id);
}
contactService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Contact-Default-all')")
@ApiOperation(value = "根据客户客户获取DEFAULT", tags = {"联系人" } ,notes = "根据客户客户获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/accounts/{account_id}/accounts/{account_id}/contacts/fetchdefault")
public ResponseEntity<List<ContactDTO>> fetchContactDefaultByAccountAccount(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id,ContactSearchContext context) {
context.setN_customerid_eq(account_id);
Page<Contact> domains = contactService.searchDefault(context) ;
List<ContactDTO> list = contactMapping.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-Contact-Default-all')")
@ApiOperation(value = "根据客户客户查询DEFAULT", tags = {"联系人" } ,notes = "根据客户客户查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/accounts/{account_id}/accounts/{account_id}/contacts/searchdefault")
public ResponseEntity<Page<ContactDTO>> searchContactDefaultByAccountAccount(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @RequestBody ContactSearchContext context) {
context.setN_customerid_eq(account_id);
Page<Contact> domains = contactService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(contactMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
......@@ -650,5 +650,161 @@ public class LeadResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(leadMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.leadService.get(#lead_id),'iBizBusinessCentral-Lead-Update')")
@ApiOperation(value = "根据客户客户联系人更新潜在顾客", tags = {"潜在顾客" }, notes = "根据客户客户联系人更新潜在顾客")
@RequestMapping(method = RequestMethod.PUT, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/leads/{lead_id}")
@Transactional
public ResponseEntity<LeadDTO> updateByAccountAccountContact(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("lead_id") String lead_id, @RequestBody LeadDTO leaddto) {
Lead domain = leadMapping.toDomain(leaddto);
domain.setParentcontactid(contact_id);
domain.setLeadid(lead_id);
leadService.update(domain);
LeadDTO dto = leadMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.leadService.getLeadByEntities(this.leadMapping.toDomain(#leaddtos)),'iBizBusinessCentral-Lead-Update')")
@ApiOperation(value = "根据客户客户联系人批量更新潜在顾客", tags = {"潜在顾客" }, notes = "根据客户客户联系人批量更新潜在顾客")
@RequestMapping(method = RequestMethod.PUT, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/leads/batch")
public ResponseEntity<Boolean> updateBatchByAccountAccountContact(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @RequestBody List<LeadDTO> leaddtos) {
List<Lead> domainlist=leadMapping.toDomain(leaddtos);
for(Lead domain:domainlist){
domain.setParentcontactid(contact_id);
}
leadService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "根据客户客户联系人获取潜在顾客草稿", tags = {"潜在顾客" }, notes = "根据客户客户联系人获取潜在顾客草稿")
@RequestMapping(method = RequestMethod.GET, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/leads/getdraft")
public ResponseEntity<LeadDTO> getDraftByAccountAccountContact(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id) {
Lead domain = new Lead();
domain.setParentcontactid(contact_id);
return ResponseEntity.status(HttpStatus.OK).body(leadMapping.toDto(leadService.getDraft(domain)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Lead-DisQualification-all')")
@ApiOperation(value = "根据客户客户联系人潜在顾客", tags = {"潜在顾客" }, notes = "根据客户客户联系人潜在顾客")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/leads/{lead_id}/disqualification")
@Transactional
public ResponseEntity<LeadDTO> disQualificationByAccountAccountContact(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("lead_id") String lead_id, @RequestBody LeadDTO leaddto) {
Lead domain = leadMapping.toDomain(leaddto);
domain.setParentcontactid(contact_id);
domain = leadService.disQualification(domain) ;
leaddto = leadMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(leaddto);
}
@ApiOperation(value = "根据客户客户联系人检查潜在顾客", tags = {"潜在顾客" }, notes = "根据客户客户联系人检查潜在顾客")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/leads/checkkey")
public ResponseEntity<Boolean> checkKeyByAccountAccountContact(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @RequestBody LeadDTO leaddto) {
return ResponseEntity.status(HttpStatus.OK).body(leadService.checkKey(leadMapping.toDomain(leaddto)));
}
@PostAuthorize("hasPermission(this.leadMapping.toDomain(returnObject.body),'iBizBusinessCentral-Lead-Get')")
@ApiOperation(value = "根据客户客户联系人获取潜在顾客", tags = {"潜在顾客" }, notes = "根据客户客户联系人获取潜在顾客")
@RequestMapping(method = RequestMethod.GET, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/leads/{lead_id}")
public ResponseEntity<LeadDTO> getByAccountAccountContact(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("lead_id") String lead_id) {
Lead domain = leadService.get(lead_id);
LeadDTO dto = leadMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.leadMapping.toDomain(#leaddto),'iBizBusinessCentral-Lead-Save')")
@ApiOperation(value = "根据客户客户联系人保存潜在顾客", tags = {"潜在顾客" }, notes = "根据客户客户联系人保存潜在顾客")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/leads/save")
public ResponseEntity<Boolean> saveByAccountAccountContact(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @RequestBody LeadDTO leaddto) {
Lead domain = leadMapping.toDomain(leaddto);
domain.setParentcontactid(contact_id);
return ResponseEntity.status(HttpStatus.OK).body(leadService.save(domain));
}
@PreAuthorize("hasPermission(this.leadMapping.toDomain(#leaddtos),'iBizBusinessCentral-Lead-Save')")
@ApiOperation(value = "根据客户客户联系人批量保存潜在顾客", tags = {"潜在顾客" }, notes = "根据客户客户联系人批量保存潜在顾客")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/leads/savebatch")
public ResponseEntity<Boolean> saveBatchByAccountAccountContact(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @RequestBody List<LeadDTO> leaddtos) {
List<Lead> domainlist=leadMapping.toDomain(leaddtos);
for(Lead domain:domainlist){
domain.setParentcontactid(contact_id);
}
leadService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Lead-Qualification-all')")
@ApiOperation(value = "根据客户客户联系人潜在顾客", tags = {"潜在顾客" }, notes = "根据客户客户联系人潜在顾客")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/leads/{lead_id}/qualification")
@Transactional
public ResponseEntity<LeadDTO> qualificationByAccountAccountContact(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("lead_id") String lead_id, @RequestBody LeadDTO leaddto) {
Lead domain = leadMapping.toDomain(leaddto);
domain.setParentcontactid(contact_id);
domain = leadService.qualification(domain) ;
leaddto = leadMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(leaddto);
}
@PreAuthorize("hasPermission(this.leadMapping.toDomain(#leaddto),'iBizBusinessCentral-Lead-Create')")
@ApiOperation(value = "根据客户客户联系人建立潜在顾客", tags = {"潜在顾客" }, notes = "根据客户客户联系人建立潜在顾客")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/leads")
@Transactional
public ResponseEntity<LeadDTO> createByAccountAccountContact(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @RequestBody LeadDTO leaddto) {
Lead domain = leadMapping.toDomain(leaddto);
domain.setParentcontactid(contact_id);
leadService.create(domain);
LeadDTO dto = leadMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.leadMapping.toDomain(#leaddtos),'iBizBusinessCentral-Lead-Create')")
@ApiOperation(value = "根据客户客户联系人批量建立潜在顾客", tags = {"潜在顾客" }, notes = "根据客户客户联系人批量建立潜在顾客")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/leads/batch")
public ResponseEntity<Boolean> createBatchByAccountAccountContact(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @RequestBody List<LeadDTO> leaddtos) {
List<Lead> domainlist=leadMapping.toDomain(leaddtos);
for(Lead domain:domainlist){
domain.setParentcontactid(contact_id);
}
leadService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.leadService.get(#lead_id),'iBizBusinessCentral-Lead-Remove')")
@ApiOperation(value = "根据客户客户联系人删除潜在顾客", tags = {"潜在顾客" }, notes = "根据客户客户联系人删除潜在顾客")
@RequestMapping(method = RequestMethod.DELETE, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/leads/{lead_id}")
@Transactional
public ResponseEntity<Boolean> removeByAccountAccountContact(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("lead_id") String lead_id) {
return ResponseEntity.status(HttpStatus.OK).body(leadService.remove(lead_id));
}
@PreAuthorize("hasPermission(this.leadService.getLeadByIds(#ids),'iBizBusinessCentral-Lead-Remove')")
@ApiOperation(value = "根据客户客户联系人批量删除潜在顾客", tags = {"潜在顾客" }, notes = "根据客户客户联系人批量删除潜在顾客")
@RequestMapping(method = RequestMethod.DELETE, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/leads/batch")
public ResponseEntity<Boolean> removeBatchByAccountAccountContact(@RequestBody List<String> ids) {
leadService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Lead-Default-all')")
@ApiOperation(value = "根据客户客户联系人获取DEFAULT", tags = {"潜在顾客" } ,notes = "根据客户客户联系人获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/leads/fetchdefault")
public ResponseEntity<List<LeadDTO>> fetchLeadDefaultByAccountAccountContact(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id,LeadSearchContext context) {
context.setN_parentcontactid_eq(contact_id);
Page<Lead> domains = leadService.searchDefault(context) ;
List<LeadDTO> list = leadMapping.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-Lead-Default-all')")
@ApiOperation(value = "根据客户客户联系人查询DEFAULT", tags = {"潜在顾客" } ,notes = "根据客户客户联系人查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/leads/searchdefault")
public ResponseEntity<Page<LeadDTO>> searchLeadDefaultByAccountAccountContact(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @RequestBody LeadSearchContext context) {
context.setN_parentcontactid_eq(contact_id);
Page<Lead> domains = leadService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(leadMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
......@@ -422,5 +422,137 @@ public class ListAccountResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(listaccountMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@ApiOperation(value = "根据客户客户检查营销列表-账户", tags = {"营销列表-账户" }, notes = "根据客户客户检查营销列表-账户")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/listaccounts/checkkey")
public ResponseEntity<Boolean> checkKeyByAccountAccount(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @RequestBody ListAccountDTO listaccountdto) {
return ResponseEntity.status(HttpStatus.OK).body(listaccountService.checkKey(listaccountMapping.toDomain(listaccountdto)));
}
@PreAuthorize("hasPermission(this.listaccountService.get(#listaccount_id),'iBizBusinessCentral-ListAccount-Remove')")
@ApiOperation(value = "根据客户客户删除营销列表-账户", tags = {"营销列表-账户" }, notes = "根据客户客户删除营销列表-账户")
@RequestMapping(method = RequestMethod.DELETE, value = "/accounts/{account_id}/accounts/{account_id}/listaccounts/{listaccount_id}")
@Transactional
public ResponseEntity<Boolean> removeByAccountAccount(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("listaccount_id") String listaccount_id) {
return ResponseEntity.status(HttpStatus.OK).body(listaccountService.remove(listaccount_id));
}
@PreAuthorize("hasPermission(this.listaccountService.getListaccountByIds(#ids),'iBizBusinessCentral-ListAccount-Remove')")
@ApiOperation(value = "根据客户客户批量删除营销列表-账户", tags = {"营销列表-账户" }, notes = "根据客户客户批量删除营销列表-账户")
@RequestMapping(method = RequestMethod.DELETE, value = "/accounts/{account_id}/accounts/{account_id}/listaccounts/batch")
public ResponseEntity<Boolean> removeBatchByAccountAccount(@RequestBody List<String> ids) {
listaccountService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.listaccountMapping.toDomain(#listaccountdto),'iBizBusinessCentral-ListAccount-Save')")
@ApiOperation(value = "根据客户客户保存营销列表-账户", tags = {"营销列表-账户" }, notes = "根据客户客户保存营销列表-账户")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/listaccounts/save")
public ResponseEntity<Boolean> saveByAccountAccount(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @RequestBody ListAccountDTO listaccountdto) {
ListAccount domain = listaccountMapping.toDomain(listaccountdto);
domain.setEntity2id(account_id);
return ResponseEntity.status(HttpStatus.OK).body(listaccountService.save(domain));
}
@PreAuthorize("hasPermission(this.listaccountMapping.toDomain(#listaccountdtos),'iBizBusinessCentral-ListAccount-Save')")
@ApiOperation(value = "根据客户客户批量保存营销列表-账户", tags = {"营销列表-账户" }, notes = "根据客户客户批量保存营销列表-账户")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/listaccounts/savebatch")
public ResponseEntity<Boolean> saveBatchByAccountAccount(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @RequestBody List<ListAccountDTO> listaccountdtos) {
List<ListAccount> domainlist=listaccountMapping.toDomain(listaccountdtos);
for(ListAccount domain:domainlist){
domain.setEntity2id(account_id);
}
listaccountService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "根据客户客户获取营销列表-账户草稿", tags = {"营销列表-账户" }, notes = "根据客户客户获取营销列表-账户草稿")
@RequestMapping(method = RequestMethod.GET, value = "/accounts/{account_id}/accounts/{account_id}/listaccounts/getdraft")
public ResponseEntity<ListAccountDTO> getDraftByAccountAccount(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id) {
ListAccount domain = new ListAccount();
domain.setEntity2id(account_id);
return ResponseEntity.status(HttpStatus.OK).body(listaccountMapping.toDto(listaccountService.getDraft(domain)));
}
@PreAuthorize("hasPermission(this.listaccountService.get(#listaccount_id),'iBizBusinessCentral-ListAccount-Update')")
@ApiOperation(value = "根据客户客户更新营销列表-账户", tags = {"营销列表-账户" }, notes = "根据客户客户更新营销列表-账户")
@RequestMapping(method = RequestMethod.PUT, value = "/accounts/{account_id}/accounts/{account_id}/listaccounts/{listaccount_id}")
@Transactional
public ResponseEntity<ListAccountDTO> updateByAccountAccount(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("listaccount_id") String listaccount_id, @RequestBody ListAccountDTO listaccountdto) {
ListAccount domain = listaccountMapping.toDomain(listaccountdto);
domain.setEntity2id(account_id);
domain.setRelationshipsid(listaccount_id);
listaccountService.update(domain);
ListAccountDTO dto = listaccountMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.listaccountService.getListaccountByEntities(this.listaccountMapping.toDomain(#listaccountdtos)),'iBizBusinessCentral-ListAccount-Update')")
@ApiOperation(value = "根据客户客户批量更新营销列表-账户", tags = {"营销列表-账户" }, notes = "根据客户客户批量更新营销列表-账户")
@RequestMapping(method = RequestMethod.PUT, value = "/accounts/{account_id}/accounts/{account_id}/listaccounts/batch")
public ResponseEntity<Boolean> updateBatchByAccountAccount(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @RequestBody List<ListAccountDTO> listaccountdtos) {
List<ListAccount> domainlist=listaccountMapping.toDomain(listaccountdtos);
for(ListAccount domain:domainlist){
domain.setEntity2id(account_id);
}
listaccountService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.listaccountMapping.toDomain(returnObject.body),'iBizBusinessCentral-ListAccount-Get')")
@ApiOperation(value = "根据客户客户获取营销列表-账户", tags = {"营销列表-账户" }, notes = "根据客户客户获取营销列表-账户")
@RequestMapping(method = RequestMethod.GET, value = "/accounts/{account_id}/accounts/{account_id}/listaccounts/{listaccount_id}")
public ResponseEntity<ListAccountDTO> getByAccountAccount(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("listaccount_id") String listaccount_id) {
ListAccount domain = listaccountService.get(listaccount_id);
ListAccountDTO dto = listaccountMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.listaccountMapping.toDomain(#listaccountdto),'iBizBusinessCentral-ListAccount-Create')")
@ApiOperation(value = "根据客户客户建立营销列表-账户", tags = {"营销列表-账户" }, notes = "根据客户客户建立营销列表-账户")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/listaccounts")
@Transactional
public ResponseEntity<ListAccountDTO> createByAccountAccount(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @RequestBody ListAccountDTO listaccountdto) {
ListAccount domain = listaccountMapping.toDomain(listaccountdto);
domain.setEntity2id(account_id);
listaccountService.create(domain);
ListAccountDTO dto = listaccountMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.listaccountMapping.toDomain(#listaccountdtos),'iBizBusinessCentral-ListAccount-Create')")
@ApiOperation(value = "根据客户客户批量建立营销列表-账户", tags = {"营销列表-账户" }, notes = "根据客户客户批量建立营销列表-账户")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/listaccounts/batch")
public ResponseEntity<Boolean> createBatchByAccountAccount(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @RequestBody List<ListAccountDTO> listaccountdtos) {
List<ListAccount> domainlist=listaccountMapping.toDomain(listaccountdtos);
for(ListAccount domain:domainlist){
domain.setEntity2id(account_id);
}
listaccountService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-ListAccount-Default-all')")
@ApiOperation(value = "根据客户客户获取DEFAULT", tags = {"营销列表-账户" } ,notes = "根据客户客户获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/accounts/{account_id}/accounts/{account_id}/listaccounts/fetchdefault")
public ResponseEntity<List<ListAccountDTO>> fetchListAccountDefaultByAccountAccount(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id,ListAccountSearchContext context) {
context.setN_entity2id_eq(account_id);
Page<ListAccount> domains = listaccountService.searchDefault(context) ;
List<ListAccountDTO> list = listaccountMapping.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-ListAccount-Default-all')")
@ApiOperation(value = "根据客户客户查询DEFAULT", tags = {"营销列表-账户" } ,notes = "根据客户客户查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/accounts/{account_id}/accounts/{account_id}/listaccounts/searchdefault")
public ResponseEntity<Page<ListAccountDTO>> searchListAccountDefaultByAccountAccount(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @RequestBody ListAccountSearchContext context) {
context.setN_entity2id_eq(account_id);
Page<ListAccount> domains = listaccountService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(listaccountMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
......@@ -554,5 +554,137 @@ public class ListContactResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(listcontactMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@ApiOperation(value = "根据客户客户联系人获取营销列表-联系人草稿", tags = {"营销列表-联系人" }, notes = "根据客户客户联系人获取营销列表-联系人草稿")
@RequestMapping(method = RequestMethod.GET, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/listcontacts/getdraft")
public ResponseEntity<ListContactDTO> getDraftByAccountAccountContact(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id) {
ListContact domain = new ListContact();
domain.setEntity2id(contact_id);
return ResponseEntity.status(HttpStatus.OK).body(listcontactMapping.toDto(listcontactService.getDraft(domain)));
}
@ApiOperation(value = "根据客户客户联系人检查营销列表-联系人", tags = {"营销列表-联系人" }, notes = "根据客户客户联系人检查营销列表-联系人")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/listcontacts/checkkey")
public ResponseEntity<Boolean> checkKeyByAccountAccountContact(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @RequestBody ListContactDTO listcontactdto) {
return ResponseEntity.status(HttpStatus.OK).body(listcontactService.checkKey(listcontactMapping.toDomain(listcontactdto)));
}
@PreAuthorize("hasPermission(this.listcontactService.get(#listcontact_id),'iBizBusinessCentral-ListContact-Remove')")
@ApiOperation(value = "根据客户客户联系人删除营销列表-联系人", tags = {"营销列表-联系人" }, notes = "根据客户客户联系人删除营销列表-联系人")
@RequestMapping(method = RequestMethod.DELETE, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/listcontacts/{listcontact_id}")
@Transactional
public ResponseEntity<Boolean> removeByAccountAccountContact(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("listcontact_id") String listcontact_id) {
return ResponseEntity.status(HttpStatus.OK).body(listcontactService.remove(listcontact_id));
}
@PreAuthorize("hasPermission(this.listcontactService.getListcontactByIds(#ids),'iBizBusinessCentral-ListContact-Remove')")
@ApiOperation(value = "根据客户客户联系人批量删除营销列表-联系人", tags = {"营销列表-联系人" }, notes = "根据客户客户联系人批量删除营销列表-联系人")
@RequestMapping(method = RequestMethod.DELETE, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/listcontacts/batch")
public ResponseEntity<Boolean> removeBatchByAccountAccountContact(@RequestBody List<String> ids) {
listcontactService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.listcontactService.get(#listcontact_id),'iBizBusinessCentral-ListContact-Update')")
@ApiOperation(value = "根据客户客户联系人更新营销列表-联系人", tags = {"营销列表-联系人" }, notes = "根据客户客户联系人更新营销列表-联系人")
@RequestMapping(method = RequestMethod.PUT, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/listcontacts/{listcontact_id}")
@Transactional
public ResponseEntity<ListContactDTO> updateByAccountAccountContact(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("listcontact_id") String listcontact_id, @RequestBody ListContactDTO listcontactdto) {
ListContact domain = listcontactMapping.toDomain(listcontactdto);
domain.setEntity2id(contact_id);
domain.setRelationshipsid(listcontact_id);
listcontactService.update(domain);
ListContactDTO dto = listcontactMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.listcontactService.getListcontactByEntities(this.listcontactMapping.toDomain(#listcontactdtos)),'iBizBusinessCentral-ListContact-Update')")
@ApiOperation(value = "根据客户客户联系人批量更新营销列表-联系人", tags = {"营销列表-联系人" }, notes = "根据客户客户联系人批量更新营销列表-联系人")
@RequestMapping(method = RequestMethod.PUT, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/listcontacts/batch")
public ResponseEntity<Boolean> updateBatchByAccountAccountContact(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @RequestBody List<ListContactDTO> listcontactdtos) {
List<ListContact> domainlist=listcontactMapping.toDomain(listcontactdtos);
for(ListContact domain:domainlist){
domain.setEntity2id(contact_id);
}
listcontactService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.listcontactMapping.toDomain(#listcontactdto),'iBizBusinessCentral-ListContact-Save')")
@ApiOperation(value = "根据客户客户联系人保存营销列表-联系人", tags = {"营销列表-联系人" }, notes = "根据客户客户联系人保存营销列表-联系人")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/listcontacts/save")
public ResponseEntity<Boolean> saveByAccountAccountContact(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @RequestBody ListContactDTO listcontactdto) {
ListContact domain = listcontactMapping.toDomain(listcontactdto);
domain.setEntity2id(contact_id);
return ResponseEntity.status(HttpStatus.OK).body(listcontactService.save(domain));
}
@PreAuthorize("hasPermission(this.listcontactMapping.toDomain(#listcontactdtos),'iBizBusinessCentral-ListContact-Save')")
@ApiOperation(value = "根据客户客户联系人批量保存营销列表-联系人", tags = {"营销列表-联系人" }, notes = "根据客户客户联系人批量保存营销列表-联系人")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/listcontacts/savebatch")
public ResponseEntity<Boolean> saveBatchByAccountAccountContact(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @RequestBody List<ListContactDTO> listcontactdtos) {
List<ListContact> domainlist=listcontactMapping.toDomain(listcontactdtos);
for(ListContact domain:domainlist){
domain.setEntity2id(contact_id);
}
listcontactService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.listcontactMapping.toDomain(returnObject.body),'iBizBusinessCentral-ListContact-Get')")
@ApiOperation(value = "根据客户客户联系人获取营销列表-联系人", tags = {"营销列表-联系人" }, notes = "根据客户客户联系人获取营销列表-联系人")
@RequestMapping(method = RequestMethod.GET, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/listcontacts/{listcontact_id}")
public ResponseEntity<ListContactDTO> getByAccountAccountContact(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("listcontact_id") String listcontact_id) {
ListContact domain = listcontactService.get(listcontact_id);
ListContactDTO dto = listcontactMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.listcontactMapping.toDomain(#listcontactdto),'iBizBusinessCentral-ListContact-Create')")
@ApiOperation(value = "根据客户客户联系人建立营销列表-联系人", tags = {"营销列表-联系人" }, notes = "根据客户客户联系人建立营销列表-联系人")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/listcontacts")
@Transactional
public ResponseEntity<ListContactDTO> createByAccountAccountContact(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @RequestBody ListContactDTO listcontactdto) {
ListContact domain = listcontactMapping.toDomain(listcontactdto);
domain.setEntity2id(contact_id);
listcontactService.create(domain);
ListContactDTO dto = listcontactMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.listcontactMapping.toDomain(#listcontactdtos),'iBizBusinessCentral-ListContact-Create')")
@ApiOperation(value = "根据客户客户联系人批量建立营销列表-联系人", tags = {"营销列表-联系人" }, notes = "根据客户客户联系人批量建立营销列表-联系人")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/listcontacts/batch")
public ResponseEntity<Boolean> createBatchByAccountAccountContact(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @RequestBody List<ListContactDTO> listcontactdtos) {
List<ListContact> domainlist=listcontactMapping.toDomain(listcontactdtos);
for(ListContact domain:domainlist){
domain.setEntity2id(contact_id);
}
listcontactService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-ListContact-Default-all')")
@ApiOperation(value = "根据客户客户联系人获取DEFAULT", tags = {"营销列表-联系人" } ,notes = "根据客户客户联系人获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/listcontacts/fetchdefault")
public ResponseEntity<List<ListContactDTO>> fetchListContactDefaultByAccountAccountContact(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id,ListContactSearchContext context) {
context.setN_entity2id_eq(contact_id);
Page<ListContact> domains = listcontactService.searchDefault(context) ;
List<ListContactDTO> list = listcontactMapping.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-ListContact-Default-all')")
@ApiOperation(value = "根据客户客户联系人查询DEFAULT", tags = {"营销列表-联系人" } ,notes = "根据客户客户联系人查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/listcontacts/searchdefault")
public ResponseEntity<Page<ListContactDTO>> searchListContactDefaultByAccountAccountContact(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @RequestBody ListContactSearchContext context) {
context.setN_entity2id_eq(contact_id);
Page<ListContact> domains = listcontactService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(listcontactMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
......@@ -818,5 +818,137 @@ public class ListLeadResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(listleadMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@ApiOperation(value = "根据客户客户联系人潜在顾客检查营销列表-潜在客户", tags = {"营销列表-潜在客户" }, notes = "根据客户客户联系人潜在顾客检查营销列表-潜在客户")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/leads/{lead_id}/listleads/checkkey")
public ResponseEntity<Boolean> checkKeyByAccountAccountContactLead(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("lead_id") String lead_id, @RequestBody ListLeadDTO listleaddto) {
return ResponseEntity.status(HttpStatus.OK).body(listleadService.checkKey(listleadMapping.toDomain(listleaddto)));
}
@PreAuthorize("hasPermission(this.listleadService.get(#listlead_id),'iBizBusinessCentral-ListLead-Remove')")
@ApiOperation(value = "根据客户客户联系人潜在顾客删除营销列表-潜在客户", tags = {"营销列表-潜在客户" }, notes = "根据客户客户联系人潜在顾客删除营销列表-潜在客户")
@RequestMapping(method = RequestMethod.DELETE, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/leads/{lead_id}/listleads/{listlead_id}")
@Transactional
public ResponseEntity<Boolean> removeByAccountAccountContactLead(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("lead_id") String lead_id, @PathVariable("listlead_id") String listlead_id) {
return ResponseEntity.status(HttpStatus.OK).body(listleadService.remove(listlead_id));
}
@PreAuthorize("hasPermission(this.listleadService.getListleadByIds(#ids),'iBizBusinessCentral-ListLead-Remove')")
@ApiOperation(value = "根据客户客户联系人潜在顾客批量删除营销列表-潜在客户", tags = {"营销列表-潜在客户" }, notes = "根据客户客户联系人潜在顾客批量删除营销列表-潜在客户")
@RequestMapping(method = RequestMethod.DELETE, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/leads/{lead_id}/listleads/batch")
public ResponseEntity<Boolean> removeBatchByAccountAccountContactLead(@RequestBody List<String> ids) {
listleadService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.listleadMapping.toDomain(#listleaddto),'iBizBusinessCentral-ListLead-Create')")
@ApiOperation(value = "根据客户客户联系人潜在顾客建立营销列表-潜在客户", tags = {"营销列表-潜在客户" }, notes = "根据客户客户联系人潜在顾客建立营销列表-潜在客户")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/leads/{lead_id}/listleads")
@Transactional
public ResponseEntity<ListLeadDTO> createByAccountAccountContactLead(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("lead_id") String lead_id, @RequestBody ListLeadDTO listleaddto) {
ListLead domain = listleadMapping.toDomain(listleaddto);
domain.setEntity2id(lead_id);
listleadService.create(domain);
ListLeadDTO dto = listleadMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.listleadMapping.toDomain(#listleaddtos),'iBizBusinessCentral-ListLead-Create')")
@ApiOperation(value = "根据客户客户联系人潜在顾客批量建立营销列表-潜在客户", tags = {"营销列表-潜在客户" }, notes = "根据客户客户联系人潜在顾客批量建立营销列表-潜在客户")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/leads/{lead_id}/listleads/batch")
public ResponseEntity<Boolean> createBatchByAccountAccountContactLead(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("lead_id") String lead_id, @RequestBody List<ListLeadDTO> listleaddtos) {
List<ListLead> domainlist=listleadMapping.toDomain(listleaddtos);
for(ListLead domain:domainlist){
domain.setEntity2id(lead_id);
}
listleadService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.listleadService.get(#listlead_id),'iBizBusinessCentral-ListLead-Update')")
@ApiOperation(value = "根据客户客户联系人潜在顾客更新营销列表-潜在客户", tags = {"营销列表-潜在客户" }, notes = "根据客户客户联系人潜在顾客更新营销列表-潜在客户")
@RequestMapping(method = RequestMethod.PUT, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/leads/{lead_id}/listleads/{listlead_id}")
@Transactional
public ResponseEntity<ListLeadDTO> updateByAccountAccountContactLead(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("lead_id") String lead_id, @PathVariable("listlead_id") String listlead_id, @RequestBody ListLeadDTO listleaddto) {
ListLead domain = listleadMapping.toDomain(listleaddto);
domain.setEntity2id(lead_id);
domain.setRelationshipsid(listlead_id);
listleadService.update(domain);
ListLeadDTO dto = listleadMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.listleadService.getListleadByEntities(this.listleadMapping.toDomain(#listleaddtos)),'iBizBusinessCentral-ListLead-Update')")
@ApiOperation(value = "根据客户客户联系人潜在顾客批量更新营销列表-潜在客户", tags = {"营销列表-潜在客户" }, notes = "根据客户客户联系人潜在顾客批量更新营销列表-潜在客户")
@RequestMapping(method = RequestMethod.PUT, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/leads/{lead_id}/listleads/batch")
public ResponseEntity<Boolean> updateBatchByAccountAccountContactLead(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("lead_id") String lead_id, @RequestBody List<ListLeadDTO> listleaddtos) {
List<ListLead> domainlist=listleadMapping.toDomain(listleaddtos);
for(ListLead domain:domainlist){
domain.setEntity2id(lead_id);
}
listleadService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.listleadMapping.toDomain(#listleaddto),'iBizBusinessCentral-ListLead-Save')")
@ApiOperation(value = "根据客户客户联系人潜在顾客保存营销列表-潜在客户", tags = {"营销列表-潜在客户" }, notes = "根据客户客户联系人潜在顾客保存营销列表-潜在客户")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/leads/{lead_id}/listleads/save")
public ResponseEntity<Boolean> saveByAccountAccountContactLead(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("lead_id") String lead_id, @RequestBody ListLeadDTO listleaddto) {
ListLead domain = listleadMapping.toDomain(listleaddto);
domain.setEntity2id(lead_id);
return ResponseEntity.status(HttpStatus.OK).body(listleadService.save(domain));
}
@PreAuthorize("hasPermission(this.listleadMapping.toDomain(#listleaddtos),'iBizBusinessCentral-ListLead-Save')")
@ApiOperation(value = "根据客户客户联系人潜在顾客批量保存营销列表-潜在客户", tags = {"营销列表-潜在客户" }, notes = "根据客户客户联系人潜在顾客批量保存营销列表-潜在客户")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/leads/{lead_id}/listleads/savebatch")
public ResponseEntity<Boolean> saveBatchByAccountAccountContactLead(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("lead_id") String lead_id, @RequestBody List<ListLeadDTO> listleaddtos) {
List<ListLead> domainlist=listleadMapping.toDomain(listleaddtos);
for(ListLead domain:domainlist){
domain.setEntity2id(lead_id);
}
listleadService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.listleadMapping.toDomain(returnObject.body),'iBizBusinessCentral-ListLead-Get')")
@ApiOperation(value = "根据客户客户联系人潜在顾客获取营销列表-潜在客户", tags = {"营销列表-潜在客户" }, notes = "根据客户客户联系人潜在顾客获取营销列表-潜在客户")
@RequestMapping(method = RequestMethod.GET, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/leads/{lead_id}/listleads/{listlead_id}")
public ResponseEntity<ListLeadDTO> getByAccountAccountContactLead(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("lead_id") String lead_id, @PathVariable("listlead_id") String listlead_id) {
ListLead domain = listleadService.get(listlead_id);
ListLeadDTO dto = listleadMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据客户客户联系人潜在顾客获取营销列表-潜在客户草稿", tags = {"营销列表-潜在客户" }, notes = "根据客户客户联系人潜在顾客获取营销列表-潜在客户草稿")
@RequestMapping(method = RequestMethod.GET, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/leads/{lead_id}/listleads/getdraft")
public ResponseEntity<ListLeadDTO> getDraftByAccountAccountContactLead(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("lead_id") String lead_id) {
ListLead domain = new ListLead();
domain.setEntity2id(lead_id);
return ResponseEntity.status(HttpStatus.OK).body(listleadMapping.toDto(listleadService.getDraft(domain)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-ListLead-Default-all')")
@ApiOperation(value = "根据客户客户联系人潜在顾客获取DEFAULT", tags = {"营销列表-潜在客户" } ,notes = "根据客户客户联系人潜在顾客获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/leads/{lead_id}/listleads/fetchdefault")
public ResponseEntity<List<ListLeadDTO>> fetchListLeadDefaultByAccountAccountContactLead(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("lead_id") String lead_id,ListLeadSearchContext context) {
context.setN_entity2id_eq(lead_id);
Page<ListLead> domains = listleadService.searchDefault(context) ;
List<ListLeadDTO> list = listleadMapping.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-ListLead-Default-all')")
@ApiOperation(value = "根据客户客户联系人潜在顾客查询DEFAULT", tags = {"营销列表-潜在客户" } ,notes = "根据客户客户联系人潜在顾客查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/leads/{lead_id}/listleads/searchdefault")
public ResponseEntity<Page<ListLeadDTO>> searchListLeadDefaultByAccountAccountContactLead(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("lead_id") String lead_id, @RequestBody ListLeadSearchContext context) {
context.setN_entity2id_eq(lead_id);
Page<ListLead> domains = listleadService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(listleadMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
......@@ -686,5 +686,137 @@ public class OpportunityCompetitorResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(opportunitycompetitorMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PostAuthorize("hasPermission(this.opportunitycompetitorMapping.toDomain(returnObject.body),'iBizBusinessCentral-OpportunityCompetitor-Get')")
@ApiOperation(value = "根据客户客户联系人商机获取商机对手", tags = {"商机对手" }, notes = "根据客户客户联系人商机获取商机对手")
@RequestMapping(method = RequestMethod.GET, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/opportunitycompetitors/{opportunitycompetitor_id}")
public ResponseEntity<OpportunityCompetitorDTO> getByAccountAccountContactOpportunity(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("opportunitycompetitor_id") String opportunitycompetitor_id) {
OpportunityCompetitor domain = opportunitycompetitorService.get(opportunitycompetitor_id);
OpportunityCompetitorDTO dto = opportunitycompetitorMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.opportunitycompetitorService.get(#opportunitycompetitor_id),'iBizBusinessCentral-OpportunityCompetitor-Remove')")
@ApiOperation(value = "根据客户客户联系人商机删除商机对手", tags = {"商机对手" }, notes = "根据客户客户联系人商机删除商机对手")
@RequestMapping(method = RequestMethod.DELETE, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/opportunitycompetitors/{opportunitycompetitor_id}")
@Transactional
public ResponseEntity<Boolean> removeByAccountAccountContactOpportunity(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("opportunitycompetitor_id") String opportunitycompetitor_id) {
return ResponseEntity.status(HttpStatus.OK).body(opportunitycompetitorService.remove(opportunitycompetitor_id));
}
@PreAuthorize("hasPermission(this.opportunitycompetitorService.getOpportunitycompetitorByIds(#ids),'iBizBusinessCentral-OpportunityCompetitor-Remove')")
@ApiOperation(value = "根据客户客户联系人商机批量删除商机对手", tags = {"商机对手" }, notes = "根据客户客户联系人商机批量删除商机对手")
@RequestMapping(method = RequestMethod.DELETE, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/opportunitycompetitors/batch")
public ResponseEntity<Boolean> removeBatchByAccountAccountContactOpportunity(@RequestBody List<String> ids) {
opportunitycompetitorService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "根据客户客户联系人商机获取商机对手草稿", tags = {"商机对手" }, notes = "根据客户客户联系人商机获取商机对手草稿")
@RequestMapping(method = RequestMethod.GET, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/opportunitycompetitors/getdraft")
public ResponseEntity<OpportunityCompetitorDTO> getDraftByAccountAccountContactOpportunity(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id) {
OpportunityCompetitor domain = new OpportunityCompetitor();
domain.setEntityid(opportunity_id);
return ResponseEntity.status(HttpStatus.OK).body(opportunitycompetitorMapping.toDto(opportunitycompetitorService.getDraft(domain)));
}
@PreAuthorize("hasPermission(this.opportunitycompetitorMapping.toDomain(#opportunitycompetitordto),'iBizBusinessCentral-OpportunityCompetitor-Save')")
@ApiOperation(value = "根据客户客户联系人商机保存商机对手", tags = {"商机对手" }, notes = "根据客户客户联系人商机保存商机对手")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/opportunitycompetitors/save")
public ResponseEntity<Boolean> saveByAccountAccountContactOpportunity(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @RequestBody OpportunityCompetitorDTO opportunitycompetitordto) {
OpportunityCompetitor domain = opportunitycompetitorMapping.toDomain(opportunitycompetitordto);
domain.setEntityid(opportunity_id);
return ResponseEntity.status(HttpStatus.OK).body(opportunitycompetitorService.save(domain));
}
@PreAuthorize("hasPermission(this.opportunitycompetitorMapping.toDomain(#opportunitycompetitordtos),'iBizBusinessCentral-OpportunityCompetitor-Save')")
@ApiOperation(value = "根据客户客户联系人商机批量保存商机对手", tags = {"商机对手" }, notes = "根据客户客户联系人商机批量保存商机对手")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/opportunitycompetitors/savebatch")
public ResponseEntity<Boolean> saveBatchByAccountAccountContactOpportunity(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @RequestBody List<OpportunityCompetitorDTO> opportunitycompetitordtos) {
List<OpportunityCompetitor> domainlist=opportunitycompetitorMapping.toDomain(opportunitycompetitordtos);
for(OpportunityCompetitor domain:domainlist){
domain.setEntityid(opportunity_id);
}
opportunitycompetitorService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.opportunitycompetitorMapping.toDomain(#opportunitycompetitordto),'iBizBusinessCentral-OpportunityCompetitor-Create')")
@ApiOperation(value = "根据客户客户联系人商机建立商机对手", tags = {"商机对手" }, notes = "根据客户客户联系人商机建立商机对手")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/opportunitycompetitors")
@Transactional
public ResponseEntity<OpportunityCompetitorDTO> createByAccountAccountContactOpportunity(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @RequestBody OpportunityCompetitorDTO opportunitycompetitordto) {
OpportunityCompetitor domain = opportunitycompetitorMapping.toDomain(opportunitycompetitordto);
domain.setEntityid(opportunity_id);
opportunitycompetitorService.create(domain);
OpportunityCompetitorDTO dto = opportunitycompetitorMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.opportunitycompetitorMapping.toDomain(#opportunitycompetitordtos),'iBizBusinessCentral-OpportunityCompetitor-Create')")
@ApiOperation(value = "根据客户客户联系人商机批量建立商机对手", tags = {"商机对手" }, notes = "根据客户客户联系人商机批量建立商机对手")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/opportunitycompetitors/batch")
public ResponseEntity<Boolean> createBatchByAccountAccountContactOpportunity(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @RequestBody List<OpportunityCompetitorDTO> opportunitycompetitordtos) {
List<OpportunityCompetitor> domainlist=opportunitycompetitorMapping.toDomain(opportunitycompetitordtos);
for(OpportunityCompetitor domain:domainlist){
domain.setEntityid(opportunity_id);
}
opportunitycompetitorService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "根据客户客户联系人商机检查商机对手", tags = {"商机对手" }, notes = "根据客户客户联系人商机检查商机对手")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/opportunitycompetitors/checkkey")
public ResponseEntity<Boolean> checkKeyByAccountAccountContactOpportunity(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @RequestBody OpportunityCompetitorDTO opportunitycompetitordto) {
return ResponseEntity.status(HttpStatus.OK).body(opportunitycompetitorService.checkKey(opportunitycompetitorMapping.toDomain(opportunitycompetitordto)));
}
@PreAuthorize("hasPermission(this.opportunitycompetitorService.get(#opportunitycompetitor_id),'iBizBusinessCentral-OpportunityCompetitor-Update')")
@ApiOperation(value = "根据客户客户联系人商机更新商机对手", tags = {"商机对手" }, notes = "根据客户客户联系人商机更新商机对手")
@RequestMapping(method = RequestMethod.PUT, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/opportunitycompetitors/{opportunitycompetitor_id}")
@Transactional
public ResponseEntity<OpportunityCompetitorDTO> updateByAccountAccountContactOpportunity(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("opportunitycompetitor_id") String opportunitycompetitor_id, @RequestBody OpportunityCompetitorDTO opportunitycompetitordto) {
OpportunityCompetitor domain = opportunitycompetitorMapping.toDomain(opportunitycompetitordto);
domain.setEntityid(opportunity_id);
domain.setRelationshipsid(opportunitycompetitor_id);
opportunitycompetitorService.update(domain);
OpportunityCompetitorDTO dto = opportunitycompetitorMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.opportunitycompetitorService.getOpportunitycompetitorByEntities(this.opportunitycompetitorMapping.toDomain(#opportunitycompetitordtos)),'iBizBusinessCentral-OpportunityCompetitor-Update')")
@ApiOperation(value = "根据客户客户联系人商机批量更新商机对手", tags = {"商机对手" }, notes = "根据客户客户联系人商机批量更新商机对手")
@RequestMapping(method = RequestMethod.PUT, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/opportunitycompetitors/batch")
public ResponseEntity<Boolean> updateBatchByAccountAccountContactOpportunity(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @RequestBody List<OpportunityCompetitorDTO> opportunitycompetitordtos) {
List<OpportunityCompetitor> domainlist=opportunitycompetitorMapping.toDomain(opportunitycompetitordtos);
for(OpportunityCompetitor domain:domainlist){
domain.setEntityid(opportunity_id);
}
opportunitycompetitorService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-OpportunityCompetitor-Default-all')")
@ApiOperation(value = "根据客户客户联系人商机获取DEFAULT", tags = {"商机对手" } ,notes = "根据客户客户联系人商机获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/opportunitycompetitors/fetchdefault")
public ResponseEntity<List<OpportunityCompetitorDTO>> fetchOpportunityCompetitorDefaultByAccountAccountContactOpportunity(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id,OpportunityCompetitorSearchContext context) {
context.setN_entityid_eq(opportunity_id);
Page<OpportunityCompetitor> domains = opportunitycompetitorService.searchDefault(context) ;
List<OpportunityCompetitorDTO> list = opportunitycompetitorMapping.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-OpportunityCompetitor-Default-all')")
@ApiOperation(value = "根据客户客户联系人商机查询DEFAULT", tags = {"商机对手" } ,notes = "根据客户客户联系人商机查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/opportunitycompetitors/searchdefault")
public ResponseEntity<Page<OpportunityCompetitorDTO>> searchOpportunityCompetitorDefaultByAccountAccountContactOpportunity(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @RequestBody OpportunityCompetitorSearchContext context) {
context.setN_entityid_eq(opportunity_id);
Page<OpportunityCompetitor> domains = opportunitycompetitorService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(opportunitycompetitorMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
......@@ -554,5 +554,137 @@ public class OpportunityProductResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(opportunityproductMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@ApiOperation(value = "根据客户客户联系人商机获取商机产品草稿", tags = {"商机产品" }, notes = "根据客户客户联系人商机获取商机产品草稿")
@RequestMapping(method = RequestMethod.GET, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/opportunityproducts/getdraft")
public ResponseEntity<OpportunityProductDTO> getDraftByAccountAccountContactOpportunity(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id) {
OpportunityProduct domain = new OpportunityProduct();
domain.setOpportunityid(opportunity_id);
return ResponseEntity.status(HttpStatus.OK).body(opportunityproductMapping.toDto(opportunityproductService.getDraft(domain)));
}
@PreAuthorize("hasPermission(this.opportunityproductMapping.toDomain(#opportunityproductdto),'iBizBusinessCentral-OpportunityProduct-Save')")
@ApiOperation(value = "根据客户客户联系人商机保存商机产品", tags = {"商机产品" }, notes = "根据客户客户联系人商机保存商机产品")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/opportunityproducts/save")
public ResponseEntity<Boolean> saveByAccountAccountContactOpportunity(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @RequestBody OpportunityProductDTO opportunityproductdto) {
OpportunityProduct domain = opportunityproductMapping.toDomain(opportunityproductdto);
domain.setOpportunityid(opportunity_id);
return ResponseEntity.status(HttpStatus.OK).body(opportunityproductService.save(domain));
}
@PreAuthorize("hasPermission(this.opportunityproductMapping.toDomain(#opportunityproductdtos),'iBizBusinessCentral-OpportunityProduct-Save')")
@ApiOperation(value = "根据客户客户联系人商机批量保存商机产品", tags = {"商机产品" }, notes = "根据客户客户联系人商机批量保存商机产品")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/opportunityproducts/savebatch")
public ResponseEntity<Boolean> saveBatchByAccountAccountContactOpportunity(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @RequestBody List<OpportunityProductDTO> opportunityproductdtos) {
List<OpportunityProduct> domainlist=opportunityproductMapping.toDomain(opportunityproductdtos);
for(OpportunityProduct domain:domainlist){
domain.setOpportunityid(opportunity_id);
}
opportunityproductService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "根据客户客户联系人商机检查商机产品", tags = {"商机产品" }, notes = "根据客户客户联系人商机检查商机产品")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/opportunityproducts/checkkey")
public ResponseEntity<Boolean> checkKeyByAccountAccountContactOpportunity(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @RequestBody OpportunityProductDTO opportunityproductdto) {
return ResponseEntity.status(HttpStatus.OK).body(opportunityproductService.checkKey(opportunityproductMapping.toDomain(opportunityproductdto)));
}
@PreAuthorize("hasPermission(this.opportunityproductService.get(#opportunityproduct_id),'iBizBusinessCentral-OpportunityProduct-Remove')")
@ApiOperation(value = "根据客户客户联系人商机删除商机产品", tags = {"商机产品" }, notes = "根据客户客户联系人商机删除商机产品")
@RequestMapping(method = RequestMethod.DELETE, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/opportunityproducts/{opportunityproduct_id}")
@Transactional
public ResponseEntity<Boolean> removeByAccountAccountContactOpportunity(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("opportunityproduct_id") String opportunityproduct_id) {
return ResponseEntity.status(HttpStatus.OK).body(opportunityproductService.remove(opportunityproduct_id));
}
@PreAuthorize("hasPermission(this.opportunityproductService.getOpportunityproductByIds(#ids),'iBizBusinessCentral-OpportunityProduct-Remove')")
@ApiOperation(value = "根据客户客户联系人商机批量删除商机产品", tags = {"商机产品" }, notes = "根据客户客户联系人商机批量删除商机产品")
@RequestMapping(method = RequestMethod.DELETE, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/opportunityproducts/batch")
public ResponseEntity<Boolean> removeBatchByAccountAccountContactOpportunity(@RequestBody List<String> ids) {
opportunityproductService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.opportunityproductService.get(#opportunityproduct_id),'iBizBusinessCentral-OpportunityProduct-Update')")
@ApiOperation(value = "根据客户客户联系人商机更新商机产品", tags = {"商机产品" }, notes = "根据客户客户联系人商机更新商机产品")
@RequestMapping(method = RequestMethod.PUT, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/opportunityproducts/{opportunityproduct_id}")
@Transactional
public ResponseEntity<OpportunityProductDTO> updateByAccountAccountContactOpportunity(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("opportunityproduct_id") String opportunityproduct_id, @RequestBody OpportunityProductDTO opportunityproductdto) {
OpportunityProduct domain = opportunityproductMapping.toDomain(opportunityproductdto);
domain.setOpportunityid(opportunity_id);
domain.setOpportunityproductid(opportunityproduct_id);
opportunityproductService.update(domain);
OpportunityProductDTO dto = opportunityproductMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.opportunityproductService.getOpportunityproductByEntities(this.opportunityproductMapping.toDomain(#opportunityproductdtos)),'iBizBusinessCentral-OpportunityProduct-Update')")
@ApiOperation(value = "根据客户客户联系人商机批量更新商机产品", tags = {"商机产品" }, notes = "根据客户客户联系人商机批量更新商机产品")
@RequestMapping(method = RequestMethod.PUT, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/opportunityproducts/batch")
public ResponseEntity<Boolean> updateBatchByAccountAccountContactOpportunity(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @RequestBody List<OpportunityProductDTO> opportunityproductdtos) {
List<OpportunityProduct> domainlist=opportunityproductMapping.toDomain(opportunityproductdtos);
for(OpportunityProduct domain:domainlist){
domain.setOpportunityid(opportunity_id);
}
opportunityproductService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.opportunityproductMapping.toDomain(#opportunityproductdto),'iBizBusinessCentral-OpportunityProduct-Create')")
@ApiOperation(value = "根据客户客户联系人商机建立商机产品", tags = {"商机产品" }, notes = "根据客户客户联系人商机建立商机产品")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/opportunityproducts")
@Transactional
public ResponseEntity<OpportunityProductDTO> createByAccountAccountContactOpportunity(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @RequestBody OpportunityProductDTO opportunityproductdto) {
OpportunityProduct domain = opportunityproductMapping.toDomain(opportunityproductdto);
domain.setOpportunityid(opportunity_id);
opportunityproductService.create(domain);
OpportunityProductDTO dto = opportunityproductMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.opportunityproductMapping.toDomain(#opportunityproductdtos),'iBizBusinessCentral-OpportunityProduct-Create')")
@ApiOperation(value = "根据客户客户联系人商机批量建立商机产品", tags = {"商机产品" }, notes = "根据客户客户联系人商机批量建立商机产品")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/opportunityproducts/batch")
public ResponseEntity<Boolean> createBatchByAccountAccountContactOpportunity(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @RequestBody List<OpportunityProductDTO> opportunityproductdtos) {
List<OpportunityProduct> domainlist=opportunityproductMapping.toDomain(opportunityproductdtos);
for(OpportunityProduct domain:domainlist){
domain.setOpportunityid(opportunity_id);
}
opportunityproductService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.opportunityproductMapping.toDomain(returnObject.body),'iBizBusinessCentral-OpportunityProduct-Get')")
@ApiOperation(value = "根据客户客户联系人商机获取商机产品", tags = {"商机产品" }, notes = "根据客户客户联系人商机获取商机产品")
@RequestMapping(method = RequestMethod.GET, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/opportunityproducts/{opportunityproduct_id}")
public ResponseEntity<OpportunityProductDTO> getByAccountAccountContactOpportunity(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("opportunityproduct_id") String opportunityproduct_id) {
OpportunityProduct domain = opportunityproductService.get(opportunityproduct_id);
OpportunityProductDTO dto = opportunityproductMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-OpportunityProduct-Default-all')")
@ApiOperation(value = "根据客户客户联系人商机获取DEFAULT", tags = {"商机产品" } ,notes = "根据客户客户联系人商机获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/opportunityproducts/fetchdefault")
public ResponseEntity<List<OpportunityProductDTO>> fetchOpportunityProductDefaultByAccountAccountContactOpportunity(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id,OpportunityProductSearchContext context) {
context.setN_opportunityid_eq(opportunity_id);
Page<OpportunityProduct> domains = opportunityproductService.searchDefault(context) ;
List<OpportunityProductDTO> list = opportunityproductMapping.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-OpportunityProduct-Default-all')")
@ApiOperation(value = "根据客户客户联系人商机查询DEFAULT", tags = {"商机产品" } ,notes = "根据客户客户联系人商机查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/opportunityproducts/searchdefault")
public ResponseEntity<Page<OpportunityProductDTO>> searchOpportunityProductDefaultByAccountAccountContactOpportunity(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @RequestBody OpportunityProductSearchContext context) {
context.setN_opportunityid_eq(opportunity_id);
Page<OpportunityProduct> domains = opportunityproductService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(opportunityproductMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
......@@ -494,5 +494,161 @@ public class OpportunityResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(opportunityMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Opportunity-Win-all')")
@ApiOperation(value = "根据客户客户联系人商机", tags = {"商机" }, notes = "根据客户客户联系人商机")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/win")
@Transactional
public ResponseEntity<OpportunityDTO> winByAccountAccountContact(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @RequestBody OpportunityDTO opportunitydto) {
Opportunity domain = opportunityMapping.toDomain(opportunitydto);
domain.setParentcontactid(contact_id);
domain = opportunityService.win(domain) ;
opportunitydto = opportunityMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(opportunitydto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Opportunity-Lose-all')")
@ApiOperation(value = "根据客户客户联系人商机", tags = {"商机" }, notes = "根据客户客户联系人商机")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/lose")
@Transactional
public ResponseEntity<OpportunityDTO> loseByAccountAccountContact(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @RequestBody OpportunityDTO opportunitydto) {
Opportunity domain = opportunityMapping.toDomain(opportunitydto);
domain.setParentcontactid(contact_id);
domain = opportunityService.lose(domain) ;
opportunitydto = opportunityMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(opportunitydto);
}
@PostAuthorize("hasPermission(this.opportunityMapping.toDomain(returnObject.body),'iBizBusinessCentral-Opportunity-Get')")
@ApiOperation(value = "根据客户客户联系人获取商机", tags = {"商机" }, notes = "根据客户客户联系人获取商机")
@RequestMapping(method = RequestMethod.GET, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}")
public ResponseEntity<OpportunityDTO> getByAccountAccountContact(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id) {
Opportunity domain = opportunityService.get(opportunity_id);
OpportunityDTO dto = opportunityMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据客户客户联系人获取商机草稿", tags = {"商机" }, notes = "根据客户客户联系人获取商机草稿")
@RequestMapping(method = RequestMethod.GET, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/getdraft")
public ResponseEntity<OpportunityDTO> getDraftByAccountAccountContact(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id) {
Opportunity domain = new Opportunity();
domain.setParentcontactid(contact_id);
return ResponseEntity.status(HttpStatus.OK).body(opportunityMapping.toDto(opportunityService.getDraft(domain)));
}
@PreAuthorize("hasPermission(this.opportunityMapping.toDomain(#opportunitydto),'iBizBusinessCentral-Opportunity-Create')")
@ApiOperation(value = "根据客户客户联系人建立商机", tags = {"商机" }, notes = "根据客户客户联系人建立商机")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities")
@Transactional
public ResponseEntity<OpportunityDTO> createByAccountAccountContact(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @RequestBody OpportunityDTO opportunitydto) {
Opportunity domain = opportunityMapping.toDomain(opportunitydto);
domain.setParentcontactid(contact_id);
opportunityService.create(domain);
OpportunityDTO dto = opportunityMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.opportunityMapping.toDomain(#opportunitydtos),'iBizBusinessCentral-Opportunity-Create')")
@ApiOperation(value = "根据客户客户联系人批量建立商机", tags = {"商机" }, notes = "根据客户客户联系人批量建立商机")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/batch")
public ResponseEntity<Boolean> createBatchByAccountAccountContact(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @RequestBody List<OpportunityDTO> opportunitydtos) {
List<Opportunity> domainlist=opportunityMapping.toDomain(opportunitydtos);
for(Opportunity domain:domainlist){
domain.setParentcontactid(contact_id);
}
opportunityService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.opportunityService.get(#opportunity_id),'iBizBusinessCentral-Opportunity-Remove')")
@ApiOperation(value = "根据客户客户联系人删除商机", tags = {"商机" }, notes = "根据客户客户联系人删除商机")
@RequestMapping(method = RequestMethod.DELETE, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}")
@Transactional
public ResponseEntity<Boolean> removeByAccountAccountContact(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id) {
return ResponseEntity.status(HttpStatus.OK).body(opportunityService.remove(opportunity_id));
}
@PreAuthorize("hasPermission(this.opportunityService.getOpportunityByIds(#ids),'iBizBusinessCentral-Opportunity-Remove')")
@ApiOperation(value = "根据客户客户联系人批量删除商机", tags = {"商机" }, notes = "根据客户客户联系人批量删除商机")
@RequestMapping(method = RequestMethod.DELETE, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/batch")
public ResponseEntity<Boolean> removeBatchByAccountAccountContact(@RequestBody List<String> ids) {
opportunityService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.opportunityService.get(#opportunity_id),'iBizBusinessCentral-Opportunity-Update')")
@ApiOperation(value = "根据客户客户联系人更新商机", tags = {"商机" }, notes = "根据客户客户联系人更新商机")
@RequestMapping(method = RequestMethod.PUT, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}")
@Transactional
public ResponseEntity<OpportunityDTO> updateByAccountAccountContact(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @RequestBody OpportunityDTO opportunitydto) {
Opportunity domain = opportunityMapping.toDomain(opportunitydto);
domain.setParentcontactid(contact_id);
domain.setOpportunityid(opportunity_id);
opportunityService.update(domain);
OpportunityDTO dto = opportunityMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.opportunityService.getOpportunityByEntities(this.opportunityMapping.toDomain(#opportunitydtos)),'iBizBusinessCentral-Opportunity-Update')")
@ApiOperation(value = "根据客户客户联系人批量更新商机", tags = {"商机" }, notes = "根据客户客户联系人批量更新商机")
@RequestMapping(method = RequestMethod.PUT, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/batch")
public ResponseEntity<Boolean> updateBatchByAccountAccountContact(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @RequestBody List<OpportunityDTO> opportunitydtos) {
List<Opportunity> domainlist=opportunityMapping.toDomain(opportunitydtos);
for(Opportunity domain:domainlist){
domain.setParentcontactid(contact_id);
}
opportunityService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "根据客户客户联系人检查商机", tags = {"商机" }, notes = "根据客户客户联系人检查商机")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/checkkey")
public ResponseEntity<Boolean> checkKeyByAccountAccountContact(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @RequestBody OpportunityDTO opportunitydto) {
return ResponseEntity.status(HttpStatus.OK).body(opportunityService.checkKey(opportunityMapping.toDomain(opportunitydto)));
}
@PreAuthorize("hasPermission(this.opportunityMapping.toDomain(#opportunitydto),'iBizBusinessCentral-Opportunity-Save')")
@ApiOperation(value = "根据客户客户联系人保存商机", tags = {"商机" }, notes = "根据客户客户联系人保存商机")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/save")
public ResponseEntity<Boolean> saveByAccountAccountContact(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @RequestBody OpportunityDTO opportunitydto) {
Opportunity domain = opportunityMapping.toDomain(opportunitydto);
domain.setParentcontactid(contact_id);
return ResponseEntity.status(HttpStatus.OK).body(opportunityService.save(domain));
}
@PreAuthorize("hasPermission(this.opportunityMapping.toDomain(#opportunitydtos),'iBizBusinessCentral-Opportunity-Save')")
@ApiOperation(value = "根据客户客户联系人批量保存商机", tags = {"商机" }, notes = "根据客户客户联系人批量保存商机")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/savebatch")
public ResponseEntity<Boolean> saveBatchByAccountAccountContact(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @RequestBody List<OpportunityDTO> opportunitydtos) {
List<Opportunity> domainlist=opportunityMapping.toDomain(opportunitydtos);
for(Opportunity domain:domainlist){
domain.setParentcontactid(contact_id);
}
opportunityService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Opportunity-Default-all')")
@ApiOperation(value = "根据客户客户联系人获取DEFAULT", tags = {"商机" } ,notes = "根据客户客户联系人获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/fetchdefault")
public ResponseEntity<List<OpportunityDTO>> fetchOpportunityDefaultByAccountAccountContact(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id,OpportunitySearchContext context) {
context.setN_parentcontactid_eq(contact_id);
Page<Opportunity> domains = opportunityService.searchDefault(context) ;
List<OpportunityDTO> list = opportunityMapping.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-Opportunity-Default-all')")
@ApiOperation(value = "根据客户客户联系人查询DEFAULT", tags = {"商机" } ,notes = "根据客户客户联系人查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/searchdefault")
public ResponseEntity<Page<OpportunityDTO>> searchOpportunityDefaultByAccountAccountContact(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @RequestBody OpportunitySearchContext context) {
context.setN_parentcontactid_eq(contact_id);
Page<Opportunity> domains = opportunityService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(opportunityMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
......@@ -554,5 +554,137 @@ public class QuoteResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(quoteMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.quoteMapping.toDomain(#quotedto),'iBizBusinessCentral-Quote-Create')")
@ApiOperation(value = "根据客户客户联系人商机建立报价单", tags = {"报价单" }, notes = "根据客户客户联系人商机建立报价单")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes")
@Transactional
public ResponseEntity<QuoteDTO> createByAccountAccountContactOpportunity(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @RequestBody QuoteDTO quotedto) {
Quote domain = quoteMapping.toDomain(quotedto);
domain.setOpportunityid(opportunity_id);
quoteService.create(domain);
QuoteDTO dto = quoteMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.quoteMapping.toDomain(#quotedtos),'iBizBusinessCentral-Quote-Create')")
@ApiOperation(value = "根据客户客户联系人商机批量建立报价单", tags = {"报价单" }, notes = "根据客户客户联系人商机批量建立报价单")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/batch")
public ResponseEntity<Boolean> createBatchByAccountAccountContactOpportunity(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @RequestBody List<QuoteDTO> quotedtos) {
List<Quote> domainlist=quoteMapping.toDomain(quotedtos);
for(Quote domain:domainlist){
domain.setOpportunityid(opportunity_id);
}
quoteService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.quoteMapping.toDomain(#quotedto),'iBizBusinessCentral-Quote-Save')")
@ApiOperation(value = "根据客户客户联系人商机保存报价单", tags = {"报价单" }, notes = "根据客户客户联系人商机保存报价单")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/save")
public ResponseEntity<Boolean> saveByAccountAccountContactOpportunity(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @RequestBody QuoteDTO quotedto) {
Quote domain = quoteMapping.toDomain(quotedto);
domain.setOpportunityid(opportunity_id);
return ResponseEntity.status(HttpStatus.OK).body(quoteService.save(domain));
}
@PreAuthorize("hasPermission(this.quoteMapping.toDomain(#quotedtos),'iBizBusinessCentral-Quote-Save')")
@ApiOperation(value = "根据客户客户联系人商机批量保存报价单", tags = {"报价单" }, notes = "根据客户客户联系人商机批量保存报价单")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/savebatch")
public ResponseEntity<Boolean> saveBatchByAccountAccountContactOpportunity(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @RequestBody List<QuoteDTO> quotedtos) {
List<Quote> domainlist=quoteMapping.toDomain(quotedtos);
for(Quote domain:domainlist){
domain.setOpportunityid(opportunity_id);
}
quoteService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.quoteService.get(#quote_id),'iBizBusinessCentral-Quote-Remove')")
@ApiOperation(value = "根据客户客户联系人商机删除报价单", tags = {"报价单" }, notes = "根据客户客户联系人商机删除报价单")
@RequestMapping(method = RequestMethod.DELETE, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}")
@Transactional
public ResponseEntity<Boolean> removeByAccountAccountContactOpportunity(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id) {
return ResponseEntity.status(HttpStatus.OK).body(quoteService.remove(quote_id));
}
@PreAuthorize("hasPermission(this.quoteService.getQuoteByIds(#ids),'iBizBusinessCentral-Quote-Remove')")
@ApiOperation(value = "根据客户客户联系人商机批量删除报价单", tags = {"报价单" }, notes = "根据客户客户联系人商机批量删除报价单")
@RequestMapping(method = RequestMethod.DELETE, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/batch")
public ResponseEntity<Boolean> removeBatchByAccountAccountContactOpportunity(@RequestBody List<String> ids) {
quoteService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.quoteService.get(#quote_id),'iBizBusinessCentral-Quote-Update')")
@ApiOperation(value = "根据客户客户联系人商机更新报价单", tags = {"报价单" }, notes = "根据客户客户联系人商机更新报价单")
@RequestMapping(method = RequestMethod.PUT, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}")
@Transactional
public ResponseEntity<QuoteDTO> updateByAccountAccountContactOpportunity(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @RequestBody QuoteDTO quotedto) {
Quote domain = quoteMapping.toDomain(quotedto);
domain.setOpportunityid(opportunity_id);
domain.setQuoteid(quote_id);
quoteService.update(domain);
QuoteDTO dto = quoteMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.quoteService.getQuoteByEntities(this.quoteMapping.toDomain(#quotedtos)),'iBizBusinessCentral-Quote-Update')")
@ApiOperation(value = "根据客户客户联系人商机批量更新报价单", tags = {"报价单" }, notes = "根据客户客户联系人商机批量更新报价单")
@RequestMapping(method = RequestMethod.PUT, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/batch")
public ResponseEntity<Boolean> updateBatchByAccountAccountContactOpportunity(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @RequestBody List<QuoteDTO> quotedtos) {
List<Quote> domainlist=quoteMapping.toDomain(quotedtos);
for(Quote domain:domainlist){
domain.setOpportunityid(opportunity_id);
}
quoteService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.quoteMapping.toDomain(returnObject.body),'iBizBusinessCentral-Quote-Get')")
@ApiOperation(value = "根据客户客户联系人商机获取报价单", tags = {"报价单" }, notes = "根据客户客户联系人商机获取报价单")
@RequestMapping(method = RequestMethod.GET, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}")
public ResponseEntity<QuoteDTO> getByAccountAccountContactOpportunity(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id) {
Quote domain = quoteService.get(quote_id);
QuoteDTO dto = quoteMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据客户客户联系人商机检查报价单", tags = {"报价单" }, notes = "根据客户客户联系人商机检查报价单")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/checkkey")
public ResponseEntity<Boolean> checkKeyByAccountAccountContactOpportunity(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @RequestBody QuoteDTO quotedto) {
return ResponseEntity.status(HttpStatus.OK).body(quoteService.checkKey(quoteMapping.toDomain(quotedto)));
}
@ApiOperation(value = "根据客户客户联系人商机获取报价单草稿", tags = {"报价单" }, notes = "根据客户客户联系人商机获取报价单草稿")
@RequestMapping(method = RequestMethod.GET, value = "/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/getdraft")
public ResponseEntity<QuoteDTO> getDraftByAccountAccountContactOpportunity(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id) {
Quote domain = new Quote();
domain.setOpportunityid(opportunity_id);
return ResponseEntity.status(HttpStatus.OK).body(quoteMapping.toDto(quoteService.getDraft(domain)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Quote-Default-all')")
@ApiOperation(value = "根据客户客户联系人商机获取DEFAULT", tags = {"报价单" } ,notes = "根据客户客户联系人商机获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/fetchdefault")
public ResponseEntity<List<QuoteDTO>> fetchQuoteDefaultByAccountAccountContactOpportunity(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id,QuoteSearchContext context) {
context.setN_opportunityid_eq(opportunity_id);
Page<Quote> domains = quoteService.searchDefault(context) ;
List<QuoteDTO> list = quoteMapping.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-Quote-Default-all')")
@ApiOperation(value = "根据客户客户联系人商机查询DEFAULT", tags = {"报价单" } ,notes = "根据客户客户联系人商机查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/accounts/{account_id}/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/searchdefault")
public ResponseEntity<Page<QuoteDTO>> searchQuoteDefaultByAccountAccountContactOpportunity(@PathVariable("account_id") String account_id, @PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @RequestBody QuoteSearchContext context) {
context.setN_opportunityid_eq(opportunity_id);
Page<Quote> domains = quoteService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(quoteMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册