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

lab_gzf 部署微服务接口

上级 1a4bceff
......@@ -119,6 +119,10 @@ zuul:
path: /listleads/**
serviceId: ibizbusinesscentral-centralapi
stripPrefix: false
opportunitycompetitor:
path: /opportunitycompetitors/**
serviceId: ibizbusinesscentral-centralapi
stripPrefix: false
contact:
path: /contacts/**
serviceId: ibizbusinesscentral-centralapi
......
......@@ -124,6 +124,49 @@ public class OpportunityCompetitor extends EntityMP implements Serializable {
@JSONField(name = "entity2name")
@JsonProperty("entity2name")
private String entity2name;
/**
* 潜在顾客
*/
@TableField(exist = false)
@JSONField(name = "originatingleadid")
@JsonProperty("originatingleadid")
private String originatingleadid;
/**
* 潜在顾客
*/
@TableField(exist = false)
@JSONField(name = "originatingleadname")
@JsonProperty("originatingleadname")
private String originatingleadname;
/**
* 状态
*/
@TableField(exist = false)
@JSONField(name = "statecode")
@JsonProperty("statecode")
private Integer statecode;
/**
* 预计收入
*/
@TableField(exist = false)
@JSONField(name = "estimatedvalue")
@JsonProperty("estimatedvalue")
private BigDecimal estimatedvalue;
/**
* 预计结束日期
*/
@TableField(exist = false)
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "estimatedclosedate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("estimatedclosedate")
private Timestamp estimatedclosedate;
/**
* 实际收入
*/
@TableField(exist = false)
@JSONField(name = "actualvalue")
@JsonProperty("actualvalue")
private BigDecimal actualvalue;
/**
*
......
......@@ -210,6 +210,12 @@ public class OpportunityCompetitorServiceImpl extends ServiceImpl<OpportunityCom
opportunity=majorEntity;
}
et.setEntityname(opportunity.getOpportunityname());
et.setOriginatingleadid(opportunity.getOriginatingleadid());
et.setOriginatingleadname(opportunity.getOriginatingleadname());
et.setStatecode(opportunity.getStatecode());
et.setEstimatedvalue(opportunity.getEstimatedvalue());
et.setEstimatedclosedate(opportunity.getEstimatedclosedate());
et.setActualvalue(opportunity.getActualvalue());
}
}
......
......@@ -3182,7 +3182,7 @@
<!--输出实体[CONTACT]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-contact-229-43">
<changeSet author="a_LAB01_e85d8801c" id="tab-contact-230-43">
<createTable tableName="CONTACT">
<column name="ADDRESS1_FREIGHTTERMSCODE" remarks="" type="VARCHAR(30)">
</column>
......@@ -4514,7 +4514,7 @@
<!--输出实体[ACCOUNT]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-account-299-54">
<changeSet author="a_LAB01_e85d8801c" id="tab-account-301-54">
<createTable tableName="ACCOUNT">
<column name="ADDRESS1_PRIMARYCONTACTNAME" remarks="" type="VARCHAR(100)">
</column>
......@@ -8085,7 +8085,7 @@
<!--输出实体[COMPETITOR]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-competitor-16-89">
<changeSet author="a_LAB01_e85d8801c" id="tab-competitor-30-89">
<createTable tableName="COMPETITOR">
<column name="ENTITYIMAGE" remarks="" type="VARCHAR(100)">
</column>
......@@ -10400,7 +10400,7 @@
<!--输出实体[OPPORTUNITY]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-opportunity-54-121">
<changeSet author="a_LAB01_e85d8801c" id="tab-opportunity-62-121">
<createTable tableName="OPPORTUNITY">
<column name="DECISIONMAKER" remarks="" type="INT">
</column>
......@@ -11031,25 +11031,25 @@
<addForeignKeyConstraint baseColumnNames="TRANSACTIONCURRENCYID" baseTableName="MONTHLYFISCALCALENDAR" constraintName="DER1N_MONTHLYFISCALCALENDAR__T" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="TRANSACTIONCURRENCYID" referencedTableName="TRANSACTIONCURRENCY" validate="true"/>
</changeSet>
<!--输出实体[CONTACT]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-contact-229-214">
<changeSet author="a_LAB01_e85d8801c" id="fk-contact-230-214">
<addForeignKeyConstraint baseColumnNames="CUSTOMERID" baseTableName="CONTACT" constraintName="DER1N_CONTACT_ACCOUNT_CUSTOMER" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ACCOUNTID" referencedTableName="ACCOUNT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-contact-229-215">
<changeSet author="a_LAB01_e85d8801c" id="fk-contact-230-215">
<addForeignKeyConstraint baseColumnNames="PREFERREDEQUIPMENTID" baseTableName="CONTACT" constraintName="DER1N_CONTACT__EQUIPMENT__PREF" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EQUIPMENTID" referencedTableName="EQUIPMENT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-contact-229-216">
<changeSet author="a_LAB01_e85d8801c" id="fk-contact-230-216">
<addForeignKeyConstraint baseColumnNames="ORIGINATINGLEADID" baseTableName="CONTACT" constraintName="DER1N_CONTACT__LEAD__ORIGINATI" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="LEADID" referencedTableName="LEAD" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-contact-229-217">
<changeSet author="a_LAB01_e85d8801c" id="fk-contact-230-217">
<addForeignKeyConstraint baseColumnNames="DEFAULTPRICELEVELID" baseTableName="CONTACT" constraintName="DER1N_CONTACT__PRICELEVEL__DEF" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="PRICELEVELID" referencedTableName="PRICELEVEL" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-contact-229-218">
<changeSet author="a_LAB01_e85d8801c" id="fk-contact-230-218">
<addForeignKeyConstraint baseColumnNames="PREFERREDSERVICEID" baseTableName="CONTACT" constraintName="DER1N_CONTACT__SERVICE__PREFER" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="SERVICEID" referencedTableName="SERVICE" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-contact-229-219">
<changeSet author="a_LAB01_e85d8801c" id="fk-contact-230-219">
<addForeignKeyConstraint baseColumnNames="SLAID" baseTableName="CONTACT" constraintName="DER1N_CONTACT__SLA__SLAID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="SLAID" referencedTableName="SLA" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-contact-229-220">
<changeSet author="a_LAB01_e85d8801c" id="fk-contact-230-220">
<addForeignKeyConstraint baseColumnNames="TRANSACTIONCURRENCYID" baseTableName="CONTACT" constraintName="DER1N_CONTACT__TRANSACTIONCURR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="TRANSACTIONCURRENCYID" referencedTableName="TRANSACTIONCURRENCY" validate="true"/>
</changeSet>
<!--输出实体[TEAM]外键关系 -->
......@@ -11135,31 +11135,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-299-255">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-301-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-299-256">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-301-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-299-257">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-301-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-299-258">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-301-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-299-259">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-301-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-299-260">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-301-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-299-261">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-301-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-299-262">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-301-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-299-263">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-301-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]外键关系 -->
......@@ -11419,7 +11419,7 @@
<!--输出实体[CAMPAIGNLIST]外键关系 -->
<!--输出实体[LISTCONTACT]外键关系 -->
<!--输出实体[COMPETITOR]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-competitor-16-346">
<changeSet author="a_LAB01_e85d8801c" id="fk-competitor-30-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]外键关系 -->
......@@ -11619,25 +11619,25 @@
<!--输出实体[RELATIONSHIPS]外键关系 -->
<!--输出实体[CONNECTIONROLE]外键关系 -->
<!--输出实体[OPPORTUNITY]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-opportunity-54-406">
<changeSet author="a_LAB01_e85d8801c" id="fk-opportunity-62-406">
<addForeignKeyConstraint baseColumnNames="PARENTACCOUNTID" baseTableName="OPPORTUNITY" constraintName="DER1N_OPPORTUNITY__ACCOUNT__PA" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ACCOUNTID" referencedTableName="ACCOUNT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-opportunity-54-407">
<changeSet author="a_LAB01_e85d8801c" id="fk-opportunity-62-407">
<addForeignKeyConstraint baseColumnNames="CAMPAIGNID" baseTableName="OPPORTUNITY" constraintName="DER1N_OPPORTUNITY__CAMPAIGN__C" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="CAMPAIGNID" referencedTableName="CAMPAIGN" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-opportunity-54-408">
<changeSet author="a_LAB01_e85d8801c" id="fk-opportunity-62-408">
<addForeignKeyConstraint baseColumnNames="PARENTCONTACTID" baseTableName="OPPORTUNITY" constraintName="DER1N_OPPORTUNITY__CONTACT__PA" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="CONTACTID" referencedTableName="CONTACT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-opportunity-54-409">
<changeSet author="a_LAB01_e85d8801c" id="fk-opportunity-62-409">
<addForeignKeyConstraint baseColumnNames="ORIGINATINGLEADID" baseTableName="OPPORTUNITY" constraintName="DER1N_OPPORTUNITY__LEAD__ORIGI" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="LEADID" referencedTableName="LEAD" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-opportunity-54-410">
<changeSet author="a_LAB01_e85d8801c" id="fk-opportunity-62-410">
<addForeignKeyConstraint baseColumnNames="PRICELEVELID" baseTableName="OPPORTUNITY" constraintName="DER1N_OPPORTUNITY__PRICELEVEL_" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="PRICELEVELID" referencedTableName="PRICELEVEL" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-opportunity-54-411">
<changeSet author="a_LAB01_e85d8801c" id="fk-opportunity-62-411">
<addForeignKeyConstraint baseColumnNames="SLAID" baseTableName="OPPORTUNITY" constraintName="DER1N_OPPORTUNITY__SLA__SLAID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="SLAID" referencedTableName="SLA" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-opportunity-54-412">
<changeSet author="a_LAB01_e85d8801c" id="fk-opportunity-62-412">
<addForeignKeyConstraint baseColumnNames="TRANSACTIONCURRENCYID" baseTableName="OPPORTUNITY" constraintName="DER1N_OPPORTUNITY__TRANSACTION" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="TRANSACTIONCURRENCYID" referencedTableName="TRANSACTIONCURRENCY" validate="true"/>
</changeSet>
<!--输出实体[OPPORTUNITYCOMPETITOR]外键关系 -->
......
......@@ -5,7 +5,7 @@
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="OpportunityCompetitorResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`ENTITY2ID`, t1.`ENTITY2NAME`, t1.`ENTITYID`, t1.`ENTITYNAME`, t1.`RELATIONSHIPSID`, t1.`RELATIONSHIPSNAME`, t1.`RELATIONSHIPSTYPE`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `RELATIONSHIPS` t1 ) t1 where relationshipsid=#{id}]]>
<![CDATA[select t1.* from (SELECT t11.`ACTUALVALUE`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`ENTITY2ID`, t1.`ENTITY2NAME`, t1.`ENTITYID`, t1.`ENTITYNAME`, t11.`ESTIMATEDCLOSEDATE`, t11.`ESTIMATEDVALUE`, t11.`ORIGINATINGLEADID`, t11.`ORIGINATINGLEADNAME`, t1.`RELATIONSHIPSID`, t1.`RELATIONSHIPSNAME`, t1.`RELATIONSHIPSTYPE`, t11.`STATECODE`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `RELATIONSHIPS` t1 LEFT JOIN OPPORTUNITY t11 ON t1.ENTITYID = t11.OPPORTUNITYID ) t1 where relationshipsid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
......@@ -47,13 +47,13 @@
<!--数据查询[Default]-->
<sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`ENTITY2ID`, t1.`ENTITY2NAME`, t1.`ENTITYID`, t1.`ENTITYNAME`, t1.`RELATIONSHIPSID`, t1.`RELATIONSHIPSNAME`, t1.`RELATIONSHIPSTYPE`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `RELATIONSHIPS` t1
<![CDATA[ SELECT t11.`ACTUALVALUE`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`ENTITY2ID`, t1.`ENTITY2NAME`, t1.`ENTITYID`, t1.`ENTITYNAME`, t11.`ESTIMATEDCLOSEDATE`, t11.`ESTIMATEDVALUE`, t11.`ORIGINATINGLEADID`, t11.`ORIGINATINGLEADNAME`, t1.`RELATIONSHIPSID`, t1.`RELATIONSHIPSNAME`, t1.`RELATIONSHIPSTYPE`, t11.`STATECODE`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `RELATIONSHIPS` t1 LEFT JOIN OPPORTUNITY t11 ON t1.ENTITYID = t11.OPPORTUNITYID
WHERE ( t1.`RELATIONSHIPSTYPE` = 'OPPORTUNITYCOMPETITOR' )
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`ENTITY2ID`, t1.`ENTITY2NAME`, t1.`ENTITYID`, t1.`ENTITYNAME`, t1.`RELATIONSHIPSID`, t1.`RELATIONSHIPSNAME`, t1.`RELATIONSHIPSTYPE`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `RELATIONSHIPS` t1
<![CDATA[ SELECT t11.`ACTUALVALUE`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`ENTITY2ID`, t1.`ENTITY2NAME`, t1.`ENTITYID`, t1.`ENTITYNAME`, t11.`ESTIMATEDCLOSEDATE`, t11.`ESTIMATEDVALUE`, t11.`ORIGINATINGLEADID`, t11.`ORIGINATINGLEADNAME`, t1.`RELATIONSHIPSID`, t1.`RELATIONSHIPSNAME`, t1.`RELATIONSHIPSTYPE`, t11.`STATECODE`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `RELATIONSHIPS` t1 LEFT JOIN OPPORTUNITY t11 ON t1.ENTITYID = t11.OPPORTUNITYID
WHERE ( t1.`RELATIONSHIPSTYPE` = 'OPPORTUNITYCOMPETITOR' )
]]>
</sql>
......
......@@ -228,6 +228,14 @@
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
, {
"dename":"OpportunityCompetitor",
"delogicname":"商机对手",
"sysmoudle":{"id":"SALES","name":"Sales"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" },{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
, {
"dename":"Contact",
"delogicname":"联系人",
"sysmoudle":{"id":"BASE","name":"Base"},
......
......@@ -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:
......
package cn.ibizlab.businesscentral.centralapi.dto;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.math.BigInteger;
import java.util.Map;
import java.util.HashMap;
import java.io.Serializable;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import cn.ibizlab.businesscentral.util.domain.DTOBase;
import lombok.Data;
/**
* 服务DTO对象[OpportunityCompetitorDTO]
*/
@Data
public class OpportunityCompetitorDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [CREATEDATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "createdate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("createdate")
private Timestamp createdate;
/**
* 属性 [CREATEMAN]
*
*/
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 属性 [RELATIONSHIPSID]
*
*/
@JSONField(name = "relationshipsid")
@JsonProperty("relationshipsid")
private String relationshipsid;
/**
* 属性 [RELATIONSHIPSNAME]
*
*/
@JSONField(name = "relationshipsname")
@JsonProperty("relationshipsname")
private String relationshipsname;
/**
* 属性 [RELATIONSHIPSTYPE]
*
*/
@JSONField(name = "relationshipstype")
@JsonProperty("relationshipstype")
private String relationshipstype;
/**
* 属性 [UPDATEDATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "updatedate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("updatedate")
private Timestamp updatedate;
/**
* 属性 [UPDATEMAN]
*
*/
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 属性 [ENTITYID]
*
*/
@JSONField(name = "entityid")
@JsonProperty("entityid")
private String entityid;
/**
* 属性 [ENTITY2ID]
*
*/
@JSONField(name = "entity2id")
@JsonProperty("entity2id")
private String entity2id;
/**
* 属性 [ENTITYNAME]
*
*/
@JSONField(name = "entityname")
@JsonProperty("entityname")
private String entityname;
/**
* 属性 [ENTITY2NAME]
*
*/
@JSONField(name = "entity2name")
@JsonProperty("entity2name")
private String entity2name;
/**
* 属性 [ORIGINATINGLEADID]
*
*/
@JSONField(name = "originatingleadid")
@JsonProperty("originatingleadid")
private String originatingleadid;
/**
* 属性 [ORIGINATINGLEADNAME]
*
*/
@JSONField(name = "originatingleadname")
@JsonProperty("originatingleadname")
private String originatingleadname;
/**
* 属性 [STATECODE]
*
*/
@JSONField(name = "statecode")
@JsonProperty("statecode")
private Integer statecode;
/**
* 属性 [ESTIMATEDVALUE]
*
*/
@JSONField(name = "estimatedvalue")
@JsonProperty("estimatedvalue")
private BigDecimal estimatedvalue;
/**
* 属性 [ESTIMATEDCLOSEDATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "estimatedclosedate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("estimatedclosedate")
private Timestamp estimatedclosedate;
/**
* 属性 [ACTUALVALUE]
*
*/
@JSONField(name = "actualvalue")
@JsonProperty("actualvalue")
private BigDecimal actualvalue;
/**
* 设置 [RELATIONSHIPSNAME]
*/
public void setRelationshipsname(String relationshipsname){
this.relationshipsname = relationshipsname ;
this.modify("relationshipsname",relationshipsname);
}
/**
* 设置 [RELATIONSHIPSTYPE]
*/
public void setRelationshipstype(String relationshipstype){
this.relationshipstype = relationshipstype ;
this.modify("relationshipstype",relationshipstype);
}
/**
* 设置 [ENTITYID]
*/
public void setEntityid(String entityid){
this.entityid = entityid ;
this.modify("entityid",entityid);
}
/**
* 设置 [ENTITY2ID]
*/
public void setEntity2id(String entity2id){
this.entity2id = entity2id ;
this.modify("entity2id",entity2id);
}
/**
* 设置 [ENTITYNAME]
*/
public void setEntityname(String entityname){
this.entityname = entityname ;
this.modify("entityname",entityname);
}
/**
* 设置 [ENTITY2NAME]
*/
public void setEntity2name(String entity2name){
this.entity2name = entity2name ;
this.modify("entity2name",entity2name);
}
}
package cn.ibizlab.businesscentral.centralapi.mapping;
import org.mapstruct.*;
import cn.ibizlab.businesscentral.core.sales.domain.OpportunityCompetitor;
import cn.ibizlab.businesscentral.centralapi.dto.OpportunityCompetitorDTO;
import cn.ibizlab.businesscentral.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface OpportunityCompetitorMapping extends MappingBase<OpportunityCompetitorDTO, OpportunityCompetitor> {
}
package cn.ibizlab.businesscentral.centralapi.rest;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.ServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.StringUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.access.prepost.PostAuthorize;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import cn.ibizlab.businesscentral.centralapi.dto.*;
import cn.ibizlab.businesscentral.centralapi.mapping.*;
import cn.ibizlab.businesscentral.core.sales.domain.OpportunityCompetitor;
import cn.ibizlab.businesscentral.core.sales.service.IOpportunityCompetitorService;
import cn.ibizlab.businesscentral.core.sales.filter.OpportunityCompetitorSearchContext;
@Slf4j
@Api(tags = {"商机对手" })
@RestController("CentralApi-opportunitycompetitor")
@RequestMapping("")
public class OpportunityCompetitorResource {
@Autowired
public IOpportunityCompetitorService opportunitycompetitorService;
@Autowired
@Lazy
public OpportunityCompetitorMapping opportunitycompetitorMapping;
@PostAuthorize("hasPermission(this.opportunitycompetitorMapping.toDomain(returnObject.body),'iBizBusinessCentral-OpportunityCompetitor-Get')")
@ApiOperation(value = "获取商机对手", tags = {"商机对手" }, notes = "获取商机对手")
@RequestMapping(method = RequestMethod.GET, value = "/opportunitycompetitors/{opportunitycompetitor_id}")
public ResponseEntity<OpportunityCompetitorDTO> get(@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 = "/opportunitycompetitors/{opportunitycompetitor_id}")
@Transactional
public ResponseEntity<Boolean> remove(@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 = "/opportunitycompetitors/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
opportunitycompetitorService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "获取商机对手草稿", tags = {"商机对手" }, notes = "获取商机对手草稿")
@RequestMapping(method = RequestMethod.GET, value = "/opportunitycompetitors/getdraft")
public ResponseEntity<OpportunityCompetitorDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(opportunitycompetitorMapping.toDto(opportunitycompetitorService.getDraft(new OpportunityCompetitor())));
}
@PreAuthorize("hasPermission(this.opportunitycompetitorMapping.toDomain(#opportunitycompetitordto),'iBizBusinessCentral-OpportunityCompetitor-Save')")
@ApiOperation(value = "保存商机对手", tags = {"商机对手" }, notes = "保存商机对手")
@RequestMapping(method = RequestMethod.POST, value = "/opportunitycompetitors/save")
public ResponseEntity<Boolean> save(@RequestBody OpportunityCompetitorDTO opportunitycompetitordto) {
return ResponseEntity.status(HttpStatus.OK).body(opportunitycompetitorService.save(opportunitycompetitorMapping.toDomain(opportunitycompetitordto)));
}
@PreAuthorize("hasPermission(this.opportunitycompetitorMapping.toDomain(#opportunitycompetitordtos),'iBizBusinessCentral-OpportunityCompetitor-Save')")
@ApiOperation(value = "批量保存商机对手", tags = {"商机对手" }, notes = "批量保存商机对手")
@RequestMapping(method = RequestMethod.POST, value = "/opportunitycompetitors/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<OpportunityCompetitorDTO> opportunitycompetitordtos) {
opportunitycompetitorService.saveBatch(opportunitycompetitorMapping.toDomain(opportunitycompetitordtos));
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 = "/opportunitycompetitors")
@Transactional
public ResponseEntity<OpportunityCompetitorDTO> create(@RequestBody OpportunityCompetitorDTO opportunitycompetitordto) {
OpportunityCompetitor domain = opportunitycompetitorMapping.toDomain(opportunitycompetitordto);
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 = "/opportunitycompetitors/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<OpportunityCompetitorDTO> opportunitycompetitordtos) {
opportunitycompetitorService.createBatch(opportunitycompetitorMapping.toDomain(opportunitycompetitordtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "检查商机对手", tags = {"商机对手" }, notes = "检查商机对手")
@RequestMapping(method = RequestMethod.POST, value = "/opportunitycompetitors/checkkey")
public ResponseEntity<Boolean> checkKey(@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 = "/opportunitycompetitors/{opportunitycompetitor_id}")
@Transactional
public ResponseEntity<OpportunityCompetitorDTO> update(@PathVariable("opportunitycompetitor_id") String opportunitycompetitor_id, @RequestBody OpportunityCompetitorDTO opportunitycompetitordto) {
OpportunityCompetitor domain = opportunitycompetitorMapping.toDomain(opportunitycompetitordto);
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 = "/opportunitycompetitors/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<OpportunityCompetitorDTO> opportunitycompetitordtos) {
opportunitycompetitorService.updateBatch(opportunitycompetitorMapping.toDomain(opportunitycompetitordtos));
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="/opportunitycompetitors/fetchdefault")
public ResponseEntity<List<OpportunityCompetitorDTO>> fetchDefault(OpportunityCompetitorSearchContext context) {
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="/opportunitycompetitors/searchdefault")
public ResponseEntity<Page<OpportunityCompetitorDTO>> searchDefault(@RequestBody OpportunityCompetitorSearchContext context) {
Page<OpportunityCompetitor> domains = opportunitycompetitorService.searchDefault(context) ;
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 = "/competitors/{competitor_id}/opportunitycompetitors/{opportunitycompetitor_id}")
public ResponseEntity<OpportunityCompetitorDTO> getByCompetitor(@PathVariable("competitor_id") String competitor_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 = "/competitors/{competitor_id}/opportunitycompetitors/{opportunitycompetitor_id}")
@Transactional
public ResponseEntity<Boolean> removeByCompetitor(@PathVariable("competitor_id") String competitor_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 = "/competitors/{competitor_id}/opportunitycompetitors/batch")
public ResponseEntity<Boolean> removeBatchByCompetitor(@RequestBody List<String> ids) {
opportunitycompetitorService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "根据竞争对手获取商机对手草稿", tags = {"商机对手" }, notes = "根据竞争对手获取商机对手草稿")
@RequestMapping(method = RequestMethod.GET, value = "/competitors/{competitor_id}/opportunitycompetitors/getdraft")
public ResponseEntity<OpportunityCompetitorDTO> getDraftByCompetitor(@PathVariable("competitor_id") String competitor_id) {
OpportunityCompetitor domain = new OpportunityCompetitor();
domain.setEntity2id(competitor_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 = "/competitors/{competitor_id}/opportunitycompetitors/save")
public ResponseEntity<Boolean> saveByCompetitor(@PathVariable("competitor_id") String competitor_id, @RequestBody OpportunityCompetitorDTO opportunitycompetitordto) {
OpportunityCompetitor domain = opportunitycompetitorMapping.toDomain(opportunitycompetitordto);
domain.setEntity2id(competitor_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 = "/competitors/{competitor_id}/opportunitycompetitors/savebatch")
public ResponseEntity<Boolean> saveBatchByCompetitor(@PathVariable("competitor_id") String competitor_id, @RequestBody List<OpportunityCompetitorDTO> opportunitycompetitordtos) {
List<OpportunityCompetitor> domainlist=opportunitycompetitorMapping.toDomain(opportunitycompetitordtos);
for(OpportunityCompetitor domain:domainlist){
domain.setEntity2id(competitor_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 = "/competitors/{competitor_id}/opportunitycompetitors")
@Transactional
public ResponseEntity<OpportunityCompetitorDTO> createByCompetitor(@PathVariable("competitor_id") String competitor_id, @RequestBody OpportunityCompetitorDTO opportunitycompetitordto) {
OpportunityCompetitor domain = opportunitycompetitorMapping.toDomain(opportunitycompetitordto);
domain.setEntity2id(competitor_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 = "/competitors/{competitor_id}/opportunitycompetitors/batch")
public ResponseEntity<Boolean> createBatchByCompetitor(@PathVariable("competitor_id") String competitor_id, @RequestBody List<OpportunityCompetitorDTO> opportunitycompetitordtos) {
List<OpportunityCompetitor> domainlist=opportunitycompetitorMapping.toDomain(opportunitycompetitordtos);
for(OpportunityCompetitor domain:domainlist){
domain.setEntity2id(competitor_id);
}
opportunitycompetitorService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "根据竞争对手检查商机对手", tags = {"商机对手" }, notes = "根据竞争对手检查商机对手")
@RequestMapping(method = RequestMethod.POST, value = "/competitors/{competitor_id}/opportunitycompetitors/checkkey")
public ResponseEntity<Boolean> checkKeyByCompetitor(@PathVariable("competitor_id") String competitor_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 = "/competitors/{competitor_id}/opportunitycompetitors/{opportunitycompetitor_id}")
@Transactional
public ResponseEntity<OpportunityCompetitorDTO> updateByCompetitor(@PathVariable("competitor_id") String competitor_id, @PathVariable("opportunitycompetitor_id") String opportunitycompetitor_id, @RequestBody OpportunityCompetitorDTO opportunitycompetitordto) {
OpportunityCompetitor domain = opportunitycompetitorMapping.toDomain(opportunitycompetitordto);
domain.setEntity2id(competitor_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 = "/competitors/{competitor_id}/opportunitycompetitors/batch")
public ResponseEntity<Boolean> updateBatchByCompetitor(@PathVariable("competitor_id") String competitor_id, @RequestBody List<OpportunityCompetitorDTO> opportunitycompetitordtos) {
List<OpportunityCompetitor> domainlist=opportunitycompetitorMapping.toDomain(opportunitycompetitordtos);
for(OpportunityCompetitor domain:domainlist){
domain.setEntity2id(competitor_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="/competitors/{competitor_id}/opportunitycompetitors/fetchdefault")
public ResponseEntity<List<OpportunityCompetitorDTO>> fetchOpportunityCompetitorDefaultByCompetitor(@PathVariable("competitor_id") String competitor_id,OpportunityCompetitorSearchContext context) {
context.setN_entity2id_eq(competitor_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="/competitors/{competitor_id}/opportunitycompetitors/searchdefault")
public ResponseEntity<Page<OpportunityCompetitorDTO>> searchOpportunityCompetitorDefaultByCompetitor(@PathVariable("competitor_id") String competitor_id, @RequestBody OpportunityCompetitorSearchContext context) {
context.setN_entity2id_eq(competitor_id);
Page<OpportunityCompetitor> domains = opportunitycompetitorService.searchDefault(context) ;
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 = "/opportunities/{opportunity_id}/opportunitycompetitors/{opportunitycompetitor_id}")
public ResponseEntity<OpportunityCompetitorDTO> getByOpportunity(@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 = "/opportunities/{opportunity_id}/opportunitycompetitors/{opportunitycompetitor_id}")
@Transactional
public ResponseEntity<Boolean> removeByOpportunity(@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 = "/opportunities/{opportunity_id}/opportunitycompetitors/batch")
public ResponseEntity<Boolean> removeBatchByOpportunity(@RequestBody List<String> ids) {
opportunitycompetitorService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "根据商机获取商机对手草稿", tags = {"商机对手" }, notes = "根据商机获取商机对手草稿")
@RequestMapping(method = RequestMethod.GET, value = "/opportunities/{opportunity_id}/opportunitycompetitors/getdraft")
public ResponseEntity<OpportunityCompetitorDTO> getDraftByOpportunity(@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 = "/opportunities/{opportunity_id}/opportunitycompetitors/save")
public ResponseEntity<Boolean> saveByOpportunity(@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 = "/opportunities/{opportunity_id}/opportunitycompetitors/savebatch")
public ResponseEntity<Boolean> saveBatchByOpportunity(@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 = "/opportunities/{opportunity_id}/opportunitycompetitors")
@Transactional
public ResponseEntity<OpportunityCompetitorDTO> createByOpportunity(@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 = "/opportunities/{opportunity_id}/opportunitycompetitors/batch")
public ResponseEntity<Boolean> createBatchByOpportunity(@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 = "/opportunities/{opportunity_id}/opportunitycompetitors/checkkey")
public ResponseEntity<Boolean> checkKeyByOpportunity(@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 = "/opportunities/{opportunity_id}/opportunitycompetitors/{opportunitycompetitor_id}")
@Transactional
public ResponseEntity<OpportunityCompetitorDTO> updateByOpportunity(@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 = "/opportunities/{opportunity_id}/opportunitycompetitors/batch")
public ResponseEntity<Boolean> updateBatchByOpportunity(@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="/opportunities/{opportunity_id}/opportunitycompetitors/fetchdefault")
public ResponseEntity<List<OpportunityCompetitorDTO>> fetchOpportunityCompetitorDefaultByOpportunity(@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="/opportunities/{opportunity_id}/opportunitycompetitors/searchdefault")
public ResponseEntity<Page<OpportunityCompetitorDTO>> searchOpportunityCompetitorDefaultByOpportunity(@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()));
}
@PostAuthorize("hasPermission(this.opportunitycompetitorMapping.toDomain(returnObject.body),'iBizBusinessCentral-OpportunityCompetitor-Get')")
@ApiOperation(value = "根据联系人商机获取商机对手", tags = {"商机对手" }, notes = "根据联系人商机获取商机对手")
@RequestMapping(method = RequestMethod.GET, value = "/contacts/{contact_id}/opportunities/{opportunity_id}/opportunitycompetitors/{opportunitycompetitor_id}")
public ResponseEntity<OpportunityCompetitorDTO> getByContactOpportunity(@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 = "/contacts/{contact_id}/opportunities/{opportunity_id}/opportunitycompetitors/{opportunitycompetitor_id}")
@Transactional
public ResponseEntity<Boolean> removeByContactOpportunity(@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 = "/contacts/{contact_id}/opportunities/{opportunity_id}/opportunitycompetitors/batch")
public ResponseEntity<Boolean> removeBatchByContactOpportunity(@RequestBody List<String> ids) {
opportunitycompetitorService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "根据联系人商机获取商机对手草稿", tags = {"商机对手" }, notes = "根据联系人商机获取商机对手草稿")
@RequestMapping(method = RequestMethod.GET, value = "/contacts/{contact_id}/opportunities/{opportunity_id}/opportunitycompetitors/getdraft")
public ResponseEntity<OpportunityCompetitorDTO> getDraftByContactOpportunity(@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 = "/contacts/{contact_id}/opportunities/{opportunity_id}/opportunitycompetitors/save")
public ResponseEntity<Boolean> saveByContactOpportunity(@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 = "/contacts/{contact_id}/opportunities/{opportunity_id}/opportunitycompetitors/savebatch")
public ResponseEntity<Boolean> saveBatchByContactOpportunity(@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 = "/contacts/{contact_id}/opportunities/{opportunity_id}/opportunitycompetitors")
@Transactional
public ResponseEntity<OpportunityCompetitorDTO> createByContactOpportunity(@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 = "/contacts/{contact_id}/opportunities/{opportunity_id}/opportunitycompetitors/batch")
public ResponseEntity<Boolean> createBatchByContactOpportunity(@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 = "/contacts/{contact_id}/opportunities/{opportunity_id}/opportunitycompetitors/checkkey")
public ResponseEntity<Boolean> checkKeyByContactOpportunity(@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 = "/contacts/{contact_id}/opportunities/{opportunity_id}/opportunitycompetitors/{opportunitycompetitor_id}")
@Transactional
public ResponseEntity<OpportunityCompetitorDTO> updateByContactOpportunity(@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 = "/contacts/{contact_id}/opportunities/{opportunity_id}/opportunitycompetitors/batch")
public ResponseEntity<Boolean> updateBatchByContactOpportunity(@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="/contacts/{contact_id}/opportunities/{opportunity_id}/opportunitycompetitors/fetchdefault")
public ResponseEntity<List<OpportunityCompetitorDTO>> fetchOpportunityCompetitorDefaultByContactOpportunity(@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="/contacts/{contact_id}/opportunities/{opportunity_id}/opportunitycompetitors/searchdefault")
public ResponseEntity<Page<OpportunityCompetitorDTO>> searchOpportunityCompetitorDefaultByContactOpportunity(@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()));
}
@PostAuthorize("hasPermission(this.opportunitycompetitorMapping.toDomain(returnObject.body),'iBizBusinessCentral-OpportunityCompetitor-Get')")
@ApiOperation(value = "根据客户联系人商机获取商机对手", tags = {"商机对手" }, notes = "根据客户联系人商机获取商机对手")
@RequestMapping(method = RequestMethod.GET, value = "/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/opportunitycompetitors/{opportunitycompetitor_id}")
public ResponseEntity<OpportunityCompetitorDTO> getByAccountContactOpportunity(@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}/contacts/{contact_id}/opportunities/{opportunity_id}/opportunitycompetitors/{opportunitycompetitor_id}")
@Transactional
public ResponseEntity<Boolean> removeByAccountContactOpportunity(@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}/contacts/{contact_id}/opportunities/{opportunity_id}/opportunitycompetitors/batch")
public ResponseEntity<Boolean> removeBatchByAccountContactOpportunity(@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}/contacts/{contact_id}/opportunities/{opportunity_id}/opportunitycompetitors/getdraft")
public ResponseEntity<OpportunityCompetitorDTO> getDraftByAccountContactOpportunity(@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}/contacts/{contact_id}/opportunities/{opportunity_id}/opportunitycompetitors/save")
public ResponseEntity<Boolean> saveByAccountContactOpportunity(@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}/contacts/{contact_id}/opportunities/{opportunity_id}/opportunitycompetitors/savebatch")
public ResponseEntity<Boolean> saveBatchByAccountContactOpportunity(@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}/contacts/{contact_id}/opportunities/{opportunity_id}/opportunitycompetitors")
@Transactional
public ResponseEntity<OpportunityCompetitorDTO> createByAccountContactOpportunity(@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}/contacts/{contact_id}/opportunities/{opportunity_id}/opportunitycompetitors/batch")
public ResponseEntity<Boolean> createBatchByAccountContactOpportunity(@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}/contacts/{contact_id}/opportunities/{opportunity_id}/opportunitycompetitors/checkkey")
public ResponseEntity<Boolean> checkKeyByAccountContactOpportunity(@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}/contacts/{contact_id}/opportunities/{opportunity_id}/opportunitycompetitors/{opportunitycompetitor_id}")
@Transactional
public ResponseEntity<OpportunityCompetitorDTO> updateByAccountContactOpportunity(@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}/contacts/{contact_id}/opportunities/{opportunity_id}/opportunitycompetitors/batch")
public ResponseEntity<Boolean> updateBatchByAccountContactOpportunity(@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}/contacts/{contact_id}/opportunities/{opportunity_id}/opportunitycompetitors/fetchdefault")
public ResponseEntity<List<OpportunityCompetitorDTO>> fetchOpportunityCompetitorDefaultByAccountContactOpportunity(@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}/contacts/{contact_id}/opportunities/{opportunity_id}/opportunitycompetitors/searchdefault")
public ResponseEntity<Page<OpportunityCompetitorDTO>> searchOpportunityCompetitorDefaultByAccountContactOpportunity(@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()));
}
}
......@@ -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 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册