Commit 282cf5b7 authored by tianbo's avatar tianbo

Merge branch 'develop_tzs_register' of…

Merge branch 'develop_tzs_register' of http://39.98.45.134:8090/moa/amos-boot-biz into develop_tzs_register
parents 2845ccb3 38f0d238
...@@ -6,6 +6,7 @@ import lombok.Getter; ...@@ -6,6 +6,7 @@ import lombok.Getter;
public enum CyclinderStatus { public enum CyclinderStatus {
NOHEGE("3139","不合格"), NOHEGE("3139","不合格"),
NOT_UPLOAD("","未上传"),
HEGE("3140","合格"); HEGE("3140","合格");
private String code; private String code;
private String name; private String name;
......
...@@ -29,10 +29,12 @@ public interface CylCylinderFillingCheckMapper extends BaseMapper<CylinderFillin ...@@ -29,10 +29,12 @@ public interface CylCylinderFillingCheckMapper extends BaseMapper<CylinderFillin
List<CylinderInfo> getCylinderInfoList(); List<CylinderInfo> getCylinderInfoList();
void updateBatch(@Param("sequenceNbrS") List<Long> sequenceNbrS); void updateBatch(@Param("sequenceNbrS") List<Long> sequenceNbrS);
List<CylinderFilling> queryUnSyncFilling(); List<CylinderFilling> queryUnSyncFilling();
void updataSyncFilling(List<String> appIds,List<String> fillingBeforeIds,List<String> sequenceCodes);
void batchInsert(@Param("list") List<CylinderFilling> list); boolean updataSyncFilling(@Param("ids") List<Long> appIds);
boolean saveAndBatchInsert(@Param("list") List<CylinderFilling> list);
Long selectCountTotal(); Long selectCountTotal();
...@@ -40,5 +42,5 @@ public interface CylCylinderFillingCheckMapper extends BaseMapper<CylinderFillin ...@@ -40,5 +42,5 @@ public interface CylCylinderFillingCheckMapper extends BaseMapper<CylinderFillin
void batchInsertOrUpdate(@Param("list") List<CylinderFillingRecord> list); void batchInsertOrUpdate(@Param("list") List<CylinderFillingRecord> list);
void updateSyncState(@Param("appIds") List<String> appids, @Param("records")List<String> records); void updateSyncState(@Param("ids") List<Long> ids);
} }
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
<foreach collection="appIdList" item="item" index="index" open="(" close=")" separator=","> <foreach collection="appIdList" item="item" index="index" open="(" close=")" separator=",">
#{item} #{item}
</foreach> </foreach>
and filling_record_id in and filling_check_id in
<foreach collection="fillingCheckIdList" item="item" index="index" open="(" close=")" separator=","> <foreach collection="fillingCheckIdList" item="item" index="index" open="(" close=")" separator=",">
#{item} #{item}
</foreach> </foreach>
...@@ -71,16 +71,27 @@ ...@@ -71,16 +71,27 @@
<update id="updataSyncFilling"> <update id="updataSyncFilling">
update tm_cylinder_filling set sync_state = 3 update tm_cylinder_filling set sync_state = 3
<where> <where>
app_id in <!-- <if test="appIds != null and appIds.size() > 0">-->
<foreach collection="appIds" item="item" index="index" open="(" close=")" separator=","> <!-- app_id in-->
#{item} <!-- <foreach collection="appIds" item="appId" index="index" open="(" close=")" separator=",">-->
</foreach> <!-- #{appId}-->
and filling_before_id in <!-- </foreach>-->
<foreach collection="fillingBeforeIds" item="item" index="index" open="(" close=")" separator=","> <!-- </if>-->
#{item} <!-- <if test="fillingBeforeIds != null and fillingBeforeIds.size() > 0">-->
</foreach> <!-- and filling_before_id in-->
and sequence_code in <!-- <foreach collection="fillingBeforeIds" item="fillingBeforeId" index="index" open="(" close=")" separator=",">-->
<foreach collection="sequenceCodes" item="item" index="index" open="(" close=")" separator=","> <!-- #{fillingBeforeId}-->
<!-- </foreach>-->
<!-- </if>-->
<!-- <if test="sequenceCodes != null and sequenceCodes.size() > 0">-->
<!-- and sequence_code in-->
<!-- <foreach collection="sequenceCodes" item="sequenceCode" index="index" open="(" close=")" separator=",">-->
<!-- #{sequenceCode}-->
<!-- </foreach>-->
<!-- </if>-->
sequence_nbr in
<foreach collection="ids" item="item" index="index" open="(" close=")" separator=",">
#{item} #{item}
</foreach> </foreach>
</where> </where>
...@@ -122,13 +133,17 @@ ...@@ -122,13 +133,17 @@
) / 16 AS DECIMAL(10, 2) ) / 16 AS DECIMAL(10, 2)
) integrity ) integrity
FROM tm_cylinder_filling cf FROM tm_cylinder_filling cf
WHERE cf.sync_state != 3 WHERE
ORDER BY cf.sync_state != 3
cf.sync_date DESC and cf.filling_before_id is not null
LIMIT 10 and cf.sequence_code is not null
and cf.app_id is not null
LIMIT 1000
</select> </select>
<insert id="batchInsert"> <insert id="saveAndBatchInsert">
INSERT INTO tz_cylinder_filling ( INSERT INTO "amos_tzs_biz"."tz_cylinder_filling"
(
sequence_nbr, sequence_nbr,
filling_before_id, filling_before_id,
filling_unit_name, filling_unit_name,
...@@ -158,8 +173,8 @@ ...@@ -158,8 +173,8 @@
#{item.sequenceNbr}, #{item.sequenceNbr},
#{item.fillingBeforeId}, #{item.fillingBeforeId},
#{item.fillingUnitName}, #{item.fillingUnitName},
#{item.isValid},
#{item.sequenceCode}, #{item.sequenceCode},
#{item.isValid},
#{item.same}, #{item.same},
#{item.isRegulations}, #{item.isRegulations},
#{item.isComplianceWithgbt}, #{item.isComplianceWithgbt},
...@@ -171,7 +186,7 @@ ...@@ -171,7 +186,7 @@
#{item.recDate}, #{item.recDate},
#{item.recUserId}, #{item.recUserId},
#{item.syncDate}, #{item.syncDate},
#{item.syncState}, '3',
#{item.appId}, #{item.appId},
#{item.integrity}, #{item.integrity},
#{item.creditCode}, #{item.creditCode},
...@@ -206,38 +221,29 @@ ...@@ -206,38 +221,29 @@
nonconformances = EXCLUDED.nonconformances nonconformances = EXCLUDED.nonconformances
</insert> </insert>
<select id="selectCountTotal" resultType="java.lang.Long"> <select id="selectCountTotal" resultType="java.lang.Long">
SELECT COUNT SELECT
( 1 ) count(1)
FROM FROM
( tm_cylinder_filling_record cfr
SELECT WHERE
sequence_nbr sync_state != 3
FROM
tm_cylinder_filling_record cfr
WHERE
sync_state != 3
AND filling_record_id is not null AND filling_record_id is not null
GROUP BY
cfr.app_id,
cfr.filling_record_id
)
</select> </select>
<select id="fillingRecordSyncRecords" <select id="fillingRecordSyncRecords"
resultType="com.yeejoin.amos.boot.module.cylinder.flc.api.entity.CylinderFillingRecord"> resultType="com.yeejoin.amos.boot.module.cylinder.flc.api.entity.CylinderFillingRecord">
SELECT SELECT
cfr.*, cfr.*,
'3' sync_state_str,
CAST (( CAST ((
( filling_record_id IS NOT NULL ) + ( filling_before_id IS NOT NULL ) + ( filling_check_id IS NOT NULL ) + ( filling_examine_id IS NOT NULL ) + ( filling_startTime IS NOT NULL ) + ( filling_endTime IS NOT NULL ) + ( filling_user IS NOT NULL ) + ( inspector_name IS NOT NULL ) + ( filling_quantity IS NOT NULL ) + ( temperature IS NOT NULL ) + ( abnormal IS NOT NULL ) ( filling_record_id IS NOT NULL ) + ( filling_before_id IS NOT NULL ) + ( filling_check_id IS NOT NULL ) + ( filling_examine_id IS NOT NULL ) + ( filling_startTime IS NOT NULL ) + ( filling_endTime IS NOT NULL ) + ( filling_user IS NOT NULL ) + ( inspector_name IS NOT NULL ) + ( filling_quantity IS NOT NULL ) + ( temperature IS NOT NULL ) + ( abnormal IS NOT NULL )
) / 11 AS DECIMAL ( 10, 2 )) integrity ) / 11 AS DECIMAL ( 10, 2 )) integrity
FROM tm_cylinder_filling_record cfr where sync_state !=3 and filling_record_id is not null FROM tm_cylinder_filling_record cfr where sync_state !=3 and filling_record_id is not null
ORDER BY cfr.sync_date
LIMIT 5000 LIMIT 1000
</select> </select>
<insert id="batchInsertOrUpdate" > <insert id="batchInsertOrUpdate" >
INSERT INTO tz_cylinder_filling_record_2210 (sequence_nbr, INSERT INTO tz_cylinder_filling_record (sequence_nbr,
filling_record_id, filling_record_id,
filling_starttime, filling_starttime,
filling_endtime, filling_endtime,
...@@ -307,14 +313,14 @@ ...@@ -307,14 +313,14 @@
<update id="updateSyncState"> <update id="updateSyncState">
update tm_cylinder_filling_record set sync_state = 3 update tm_cylinder_filling_record set sync_state = 3
<where> <where>
app_id in sequence_nbr in
<foreach collection="appIds" item="item" index="index" open="(" close=")" separator=","> <foreach collection="ids" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
and filling_record_id in
<foreach collection="records" item="item" index="index" open="(" close=")" separator=",">
#{item} #{item}
</foreach> </foreach>
<!-- and filling_record_id in-->
<!-- <foreach collection="records" item="item" index="index" open="(" close=")" separator=",">-->
<!-- #{item}-->
<!-- </foreach>-->
</where> </where>
</update> </update>
</mapper> </mapper>
...@@ -34,6 +34,7 @@ import org.elasticsearch.client.RestHighLevelClient; ...@@ -34,6 +34,7 @@ import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.index.query.BoolQueryBuilder; import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.search.builder.SearchSourceBuilder; import org.elasticsearch.search.builder.SearchSourceBuilder;
import org.elasticsearch.search.sort.SortOrder;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -973,6 +974,7 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind ...@@ -973,6 +974,7 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
} }
builder.query(boolMust); builder.query(boolMust);
builder.sort("sequenceNbr",SortOrder.DESC);
builder.from((pageNum - 1) * pageSize); builder.from((pageNum - 1) * pageSize);
builder.size(pageSize); builder.size(pageSize);
builder.trackTotalHits(true); builder.trackTotalHits(true);
......
...@@ -54,8 +54,8 @@ public class CylinderSyncServiceImpl { ...@@ -54,8 +54,8 @@ public class CylinderSyncServiceImpl {
return fillingCheckMapper.queryUnSyncFilling(); return fillingCheckMapper.queryUnSyncFilling();
} }
public void updataSyncFilling(List<String> appIds,List<String> fillingBeforeIds,List<String> sequenceCodes){ public boolean updataSyncFilling(List<Long> ids){
fillingCheckMapper.updataSyncFilling(appIds,fillingBeforeIds,sequenceCodes); return fillingCheckMapper.updataSyncFilling(ids);
} }
public Long fillingRecordSync(){ public Long fillingRecordSync(){
...@@ -66,7 +66,7 @@ public class CylinderSyncServiceImpl { ...@@ -66,7 +66,7 @@ public class CylinderSyncServiceImpl {
return fillingCheckMapper.fillingRecordSyncRecords(); return fillingCheckMapper.fillingRecordSyncRecords();
} }
public void updateSyncState(List<String> appIds, List<String> records){ public void updateSyncState(List<Long> ids){
fillingCheckMapper.updateSyncState(appIds, records); fillingCheckMapper.updateSyncState(ids);
} }
} }
\ No newline at end of file
...@@ -183,8 +183,8 @@ public class TzCylinderServiceImpl extends BaseService<TzCylinderInfoDto, Cylind ...@@ -183,8 +183,8 @@ public class TzCylinderServiceImpl extends BaseService<TzCylinderInfoDto, Cylind
} }
for (TzCylinderFillingDto tzCylinderFillingDto : tzCylinderFillingDtoList) { for (TzCylinderFillingDto tzCylinderFillingDto : tzCylinderFillingDtoList) {
if (ValidationUtil.isEmpty(tzCylinderFillingDto.getTzCylinderAfterCheckDtoList())) { // 充装后复查记录没有默认不合格 if (ValidationUtil.isEmpty(tzCylinderFillingDto.getTzCylinderAfterCheckDtoList())) { // 充装后复查记录没有默认未上传
tzCylinderFillingDto.setCheckResultsAfter(CyclinderStatus.NOHEGE.getName()); tzCylinderFillingDto.setCheckResultsAfter(CyclinderStatus.NOT_UPLOAD.getName());
} else { } else {
List<TzCylinderCheckDto> collect = tzCylinderFillingDto.getTzCylinderAfterCheckDtoList().stream().filter(dto -> dto.getResult().equals("0")).collect(Collectors.toList()); List<TzCylinderCheckDto> collect = tzCylinderFillingDto.getTzCylinderAfterCheckDtoList().stream().filter(dto -> dto.getResult().equals("0")).collect(Collectors.toList());
if (collect.size() != 0) { if (collect.size() != 0) {
......
...@@ -19,12 +19,12 @@ eureka.client.service-url.defaultZone=http://172.16.10.210:10001/eureka/ ...@@ -19,12 +19,12 @@ eureka.client.service-url.defaultZone=http://172.16.10.210:10001/eureka/
eureka.instance.prefer-ip-address=true eureka.instance.prefer-ip-address=true
management.endpoint.health.show-details=always management.endpoint.health.show-details=always
management.endpoints.web.exposure.include=* management.endpoints.web.exposure.include=*
eureka.instance.health-check-url=http://172.16.3.89:${server.port}${server.servlet.context-path}/actuator/health eureka.instance.health-check-url=http://172.16.3.17:${server.port}${server.servlet.context-path}/actuator/health
eureka.instance.metadata-map.management.context-path=${server.servlet.context-path}/actuator eureka.instance.metadata-map.management.context-path=${server.servlet.context-path}/actuator
eureka.instance.status-page-url=http://172.16.3.89:${server.port}${server.servlet.context-path}/actuator/info eureka.instance.status-page-url=http://172.16.3.17:${server.port}${server.servlet.context-path}/actuator/info
eureka.instance.metadata-map.management.api-docs=http://172.16.3.89:${server.port}${server.servlet.context-path}/doc\ eureka.instance.metadata-map.management.api-docs=http://172.16.3.17:${server.port}${server.servlet.context-path}/doc\
.html .html
eureka.instance.ip-address=172.16.3.89 eureka.instance.ip-address=172.16.3.17
## ES properties: ## ES properties:
elasticsearch.username=elastic elasticsearch.username=elastic
elasticsearch.password=a123456 elasticsearch.password=a123456
......
spring.application.name=TZS-CYLINDER spring.application.name=TZS-CYLINDER
server.servlet.context-path=/cylinder server.servlet.context-path=/cylinder
server.port=11003 server.port=11003
spring.profiles.active=dev spring.profiles.active=cyl
spring.jackson.time-zone=GMT+8 spring.jackson.time-zone=GMT+8
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
......
package com.yeejoin.amos.boot.module.tcm.api.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "GroupAndPersonInfoDto", description = "用户组及组内用户相关信息")
public class GroupAndPersonInfoDto {
/**
* 组id
*/
@ApiModelProperty(value = "组id")
private Long groupId;
/**
* 组名称
*/
@ApiModelProperty(value = "组名称")
private String groupName;
/**
* 人员名称
*/
@ApiModelProperty(value = "人员名称")
private String userName;
/**
* 人员id
*/
@ApiModelProperty(value = "人员id")
private String userId;
/**
* 所在单位名称
*/
@ApiModelProperty(value = "所在单位名称")
private String unitName;
/**
* 所在单位统一信用代码
*/
@ApiModelProperty(value = "所在单位统一信用代码")
private String unitCode;
/**
* 企业类型
*/
@ApiModelProperty(value = "企业类型")
private String unitType;
/**
* 企业类型编码
*/
@ApiModelProperty(value = "企业类型编码")
private String unitTypeCode;
/**
* 企业涉及设备类型
*/
@ApiModelProperty(value = "企业涉及设备类型")
private String equipCategory;
/**
* 企业涉及设备类型编码
*/
@ApiModelProperty(value = "企业涉及设备类型编码")
private String equipCategoryCode;
}
package com.yeejoin.amos.boot.module.tcm.api.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.HashMap;
import java.util.Map;
@AllArgsConstructor
@Getter
public enum UnitTypeEnum {
/**
* *注册单位类型
*/
sydw("使用单位", "1232"),
czdw("充装单位", "1231"),
jyjcjg("检验检测机构", "1233"),
azgzwxdw("安装改造维修单位", "1234"),
zzdw("制造单位", "1236"),
sjdw("设计单位", "1235"),
grzt("个人主体", "6599");
private String name;
private String code;
public static Map<String, String> getName = new HashMap<>();
public static Map<String, String> getCode = new HashMap<>();
static {
for (UnitTypeEnum e : UnitTypeEnum.values()) {
getName.put(e.code, e.name);
getCode.put(e.name, e.code);
}
}
}
...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.tcm.api.mapper; ...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.tcm.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.tcm.api.dto.GroupAndPersonInfoDto;
import com.yeejoin.amos.boot.module.tcm.api.dto.TzsEquipListDto; import com.yeejoin.amos.boot.module.tcm.api.dto.TzsEquipListDto;
import com.yeejoin.amos.boot.module.tcm.api.dto.TzsUserInfoDto; import com.yeejoin.amos.boot.module.tcm.api.dto.TzsUserInfoDto;
import com.yeejoin.amos.boot.module.tcm.api.entity.TzsUserInfo; import com.yeejoin.amos.boot.module.tcm.api.entity.TzsUserInfo;
...@@ -23,4 +24,6 @@ public interface TzsUserInfoMapper extends BaseMapper<TzsUserInfo> { ...@@ -23,4 +24,6 @@ public interface TzsUserInfoMapper extends BaseMapper<TzsUserInfo> {
@Param("companyCode") String companyCode, @Param("companyCode") String companyCode,
@Param("userSeq") String userSeq, @Param("userSeq") String userSeq,
@Param("dto") TzsEquipListDto dto); @Param("dto") TzsEquipListDto dto);
GroupAndPersonInfoDto getUnitInfoByUserId(String userId);
} }
...@@ -3,10 +3,12 @@ package com.yeejoin.amos.boot.module.tcm.api.service; ...@@ -3,10 +3,12 @@ package com.yeejoin.amos.boot.module.tcm.api.service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yeejoin.amos.boot.module.tcm.api.dto.GroupAndPersonInfoDto;
import com.yeejoin.amos.boot.module.tcm.api.dto.TzsEquipListDto; import com.yeejoin.amos.boot.module.tcm.api.dto.TzsEquipListDto;
import com.yeejoin.amos.boot.module.tcm.api.dto.TzsUserInfoDto; import com.yeejoin.amos.boot.module.tcm.api.dto.TzsUserInfoDto;
import com.yeejoin.amos.boot.module.tcm.api.entity.TzsUserInfo; import com.yeejoin.amos.boot.module.tcm.api.entity.TzsUserInfo;
import com.yeejoin.amos.boot.module.tcm.api.entity.TzsUserQualifications; import com.yeejoin.amos.boot.module.tcm.api.entity.TzsUserQualifications;
import com.yeejoin.amos.feign.privilege.model.GroupModel;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -39,4 +41,10 @@ public interface ITzsUserInfoService extends IService<TzsUserInfo> { ...@@ -39,4 +41,10 @@ public interface ITzsUserInfoService extends IService<TzsUserInfo> {
Boolean equipBind(String type, String userSeq, String creditCode, Map<String,Object> map); Boolean equipBind(String type, String userSeq, String creditCode, Map<String,Object> map);
List<TzsUserInfo> getSafetyList(String companyCode); List<TzsUserInfo> getSafetyList(String companyCode);
List<Map<String,Object>> getGroupList();
Map<String,Object> getPersonType();
List<GroupAndPersonInfoDto> getGroupAndPersonInfo(Long groupId);
} }
...@@ -152,4 +152,17 @@ ...@@ -152,4 +152,17 @@
</if> </if>
</select> </select>
<select id="getUnitInfoByUserId" resultType="com.yeejoin.amos.boot.module.tcm.api.dto.GroupAndPersonInfoDto">
SELECT
tui.unit_name,
tui.unit_code,
replace(tzei.unit_type,'#', ',') unitType,
tzei.equip_category
FROM
tzs_user_info tui
LEFT JOIN tz_base_enterprise_info tzei ON tui.unit_code = tzei.use_code
WHERE
amos_user_id = #{userId}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -8,6 +8,7 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams; ...@@ -8,6 +8,7 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.tcm.api.dto.GroupAndPersonInfoDto;
import com.yeejoin.amos.boot.module.tcm.api.dto.TzsEquipListDto; import com.yeejoin.amos.boot.module.tcm.api.dto.TzsEquipListDto;
import com.yeejoin.amos.boot.module.tcm.api.dto.TzsUserInfoDto; import com.yeejoin.amos.boot.module.tcm.api.dto.TzsUserInfoDto;
import com.yeejoin.amos.boot.module.tcm.api.entity.TzsUserInfo; import com.yeejoin.amos.boot.module.tcm.api.entity.TzsUserInfo;
...@@ -16,6 +17,7 @@ import com.yeejoin.amos.boot.module.tcm.biz.service.impl.TzsUserInfoServiceImpl; ...@@ -16,6 +17,7 @@ import com.yeejoin.amos.boot.module.tcm.biz.service.impl.TzsUserInfoServiceImpl;
import com.yeejoin.amos.component.feign.utils.FeignUtil; import com.yeejoin.amos.component.feign.utils.FeignUtil;
import com.yeejoin.amos.feign.privilege.Privilege; import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.CompanyModel; import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import com.yeejoin.amos.feign.privilege.model.GroupModel;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -229,4 +231,30 @@ public class TzsUserInfoController extends BaseController { ...@@ -229,4 +231,30 @@ public class TzsUserInfoController extends BaseController {
return ResponseHelper.buildResponse(tzsUserInfoService.getSafetyList(companyCode)); return ResponseHelper.buildResponse(tzsUserInfoService.getSafetyList(companyCode));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getGroupList")
@ApiOperation(httpMethod = "GET", value = "两个规定用户组列表查询", notes = "两个规定用户组列表查询")
public ResponseModel<List<Map<String, Object>>> getGroupList() {
return ResponseHelper.buildResponse(tzsUserInfoService.getGroupList());
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getPersonType")
@ApiOperation(httpMethod = "GET", value = "获取当前登录人人员类型", notes = "获取当前登录人人员类型")
public ResponseModel<Map<String,Object>> getPersonType() {
return ResponseHelper.buildResponse(tzsUserInfoService.getPersonType());
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getGroupAndPersonInfo")
@ApiOperation(httpMethod = "GET", value = "通过组id查询组及组内人员信息", notes = "通过组id查询组及组内人员信息")
public ResponseModel<List<GroupAndPersonInfoDto>> getGroupAndPersonInfo(@RequestParam(value = "groupId") Long groupId) {
return ResponseHelper.buildResponse(tzsUserInfoService.getGroupAndPersonInfo(groupId));
}
} }
...@@ -12,10 +12,12 @@ import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl; ...@@ -12,10 +12,12 @@ import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.tcm.api.dto.ESEquipmentCategoryDto; import com.yeejoin.amos.boot.module.tcm.api.dto.ESEquipmentCategoryDto;
import com.yeejoin.amos.boot.module.tcm.api.dto.GroupAndPersonInfoDto;
import com.yeejoin.amos.boot.module.tcm.api.dto.TzsEquipListDto; import com.yeejoin.amos.boot.module.tcm.api.dto.TzsEquipListDto;
import com.yeejoin.amos.boot.module.tcm.api.dto.TzsUserInfoDto; import com.yeejoin.amos.boot.module.tcm.api.dto.TzsUserInfoDto;
import com.yeejoin.amos.boot.module.tcm.api.entity.*; import com.yeejoin.amos.boot.module.tcm.api.entity.*;
import com.yeejoin.amos.boot.module.tcm.api.enums.EquipmentClassifityEnum; import com.yeejoin.amos.boot.module.tcm.api.enums.EquipmentClassifityEnum;
import com.yeejoin.amos.boot.module.tcm.api.enums.UnitTypeEnum;
import com.yeejoin.amos.boot.module.tcm.api.mapper.TzsUserEquipMapper; import com.yeejoin.amos.boot.module.tcm.api.mapper.TzsUserEquipMapper;
import com.yeejoin.amos.boot.module.tcm.api.mapper.TzsUserInfoMapper; import com.yeejoin.amos.boot.module.tcm.api.mapper.TzsUserInfoMapper;
import com.yeejoin.amos.boot.module.tcm.api.service.ITzsUserInfoService; import com.yeejoin.amos.boot.module.tcm.api.service.ITzsUserInfoService;
...@@ -27,6 +29,7 @@ import com.yeejoin.amos.component.feign.utils.FeignUtil; ...@@ -27,6 +29,7 @@ import com.yeejoin.amos.component.feign.utils.FeignUtil;
import com.yeejoin.amos.feign.privilege.Privilege; import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.CompanyModel; import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import com.yeejoin.amos.feign.privilege.model.GroupModel;
import com.yeejoin.amos.feign.privilege.model.RoleModel; import com.yeejoin.amos.feign.privilege.model.RoleModel;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
...@@ -405,6 +408,83 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI ...@@ -405,6 +408,83 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
} }
@Override @Override
public List<Map<String, Object>> getGroupList() {
FeignClientResult<Collection<GroupModel>> collectionFeignClientResult = Privilege.groupClient.selectForList(1712370734598221825L, null);
Collection<GroupModel> GroupModelResult = collectionFeignClientResult.getResult();
List<GroupModel> collect = GroupModelResult.stream().filter(e -> "twoStipulate".equals(e.getGroupDesc())).collect(Collectors.toList());
List<Map<String, Object>> result = new ArrayList<>();
for (GroupModel groupModel : collect) {
Map<String, Object> map = new HashMap<>();
map.put("groupName", groupModel.getGroupName());
map.put("sequenceNbr", groupModel.getSequenceNbr());
result.add(map);
}
return result;
}
@Override
public Map<String, Object> getPersonType() {
ReginParams reginParams = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
if (ObjectUtils.isEmpty(reginParams)) {
return null;
}
String userId = reginParams.getUserModel().getUserId();
TzsUserInfo tzsUserInfo = tzsUserInfoMapper.selectOne(new QueryWrapper<TzsUserInfo>().eq("amos_user_id", userId));
Map<String, Object> result = new HashMap<>();
result.put("postName", tzsUserInfo.getPostName());
return result;
}
@Override
public List<GroupAndPersonInfoDto> getGroupAndPersonInfo(Long groupId) {
List<GroupAndPersonInfoDto> result = new ArrayList<>();
List<AgencyUserModel> agencyUserModelList = Privilege.groupUserClient.queryForList(groupId).getResult();
if (!ObjectUtils.isEmpty(agencyUserModelList) && agencyUserModelList.size() > 0) {
for (AgencyUserModel agencyUserModel : agencyUserModelList) {
GroupAndPersonInfoDto groupAndPersonInfoDto = new GroupAndPersonInfoDto();
groupAndPersonInfoDto = tzsUserInfoMapper.getUnitInfoByUserId(agencyUserModel.getUserId());
groupAndPersonInfoDto.setGroupId(groupId);
String groupName = Privilege.groupClient.seleteOne(groupId).getResult().getGroupName();
groupAndPersonInfoDto.setGroupName(groupName);
groupAndPersonInfoDto.setUserId(agencyUserModel.getUserId());
groupAndPersonInfoDto.setUserName(agencyUserModel.getRealName());
String[] UnitType = groupAndPersonInfoDto.getUnitType().split(",");
if (UnitType.length > 0) {
StringBuilder unitTypeCode = new StringBuilder();
for (String s : UnitType) {
unitTypeCode.append(UnitTypeEnum.getCode.get(s)).append(",");
}
groupAndPersonInfoDto.setUnitTypeCode(unitTypeCode.substring(0, unitTypeCode.length() - 1));
} else {
groupAndPersonInfoDto.setUnitTypeCode(UnitTypeEnum.getCode.get(UnitType));
}
String EquipCategory = groupAndPersonInfoDto.getEquipCategory()
.replace("[","")
.replace("]","")
.replace("\"","");
List<String> equipCategoryList = Arrays.asList(EquipCategory.split(","));
if (equipCategoryList.size() > 0) {
StringBuilder equipCategoryCode = new StringBuilder();
StringBuilder equipCategory = new StringBuilder();
for (String s : equipCategoryList) {
equipCategoryCode.append(s).append(",");
equipCategory.append(EquipmentClassifityEnum.getName.get(s)).append(",");
}
groupAndPersonInfoDto.setEquipCategory(equipCategory.substring(0, equipCategory.length() - 1));
groupAndPersonInfoDto.setEquipCategoryCode(equipCategoryCode.substring(0, equipCategoryCode.length() - 1));
} else {
groupAndPersonInfoDto.setEquipCategory(EquipmentClassifityEnum.getName.get(equipCategoryList.get(0)));
groupAndPersonInfoDto.setEquipCategoryCode(equipCategoryList.get(0));
}
result.add(groupAndPersonInfoDto);
}
}
return result;
}
@Override
public List<Map<String, Object>> getUserType(String unitType) { public List<Map<String, Object>> getUserType(String unitType) {
if (unitType.equals("pro")) { if (unitType.equals("pro")) {
return tzsUserInfoMapper.getUserType("QYRYGW-SCDW"); return tzsUserInfoMapper.getUserType("QYRYGW-SCDW");
......
...@@ -7,11 +7,11 @@ eureka.client.service-url.defaultZone=http://172.16.10.210:10001/eureka/ ...@@ -7,11 +7,11 @@ eureka.client.service-url.defaultZone=http://172.16.10.210:10001/eureka/
eureka.instance.prefer-ip-address=true eureka.instance.prefer-ip-address=true
management.endpoint.health.show-details=always management.endpoint.health.show-details=always
management.endpoints.web.exposure.include=* management.endpoints.web.exposure.include=*
eureka.instance.health-check-url=http://172.16.3.34:${server.port}${server.servlet.context-path}/actuator/health eureka.instance.health-check-url=http://172.16.3.17:${server.port}${server.servlet.context-path}/actuator/health
eureka.instance.metadata-map.management.context-path=${server.servlet.context-path}/actuator eureka.instance.metadata-map.management.context-path=${server.servlet.context-path}/actuator
eureka.instance.status-page-url=http://172.16.3.34:${server.port}${server.servlet.context-path}/actuator/info eureka.instance.status-page-url=http://172.16.3.17:${server.port}${server.servlet.context-path}/actuator/info
eureka.instance.metadata-map.management.api-docs=http://172.16.3.34:${server.port}${server.servlet.context-path}/doc.html eureka.instance.metadata-map.management.api-docs=http://172.16.3.17:${server.port}${server.servlet.context-path}/doc.html
eureka.instance.ip-address=172.16.3.34 eureka.instance.ip-address=172.16.3.17
## ES properties: ## ES properties:
elasticsearch.username=elastic elasticsearch.username=elastic
elasticsearch.password=a123456 elasticsearch.password=a123456
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment