diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java index 585835f705..07f60c2ecd 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java @@ -10,6 +10,7 @@ import com.epmet.auth.constants.AuthOperationConstants; import com.epmet.common.token.constant.LoginConstant; import com.epmet.commons.rocketmq.messages.LoginMQMsg; import com.epmet.commons.tools.constant.AppClientConstant; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.enums.EnvEnum; @@ -192,6 +193,20 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol throw new RenException(EpmetErrorCode.PLEASE_LOGIN.getCode()); } StaffLatestAgencyResultDTO staffLatestAgencyResultDTO = latestStaffWechat.getData(); + //2022.11.24校验下用户是否被禁用 + //2.1根据手机号查询到用户信息 前端不跳转,暂时先注释吧 + ThirdCustomerStaffFormDTO dto = new ThirdCustomerStaffFormDTO(); + dto.setCustomerId(staffLatestAgencyResultDTO.getCustomerId()); + dto.setMobile(staffLatestAgencyResultDTO.getMobile()); + Result> customerStaffResult = epmetUserOpenFeignClient.getCustsomerStaffByIdAndPhone(dto); + if (!customerStaffResult.success()) { + logger.error(String.format("手机验证码登录异常,手机号[%s],code[%s],msg[%s]", staffLatestAgencyResultDTO.getMobile(), customerStaffResult.getCode(), customerStaffResult.getMsg())); + throw new RenException(customerStaffResult.getCode()); + } + // 8008 前端会提示:登录失效,请重新登录 跳转到登录界面。所以这里写死返回8008. + if("disabled".equals(customerStaffResult.getData().get(NumConstant.ZERO).getEnableFlag())){ + throw new EpmetException(EpmetErrorCode.PLEASE_LOGIN.getCode(),EpmetErrorCode.GOV_STAFF_DISABLED.getMsg(),EpmetErrorCode.GOV_STAFF_DISABLED.getMsg()); + } //3.记录staff_wechat this.savestaffwechat(staffLatestAgencyResultDTO.getStaffId(), userWechatDTO.getWxOpenId(), staffLatestAgencyResultDTO.getCustomerId()); @@ -538,7 +553,9 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol logger.error(String.format("手机验证码登录异常,手机号[%s],code[%s],msg[%s]", formDTO.getMobile(), customerStaffResult.getCode(), customerStaffResult.getMsg())); throw new RenException(customerStaffResult.getCode()); } - + if("disabled".equals(customerStaffResult.getData().get(NumConstant.ZERO).getEnableFlag())){ + throw new EpmetException(EpmetErrorCode.GOV_STAFF_DISABLED.getCode(),EpmetErrorCode.GOV_STAFF_DISABLED.getMsg(),EpmetErrorCode.GOV_STAFF_DISABLED.getMsg()); + } //3、查询用户所有的组织信息 List customerIdList = new ArrayList<>(); for (CustomerStaffDTO customerStaffDTO : customerStaffResult.getData()) { @@ -571,12 +588,16 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol dto.setCustomerId(customer.getId()); dto.setMobile(formDTO.getMobile()); Result> customerStaffResult = epmetUserOpenFeignClient.getCustsomerStaffByIdAndPhone(dto); - if (!customerStaffResult.success()) { + if (!customerStaffResult.success()||CollectionUtils.isEmpty(customerStaffResult.getData())) { logger.warn(String.format("手机密码登录异常,手机号[%s],code[%s],msg[%s]", formDTO.getMobile(), customerStaffResult.getCode(), customerStaffResult.getMsg())); throw new RenException(customerStaffResult.getCode()); } //2、密码是否正确 List customerStaffList=customerStaffResult.getData(); + // 禁用的给予提示 + if("disabled".equals(customerStaffList.get(NumConstant.ZERO).getEnableFlag())){ + throw new EpmetException(EpmetErrorCode.GOV_STAFF_DISABLED.getCode(),EpmetErrorCode.GOV_STAFF_DISABLED.getMsg(),EpmetErrorCode.GOV_STAFF_DISABLED.getMsg()); + } //3、查询用户所有的组织信息 List customerIdList = new ArrayList<>(); //是否设置过密码 diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ConvertUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ConvertUtils.java index 6d2e509797..ba53ab8c66 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ConvertUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ConvertUtils.java @@ -8,6 +8,7 @@ package com.epmet.commons.tools.utils; +import org.apache.commons.collections4.CollectionUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeanUtils; @@ -64,6 +65,21 @@ public class ConvertUtils { return targetList; } + public static List batchMapToEntity(List> maps, Class entity){ + if (CollectionUtils.isEmpty(maps)){ + return new ArrayList<>(); + } + List targetList = new ArrayList<>(maps.size()); + try { + for (Map map : maps) { + targetList.add(mapToEntity(map, entity)); + } + }catch (Exception e){ + logger.error("batchMapToEntity convert error ", e); + } + return targetList; + } + public static T mapToEntity(Map map, Class entity) { if (null == map){ return null; diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java index 2367f0bbb1..4d89c1bef8 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java @@ -102,14 +102,14 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl search(PartyActivityFormDTO formDTO) { - if (null == formDTO.getStartTime()) { + /*if (null == formDTO.getStartTime()) { Date startDate = DateUtils.parse("1900-01-01 00:00:00", DateUtils.DATE_TIME_PATTERN); formDTO.setStartTime(startDate); } if (null == formDTO.getEndTime()) { Date endDate = DateUtils.parse("2099-12-31 00:00:00", DateUtils.DATE_TIME_PATTERN); formDTO.setEndTime(endDate); - } + }*/ PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); List list = baseDao.selectActivityList(formDTO); PageInfo pageInfo = new PageInfo<>(list); @@ -159,14 +159,14 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl list(PartyActivityFormDTO formDTO) { - if (null == formDTO.getStartTime()) { + /*if (null == formDTO.getStartTime()) { Date startDate = DateUtils.parse("1900-01-01 00:00:00", DateUtils.DATE_TIME_PATTERN); formDTO.setStartTime(startDate); } if (null == formDTO.getEndTime()) { Date endDate = DateUtils.parse("2099-12-31 00:00:00", DateUtils.DATE_TIME_PATTERN); formDTO.setEndTime(endDate); - } + }*/ List list = baseDao.selectActivityList(formDTO); List dtoList = ConvertUtils.sourceToTarget(list, IcPartyActivityDTO.class); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyActivityDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyActivityDao.xml index aee61f74dc..e142f3680f 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyActivityDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyActivityDao.xml @@ -51,55 +51,27 @@ a.ID, a.ACT_ID, a.GRID_ID, - b.unitId, - c.serviceMatter, - TITLE, - TARGET, - CONTENT, - PEOPLE_COUNT, - ACTIVITY_TIME, - ADDRESS, - LONGITUDE, - LATITUDE, - RESULT, + ur.UNIT_ID, + GROUP_CONCAT( sr.SERVICE_MATTER ) AS serviceMatter, + a.TITLE, + a.TARGET, + a.CONTENT, + a.PEOPLE_COUNT, + a.ACTIVITY_TIME, + a.ADDRESS, + a.LONGITUDE, + a.LATITUDE, + a.RESULT, a.AGENCY_ID, a.CUSTOMER_ID FROM ic_party_activity a - INNER JOIN ( - SELECT - ur.ACTIVITY_ID, - GROUP_CONCAT( ur.UNIT_ID ) AS unitId - FROM - ic_activity_unit_relation ur - WHERE - ur.DEL_FLAG = '0' - - AND (ur.AGENCY_ID = #{agencyId} or ur.PIDS like concat('%',#{agencyId},'%')) - - - AND ur.UNIT_ID = #{unitId} - - GROUP BY - ur.ACTIVITY_ID - ) b ON a.ID = b.ACTIVITY_ID - INNER JOIN ( - SELECT - sr.ACTIVITY_ID, - GROUP_CONCAT( sr.SERVICE_MATTER ) AS serviceMatter - FROM - ic_activity_service_relation sr - WHERE - sr.DEL_FLAG = '0' - - AND (sr.AGENCY_ID = #{agencyId} or sr.PIDS like concat('%',#{agencyId},'%')) - - - AND sr.SERVICE_MATTER = #{serviceMatter} - - GROUP BY - sr.ACTIVITY_ID - ) c ON a.ID = c.ACTIVITY_ID + left join ic_activity_unit_relation ur + on (ur.ACTIVITY_ID=a.id + and ur.del_flag='0') + left JOIN ic_activity_service_relation sr + on(a.ID = sr.ACTIVITY_ID + and sr.del_flag='0') WHERE a.DEL_FLAG = '0' @@ -109,11 +81,19 @@ AND a.GRID_ID = #{gridId} - AND TITLE LIKE concat('%', #{title}, '%') + AND a.TITLE LIKE concat('%', #{title}, '%') - AND ACTIVITY_TIME BETWEEN #{startTime} AND #{endTime} - ORDER BY ACTIVITY_TIME DESC - + + AND ur.UNIT_ID = #{unitId} + + + AND sr.SERVICE_MATTER = #{serviceMatter} + + + AND a.ACTIVITY_TIME BETWEEN #{startTime} AND #{endTime} + + GROUP BY a.id + ORDER BY a.ACTIVITY_TIME DESC SELECT - r.*, - a.ID AS epidemicId, - r.CREATED_TIME AS reportTime, - r.ID_CARD as realIdCard, - r.MOBILE as realMobile, - ( - CASE - WHEN r.USER_TYPE = 'resi' THEN IFNULL(ubi.REAL_NAME, '无') - ELSE IFNULL(cs.REAL_NAME, '无') - END - ) AS createdByName + r.*, + a.ID AS epidemicId, + r.CREATED_TIME AS reportTime, + r.ID_CARD as realIdCard, + r.MOBILE as realMobile, + ( + CASE + WHEN r.USER_TYPE = 'resi' THEN IFNULL(ubi.REAL_NAME, '无') + ELSE IFNULL(cs.REAL_NAME, '无') + END + ) AS createdByName, + CONCAT(r.via_province,r.via_city,r.via_county) via FROM ic_trip_report_record r LEFT JOIN ( select * from ic_epidemic_special_attention GROUP BY id_card ORDER BY created_time DESC @@ -87,7 +88,7 @@ AND r.isolate_type = #{isolateType} ORDER BY - r.ARRIVE_DATE DESC, r.CREATED_TIME DESC + r.ARRIVE_DATE DESC, r.arrive_time DESC, r.CREATED_TIME DESC @@ -151,6 +152,18 @@ order by total desc + + + update ic_trip_report_record set del_flag='1',UPDATED_BY=#{userId},UPDATED_TIME=NOW() WHERE AGENCY_ID=#{agencyId} @@ -160,4 +173,198 @@ ) + + + + UPDATE ic_trip_report_record + + + + when yt_id = #{l.ytId} then #{l.detailAddress} + + + + + when yt_id = #{l.ytId} then #{l.travelCodeAbnormal} + + + + + when yt_id = #{l.ytId} then #{l.healthCodeAbnormal} + + + + + when yt_id = #{l.ytId} then #{l.twonName} + + + + + when yt_id = #{l.ytId} then #{l.countyName} + + + + + when yt_id = #{l.ytId} then #{l.cityName} + + + + + when yt_id = #{l.ytId} then #{l.provinceName} + + + + + when yt_id = #{l.ytId} then #{l.carryHesuanProof} + + + + + when yt_id = #{l.ytId} then #{l.leaveTheRiskAreaTime} + + + + + when yt_id = #{l.ytId} then #{l.comeAreaFull} + + + + + when yt_id = #{l.ytId} then #{l.reportStreet} + + + + + when yt_id = #{l.ytId} then #{l.arriveTime} + + + + + when yt_id = #{l.ytId} then #{l.shift} + + + + + when yt_id = #{l.ytId} then #{l.comeMode} + + + + + when yt_id = #{l.ytId} then #{l.covidFlag} + + + + + when yt_id = #{l.ytId} then #{l.sex} + + + + + when yt_id = #{l.ytId} then #{l.age} + + + + + when yt_id = #{l.ytId} then #{l.area} + + + + + when yt_id = #{l.ytId} then #{l.cardType} + + + + + when yt_id = #{l.ytId} then #{l.invalidTime} + + + + + when yt_id = #{l.ytId} then #{l.travelCodeImg} + + + + + when yt_id = #{l.ytId} then #{l.arriveLuTime} + + + + + when yt_id = #{l.ytId} then #{l.destinationStation} + + + + + when yt_id = #{l.ytId} then #{l.carryVehicleNumberColor} + + + + + when yt_id = #{l.ytId} then #{l.carryVehicleNumber} + + + + + when yt_id = #{l.ytId} then #{l.carryVehicle} + + + + + when yt_id = #{l.ytId} then #{l.registeredResidenceAddress} + + + + + when yt_id = #{l.ytId} then #{l.registeredResidenceCity} + + + + + when yt_id = #{l.ytId} then #{l.travelPersonnel} + + + + + when yt_id = #{l.ytId} then #{l.viaCounty} + + + + + when yt_id = #{l.ytId} then #{l.viaCity} + + + + + when yt_id = #{l.ytId} then #{l.viaProvince} + + + + + when yt_id = #{l.ytId} then #{l.nonlocalResidenceHistory} + + + + + when yt_id = #{l.ytId} then #{l.declarationStatus} + + + + + when yt_id = #{l.ytId} then #{l.twoCodeOneReportStatus} + + + + + when yt_id = #{l.ytId} then #{l.detectionAbnormal} + + + UPDATED_TIME = NOW() + + WHERE DEL_FLAG = '0' + AND yt_id IN ( + + #{l.ytId} + + ) + \ No newline at end of file