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

jackwang 部署微服务接口

上级 15a7098e
......@@ -37,11 +37,11 @@
git clone -b master $para2 ibizhumanresources/
export NODE_OPTIONS=--max-old-space-size=4096
cd ibizhumanresources/
mvn clean package -Ppim
cd humanresource-app/humanresource-app-pim
mvn -Ppim docker:build
mvn -Ppim docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/humanresource-app-pim.yaml iBizEE --with-registry-auth
mvn clean package -Phrapi
cd humanresource-provider/humanresource-provider-hrapi
mvn -Phrapi docker:build
mvn -Phrapi docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/humanresource-provider-hrapi.yaml iBizEE --with-registry-auth
</command>
</hudson.tasks.Shell>
</builders>
......
......@@ -12,6 +12,6 @@ CMD echo "The application will start in ${IBIZ_SLEEP}s..." && \
sleep ${IBIZ_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /humanresource-app-pim.jar
EXPOSE 10327
EXPOSE 8080
ADD humanresource-app-pim.jar /humanresource-app-pim.jar
......@@ -3,25 +3,9 @@ services:
humanresource-app-pim:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/humanresource-app-pim:latest
ports:
- "10327:10327"
- "8080:8080"
networks:
- agent_network
environment:
- SPRING_CLOUD_NACOS_DISCOVERY_IP=172.16.240.110
- SERVER_PORT=10327
- SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR=172.16.240.110:8848
- SPRING_REDIS_HOST=172.16.240.110
- 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&allowMultiQueries=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
- SEATA_REGISTRY_NACOS_SERVER-ADDR=172.16.240.110:8848
- SEATA_ENABLED=true
deploy:
resources:
limits:
......
......@@ -117,6 +117,21 @@ public class HROrgAddress extends EntityMP implements Serializable {
@JSONField(name = "mainaddress")
@JsonProperty("mainaddress")
private Integer mainaddress;
/**
* 组织
*/
@TableField(value = "hrorganizationid")
@JSONField(name = "hrorganizationid")
@JsonProperty("hrorganizationid")
private String hrorganizationid;
/**
* 组织
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.humanresource.core.base.domain.HROrganization hrorganization;
......@@ -160,6 +175,14 @@ public class HROrgAddress extends EntityMP implements Serializable {
this.modify("mainaddress",mainaddress);
}
/**
* 设置 [组织]
*/
public void setHrorganizationid(String hrorganizationid){
this.hrorganizationid = hrorganizationid ;
this.modify("hrorganizationid",hrorganizationid);
}
}
......
......@@ -110,6 +110,21 @@ public class HROrgContact extends EntityMP implements Serializable {
@JSONField(name = "maincontact")
@JsonProperty("maincontact")
private Integer maincontact;
/**
* 组织
*/
@TableField(value = "hrorganizationid")
@JSONField(name = "hrorganizationid")
@JsonProperty("hrorganizationid")
private String hrorganizationid;
/**
* 组织
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.humanresource.core.base.domain.HROrganization hrorganization;
......@@ -145,6 +160,14 @@ public class HROrgContact extends EntityMP implements Serializable {
this.modify("maincontact",maincontact);
}
/**
* 设置 [组织]
*/
public void setHrorganizationid(String hrorganizationid){
this.hrorganizationid = hrorganizationid ;
this.modify("hrorganizationid",hrorganizationid);
}
}
......
......@@ -41,6 +41,13 @@ public class HROrgAddressSearchContext extends QueryWrapperContext<HROrgAddress>
this.getSearchCond().eq("uses", n_uses_eq);
}
}
private String n_hrorganizationid_eq;//[组织]
public void setN_hrorganizationid_eq(String n_hrorganizationid_eq) {
this.n_hrorganizationid_eq = n_hrorganizationid_eq;
if(!ObjectUtils.isEmpty(this.n_hrorganizationid_eq)){
this.getSearchCond().eq("hrorganizationid", n_hrorganizationid_eq);
}
}
/**
* 启用快速搜索
......
......@@ -41,6 +41,13 @@ public class HROrgContactSearchContext extends QueryWrapperContext<HROrgContact>
this.getSearchCond().eq("contacttype", n_contacttype_eq);
}
}
private String n_hrorganizationid_eq;//[组织]
public void setN_hrorganizationid_eq(String n_hrorganizationid_eq) {
this.n_hrorganizationid_eq = n_hrorganizationid_eq;
if(!ObjectUtils.isEmpty(this.n_hrorganizationid_eq)){
this.getSearchCond().eq("hrorganizationid", n_hrorganizationid_eq);
}
}
/**
* 启用快速搜索
......
......@@ -62,4 +62,6 @@ public interface HROrgAddressMapper extends BaseMapper<HROrgAddress>{
@Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
List<HROrgAddress> selectByHrorganizationid(@Param("organizationid") Serializable organizationid) ;
}
......@@ -62,4 +62,6 @@ public interface HROrgContactMapper extends BaseMapper<HROrgContact>{
@Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
List<HROrgContact> selectByHrorganizationid(@Param("organizationid") Serializable organizationid) ;
}
......@@ -37,6 +37,8 @@ public interface IHROrgAddressService extends IService<HROrgAddress>{
boolean save(HROrgAddress et) ;
void saveBatch(List<HROrgAddress> list) ;
Page<HROrgAddress> searchDefault(HROrgAddressSearchContext context) ;
List<HROrgAddress> selectByHrorganizationid(String organizationid) ;
void removeByHrorganizationid(String organizationid) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
......
......@@ -37,6 +37,8 @@ public interface IHROrgContactService extends IService<HROrgContact>{
boolean save(HROrgContact et) ;
void saveBatch(List<HROrgContact> list) ;
Page<HROrgContact> searchDefault(HROrgContactSearchContext context) ;
List<HROrgContact> selectByHrorganizationid(String organizationid) ;
void removeByHrorganizationid(String organizationid) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
......
......@@ -45,6 +45,9 @@ import org.springframework.util.StringUtils;
@Service("HROrgAddressServiceImpl")
public class HROrgAddressServiceImpl extends ServiceImpl<HROrgAddressMapper, HROrgAddress> implements IHROrgAddressService {
@Autowired
@Lazy
protected cn.ibizlab.humanresource.core.base.service.IHROrganizationService hrorganizationService;
protected int batchSize = 500;
......@@ -140,6 +143,16 @@ public class HROrgAddressServiceImpl extends ServiceImpl<HROrgAddressMapper, HRO
}
@Override
public List<HROrgAddress> selectByHrorganizationid(String organizationid) {
return baseMapper.selectByHrorganizationid(organizationid);
}
@Override
public void removeByHrorganizationid(String organizationid) {
this.remove(new QueryWrapper<HROrgAddress>().eq("hrorganizationid",organizationid));
}
/**
* 查询集合 DEFAULT
......
......@@ -45,6 +45,9 @@ import org.springframework.util.StringUtils;
@Service("HROrgContactServiceImpl")
public class HROrgContactServiceImpl extends ServiceImpl<HROrgContactMapper, HROrgContact> implements IHROrgContactService {
@Autowired
@Lazy
protected cn.ibizlab.humanresource.core.base.service.IHROrganizationService hrorganizationService;
protected int batchSize = 500;
......@@ -140,6 +143,16 @@ public class HROrgContactServiceImpl extends ServiceImpl<HROrgContactMapper, HRO
}
@Override
public List<HROrgContact> selectByHrorganizationid(String organizationid) {
return baseMapper.selectByHrorganizationid(organizationid);
}
@Override
public void removeByHrorganizationid(String organizationid) {
this.remove(new QueryWrapper<HROrgContact>().eq("hrorganizationid",organizationid));
}
/**
* 查询集合 DEFAULT
......
......@@ -50,6 +50,12 @@ public class HROrganizationServiceImpl extends ServiceImpl<HROrganizationMapper,
protected cn.ibizlab.humanresource.core.humanresource.service.IHREmployeeService hremployeeService;
@Autowired
@Lazy
protected cn.ibizlab.humanresource.core.base.service.IHROrgAddressService hrorgaddressService;
@Autowired
@Lazy
protected cn.ibizlab.humanresource.core.base.service.IHROrgContactService hrorgcontactService;
@Autowired
@Lazy
protected cn.ibizlab.humanresource.core.base.service.IHROMHierarchyService hromhierarchyService;
protected int batchSize = 500;
......
......@@ -225,6 +225,8 @@
</column>
<column name="MAINADDRESS" remarks="" type="INT">
</column>
<column name="HRORGANIZATIONID" remarks="" type="VARCHAR(60)">
</column>
</createTable>
</changeSet>
......@@ -251,6 +253,8 @@
</column>
<column name="MAINCONTACT" remarks="" type="INT">
</column>
<column name="HRORGANIZATIONID" remarks="" type="VARCHAR(60)">
</column>
</createTable>
</changeSet>
......@@ -313,7 +317,13 @@
</changeSet>
<!--输出实体[HROPERATIONUNIT]外键关系 -->
<!--输出实体[HRORGADDRESS]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-hrorgaddress-27-19">
<addForeignKeyConstraint baseColumnNames="HRORGANIZATIONID" baseTableName="T_HRORGADDRESS" constraintName="DER1N_HRORGADDRESS_HRORGANIZAT" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ORGANIZATIONID" referencedTableName="ORGANIZATION" validate="true"/>
</changeSet>
<!--输出实体[HRORGCONTACT]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-hrorgcontact-23-20">
<addForeignKeyConstraint baseColumnNames="HRORGANIZATIONID" baseTableName="T_HRORGCONTACT" constraintName="DER1N_HRORGCONTACT_HRORGANIZAT" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ORGANIZATIONID" referencedTableName="ORGANIZATION" validate="true"/>
</changeSet>
<!--输出实体[HRORGANIZATION]外键关系 -->
</databaseChangeLog>
......@@ -5,16 +5,26 @@
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="HROrgAddressResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`ADDRESS`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`HRORGADDRESSID`, t1.`HRORGADDRESSNAME`, t1.`MAINADDRESS`, t1.`POSTCODE`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`USES` FROM `T_HRORGADDRESS` t1 ) t1 where hrorgaddressid=#{id}]]>
<![CDATA[select t1.* from (SELECT t1.`ADDRESS`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`HRORGADDRESSID`, t1.`HRORGADDRESSNAME`, t1.`HRORGANIZATIONID`, t1.`MAINADDRESS`, t1.`POSTCODE`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`USES` FROM `T_HRORGADDRESS` t1 ) t1 where hrorgaddressid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="HROrgAddressResultMap" type="cn.ibizlab.humanresource.core.base.domain.HROrgAddress" autoMapping="true">
<id property="hrorgaddressid" column="hrorgaddressid" /><!--主键字段映射-->
<result property="hrorganizationid" column="hrorganizationid" />
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="hrorganization" javaType="cn.ibizlab.humanresource.core.base.domain.HROrganization" column="hrorganizationid" select="cn.ibizlab.humanresource.core.base.mapper.HROrganizationMapper.selectById" fetchType="lazy"></association>
</resultMap>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_HRORGADDRESS_HRORGANIZATION_HRORGANIZATIONID_6BD9DC] -->
<select id="selectByHrorganizationid" resultMap="HROrgAddressResultMap">
select t1.* from (
<include refid="Default" />
) t1
where hrorganizationid=#{organizationid}
</select>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.humanresource.core.base.filter.HROrgAddressSearchContext" resultMap="HROrgAddressResultMap">
......@@ -27,12 +37,12 @@
<!--数据查询[Default]-->
<sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.`ADDRESS`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`HRORGADDRESSID`, t1.`HRORGADDRESSNAME`, t1.`MAINADDRESS`, t1.`POSTCODE`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`USES` FROM `T_HRORGADDRESS` t1
<![CDATA[ SELECT t1.`ADDRESS`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`HRORGADDRESSID`, t1.`HRORGADDRESSNAME`, t1.`HRORGANIZATIONID`, t1.`MAINADDRESS`, t1.`POSTCODE`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`USES` FROM `T_HRORGADDRESS` t1
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`ADDRESS`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`HRORGADDRESSID`, t1.`HRORGADDRESSNAME`, t1.`MAINADDRESS`, t1.`POSTCODE`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`USES` FROM `T_HRORGADDRESS` t1
<![CDATA[ SELECT t1.`ADDRESS`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`HRORGADDRESSID`, t1.`HRORGADDRESSNAME`, t1.`HRORGANIZATIONID`, t1.`MAINADDRESS`, t1.`POSTCODE`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`USES` FROM `T_HRORGADDRESS` t1
]]>
</sql>
</mapper>
......
......@@ -5,16 +5,26 @@
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="HROrgContactResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`CONTACTINFO`, t1.`CONTACTTYPE`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`HRORGCONTACTID`, t1.`HRORGCONTACTNAME`, t1.`MAINCONTACT`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `T_HRORGCONTACT` t1 ) t1 where hrorgcontactid=#{id}]]>
<![CDATA[select t1.* from (SELECT t1.`CONTACTINFO`, t1.`CONTACTTYPE`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`HRORGANIZATIONID`, t1.`HRORGCONTACTID`, t1.`HRORGCONTACTNAME`, t1.`MAINCONTACT`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `T_HRORGCONTACT` t1 ) t1 where hrorgcontactid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="HROrgContactResultMap" type="cn.ibizlab.humanresource.core.base.domain.HROrgContact" autoMapping="true">
<id property="hrorgcontactid" column="hrorgcontactid" /><!--主键字段映射-->
<result property="hrorganizationid" column="hrorganizationid" />
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="hrorganization" javaType="cn.ibizlab.humanresource.core.base.domain.HROrganization" column="hrorganizationid" select="cn.ibizlab.humanresource.core.base.mapper.HROrganizationMapper.selectById" fetchType="lazy"></association>
</resultMap>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_HRORGCONTACT_HRORGANIZATION_HRORGANIZATIONID_6BD9DC] -->
<select id="selectByHrorganizationid" resultMap="HROrgContactResultMap">
select t1.* from (
<include refid="Default" />
) t1
where hrorganizationid=#{organizationid}
</select>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.humanresource.core.base.filter.HROrgContactSearchContext" resultMap="HROrgContactResultMap">
......@@ -27,12 +37,12 @@
<!--数据查询[Default]-->
<sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.`CONTACTINFO`, t1.`CONTACTTYPE`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`HRORGCONTACTID`, t1.`HRORGCONTACTNAME`, t1.`MAINCONTACT`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `T_HRORGCONTACT` t1
<![CDATA[ SELECT t1.`CONTACTINFO`, t1.`CONTACTTYPE`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`HRORGANIZATIONID`, t1.`HRORGCONTACTID`, t1.`HRORGCONTACTNAME`, t1.`MAINCONTACT`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `T_HRORGCONTACT` t1
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`CONTACTINFO`, t1.`CONTACTTYPE`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`HRORGCONTACTID`, t1.`HRORGCONTACTNAME`, t1.`MAINCONTACT`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `T_HRORGCONTACT` t1
<![CDATA[ SELECT t1.`CONTACTINFO`, t1.`CONTACTTYPE`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`HRORGANIZATIONID`, t1.`HRORGCONTACTID`, t1.`HRORGCONTACTNAME`, t1.`MAINCONTACT`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `T_HRORGCONTACT` t1
]]>
</sql>
</mapper>
......
......@@ -12,6 +12,6 @@ CMD echo "The application will start in ${IBIZ_SLEEP}s..." && \
sleep ${IBIZ_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /humanresource-provider-hrapi.jar
EXPOSE 8081
EXPOSE 10317
ADD humanresource-provider-hrapi.jar /humanresource-provider-hrapi.jar
......@@ -3,9 +3,25 @@ services:
humanresource-provider-hrapi:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/humanresource-provider-hrapi:latest
ports:
- "8081:8081"
- "10317:10317"
networks:
- agent_network
environment:
- SPRING_CLOUD_NACOS_DISCOVERY_IP=172.16.240.110
- SERVER_PORT=10317
- SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR=172.16.240.110:8848
- SPRING_REDIS_HOST=172.16.240.110
- 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&allowMultiQueries=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
- SEATA_REGISTRY_NACOS_SERVER-ADDR=172.16.240.110:8848
- SEATA_ENABLED=true
deploy:
resources:
limits:
......
......@@ -105,6 +105,14 @@ public class HROrgAddressDTO extends DTOBase implements Serializable {
@JsonProperty("mainaddress")
private Integer mainaddress;
/**
* 属性 [HRORGANIZATIONID]
*
*/
@JSONField(name = "hrorganizationid")
@JsonProperty("hrorganizationid")
private String hrorganizationid;
/**
* 设置 [HRORGADDRESSNAME]
......@@ -146,6 +154,14 @@ public class HROrgAddressDTO extends DTOBase implements Serializable {
this.modify("mainaddress",mainaddress);
}
/**
* 设置 [HRORGANIZATIONID]
*/
public void setHrorganizationid(String hrorganizationid){
this.hrorganizationid = hrorganizationid ;
this.modify("hrorganizationid",hrorganizationid);
}
}
......@@ -97,6 +97,14 @@ public class HROrgContactDTO extends DTOBase implements Serializable {
@JsonProperty("maincontact")
private Integer maincontact;
/**
* 属性 [HRORGANIZATIONID]
*
*/
@JSONField(name = "hrorganizationid")
@JsonProperty("hrorganizationid")
private String hrorganizationid;
/**
* 设置 [HRORGCONTACTNAME]
......@@ -130,6 +138,14 @@ public class HROrgContactDTO extends DTOBase implements Serializable {
this.modify("maincontact",maincontact);
}
/**
* 设置 [HRORGANIZATIONID]
*/
public void setHrorganizationid(String hrorganizationid){
this.hrorganizationid = hrorganizationid ;
this.modify("hrorganizationid",hrorganizationid);
}
}
......@@ -160,5 +160,138 @@ public class HROrgAddressResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrorgaddressMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.hrorgaddressMapping.toDomain(#hrorgaddressdto),'iBizHumanResources-HROrgAddress-Create')")
@ApiOperation(value = "根据组织建立组织地址", tags = {"组织地址" }, notes = "根据组织建立组织地址")
@RequestMapping(method = RequestMethod.POST, value = "/hrorganizations/{hrorganization_id}/hrorgaddresses")
@Transactional
public ResponseEntity<HROrgAddressDTO> createByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @RequestBody HROrgAddressDTO hrorgaddressdto) {
HROrgAddress domain = hrorgaddressMapping.toDomain(hrorgaddressdto);
domain.setHrorganizationid(hrorganization_id);
hrorgaddressService.create(domain);
HROrgAddressDTO dto = hrorgaddressMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrorgaddressMapping.toDomain(#hrorgaddressdtos),'iBizHumanResources-HROrgAddress-Create')")
@ApiOperation(value = "根据组织批量建立组织地址", tags = {"组织地址" }, notes = "根据组织批量建立组织地址")
@RequestMapping(method = RequestMethod.POST, value = "/hrorganizations/{hrorganization_id}/hrorgaddresses/batch")
public ResponseEntity<Boolean> createBatchByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @RequestBody List<HROrgAddressDTO> hrorgaddressdtos) {
List<HROrgAddress> domainlist=hrorgaddressMapping.toDomain(hrorgaddressdtos);
for(HROrgAddress domain:domainlist){
domain.setHrorganizationid(hrorganization_id);
}
hrorgaddressService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "hrorgaddress" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.hrorgaddressService.get(#hrorgaddress_id),'iBizHumanResources-HROrgAddress-Update')")
@ApiOperation(value = "根据组织更新组织地址", tags = {"组织地址" }, notes = "根据组织更新组织地址")
@RequestMapping(method = RequestMethod.PUT, value = "/hrorganizations/{hrorganization_id}/hrorgaddresses/{hrorgaddress_id}")
@Transactional
public ResponseEntity<HROrgAddressDTO> updateByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @PathVariable("hrorgaddress_id") String hrorgaddress_id, @RequestBody HROrgAddressDTO hrorgaddressdto) {
HROrgAddress domain = hrorgaddressMapping.toDomain(hrorgaddressdto);
domain.setHrorganizationid(hrorganization_id);
domain.setHrorgaddressid(hrorgaddress_id);
hrorgaddressService.update(domain);
HROrgAddressDTO dto = hrorgaddressMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrorgaddressService.getHrorgaddressByEntities(this.hrorgaddressMapping.toDomain(#hrorgaddressdtos)),'iBizHumanResources-HROrgAddress-Update')")
@ApiOperation(value = "根据组织批量更新组织地址", tags = {"组织地址" }, notes = "根据组织批量更新组织地址")
@RequestMapping(method = RequestMethod.PUT, value = "/hrorganizations/{hrorganization_id}/hrorgaddresses/batch")
public ResponseEntity<Boolean> updateBatchByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @RequestBody List<HROrgAddressDTO> hrorgaddressdtos) {
List<HROrgAddress> domainlist=hrorgaddressMapping.toDomain(hrorgaddressdtos);
for(HROrgAddress domain:domainlist){
domain.setHrorganizationid(hrorganization_id);
}
hrorgaddressService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.hrorgaddressService.get(#hrorgaddress_id),'iBizHumanResources-HROrgAddress-Remove')")
@ApiOperation(value = "根据组织删除组织地址", tags = {"组织地址" }, notes = "根据组织删除组织地址")
@RequestMapping(method = RequestMethod.DELETE, value = "/hrorganizations/{hrorganization_id}/hrorgaddresses/{hrorgaddress_id}")
@Transactional
public ResponseEntity<Boolean> removeByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @PathVariable("hrorgaddress_id") String hrorgaddress_id) {
return ResponseEntity.status(HttpStatus.OK).body(hrorgaddressService.remove(hrorgaddress_id));
}
@PreAuthorize("hasPermission(this.hrorgaddressService.getHrorgaddressByIds(#ids),'iBizHumanResources-HROrgAddress-Remove')")
@ApiOperation(value = "根据组织批量删除组织地址", tags = {"组织地址" }, notes = "根据组织批量删除组织地址")
@RequestMapping(method = RequestMethod.DELETE, value = "/hrorganizations/{hrorganization_id}/hrorgaddresses/batch")
public ResponseEntity<Boolean> removeBatchByHROrganization(@RequestBody List<String> ids) {
hrorgaddressService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.hrorgaddressMapping.toDomain(returnObject.body),'iBizHumanResources-HROrgAddress-Get')")
@ApiOperation(value = "根据组织获取组织地址", tags = {"组织地址" }, notes = "根据组织获取组织地址")
@RequestMapping(method = RequestMethod.GET, value = "/hrorganizations/{hrorganization_id}/hrorgaddresses/{hrorgaddress_id}")
public ResponseEntity<HROrgAddressDTO> getByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @PathVariable("hrorgaddress_id") String hrorgaddress_id) {
HROrgAddress domain = hrorgaddressService.get(hrorgaddress_id);
HROrgAddressDTO dto = hrorgaddressMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据组织获取组织地址草稿", tags = {"组织地址" }, notes = "根据组织获取组织地址草稿")
@RequestMapping(method = RequestMethod.GET, value = "/hrorganizations/{hrorganization_id}/hrorgaddresses/getdraft")
public ResponseEntity<HROrgAddressDTO> getDraftByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id) {
HROrgAddress domain = new HROrgAddress();
domain.setHrorganizationid(hrorganization_id);
return ResponseEntity.status(HttpStatus.OK).body(hrorgaddressMapping.toDto(hrorgaddressService.getDraft(domain)));
}
@ApiOperation(value = "根据组织检查组织地址", tags = {"组织地址" }, notes = "根据组织检查组织地址")
@RequestMapping(method = RequestMethod.POST, value = "/hrorganizations/{hrorganization_id}/hrorgaddresses/checkkey")
public ResponseEntity<Boolean> checkKeyByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @RequestBody HROrgAddressDTO hrorgaddressdto) {
return ResponseEntity.status(HttpStatus.OK).body(hrorgaddressService.checkKey(hrorgaddressMapping.toDomain(hrorgaddressdto)));
}
@PreAuthorize("hasPermission(this.hrorgaddressMapping.toDomain(#hrorgaddressdto),'iBizHumanResources-HROrgAddress-Save')")
@ApiOperation(value = "根据组织保存组织地址", tags = {"组织地址" }, notes = "根据组织保存组织地址")
@RequestMapping(method = RequestMethod.POST, value = "/hrorganizations/{hrorganization_id}/hrorgaddresses/save")
public ResponseEntity<Boolean> saveByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @RequestBody HROrgAddressDTO hrorgaddressdto) {
HROrgAddress domain = hrorgaddressMapping.toDomain(hrorgaddressdto);
domain.setHrorganizationid(hrorganization_id);
return ResponseEntity.status(HttpStatus.OK).body(hrorgaddressService.save(domain));
}
@PreAuthorize("hasPermission(this.hrorgaddressMapping.toDomain(#hrorgaddressdtos),'iBizHumanResources-HROrgAddress-Save')")
@ApiOperation(value = "根据组织批量保存组织地址", tags = {"组织地址" }, notes = "根据组织批量保存组织地址")
@RequestMapping(method = RequestMethod.POST, value = "/hrorganizations/{hrorganization_id}/hrorgaddresses/savebatch")
public ResponseEntity<Boolean> saveBatchByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @RequestBody List<HROrgAddressDTO> hrorgaddressdtos) {
List<HROrgAddress> domainlist=hrorgaddressMapping.toDomain(hrorgaddressdtos);
for(HROrgAddress domain:domainlist){
domain.setHrorganizationid(hrorganization_id);
}
hrorgaddressService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizHumanResources-HROrgAddress-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HROrgAddress-Get')")
@ApiOperation(value = "根据组织获取DEFAULT", tags = {"组织地址" } ,notes = "根据组织获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/hrorganizations/{hrorganization_id}/hrorgaddresses/fetchdefault")
public ResponseEntity<List<HROrgAddressDTO>> fetchHROrgAddressDefaultByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id,HROrgAddressSearchContext context) {
context.setN_hrorganizationid_eq(hrorganization_id);
Page<HROrgAddress> domains = hrorgaddressService.searchDefault(context) ;
List<HROrgAddressDTO> list = hrorgaddressMapping.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','iBizHumanResources-HROrgAddress-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HROrgAddress-Get')")
@ApiOperation(value = "根据组织查询DEFAULT", tags = {"组织地址" } ,notes = "根据组织查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/hrorganizations/{hrorganization_id}/hrorgaddresses/searchdefault")
public ResponseEntity<Page<HROrgAddressDTO>> searchHROrgAddressDefaultByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @RequestBody HROrgAddressSearchContext context) {
context.setN_hrorganizationid_eq(hrorganization_id);
Page<HROrgAddress> domains = hrorgaddressService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrorgaddressMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
......@@ -160,5 +160,138 @@ public class HROrgContactResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrorgcontactMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.hrorgcontactMapping.toDomain(#hrorgcontactdto),'iBizHumanResources-HROrgContact-Create')")
@ApiOperation(value = "根据组织建立组织联系信息", tags = {"组织联系信息" }, notes = "根据组织建立组织联系信息")
@RequestMapping(method = RequestMethod.POST, value = "/hrorganizations/{hrorganization_id}/hrorgcontacts")
@Transactional
public ResponseEntity<HROrgContactDTO> createByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @RequestBody HROrgContactDTO hrorgcontactdto) {
HROrgContact domain = hrorgcontactMapping.toDomain(hrorgcontactdto);
domain.setHrorganizationid(hrorganization_id);
hrorgcontactService.create(domain);
HROrgContactDTO dto = hrorgcontactMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrorgcontactMapping.toDomain(#hrorgcontactdtos),'iBizHumanResources-HROrgContact-Create')")
@ApiOperation(value = "根据组织批量建立组织联系信息", tags = {"组织联系信息" }, notes = "根据组织批量建立组织联系信息")
@RequestMapping(method = RequestMethod.POST, value = "/hrorganizations/{hrorganization_id}/hrorgcontacts/batch")
public ResponseEntity<Boolean> createBatchByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @RequestBody List<HROrgContactDTO> hrorgcontactdtos) {
List<HROrgContact> domainlist=hrorgcontactMapping.toDomain(hrorgcontactdtos);
for(HROrgContact domain:domainlist){
domain.setHrorganizationid(hrorganization_id);
}
hrorgcontactService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "hrorgcontact" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.hrorgcontactService.get(#hrorgcontact_id),'iBizHumanResources-HROrgContact-Update')")
@ApiOperation(value = "根据组织更新组织联系信息", tags = {"组织联系信息" }, notes = "根据组织更新组织联系信息")
@RequestMapping(method = RequestMethod.PUT, value = "/hrorganizations/{hrorganization_id}/hrorgcontacts/{hrorgcontact_id}")
@Transactional
public ResponseEntity<HROrgContactDTO> updateByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @PathVariable("hrorgcontact_id") String hrorgcontact_id, @RequestBody HROrgContactDTO hrorgcontactdto) {
HROrgContact domain = hrorgcontactMapping.toDomain(hrorgcontactdto);
domain.setHrorganizationid(hrorganization_id);
domain.setHrorgcontactid(hrorgcontact_id);
hrorgcontactService.update(domain);
HROrgContactDTO dto = hrorgcontactMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.hrorgcontactService.getHrorgcontactByEntities(this.hrorgcontactMapping.toDomain(#hrorgcontactdtos)),'iBizHumanResources-HROrgContact-Update')")
@ApiOperation(value = "根据组织批量更新组织联系信息", tags = {"组织联系信息" }, notes = "根据组织批量更新组织联系信息")
@RequestMapping(method = RequestMethod.PUT, value = "/hrorganizations/{hrorganization_id}/hrorgcontacts/batch")
public ResponseEntity<Boolean> updateBatchByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @RequestBody List<HROrgContactDTO> hrorgcontactdtos) {
List<HROrgContact> domainlist=hrorgcontactMapping.toDomain(hrorgcontactdtos);
for(HROrgContact domain:domainlist){
domain.setHrorganizationid(hrorganization_id);
}
hrorgcontactService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.hrorgcontactService.get(#hrorgcontact_id),'iBizHumanResources-HROrgContact-Remove')")
@ApiOperation(value = "根据组织删除组织联系信息", tags = {"组织联系信息" }, notes = "根据组织删除组织联系信息")
@RequestMapping(method = RequestMethod.DELETE, value = "/hrorganizations/{hrorganization_id}/hrorgcontacts/{hrorgcontact_id}")
@Transactional
public ResponseEntity<Boolean> removeByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @PathVariable("hrorgcontact_id") String hrorgcontact_id) {
return ResponseEntity.status(HttpStatus.OK).body(hrorgcontactService.remove(hrorgcontact_id));
}
@PreAuthorize("hasPermission(this.hrorgcontactService.getHrorgcontactByIds(#ids),'iBizHumanResources-HROrgContact-Remove')")
@ApiOperation(value = "根据组织批量删除组织联系信息", tags = {"组织联系信息" }, notes = "根据组织批量删除组织联系信息")
@RequestMapping(method = RequestMethod.DELETE, value = "/hrorganizations/{hrorganization_id}/hrorgcontacts/batch")
public ResponseEntity<Boolean> removeBatchByHROrganization(@RequestBody List<String> ids) {
hrorgcontactService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.hrorgcontactMapping.toDomain(returnObject.body),'iBizHumanResources-HROrgContact-Get')")
@ApiOperation(value = "根据组织获取组织联系信息", tags = {"组织联系信息" }, notes = "根据组织获取组织联系信息")
@RequestMapping(method = RequestMethod.GET, value = "/hrorganizations/{hrorganization_id}/hrorgcontacts/{hrorgcontact_id}")
public ResponseEntity<HROrgContactDTO> getByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @PathVariable("hrorgcontact_id") String hrorgcontact_id) {
HROrgContact domain = hrorgcontactService.get(hrorgcontact_id);
HROrgContactDTO dto = hrorgcontactMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据组织获取组织联系信息草稿", tags = {"组织联系信息" }, notes = "根据组织获取组织联系信息草稿")
@RequestMapping(method = RequestMethod.GET, value = "/hrorganizations/{hrorganization_id}/hrorgcontacts/getdraft")
public ResponseEntity<HROrgContactDTO> getDraftByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id) {
HROrgContact domain = new HROrgContact();
domain.setHrorganizationid(hrorganization_id);
return ResponseEntity.status(HttpStatus.OK).body(hrorgcontactMapping.toDto(hrorgcontactService.getDraft(domain)));
}
@ApiOperation(value = "根据组织检查组织联系信息", tags = {"组织联系信息" }, notes = "根据组织检查组织联系信息")
@RequestMapping(method = RequestMethod.POST, value = "/hrorganizations/{hrorganization_id}/hrorgcontacts/checkkey")
public ResponseEntity<Boolean> checkKeyByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @RequestBody HROrgContactDTO hrorgcontactdto) {
return ResponseEntity.status(HttpStatus.OK).body(hrorgcontactService.checkKey(hrorgcontactMapping.toDomain(hrorgcontactdto)));
}
@PreAuthorize("hasPermission(this.hrorgcontactMapping.toDomain(#hrorgcontactdto),'iBizHumanResources-HROrgContact-Save')")
@ApiOperation(value = "根据组织保存组织联系信息", tags = {"组织联系信息" }, notes = "根据组织保存组织联系信息")
@RequestMapping(method = RequestMethod.POST, value = "/hrorganizations/{hrorganization_id}/hrorgcontacts/save")
public ResponseEntity<Boolean> saveByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @RequestBody HROrgContactDTO hrorgcontactdto) {
HROrgContact domain = hrorgcontactMapping.toDomain(hrorgcontactdto);
domain.setHrorganizationid(hrorganization_id);
return ResponseEntity.status(HttpStatus.OK).body(hrorgcontactService.save(domain));
}
@PreAuthorize("hasPermission(this.hrorgcontactMapping.toDomain(#hrorgcontactdtos),'iBizHumanResources-HROrgContact-Save')")
@ApiOperation(value = "根据组织批量保存组织联系信息", tags = {"组织联系信息" }, notes = "根据组织批量保存组织联系信息")
@RequestMapping(method = RequestMethod.POST, value = "/hrorganizations/{hrorganization_id}/hrorgcontacts/savebatch")
public ResponseEntity<Boolean> saveBatchByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @RequestBody List<HROrgContactDTO> hrorgcontactdtos) {
List<HROrgContact> domainlist=hrorgcontactMapping.toDomain(hrorgcontactdtos);
for(HROrgContact domain:domainlist){
domain.setHrorganizationid(hrorganization_id);
}
hrorgcontactService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizHumanResources-HROrgContact-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HROrgContact-Get')")
@ApiOperation(value = "根据组织获取DEFAULT", tags = {"组织联系信息" } ,notes = "根据组织获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/hrorganizations/{hrorganization_id}/hrorgcontacts/fetchdefault")
public ResponseEntity<List<HROrgContactDTO>> fetchHROrgContactDefaultByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id,HROrgContactSearchContext context) {
context.setN_hrorganizationid_eq(hrorganization_id);
Page<HROrgContact> domains = hrorgcontactService.searchDefault(context) ;
List<HROrgContactDTO> list = hrorgcontactMapping.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','iBizHumanResources-HROrgContact-searchDefault-all') and hasPermission(#context,'iBizHumanResources-HROrgContact-Get')")
@ApiOperation(value = "根据组织查询DEFAULT", tags = {"组织联系信息" } ,notes = "根据组织查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/hrorganizations/{hrorganization_id}/hrorgcontacts/searchdefault")
public ResponseEntity<Page<HROrgContactDTO>> searchHROrgContactDefaultByHROrganization(@PathVariable("hrorganization_id") String hrorganization_id, @RequestBody HROrgContactSearchContext context) {
context.setN_hrorganizationid_eq(hrorganization_id);
Page<HROrgContact> domains = hrorgcontactService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(hrorgcontactMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册