Commit 3faf49dc authored by 刘林's avatar 刘林

Merge remote-tracking branch 'origin/develop_tzs_bugfix' into develop_tzs_bugfix

parents 8221db7a 6365c013
...@@ -4,17 +4,23 @@ import cn.hutool.core.util.URLUtil; ...@@ -4,17 +4,23 @@ import cn.hutool.core.util.URLUtil;
import cn.hutool.http.HttpUtil; import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.api.openapi.face.orm.entity.SSOAccountRelation; import com.yeejoin.amos.api.openapi.face.orm.entity.SSOAccountRelation;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.component.feign.model.Page;
import com.yeejoin.amos.component.feign.utils.FeignUtil; import com.yeejoin.amos.component.feign.utils.FeignUtil;
import com.yeejoin.amos.component.robot.AmosRequestContext;
import com.yeejoin.amos.feign.privilege.Privilege; import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.LoginInfoModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.VerifyCodeAuthModel;
import com.yeejoin.amos.feign.privilege.util.AesUtil;
import com.yeejoin.amos.openapi.enums.SSOLoginStatusEnum; import com.yeejoin.amos.openapi.enums.SSOLoginStatusEnum;
import com.yeejoin.amos.openapi.enums.TaAccessConfigBizeEnum; import com.yeejoin.amos.openapi.enums.TaAccessConfigBizeEnum;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.HashMap;
import java.util.Map; import java.util.Map;
/** /**
...@@ -29,6 +35,9 @@ public class SSOServiceImpl { ...@@ -29,6 +35,9 @@ public class SSOServiceImpl {
@Autowired @Autowired
private SSOAccountRelationServiceImpl ssoAccountRelationService; private SSOAccountRelationServiceImpl ssoAccountRelationService;
@Autowired
AmosRequestContext amosRequestContext;
public Map<String, String> getPlatformUserInfo(String portalCode) { public Map<String, String> getPlatformUserInfo(String portalCode) {
// 获取统一门户accessToken // 获取统一门户accessToken
String accessToken = getPortalAccessToken(portalCode); String accessToken = getPortalAccessToken(portalCode);
...@@ -53,20 +62,41 @@ public class SSOServiceImpl { ...@@ -53,20 +62,41 @@ public class SSOServiceImpl {
ssoAccountRelationService.save(ssoAccountRelation); ssoAccountRelationService.save(ssoAccountRelation);
return null; return null;
} }
// 存在两个平台用户对应关系并且登录状态(LoginStatus)为1,则用查到的用户信息登录监管平台 RequestContext.setProduct(amosRequestContext.getProduct());
if (ssoAccountRelation.getLoginStatus().equals(SSOLoginStatusEnum.SUCCESS.getCode())) { RequestContext.setAppKey(amosRequestContext.getAppKey());
// 1.查询监管平台用户登录信息(loginId和password) RequestContext.setToken(amosRequestContext.getToken());
List<LoginInfoModel> agencyUserClientList = FeignUtil.remoteCall(() -> Privilege.agencyUserClient.getLoginInfoList(userPhoneNumber)); // 1.查询监管平台用户信息
if (ValidationUtil.isEmpty(agencyUserClientList)) { Page<AgencyUserModel> agencyUserModelList = FeignUtil.remoteCall(() -> Privilege.agencyUserClient.queryForPage(null, null, userPhoneNumber, null, 1, 100));
ssoAccountRelation.setLoginStatus(SSOLoginStatusEnum.FAILED.getCode()); if (ValidationUtil.isEmpty(agencyUserModelList) || agencyUserModelList.getTotal() == 0) {
ssoAccountRelationService.updateById(ssoAccountRelation); ssoAccountRelation.setLoginStatus(SSOLoginStatusEnum.FAILED.getCode());
ssoAccountRelationService.updateById(ssoAccountRelation);
return null;
} else {
ssoAccountRelation.setLoginStatus(SSOLoginStatusEnum.SUCCESS.getCode());
// 2.登录监管平台
Map<String, String> agencyUserModel = (Map<String, String>) agencyUserModelList.getRecords().get(0);
VerifyCodeAuthModel verifyCodeAuthModel = new VerifyCodeAuthModel();
verifyCodeAuthModel.setLoginId(agencyUserModel.get("userName"));
verifyCodeAuthModel.setVerifyCode(AesUtil.encode(agencyUserModel.get("userName"),"qaz"));
FeignClientResult<Map<String, String>> loginResult;
loginResult = Privilege.authClient.userNameVerifyCode(verifyCodeAuthModel);
if (loginResult.getStatus() != 200) {
return null; return null;
} }
// 2.登录监管平台 ssoAccountRelationService.updateById(ssoAccountRelation);
String amosUserId = loginResult.getResult().get("userId");
String amosToken = loginResult.getResult().get("token");
// 3.为用户授权应用 // 3.为用户授权应用
RequestContext.setToken(amosToken);
RequestContext.setAgencyCode("tzs");
RequestContext.setExeUserId(amosUserId);
FeignUtil.remoteCall(() -> Privilege.applicationClient.queryUserService());
// 4.返回监管平台用户登录信息 // 4.返回监管平台用户登录信息
Map<String, String> result = new HashMap<>();
result.put("amosToken", amosToken);
result.put("amosUserId", amosUserId);
return result;
} }
return null;
} }
/** /**
......
package com.yeejoin.amos.boot.module.jg.api.mapper; package com.yeejoin.amos.boot.module.jg.api.mapper;
import com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNoticeEq; import com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNoticeEq;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
/** /**
* 安装告知设备关系表 Mapper 接口 * 安装告知设备关系表 Mapper 接口
...@@ -11,4 +13,11 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -11,4 +13,11 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/ */
public interface JgInstallationNoticeEqMapper extends CustomBaseMapper<JgInstallationNoticeEq> { public interface JgInstallationNoticeEqMapper extends CustomBaseMapper<JgInstallationNoticeEq> {
/**
* 查询安装告知完成但是纳管状态非已纳管的管道
*
* @return List<JgInstallationNoticeEq> 管道record数组
*/
List<JgInstallationNoticeEq> selectErrorRecordOfInIntoManage();
} }
...@@ -52,4 +52,11 @@ public interface JgInstallationNoticeMapper extends CustomBaseMapper<JgInstallat ...@@ -52,4 +52,11 @@ public interface JgInstallationNoticeMapper extends CustomBaseMapper<JgInstallat
List<Map<String, Object>> getDeviceListByProjectContraption(@Param("projectContraptionSeq") String projectContraptionSeq); List<Map<String, Object>> getDeviceListByProjectContraption(@Param("projectContraptionSeq") String projectContraptionSeq);
List<Map<String, Object>> getPipelineEquInfoByRecords(@Param("records") List<String> records); List<Map<String, Object>> getPipelineEquInfoByRecords(@Param("records") List<String> records);
/**
* 安装使用登记查询关联的安装告知
* @param useRegisterId 使用登记id
* @return 登记关联的告知
*/
JgInstallationNotice selectNoticeDataByUseRegisterId(@Param("useRegisterId") String useRegisterId );
} }
...@@ -121,4 +121,5 @@ public interface JgUseRegistrationMapper extends BaseMapper<JgUseRegistration> { ...@@ -121,4 +121,5 @@ public interface JgUseRegistrationMapper extends BaseMapper<JgUseRegistration> {
* @return List<Map<String, Object>> * @return List<Map<String, Object>>
*/ */
List<Map<String, Object>> selectPieLineListByOfCanReg(@Param("projectContraptionSeq") String projectContraptionSeq); List<Map<String, Object>> selectPieLineListByOfCanReg(@Param("projectContraptionSeq") String projectContraptionSeq);
} }
...@@ -2,4 +2,18 @@ ...@@ -2,4 +2,18 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeEqMapper"> <mapper namespace="com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeEqMapper">
<select id="selectErrorRecordOfInIntoManage" resultType="com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNoticeEq">
SELECT
ne.equ_id
FROM
"tzs_jg_installation_notice" n,
tzs_jg_installation_notice_eq ne,
"idx_biz_jg_use_info" u
WHERE
n.notice_status = '6616'
and ne.equip_transfer_id = n.sequence_nbr
and ne.equ_id = u."RECORD"
and (u."IS_INTO_MANAGEMENT" = false or u."IS_INTO_MANAGEMENT" is null)
and n.project_contraption <![CDATA[<>]]> ''
</select>
</mapper> </mapper>
...@@ -315,6 +315,25 @@ ...@@ -315,6 +315,25 @@
</where> </where>
</select> </select>
<select id="selectNoticeDataByUseRegisterId" resultType="com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNotice">
SELECT
n.sequence_nbr,
n.project_contraption,
n.project_contraption_id,
ne.equ_id as remark
FROM
"tzs_jg_installation_notice" n,
tzs_jg_installation_notice_eq ne
WHERE
n.notice_status = '6616'
and ne.equip_transfer_id = n.sequence_nbr
and ne.equ_id = (
select
re.equ_id
from
tzs_jg_use_registration_eq re
where
re.equip_transfer_id = #{useRegisterId} limit 1
)
</select>
</mapper> </mapper>
...@@ -69,4 +69,21 @@ public class DataHandlerController extends BaseController { ...@@ -69,4 +69,21 @@ public class DataHandlerController extends BaseController {
return ResponseHelper.buildResponse(true); return ResponseHelper.buildResponse(true);
} }
@ApiOperation(httpMethod = "PUT", value = "安装告知缺少装置id、装置未创建、安装告知完成但是设备状态为未纳管数据处理", notes = "历史数据处理")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/v3/projectContraption/notice")
public ResponseModel<Boolean> projectContraptionNoticeDataDealV3(){
dataHandlerService.projectContraptionNoticeDataDeal();
return ResponseHelper.buildResponse(true);
}
@ApiOperation(httpMethod = "PUT", value = "使用登记缺少装置id数据处理", notes = "历史数据处理,依赖/v3/projectContraption/notice作为基础数据")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/v3/projectContraption/useRegister")
public ResponseModel<Boolean> projectContraptionUseRegisterDataDealV3(){
dataHandlerService.projectContraptionUseRegisterDataDeal();
return ResponseHelper.buildResponse(true);
}
} }
...@@ -103,7 +103,8 @@ ...@@ -103,7 +103,8 @@
tui.profile, tui.profile,
tui.certificate_num certificateNum, tui.certificate_num certificateNum,
tui.post_name postName, tui.post_name postName,
tui.phone tui.phone,
tui.equip_type equipType
FROM FROM
tzs_user_info tui tzs_user_info tui
where where
...@@ -117,6 +118,12 @@ ...@@ -117,6 +118,12 @@
<if test="map.post != null and map.post != ''"> <if test="map.post != null and map.post != ''">
AND tui.post LIKE concat ( '%', #{map.post}, '%' ) AND tui.post LIKE concat ( '%', #{map.post}, '%' )
</if> </if>
<if test="map.equipType != null and map.equipType != ''">
AND tui.equip_type LIKE concat ( '%', #{map.equipType}, '%' )
</if>
<if test="map.phone != null and map.phone != ''">
AND tui.phone LIKE concat ( '%', #{map.phone}, '%' )
</if>
</select> </select>
<select id="getPostList" resultType="java.util.Map"> <select id="getPostList" resultType="java.util.Map">
SELECT SELECT
......
...@@ -116,7 +116,8 @@ ...@@ -116,7 +116,8 @@
tui.certificate_num certificateNum, tui.certificate_num certificateNum,
tui.unit_name unitName, tui.unit_name unitName,
tui.post_name postName, tui.post_name postName,
tui.phone tui.phone,
tui.equip_type equipType
FROM FROM
tzs_user_info tui tzs_user_info tui
LEFT JOIN tz_base_enterprise_info bei ON tui.unit_code = bei.use_code LEFT JOIN tz_base_enterprise_info bei ON tui.unit_code = bei.use_code
...@@ -146,6 +147,12 @@ ...@@ -146,6 +147,12 @@
<if test="paramDto.unitName != null and paramDto.unitName != ''"> <if test="paramDto.unitName != null and paramDto.unitName != ''">
AND tui.unit_name LIKE concat ( '%', #{paramDto.unitName}, '%' ) AND tui.unit_name LIKE concat ( '%', #{paramDto.unitName}, '%' )
</if> </if>
<if test="paramDto.equipType != null and paramDto.equipType != ''">
AND tui.equip_type LIKE concat ( '%', #{paramDto.equipType}, '%' )
</if>
<if test="paramDto.phone != null and paramDto.phone != ''">
AND tui.phone LIKE concat ( '%', #{paramDto.phone}, '%' )
</if>
</select> </select>
<select id="count" resultType="java.lang.Integer"> <select id="count" resultType="java.lang.Integer">
select count(1) from idx_biz_jg_other_info where INFORMATION_SITUATION NOTNULL select count(1) from idx_biz_jg_other_info where INFORMATION_SITUATION NOTNULL
......
...@@ -28,8 +28,10 @@ import com.yeejoin.amos.boot.module.statistics.api.mapper.EnterpriseBizMapper; ...@@ -28,8 +28,10 @@ import com.yeejoin.amos.boot.module.statistics.api.mapper.EnterpriseBizMapper;
import com.yeejoin.amos.boot.module.statistics.api.mapper.PlanTaskMapper; import com.yeejoin.amos.boot.module.statistics.api.mapper.PlanTaskMapper;
import com.yeejoin.amos.boot.module.statistics.api.mapper.TzsBaseInstitutionMapper; import com.yeejoin.amos.boot.module.statistics.api.mapper.TzsBaseInstitutionMapper;
import com.yeejoin.amos.boot.module.ymt.api.dto.BaseUnitLicenceDto; import com.yeejoin.amos.boot.module.ymt.api.dto.BaseUnitLicenceDto;
import com.yeejoin.amos.boot.module.ymt.api.dto.EquipmentCategoryDto;
import com.yeejoin.amos.boot.module.ymt.api.entity.BaseUnitLicence; import com.yeejoin.amos.boot.module.ymt.api.entity.BaseUnitLicence;
import com.yeejoin.amos.boot.module.ymt.api.mapper.BaseUnitLicenceMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.BaseUnitLicenceMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.EquipmentCategoryMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.TzBaseEnterpriseInfoMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.TzBaseEnterpriseInfoMapper;
import com.yeejoin.amos.boot.module.ymt.flc.api.dto.RegUnitIcDto; import com.yeejoin.amos.boot.module.ymt.flc.api.dto.RegUnitIcDto;
import com.yeejoin.amos.boot.module.ymt.flc.api.dto.RegUnitInfoDto; import com.yeejoin.amos.boot.module.ymt.flc.api.dto.RegUnitInfoDto;
...@@ -86,6 +88,8 @@ public class EnterpriseBizByTCMServiceImpl { ...@@ -86,6 +88,8 @@ public class EnterpriseBizByTCMServiceImpl {
private PlanTaskMapper planTaskMapper; private PlanTaskMapper planTaskMapper;
private EquipmentCategoryMapper equipmentCategoryMapper;
public EnterpriseBizByTCMServiceImpl(RedisUtils redisUtils, StCommonServiceImpl stCommonService, public EnterpriseBizByTCMServiceImpl(RedisUtils redisUtils, StCommonServiceImpl stCommonService,
TzBaseEnterpriseInfoMapper tzBaseEnterpriseInfoMapper, TzBaseEnterpriseInfoMapper tzBaseEnterpriseInfoMapper,
EnterpriseBizMapper enterpriseBizMapper, EnterpriseBizMapper enterpriseBizMapper,
...@@ -95,7 +99,8 @@ public class EnterpriseBizByTCMServiceImpl { ...@@ -95,7 +99,8 @@ public class EnterpriseBizByTCMServiceImpl {
BaseUnitLicenceMapper baseUnitLicenceMapper, BaseUnitLicenceMapper baseUnitLicenceMapper,
RegUnitInfoMapper regUnitInfoMapper, RegUnitInfoMapper regUnitInfoMapper,
RegUnitIcMapper regUnitIcMapper, RegUnitIcMapper regUnitIcMapper,
PlanTaskMapper planTaskMapper) { PlanTaskMapper planTaskMapper,
EquipmentCategoryMapper equipmentCategoryMapper) {
this.redisUtils = redisUtils; this.redisUtils = redisUtils;
this.stCommonService = stCommonService; this.stCommonService = stCommonService;
this.tzBaseEnterpriseInfoMapper = tzBaseEnterpriseInfoMapper; this.tzBaseEnterpriseInfoMapper = tzBaseEnterpriseInfoMapper;
...@@ -107,6 +112,7 @@ public class EnterpriseBizByTCMServiceImpl { ...@@ -107,6 +112,7 @@ public class EnterpriseBizByTCMServiceImpl {
this.regUnitInfoMapper = regUnitInfoMapper; this.regUnitInfoMapper = regUnitInfoMapper;
this.regUnitIcMapper = regUnitIcMapper; this.regUnitIcMapper = regUnitIcMapper;
this.planTaskMapper = planTaskMapper; this.planTaskMapper = planTaskMapper;
this.equipmentCategoryMapper = equipmentCategoryMapper;
} }
public Map<String, Object> getInfoByUseCodeMap(String useCode) { public Map<String, Object> getInfoByUseCodeMap(String useCode) {
...@@ -441,6 +447,23 @@ public class EnterpriseBizByTCMServiceImpl { ...@@ -441,6 +447,23 @@ public class EnterpriseBizByTCMServiceImpl {
public Page<Map<String,Object>> getPersonPage(JSONObject map, Page page) { public Page<Map<String,Object>> getPersonPage(JSONObject map, Page page) {
Page<Map<String, Object>> result = planTaskMapper.getPersonPage(page, map); Page<Map<String, Object>> result = planTaskMapper.getPersonPage(page, map);
List<EquipmentCategoryDto> equipmentCategoryDtos = equipmentCategoryMapper.selectClassify();
Map<String,String> equipType = new HashMap<>();
for(EquipmentCategoryDto dto : equipmentCategoryDtos){
equipType.put(dto.getCode(),dto.getName());
}
for(Map<String,Object> m : result.getRecords()){
if(StrUtil.isNotEmpty((String) m.get("equipType"))){
JSONArray array = JSONArray.parseArray(m.get("equipType")+"");
array.forEach(t->{
if(StrUtil.isEmpty((String) m.get("equipTypeName"))){
m.put("equipTypeName",equipType.get(t+""));
}else{
m.put("equipTypeName",m.get("equipTypeName")+"/"+equipType.get(t+""));
}
});
}
}
return result; return result;
} }
......
package com.yeejoin.amos.boot.module.statistcs.biz.service.impl; package com.yeejoin.amos.boot.module.statistcs.biz.service.impl;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
...@@ -1145,6 +1146,23 @@ public class ZLDPStatisticsServiceImpl { ...@@ -1145,6 +1146,23 @@ public class ZLDPStatisticsServiceImpl {
String orgCode = stCommonService.getAndSetOrgCode(regionCode); String orgCode = stCommonService.getAndSetOrgCode(regionCode);
List<String> unitTypeList = UnitTypeEnum.getNameListByType(paramDto.getCompanyType()); List<String> unitTypeList = UnitTypeEnum.getNameListByType(paramDto.getCompanyType());
Page<Map<String, Object>> result = screenMapper.getPersonPage(page, paramDto, orgCode, unitTypeList); Page<Map<String, Object>> result = screenMapper.getPersonPage(page, paramDto, orgCode, unitTypeList);
List<EquipmentCategoryDto> equipmentCategoryDtos = equipmentCategoryMapper.selectClassify();
Map<String,String> equipType = new HashMap<>();
for(EquipmentCategoryDto dto : equipmentCategoryDtos){
equipType.put(dto.getCode(),dto.getName());
}
for(Map<String,Object> m : result.getRecords()){
if(StrUtil.isNotEmpty((String) m.get("equipType"))){
JSONArray array = JSONArray.parseArray(m.get("equipType")+"");
array.forEach(t->{
if(StrUtil.isEmpty((String) m.get("equipTypeName"))){
m.put("equipTypeName",equipType.get(t+""));
}else{
m.put("equipTypeName",m.get("equipTypeName")+"/"+equipType.get(t+""));
}
});
}
}
return result; return result;
} }
......
...@@ -139,6 +139,7 @@ ...@@ -139,6 +139,7 @@
"keyParams": [ "keyParams": [
{ "key": "unitType", "label": "单位类型" }, { "key": "unitType", "label": "单位类型" },
{ "key": "useUnit", "label": "单位名称" }, { "key": "useUnit", "label": "单位名称" },
{ "key": "useUnitCertificate", "label": "证件类型" },
{ "key": "useUnitCode", "label": "证件号码" }, { "key": "useUnitCode", "label": "证件号码" },
{ "key": "governingBody", "label": "管辖机构" }, { "key": "governingBody", "label": "管辖机构" },
{ "key": "address", "label": "地址" }, { "key": "address", "label": "地址" },
......
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