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

lab_gzf 部署微服务接口

上级 e7cca149
......@@ -362,7 +362,7 @@ public class QuoteDetail extends EntityMP implements Serializable {
@JsonProperty("productoverridden")
private Integer productoverridden;
/**
* Product Name
* 产品名称
*/
@TableField(value = "productname")
@JSONField(name = "productname")
......@@ -868,7 +868,7 @@ public class QuoteDetail extends EntityMP implements Serializable {
}
/**
* 设置 [Product Name]
* 设置 [产品名称]
*/
public void setProductname(String productname){
this.productname = productname ;
......
......@@ -466,7 +466,7 @@
<!--输出实体[QUOTEDETAIL]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-quotedetail-4-8">
<changeSet author="a_LAB01_e85d8801c" id="tab-quotedetail-10-8">
<createTable tableName="QUOTEDETAIL">
<column name="OWNERIDTYPE" remarks="" type="VARCHAR(100)">
</column>
......@@ -4514,7 +4514,7 @@
<!--输出实体[ACCOUNT]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-account-349-54">
<changeSet author="a_LAB01_e85d8801c" id="tab-account-355-54">
<createTable tableName="ACCOUNT">
<column name="ADDRESS1_PRIMARYCONTACTNAME" remarks="" type="VARCHAR(100)">
</column>
......@@ -10773,19 +10773,19 @@
<addForeignKeyConstraint baseColumnNames="TRANSACTIONCURRENCYID" baseTableName="SEMIANNUALFISCALCALENDAR" constraintName="DER1N_SEMIANNUALFISCALCALENDAR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="TRANSACTIONCURRENCYID" referencedTableName="TRANSACTIONCURRENCY" validate="true"/>
</changeSet>
<!--输出实体[QUOTEDETAIL]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-quotedetail-4-134">
<changeSet author="a_LAB01_e85d8801c" id="fk-quotedetail-10-134">
<addForeignKeyConstraint baseColumnNames="PRODUCTID" baseTableName="QUOTEDETAIL" constraintName="DER1N_QUOTEDETAIL__PRODUCT__PR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="PRODUCTID" referencedTableName="PRODUCT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-quotedetail-4-135">
<changeSet author="a_LAB01_e85d8801c" id="fk-quotedetail-10-135">
<addForeignKeyConstraint baseColumnNames="PARENTBUNDLEIDREF" baseTableName="QUOTEDETAIL" constraintName="DER1N_QUOTEDETAIL__QUOTEDETAIL" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="QUOTEDETAILID" referencedTableName="QUOTEDETAIL" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-quotedetail-4-136">
<changeSet author="a_LAB01_e85d8801c" id="fk-quotedetail-10-136">
<addForeignKeyConstraint baseColumnNames="QUOTEID" baseTableName="QUOTEDETAIL" constraintName="DER1N_QUOTEDETAIL__QUOTE__QUOT" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="QUOTEID" referencedTableName="QUOTE" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-quotedetail-4-137">
<changeSet author="a_LAB01_e85d8801c" id="fk-quotedetail-10-137">
<addForeignKeyConstraint baseColumnNames="TRANSACTIONCURRENCYID" baseTableName="QUOTEDETAIL" constraintName="DER1N_QUOTEDETAIL__TRANSACTION" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="TRANSACTIONCURRENCYID" referencedTableName="TRANSACTIONCURRENCY" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-quotedetail-4-138">
<changeSet author="a_LAB01_e85d8801c" id="fk-quotedetail-10-138">
<addForeignKeyConstraint baseColumnNames="UOMID" baseTableName="QUOTEDETAIL" constraintName="DER1N_QUOTEDETAIL__UOM__UOMID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="UOMID" referencedTableName="UOM" validate="true"/>
</changeSet>
<!--输出实体[QUARTERLYFISCALCALENDAR]外键关系 -->
......@@ -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-349-255">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-355-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-349-256">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-355-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-349-257">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-355-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-349-258">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-355-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-349-259">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-355-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-349-260">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-355-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-349-261">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-355-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-349-262">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-355-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-349-263">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-355-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]外键关系 -->
......
......@@ -9,6 +9,6 @@ CMD echo "The application will start in ${IBIZ_SLEEP}s..." && \
sleep ${IBIZ_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /businesscentral-provider-centralapi.jar
EXPOSE 8081
EXPOSE 10310
ADD businesscentral-provider-centralapi.jar /businesscentral-provider-centralapi.jar
......@@ -3,9 +3,23 @@ services:
businesscentral-provider-centralapi:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/businesscentral-provider-centralapi:latest
ports:
- "8081:8081"
- "10310:10310"
networks:
- agent_network
environment:
- SPRING_CLOUD_NACOS_DISCOVERY_IP=172.16.240.110
- SERVER_PORT=10310
- SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR=172.16.240.110:8848
- SPRING_REDIS_HOST=127.0.0.1
- SPRING_REDIS_PORT=6379
- SPRING_REDIS_DATABASE=0
- SPRING_DATASOURCE_USERNAME=a_LAB01_e85d8801c
- SPRING_DATASOURCE_PASSWORD=b1@@@772
- SPRING_DATASOURCE_URL=jdbc:mysql://172.16.186.185:3306/a_LAB01_e85d8801c?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true
- SPRING_DATASOURCE_DRIVER-CLASS-NAME=com.mysql.jdbc.Driver
- SPRING_DATASOURCE_DEFAULTSCHEMA=a_LAB01_e85d8801c
- CAS=https://passport.ibizlab.cn
- NACOS=172.16.240.110:8848
deploy:
resources:
limits:
......
......@@ -158,5 +158,533 @@ public class QuoteDetailResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(quotedetailMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@ApiOperation(value = "根据报价单获取报价单产品草稿", tags = {"报价单产品" }, notes = "根据报价单获取报价单产品草稿")
@RequestMapping(method = RequestMethod.GET, value = "/quotes/{quote_id}/quotedetails/getdraft")
public ResponseEntity<QuoteDetailDTO> getDraftByQuote(@PathVariable("quote_id") String quote_id) {
QuoteDetail domain = new QuoteDetail();
domain.setQuoteid(quote_id);
return ResponseEntity.status(HttpStatus.OK).body(quotedetailMapping.toDto(quotedetailService.getDraft(domain)));
}
@PreAuthorize("hasPermission(this.quotedetailService.get(#quotedetail_id),'iBizBusinessCentral-QuoteDetail-Update')")
@ApiOperation(value = "根据报价单更新报价单产品", tags = {"报价单产品" }, notes = "根据报价单更新报价单产品")
@RequestMapping(method = RequestMethod.PUT, value = "/quotes/{quote_id}/quotedetails/{quotedetail_id}")
@Transactional
public ResponseEntity<QuoteDetailDTO> updateByQuote(@PathVariable("quote_id") String quote_id, @PathVariable("quotedetail_id") String quotedetail_id, @RequestBody QuoteDetailDTO quotedetaildto) {
QuoteDetail domain = quotedetailMapping.toDomain(quotedetaildto);
domain.setQuoteid(quote_id);
domain.setQuotedetailid(quotedetail_id);
quotedetailService.update(domain);
QuoteDetailDTO dto = quotedetailMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.quotedetailService.getQuotedetailByEntities(this.quotedetailMapping.toDomain(#quotedetaildtos)),'iBizBusinessCentral-QuoteDetail-Update')")
@ApiOperation(value = "根据报价单批量更新报价单产品", tags = {"报价单产品" }, notes = "根据报价单批量更新报价单产品")
@RequestMapping(method = RequestMethod.PUT, value = "/quotes/{quote_id}/quotedetails/batch")
public ResponseEntity<Boolean> updateBatchByQuote(@PathVariable("quote_id") String quote_id, @RequestBody List<QuoteDetailDTO> quotedetaildtos) {
List<QuoteDetail> domainlist=quotedetailMapping.toDomain(quotedetaildtos);
for(QuoteDetail domain:domainlist){
domain.setQuoteid(quote_id);
}
quotedetailService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.quotedetailMapping.toDomain(#quotedetaildto),'iBizBusinessCentral-QuoteDetail-Save')")
@ApiOperation(value = "根据报价单保存报价单产品", tags = {"报价单产品" }, notes = "根据报价单保存报价单产品")
@RequestMapping(method = RequestMethod.POST, value = "/quotes/{quote_id}/quotedetails/save")
public ResponseEntity<Boolean> saveByQuote(@PathVariable("quote_id") String quote_id, @RequestBody QuoteDetailDTO quotedetaildto) {
QuoteDetail domain = quotedetailMapping.toDomain(quotedetaildto);
domain.setQuoteid(quote_id);
return ResponseEntity.status(HttpStatus.OK).body(quotedetailService.save(domain));
}
@PreAuthorize("hasPermission(this.quotedetailMapping.toDomain(#quotedetaildtos),'iBizBusinessCentral-QuoteDetail-Save')")
@ApiOperation(value = "根据报价单批量保存报价单产品", tags = {"报价单产品" }, notes = "根据报价单批量保存报价单产品")
@RequestMapping(method = RequestMethod.POST, value = "/quotes/{quote_id}/quotedetails/savebatch")
public ResponseEntity<Boolean> saveBatchByQuote(@PathVariable("quote_id") String quote_id, @RequestBody List<QuoteDetailDTO> quotedetaildtos) {
List<QuoteDetail> domainlist=quotedetailMapping.toDomain(quotedetaildtos);
for(QuoteDetail domain:domainlist){
domain.setQuoteid(quote_id);
}
quotedetailService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.quotedetailService.get(#quotedetail_id),'iBizBusinessCentral-QuoteDetail-Remove')")
@ApiOperation(value = "根据报价单删除报价单产品", tags = {"报价单产品" }, notes = "根据报价单删除报价单产品")
@RequestMapping(method = RequestMethod.DELETE, value = "/quotes/{quote_id}/quotedetails/{quotedetail_id}")
@Transactional
public ResponseEntity<Boolean> removeByQuote(@PathVariable("quote_id") String quote_id, @PathVariable("quotedetail_id") String quotedetail_id) {
return ResponseEntity.status(HttpStatus.OK).body(quotedetailService.remove(quotedetail_id));
}
@PreAuthorize("hasPermission(this.quotedetailService.getQuotedetailByIds(#ids),'iBizBusinessCentral-QuoteDetail-Remove')")
@ApiOperation(value = "根据报价单批量删除报价单产品", tags = {"报价单产品" }, notes = "根据报价单批量删除报价单产品")
@RequestMapping(method = RequestMethod.DELETE, value = "/quotes/{quote_id}/quotedetails/batch")
public ResponseEntity<Boolean> removeBatchByQuote(@RequestBody List<String> ids) {
quotedetailService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "根据报价单检查报价单产品", tags = {"报价单产品" }, notes = "根据报价单检查报价单产品")
@RequestMapping(method = RequestMethod.POST, value = "/quotes/{quote_id}/quotedetails/checkkey")
public ResponseEntity<Boolean> checkKeyByQuote(@PathVariable("quote_id") String quote_id, @RequestBody QuoteDetailDTO quotedetaildto) {
return ResponseEntity.status(HttpStatus.OK).body(quotedetailService.checkKey(quotedetailMapping.toDomain(quotedetaildto)));
}
@PostAuthorize("hasPermission(this.quotedetailMapping.toDomain(returnObject.body),'iBizBusinessCentral-QuoteDetail-Get')")
@ApiOperation(value = "根据报价单获取报价单产品", tags = {"报价单产品" }, notes = "根据报价单获取报价单产品")
@RequestMapping(method = RequestMethod.GET, value = "/quotes/{quote_id}/quotedetails/{quotedetail_id}")
public ResponseEntity<QuoteDetailDTO> getByQuote(@PathVariable("quote_id") String quote_id, @PathVariable("quotedetail_id") String quotedetail_id) {
QuoteDetail domain = quotedetailService.get(quotedetail_id);
QuoteDetailDTO dto = quotedetailMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.quotedetailMapping.toDomain(#quotedetaildto),'iBizBusinessCentral-QuoteDetail-Create')")
@ApiOperation(value = "根据报价单建立报价单产品", tags = {"报价单产品" }, notes = "根据报价单建立报价单产品")
@RequestMapping(method = RequestMethod.POST, value = "/quotes/{quote_id}/quotedetails")
@Transactional
public ResponseEntity<QuoteDetailDTO> createByQuote(@PathVariable("quote_id") String quote_id, @RequestBody QuoteDetailDTO quotedetaildto) {
QuoteDetail domain = quotedetailMapping.toDomain(quotedetaildto);
domain.setQuoteid(quote_id);
quotedetailService.create(domain);
QuoteDetailDTO dto = quotedetailMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.quotedetailMapping.toDomain(#quotedetaildtos),'iBizBusinessCentral-QuoteDetail-Create')")
@ApiOperation(value = "根据报价单批量建立报价单产品", tags = {"报价单产品" }, notes = "根据报价单批量建立报价单产品")
@RequestMapping(method = RequestMethod.POST, value = "/quotes/{quote_id}/quotedetails/batch")
public ResponseEntity<Boolean> createBatchByQuote(@PathVariable("quote_id") String quote_id, @RequestBody List<QuoteDetailDTO> quotedetaildtos) {
List<QuoteDetail> domainlist=quotedetailMapping.toDomain(quotedetaildtos);
for(QuoteDetail domain:domainlist){
domain.setQuoteid(quote_id);
}
quotedetailService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-QuoteDetail-Default-all')")
@ApiOperation(value = "根据报价单获取DEFAULT", tags = {"报价单产品" } ,notes = "根据报价单获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/quotes/{quote_id}/quotedetails/fetchdefault")
public ResponseEntity<List<QuoteDetailDTO>> fetchQuoteDetailDefaultByQuote(@PathVariable("quote_id") String quote_id,QuoteDetailSearchContext context) {
context.setN_quoteid_eq(quote_id);
Page<QuoteDetail> domains = quotedetailService.searchDefault(context) ;
List<QuoteDetailDTO> list = quotedetailMapping.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-QuoteDetail-Default-all')")
@ApiOperation(value = "根据报价单查询DEFAULT", tags = {"报价单产品" } ,notes = "根据报价单查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/quotes/{quote_id}/quotedetails/searchdefault")
public ResponseEntity<Page<QuoteDetailDTO>> searchQuoteDetailDefaultByQuote(@PathVariable("quote_id") String quote_id, @RequestBody QuoteDetailSearchContext context) {
context.setN_quoteid_eq(quote_id);
Page<QuoteDetail> domains = quotedetailService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(quotedetailMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@ApiOperation(value = "根据商机报价单获取报价单产品草稿", tags = {"报价单产品" }, notes = "根据商机报价单获取报价单产品草稿")
@RequestMapping(method = RequestMethod.GET, value = "/opportunities/{opportunity_id}/quotes/{quote_id}/quotedetails/getdraft")
public ResponseEntity<QuoteDetailDTO> getDraftByOpportunityQuote(@PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id) {
QuoteDetail domain = new QuoteDetail();
domain.setQuoteid(quote_id);
return ResponseEntity.status(HttpStatus.OK).body(quotedetailMapping.toDto(quotedetailService.getDraft(domain)));
}
@PreAuthorize("hasPermission(this.quotedetailService.get(#quotedetail_id),'iBizBusinessCentral-QuoteDetail-Update')")
@ApiOperation(value = "根据商机报价单更新报价单产品", tags = {"报价单产品" }, notes = "根据商机报价单更新报价单产品")
@RequestMapping(method = RequestMethod.PUT, value = "/opportunities/{opportunity_id}/quotes/{quote_id}/quotedetails/{quotedetail_id}")
@Transactional
public ResponseEntity<QuoteDetailDTO> updateByOpportunityQuote(@PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("quotedetail_id") String quotedetail_id, @RequestBody QuoteDetailDTO quotedetaildto) {
QuoteDetail domain = quotedetailMapping.toDomain(quotedetaildto);
domain.setQuoteid(quote_id);
domain.setQuotedetailid(quotedetail_id);
quotedetailService.update(domain);
QuoteDetailDTO dto = quotedetailMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.quotedetailService.getQuotedetailByEntities(this.quotedetailMapping.toDomain(#quotedetaildtos)),'iBizBusinessCentral-QuoteDetail-Update')")
@ApiOperation(value = "根据商机报价单批量更新报价单产品", tags = {"报价单产品" }, notes = "根据商机报价单批量更新报价单产品")
@RequestMapping(method = RequestMethod.PUT, value = "/opportunities/{opportunity_id}/quotes/{quote_id}/quotedetails/batch")
public ResponseEntity<Boolean> updateBatchByOpportunityQuote(@PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @RequestBody List<QuoteDetailDTO> quotedetaildtos) {
List<QuoteDetail> domainlist=quotedetailMapping.toDomain(quotedetaildtos);
for(QuoteDetail domain:domainlist){
domain.setQuoteid(quote_id);
}
quotedetailService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.quotedetailMapping.toDomain(#quotedetaildto),'iBizBusinessCentral-QuoteDetail-Save')")
@ApiOperation(value = "根据商机报价单保存报价单产品", tags = {"报价单产品" }, notes = "根据商机报价单保存报价单产品")
@RequestMapping(method = RequestMethod.POST, value = "/opportunities/{opportunity_id}/quotes/{quote_id}/quotedetails/save")
public ResponseEntity<Boolean> saveByOpportunityQuote(@PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @RequestBody QuoteDetailDTO quotedetaildto) {
QuoteDetail domain = quotedetailMapping.toDomain(quotedetaildto);
domain.setQuoteid(quote_id);
return ResponseEntity.status(HttpStatus.OK).body(quotedetailService.save(domain));
}
@PreAuthorize("hasPermission(this.quotedetailMapping.toDomain(#quotedetaildtos),'iBizBusinessCentral-QuoteDetail-Save')")
@ApiOperation(value = "根据商机报价单批量保存报价单产品", tags = {"报价单产品" }, notes = "根据商机报价单批量保存报价单产品")
@RequestMapping(method = RequestMethod.POST, value = "/opportunities/{opportunity_id}/quotes/{quote_id}/quotedetails/savebatch")
public ResponseEntity<Boolean> saveBatchByOpportunityQuote(@PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @RequestBody List<QuoteDetailDTO> quotedetaildtos) {
List<QuoteDetail> domainlist=quotedetailMapping.toDomain(quotedetaildtos);
for(QuoteDetail domain:domainlist){
domain.setQuoteid(quote_id);
}
quotedetailService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.quotedetailService.get(#quotedetail_id),'iBizBusinessCentral-QuoteDetail-Remove')")
@ApiOperation(value = "根据商机报价单删除报价单产品", tags = {"报价单产品" }, notes = "根据商机报价单删除报价单产品")
@RequestMapping(method = RequestMethod.DELETE, value = "/opportunities/{opportunity_id}/quotes/{quote_id}/quotedetails/{quotedetail_id}")
@Transactional
public ResponseEntity<Boolean> removeByOpportunityQuote(@PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("quotedetail_id") String quotedetail_id) {
return ResponseEntity.status(HttpStatus.OK).body(quotedetailService.remove(quotedetail_id));
}
@PreAuthorize("hasPermission(this.quotedetailService.getQuotedetailByIds(#ids),'iBizBusinessCentral-QuoteDetail-Remove')")
@ApiOperation(value = "根据商机报价单批量删除报价单产品", tags = {"报价单产品" }, notes = "根据商机报价单批量删除报价单产品")
@RequestMapping(method = RequestMethod.DELETE, value = "/opportunities/{opportunity_id}/quotes/{quote_id}/quotedetails/batch")
public ResponseEntity<Boolean> removeBatchByOpportunityQuote(@RequestBody List<String> ids) {
quotedetailService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "根据商机报价单检查报价单产品", tags = {"报价单产品" }, notes = "根据商机报价单检查报价单产品")
@RequestMapping(method = RequestMethod.POST, value = "/opportunities/{opportunity_id}/quotes/{quote_id}/quotedetails/checkkey")
public ResponseEntity<Boolean> checkKeyByOpportunityQuote(@PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @RequestBody QuoteDetailDTO quotedetaildto) {
return ResponseEntity.status(HttpStatus.OK).body(quotedetailService.checkKey(quotedetailMapping.toDomain(quotedetaildto)));
}
@PostAuthorize("hasPermission(this.quotedetailMapping.toDomain(returnObject.body),'iBizBusinessCentral-QuoteDetail-Get')")
@ApiOperation(value = "根据商机报价单获取报价单产品", tags = {"报价单产品" }, notes = "根据商机报价单获取报价单产品")
@RequestMapping(method = RequestMethod.GET, value = "/opportunities/{opportunity_id}/quotes/{quote_id}/quotedetails/{quotedetail_id}")
public ResponseEntity<QuoteDetailDTO> getByOpportunityQuote(@PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("quotedetail_id") String quotedetail_id) {
QuoteDetail domain = quotedetailService.get(quotedetail_id);
QuoteDetailDTO dto = quotedetailMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.quotedetailMapping.toDomain(#quotedetaildto),'iBizBusinessCentral-QuoteDetail-Create')")
@ApiOperation(value = "根据商机报价单建立报价单产品", tags = {"报价单产品" }, notes = "根据商机报价单建立报价单产品")
@RequestMapping(method = RequestMethod.POST, value = "/opportunities/{opportunity_id}/quotes/{quote_id}/quotedetails")
@Transactional
public ResponseEntity<QuoteDetailDTO> createByOpportunityQuote(@PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @RequestBody QuoteDetailDTO quotedetaildto) {
QuoteDetail domain = quotedetailMapping.toDomain(quotedetaildto);
domain.setQuoteid(quote_id);
quotedetailService.create(domain);
QuoteDetailDTO dto = quotedetailMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.quotedetailMapping.toDomain(#quotedetaildtos),'iBizBusinessCentral-QuoteDetail-Create')")
@ApiOperation(value = "根据商机报价单批量建立报价单产品", tags = {"报价单产品" }, notes = "根据商机报价单批量建立报价单产品")
@RequestMapping(method = RequestMethod.POST, value = "/opportunities/{opportunity_id}/quotes/{quote_id}/quotedetails/batch")
public ResponseEntity<Boolean> createBatchByOpportunityQuote(@PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @RequestBody List<QuoteDetailDTO> quotedetaildtos) {
List<QuoteDetail> domainlist=quotedetailMapping.toDomain(quotedetaildtos);
for(QuoteDetail domain:domainlist){
domain.setQuoteid(quote_id);
}
quotedetailService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-QuoteDetail-Default-all')")
@ApiOperation(value = "根据商机报价单获取DEFAULT", tags = {"报价单产品" } ,notes = "根据商机报价单获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/opportunities/{opportunity_id}/quotes/{quote_id}/quotedetails/fetchdefault")
public ResponseEntity<List<QuoteDetailDTO>> fetchQuoteDetailDefaultByOpportunityQuote(@PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id,QuoteDetailSearchContext context) {
context.setN_quoteid_eq(quote_id);
Page<QuoteDetail> domains = quotedetailService.searchDefault(context) ;
List<QuoteDetailDTO> list = quotedetailMapping.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-QuoteDetail-Default-all')")
@ApiOperation(value = "根据商机报价单查询DEFAULT", tags = {"报价单产品" } ,notes = "根据商机报价单查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/opportunities/{opportunity_id}/quotes/{quote_id}/quotedetails/searchdefault")
public ResponseEntity<Page<QuoteDetailDTO>> searchQuoteDetailDefaultByOpportunityQuote(@PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @RequestBody QuoteDetailSearchContext context) {
context.setN_quoteid_eq(quote_id);
Page<QuoteDetail> domains = quotedetailService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(quotedetailMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@ApiOperation(value = "根据联系人商机报价单获取报价单产品草稿", tags = {"报价单产品" }, notes = "根据联系人商机报价单获取报价单产品草稿")
@RequestMapping(method = RequestMethod.GET, value = "/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/quotedetails/getdraft")
public ResponseEntity<QuoteDetailDTO> getDraftByContactOpportunityQuote(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id) {
QuoteDetail domain = new QuoteDetail();
domain.setQuoteid(quote_id);
return ResponseEntity.status(HttpStatus.OK).body(quotedetailMapping.toDto(quotedetailService.getDraft(domain)));
}
@PreAuthorize("hasPermission(this.quotedetailService.get(#quotedetail_id),'iBizBusinessCentral-QuoteDetail-Update')")
@ApiOperation(value = "根据联系人商机报价单更新报价单产品", tags = {"报价单产品" }, notes = "根据联系人商机报价单更新报价单产品")
@RequestMapping(method = RequestMethod.PUT, value = "/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/quotedetails/{quotedetail_id}")
@Transactional
public ResponseEntity<QuoteDetailDTO> updateByContactOpportunityQuote(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("quotedetail_id") String quotedetail_id, @RequestBody QuoteDetailDTO quotedetaildto) {
QuoteDetail domain = quotedetailMapping.toDomain(quotedetaildto);
domain.setQuoteid(quote_id);
domain.setQuotedetailid(quotedetail_id);
quotedetailService.update(domain);
QuoteDetailDTO dto = quotedetailMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.quotedetailService.getQuotedetailByEntities(this.quotedetailMapping.toDomain(#quotedetaildtos)),'iBizBusinessCentral-QuoteDetail-Update')")
@ApiOperation(value = "根据联系人商机报价单批量更新报价单产品", tags = {"报价单产品" }, notes = "根据联系人商机报价单批量更新报价单产品")
@RequestMapping(method = RequestMethod.PUT, value = "/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/quotedetails/batch")
public ResponseEntity<Boolean> updateBatchByContactOpportunityQuote(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @RequestBody List<QuoteDetailDTO> quotedetaildtos) {
List<QuoteDetail> domainlist=quotedetailMapping.toDomain(quotedetaildtos);
for(QuoteDetail domain:domainlist){
domain.setQuoteid(quote_id);
}
quotedetailService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.quotedetailMapping.toDomain(#quotedetaildto),'iBizBusinessCentral-QuoteDetail-Save')")
@ApiOperation(value = "根据联系人商机报价单保存报价单产品", tags = {"报价单产品" }, notes = "根据联系人商机报价单保存报价单产品")
@RequestMapping(method = RequestMethod.POST, value = "/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/quotedetails/save")
public ResponseEntity<Boolean> saveByContactOpportunityQuote(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @RequestBody QuoteDetailDTO quotedetaildto) {
QuoteDetail domain = quotedetailMapping.toDomain(quotedetaildto);
domain.setQuoteid(quote_id);
return ResponseEntity.status(HttpStatus.OK).body(quotedetailService.save(domain));
}
@PreAuthorize("hasPermission(this.quotedetailMapping.toDomain(#quotedetaildtos),'iBizBusinessCentral-QuoteDetail-Save')")
@ApiOperation(value = "根据联系人商机报价单批量保存报价单产品", tags = {"报价单产品" }, notes = "根据联系人商机报价单批量保存报价单产品")
@RequestMapping(method = RequestMethod.POST, value = "/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/quotedetails/savebatch")
public ResponseEntity<Boolean> saveBatchByContactOpportunityQuote(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @RequestBody List<QuoteDetailDTO> quotedetaildtos) {
List<QuoteDetail> domainlist=quotedetailMapping.toDomain(quotedetaildtos);
for(QuoteDetail domain:domainlist){
domain.setQuoteid(quote_id);
}
quotedetailService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.quotedetailService.get(#quotedetail_id),'iBizBusinessCentral-QuoteDetail-Remove')")
@ApiOperation(value = "根据联系人商机报价单删除报价单产品", tags = {"报价单产品" }, notes = "根据联系人商机报价单删除报价单产品")
@RequestMapping(method = RequestMethod.DELETE, value = "/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/quotedetails/{quotedetail_id}")
@Transactional
public ResponseEntity<Boolean> removeByContactOpportunityQuote(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("quotedetail_id") String quotedetail_id) {
return ResponseEntity.status(HttpStatus.OK).body(quotedetailService.remove(quotedetail_id));
}
@PreAuthorize("hasPermission(this.quotedetailService.getQuotedetailByIds(#ids),'iBizBusinessCentral-QuoteDetail-Remove')")
@ApiOperation(value = "根据联系人商机报价单批量删除报价单产品", tags = {"报价单产品" }, notes = "根据联系人商机报价单批量删除报价单产品")
@RequestMapping(method = RequestMethod.DELETE, value = "/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/quotedetails/batch")
public ResponseEntity<Boolean> removeBatchByContactOpportunityQuote(@RequestBody List<String> ids) {
quotedetailService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "根据联系人商机报价单检查报价单产品", tags = {"报价单产品" }, notes = "根据联系人商机报价单检查报价单产品")
@RequestMapping(method = RequestMethod.POST, value = "/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/quotedetails/checkkey")
public ResponseEntity<Boolean> checkKeyByContactOpportunityQuote(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @RequestBody QuoteDetailDTO quotedetaildto) {
return ResponseEntity.status(HttpStatus.OK).body(quotedetailService.checkKey(quotedetailMapping.toDomain(quotedetaildto)));
}
@PostAuthorize("hasPermission(this.quotedetailMapping.toDomain(returnObject.body),'iBizBusinessCentral-QuoteDetail-Get')")
@ApiOperation(value = "根据联系人商机报价单获取报价单产品", tags = {"报价单产品" }, notes = "根据联系人商机报价单获取报价单产品")
@RequestMapping(method = RequestMethod.GET, value = "/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/quotedetails/{quotedetail_id}")
public ResponseEntity<QuoteDetailDTO> getByContactOpportunityQuote(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("quotedetail_id") String quotedetail_id) {
QuoteDetail domain = quotedetailService.get(quotedetail_id);
QuoteDetailDTO dto = quotedetailMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.quotedetailMapping.toDomain(#quotedetaildto),'iBizBusinessCentral-QuoteDetail-Create')")
@ApiOperation(value = "根据联系人商机报价单建立报价单产品", tags = {"报价单产品" }, notes = "根据联系人商机报价单建立报价单产品")
@RequestMapping(method = RequestMethod.POST, value = "/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/quotedetails")
@Transactional
public ResponseEntity<QuoteDetailDTO> createByContactOpportunityQuote(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @RequestBody QuoteDetailDTO quotedetaildto) {
QuoteDetail domain = quotedetailMapping.toDomain(quotedetaildto);
domain.setQuoteid(quote_id);
quotedetailService.create(domain);
QuoteDetailDTO dto = quotedetailMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.quotedetailMapping.toDomain(#quotedetaildtos),'iBizBusinessCentral-QuoteDetail-Create')")
@ApiOperation(value = "根据联系人商机报价单批量建立报价单产品", tags = {"报价单产品" }, notes = "根据联系人商机报价单批量建立报价单产品")
@RequestMapping(method = RequestMethod.POST, value = "/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/quotedetails/batch")
public ResponseEntity<Boolean> createBatchByContactOpportunityQuote(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @RequestBody List<QuoteDetailDTO> quotedetaildtos) {
List<QuoteDetail> domainlist=quotedetailMapping.toDomain(quotedetaildtos);
for(QuoteDetail domain:domainlist){
domain.setQuoteid(quote_id);
}
quotedetailService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-QuoteDetail-Default-all')")
@ApiOperation(value = "根据联系人商机报价单获取DEFAULT", tags = {"报价单产品" } ,notes = "根据联系人商机报价单获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/quotedetails/fetchdefault")
public ResponseEntity<List<QuoteDetailDTO>> fetchQuoteDetailDefaultByContactOpportunityQuote(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id,QuoteDetailSearchContext context) {
context.setN_quoteid_eq(quote_id);
Page<QuoteDetail> domains = quotedetailService.searchDefault(context) ;
List<QuoteDetailDTO> list = quotedetailMapping.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-QuoteDetail-Default-all')")
@ApiOperation(value = "根据联系人商机报价单查询DEFAULT", tags = {"报价单产品" } ,notes = "根据联系人商机报价单查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/quotedetails/searchdefault")
public ResponseEntity<Page<QuoteDetailDTO>> searchQuoteDetailDefaultByContactOpportunityQuote(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @RequestBody QuoteDetailSearchContext context) {
context.setN_quoteid_eq(quote_id);
Page<QuoteDetail> domains = quotedetailService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(quotedetailMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@ApiOperation(value = "根据客户联系人商机报价单获取报价单产品草稿", tags = {"报价单产品" }, notes = "根据客户联系人商机报价单获取报价单产品草稿")
@RequestMapping(method = RequestMethod.GET, value = "/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/quotedetails/getdraft")
public ResponseEntity<QuoteDetailDTO> getDraftByAccountContactOpportunityQuote(@PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id) {
QuoteDetail domain = new QuoteDetail();
domain.setQuoteid(quote_id);
return ResponseEntity.status(HttpStatus.OK).body(quotedetailMapping.toDto(quotedetailService.getDraft(domain)));
}
@PreAuthorize("hasPermission(this.quotedetailService.get(#quotedetail_id),'iBizBusinessCentral-QuoteDetail-Update')")
@ApiOperation(value = "根据客户联系人商机报价单更新报价单产品", tags = {"报价单产品" }, notes = "根据客户联系人商机报价单更新报价单产品")
@RequestMapping(method = RequestMethod.PUT, value = "/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/quotedetails/{quotedetail_id}")
@Transactional
public ResponseEntity<QuoteDetailDTO> updateByAccountContactOpportunityQuote(@PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("quotedetail_id") String quotedetail_id, @RequestBody QuoteDetailDTO quotedetaildto) {
QuoteDetail domain = quotedetailMapping.toDomain(quotedetaildto);
domain.setQuoteid(quote_id);
domain.setQuotedetailid(quotedetail_id);
quotedetailService.update(domain);
QuoteDetailDTO dto = quotedetailMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.quotedetailService.getQuotedetailByEntities(this.quotedetailMapping.toDomain(#quotedetaildtos)),'iBizBusinessCentral-QuoteDetail-Update')")
@ApiOperation(value = "根据客户联系人商机报价单批量更新报价单产品", tags = {"报价单产品" }, notes = "根据客户联系人商机报价单批量更新报价单产品")
@RequestMapping(method = RequestMethod.PUT, value = "/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/quotedetails/batch")
public ResponseEntity<Boolean> updateBatchByAccountContactOpportunityQuote(@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 List<QuoteDetailDTO> quotedetaildtos) {
List<QuoteDetail> domainlist=quotedetailMapping.toDomain(quotedetaildtos);
for(QuoteDetail domain:domainlist){
domain.setQuoteid(quote_id);
}
quotedetailService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.quotedetailMapping.toDomain(#quotedetaildto),'iBizBusinessCentral-QuoteDetail-Save')")
@ApiOperation(value = "根据客户联系人商机报价单保存报价单产品", tags = {"报价单产品" }, notes = "根据客户联系人商机报价单保存报价单产品")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/quotedetails/save")
public ResponseEntity<Boolean> saveByAccountContactOpportunityQuote(@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 QuoteDetailDTO quotedetaildto) {
QuoteDetail domain = quotedetailMapping.toDomain(quotedetaildto);
domain.setQuoteid(quote_id);
return ResponseEntity.status(HttpStatus.OK).body(quotedetailService.save(domain));
}
@PreAuthorize("hasPermission(this.quotedetailMapping.toDomain(#quotedetaildtos),'iBizBusinessCentral-QuoteDetail-Save')")
@ApiOperation(value = "根据客户联系人商机报价单批量保存报价单产品", tags = {"报价单产品" }, notes = "根据客户联系人商机报价单批量保存报价单产品")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/quotedetails/savebatch")
public ResponseEntity<Boolean> saveBatchByAccountContactOpportunityQuote(@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 List<QuoteDetailDTO> quotedetaildtos) {
List<QuoteDetail> domainlist=quotedetailMapping.toDomain(quotedetaildtos);
for(QuoteDetail domain:domainlist){
domain.setQuoteid(quote_id);
}
quotedetailService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.quotedetailService.get(#quotedetail_id),'iBizBusinessCentral-QuoteDetail-Remove')")
@ApiOperation(value = "根据客户联系人商机报价单删除报价单产品", tags = {"报价单产品" }, notes = "根据客户联系人商机报价单删除报价单产品")
@RequestMapping(method = RequestMethod.DELETE, value = "/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/quotedetails/{quotedetail_id}")
@Transactional
public ResponseEntity<Boolean> removeByAccountContactOpportunityQuote(@PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("quotedetail_id") String quotedetail_id) {
return ResponseEntity.status(HttpStatus.OK).body(quotedetailService.remove(quotedetail_id));
}
@PreAuthorize("hasPermission(this.quotedetailService.getQuotedetailByIds(#ids),'iBizBusinessCentral-QuoteDetail-Remove')")
@ApiOperation(value = "根据客户联系人商机报价单批量删除报价单产品", tags = {"报价单产品" }, notes = "根据客户联系人商机报价单批量删除报价单产品")
@RequestMapping(method = RequestMethod.DELETE, value = "/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/quotedetails/batch")
public ResponseEntity<Boolean> removeBatchByAccountContactOpportunityQuote(@RequestBody List<String> ids) {
quotedetailService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "根据客户联系人商机报价单检查报价单产品", tags = {"报价单产品" }, notes = "根据客户联系人商机报价单检查报价单产品")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/quotedetails/checkkey")
public ResponseEntity<Boolean> checkKeyByAccountContactOpportunityQuote(@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 QuoteDetailDTO quotedetaildto) {
return ResponseEntity.status(HttpStatus.OK).body(quotedetailService.checkKey(quotedetailMapping.toDomain(quotedetaildto)));
}
@PostAuthorize("hasPermission(this.quotedetailMapping.toDomain(returnObject.body),'iBizBusinessCentral-QuoteDetail-Get')")
@ApiOperation(value = "根据客户联系人商机报价单获取报价单产品", tags = {"报价单产品" }, notes = "根据客户联系人商机报价单获取报价单产品")
@RequestMapping(method = RequestMethod.GET, value = "/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/quotedetails/{quotedetail_id}")
public ResponseEntity<QuoteDetailDTO> getByAccountContactOpportunityQuote(@PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("quotedetail_id") String quotedetail_id) {
QuoteDetail domain = quotedetailService.get(quotedetail_id);
QuoteDetailDTO dto = quotedetailMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.quotedetailMapping.toDomain(#quotedetaildto),'iBizBusinessCentral-QuoteDetail-Create')")
@ApiOperation(value = "根据客户联系人商机报价单建立报价单产品", tags = {"报价单产品" }, notes = "根据客户联系人商机报价单建立报价单产品")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/quotedetails")
@Transactional
public ResponseEntity<QuoteDetailDTO> createByAccountContactOpportunityQuote(@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 QuoteDetailDTO quotedetaildto) {
QuoteDetail domain = quotedetailMapping.toDomain(quotedetaildto);
domain.setQuoteid(quote_id);
quotedetailService.create(domain);
QuoteDetailDTO dto = quotedetailMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.quotedetailMapping.toDomain(#quotedetaildtos),'iBizBusinessCentral-QuoteDetail-Create')")
@ApiOperation(value = "根据客户联系人商机报价单批量建立报价单产品", tags = {"报价单产品" }, notes = "根据客户联系人商机报价单批量建立报价单产品")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/quotedetails/batch")
public ResponseEntity<Boolean> createBatchByAccountContactOpportunityQuote(@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 List<QuoteDetailDTO> quotedetaildtos) {
List<QuoteDetail> domainlist=quotedetailMapping.toDomain(quotedetaildtos);
for(QuoteDetail domain:domainlist){
domain.setQuoteid(quote_id);
}
quotedetailService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-QuoteDetail-Default-all')")
@ApiOperation(value = "根据客户联系人商机报价单获取DEFAULT", tags = {"报价单产品" } ,notes = "根据客户联系人商机报价单获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/quotedetails/fetchdefault")
public ResponseEntity<List<QuoteDetailDTO>> fetchQuoteDetailDefaultByAccountContactOpportunityQuote(@PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id,QuoteDetailSearchContext context) {
context.setN_quoteid_eq(quote_id);
Page<QuoteDetail> domains = quotedetailService.searchDefault(context) ;
List<QuoteDetailDTO> list = quotedetailMapping.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-QuoteDetail-Default-all')")
@ApiOperation(value = "根据客户联系人商机报价单查询DEFAULT", tags = {"报价单产品" } ,notes = "根据客户联系人商机报价单查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/quotedetails/searchdefault")
public ResponseEntity<Page<QuoteDetailDTO>> searchQuoteDetailDefaultByAccountContactOpportunityQuote(@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 QuoteDetailSearchContext context) {
context.setN_quoteid_eq(quote_id);
Page<QuoteDetail> domains = quotedetailService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(quotedetailMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
......@@ -37,6 +37,11 @@
git clone -b master $para2 ibizbusinesscentral/
export NODE_OPTIONS=--max-old-space-size=4096
cd ibizbusinesscentral/
mvn clean package -Pcentralapi
cd businesscentral-provider/businesscentral-provider-centralapi
mvn -Pcentralapi docker:build
mvn -Pcentralapi docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/businesscentral-provider-centralapi.yaml iBizEE --with-registry-auth
</command>
</hudson.tasks.Shell>
</builders>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册