Commit edc1a018 authored by 刘林's avatar 刘林

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

parents ff01ab56 d37f41b2
...@@ -428,7 +428,9 @@ ...@@ -428,7 +428,9 @@
OR fu.transfer_to_user_ids LIKE CONCAT('%', #{dto.currentUserId}, '%')) OR fu.transfer_to_user_ids LIKE CONCAT('%', #{dto.currentUserId}, '%'))
</when> </when>
<otherwise> <otherwise>
AND fu.supervision_org_code LIKE CONCAT(#{dto.supervisionOrgCode}, '%') <if test="dto.receiveCompanyCode != null and dto.receiveCompanyCode != ''">
AND fu.receive_company_code = #{dto.receiveCompanyCode}
</if>
</otherwise> </otherwise>
</choose> </choose>
AND fu.status != '使用单位待提交' AND fu.status != '使用单位待提交'
...@@ -674,7 +676,9 @@ ...@@ -674,7 +676,9 @@
OR ur.transfer_to_user_ids LIKE CONCAT('%', #{dto.currentUserId}, '%')) OR ur.transfer_to_user_ids LIKE CONCAT('%', #{dto.currentUserId}, '%'))
</when> </when>
<otherwise> <otherwise>
AND ur.supervision_org_code LIKE CONCAT(#{dto.supervisionOrgCode}, '%') <if test="dto.receiveCompanyCode != null and dto.receiveCompanyCode != ''">
AND ur.receive_company_code = #{dto.receiveCompanyCode}
</if>
</otherwise> </otherwise>
</choose> </choose>
AND ur.status <![CDATA[<>]]> '使用单位待提交' AND ur.status <![CDATA[<>]]> '使用单位待提交'
......
...@@ -122,7 +122,9 @@ public class JgUseRegistrationController extends BaseController { ...@@ -122,7 +122,9 @@ public class JgUseRegistrationController extends BaseController {
info.getCompany().getCompanyCode().split("_")[1] : info.getCompany().getCompanyCode()); info.getCompany().getCompanyCode().split("_")[1] : info.getCompany().getCompanyCode());
} else { } else {
dto.setDataType(BaseController.COMPANY_TYPE_SUPERVISION); dto.setDataType(BaseController.COMPANY_TYPE_SUPERVISION);
dto.setReceiveCompanyCode(info.getCompany().getCompanyCode()); if (client.equals("jgAudit")) {
dto.setReceiveCompanyCode(info.getCompany().getCompanyCode());
}
dto.setSupervisionOrgCode(info.getCompany().getOrgCode()); dto.setSupervisionOrgCode(info.getCompany().getOrgCode());
} }
if (dto.getAuditPassDateRange() != null && !dto.getAuditPassDateRange().isEmpty()) { if (dto.getAuditPassDateRange() != null && !dto.getAuditPassDateRange().isEmpty()) {
......
...@@ -50,6 +50,7 @@ import com.yeejoin.amos.boot.module.jg.biz.feign.WorkFlowFeignService; ...@@ -50,6 +50,7 @@ import com.yeejoin.amos.boot.module.jg.biz.feign.WorkFlowFeignService;
import com.yeejoin.amos.boot.module.jg.biz.reminder.core.event.EquipCreateOrEditEvent; import com.yeejoin.amos.boot.module.jg.biz.reminder.core.event.EquipCreateOrEditEvent;
import com.yeejoin.amos.boot.module.jg.biz.service.ICmWorkflowService; import com.yeejoin.amos.boot.module.jg.biz.service.ICmWorkflowService;
import com.yeejoin.amos.boot.module.jg.biz.service.ICompensateFlowDataOfRedis; import com.yeejoin.amos.boot.module.jg.biz.service.ICompensateFlowDataOfRedis;
import com.yeejoin.amos.boot.module.jg.biz.utils.CodeUtil;
import com.yeejoin.amos.boot.module.jg.biz.utils.FileExporter; import com.yeejoin.amos.boot.module.jg.biz.utils.FileExporter;
import com.yeejoin.amos.boot.module.jg.biz.utils.ImageUtils; import com.yeejoin.amos.boot.module.jg.biz.utils.ImageUtils;
import com.yeejoin.amos.boot.module.ymt.api.entity.*; import com.yeejoin.amos.boot.module.ymt.api.entity.*;
...@@ -198,6 +199,9 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform ...@@ -198,6 +199,9 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
@Resource @Resource
private DiscardOrderCheckFactory discardOrderCheckFactory; private DiscardOrderCheckFactory discardOrderCheckFactory;
@Autowired
private CodeUtil codeUtil;
/** /**
* @param auditPassDate 通过时间 * @param auditPassDate 通过时间
* @param exportParamsMap 参数map * @param exportParamsMap 参数map
...@@ -947,7 +951,7 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform ...@@ -947,7 +951,7 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
jgVehicleInformation.setNextExecuteUserIds(""); jgVehicleInformation.setNextExecuteUserIds("");
// 生成使用登记证编号 // 生成使用登记证编号
String receiveCompanyCode = jgVehicleInformation.getReceiveCompanyCode(); String receiveCompanyCode = codeUtil.getCityRegionCode(jgVehicleInformation.getReceiveCompanyCode());
CompanyModel receiveCompanyResult = Privilege.companyClient.queryByCompanyCode(receiveCompanyCode).getResult(); CompanyModel receiveCompanyResult = Privilege.companyClient.queryByCompanyCode(receiveCompanyCode).getResult();
//查询到局级 //查询到局级
// 如果不是局级公司,则查询其上级公司信息 // 如果不是局级公司,则查询其上级公司信息
......
...@@ -3,6 +3,8 @@ package com.yeejoin.amos.boot.module.statistics.api.mapper; ...@@ -3,6 +3,8 @@ package com.yeejoin.amos.boot.module.statistics.api.mapper;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* Mapper 接口 * Mapper 接口
* *
...@@ -24,4 +26,6 @@ public interface CommonBaseMapper { ...@@ -24,4 +26,6 @@ public interface CommonBaseMapper {
* @return 地市对应行政区划seq * @return 地市对应行政区划seq
*/ */
String selectCompanyRegionSeq(@Param("receiveCompanyCode") String receiveCompanyCode); String selectCompanyRegionSeq(@Param("receiveCompanyCode") String receiveCompanyCode);
List<String> selectCompanyCodeByRegionCode(Long regionSeq);
} }
...@@ -18,4 +18,33 @@ ...@@ -18,4 +18,33 @@
where where
company_code = #{receiveCompanyCode} and is_deleted = false company_code = #{receiveCompanyCode} and is_deleted = false
</select> </select>
<select id="selectCompanyCodeByRegionCode" resultType="java.lang.String">
WITH RECURSIVE company_tree AS (
SELECT
sequence_nbr,
company_name,
company_code,
parent_id,
ARRAY[sequence_nbr] AS path
FROM privilege_company
WHERE region_seq = #{regionSeq}
and (level != 'company' and level != 'organization')
UNION ALL
SELECT
c.sequence_nbr,
c.company_name,
c.company_code,
c.parent_id,
ct.path || c.sequence_nbr
FROM privilege_company c
INNER JOIN company_tree ct ON c.parent_id = ct.sequence_nbr
WHERE NOT (c.sequence_nbr = ANY(ct.path))
and (c.level != 'company' and c.level != 'organization')
)
SELECT
company_code companyCode
FROM company_tree ct
ORDER BY sequence_nbr;
</select>
</mapper> </mapper>
...@@ -96,6 +96,9 @@ public class StCommonServiceImpl { ...@@ -96,6 +96,9 @@ public class StCommonServiceImpl {
private static Map<Integer, RegionModel> regionCodeRegionMap = new ConcurrentHashMap<>(); private static Map<Integer, RegionModel> regionCodeRegionMap = new ConcurrentHashMap<>();
// 行政区域code对应监管/审批单位code Map
private static Map<Integer, List<String>> regionCodeCompanyCodeMap = new ConcurrentHashMap<>();
private static final List<RegionModel> regionModels = new ArrayList<>(); private static final List<RegionModel> regionModels = new ArrayList<>();
private static List<EquipmentCategoryDto> equipmentCategoryDtos; private static List<EquipmentCategoryDto> equipmentCategoryDtos;
...@@ -165,6 +168,8 @@ public class StCommonServiceImpl { ...@@ -165,6 +168,8 @@ public class StCommonServiceImpl {
* @param dpFilterParamDto 过滤条件 * @param dpFilterParamDto 过滤条件
*/ */
private void setChildCompanyCodeByRegion(String cityCode, DPFilterParamDto dpFilterParamDto) { private void setChildCompanyCodeByRegion(String cityCode, DPFilterParamDto dpFilterParamDto) {
RegionModel region = regionCodeRegionMap.get(Integer.valueOf(cityCode));
dpFilterParamDto.setCompanyCodes(regionCodeCompanyCodeMap.computeIfAbsent(Integer.valueOf(cityCode), k -> commonMapper.selectCompanyCodeByRegionCode(region.getSequenceNbr())));
} }
public String getAndSetOrgCode(String cityCode) { public String getAndSetOrgCode(String cityCode) {
......
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