Commit bbf7b80d authored by tianbo's avatar tianbo

fix(equip): 修复普通气瓶登记信息获取逻辑

- 新增 queryUseRegistrationByRecord 方法查询使用登记信息 - 实现数据库查询逻辑获取气瓶的接收单位和审核通过日期 - 为普通气瓶添加从使用登记单据获取登记机关和日期的逻辑
parent 6c3b479c
......@@ -380,5 +380,7 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> {
List<Map<String, Object>> queryInInspectionRecord();
List<String> querySupervisionCompanyCode();
Map<String, String> queryUseRegistrationByRecord(String record);
}
......@@ -3505,4 +3505,12 @@
from
tz_supervision_approval_mapping
</select>
<select id="queryUseRegistrationByRecord" resultType="java.util.Map">
select ur.audit_pass_date as auditPassDate, ur.receive_company_code as receiveCompanyCode
from tzs_jg_use_registration_eq eq
left join tzs_jg_use_registration ur on ur.sequence_nbr = eq.equip_transfer_id
where eq.equ_id = #{record}
limit 1
</select>
</mapper>
......@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.jg.biz.edit.process.equip;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.text.CharSequenceUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
......@@ -838,10 +839,13 @@ public class CommonEquipDataProcessService {
}
}
}
// 普通气瓶的登记机关和登记日期从增补当时的单据信息取
// 普通气瓶(非车用气瓶)的登记机关和登记日期从增补当时的单据信息取
if (CylinderTypeEnum.CYLINDER.getCode().equals(registerInfo.getEquCategory()) && "0".equals(registerInfo.getWhetherVehicleCylinder())) {
// result.put("receiveCompanyCode", "");
// result.put("O_REG_DATE", "");
Map<String, String> useRegistration = commonMapper.queryUseRegistrationByRecord(record);
if (!ValidationUtil.isEmpty(useRegistration)) {
result.put("receiveCompanyCode", MapUtil.getStr(useRegistration, "receiveCompanyCode"));
result.put("O_REG_DATE", MapUtil.getStr(useRegistration,"auditPassDate"));
}
}
// 返回当前登录人单位类型(企业还是监管、审批)
result.put("loginUnitType", commonService.getSelectedOrgInfo().getCompany().getLevel());
......
......@@ -1930,6 +1930,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
String equListStr = (String) objMap.get("EQU_LIST");
String equCategoryStr = (String) objMap.get("EQU_CATEGORY");
String useRegistrationCode = (String) objMap.get("useRegistrationCode");
String whetherVehicleCylinder = MapUtil.getStr(objMap, "WHETHER_VEHICLE_CYLINDER");
String business = "";
// 仅做施工告知的设备查询施工信息。厂车=5000、流动式起重机=4400、气瓶=2300不查询施工信息
......@@ -1989,6 +1990,15 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
objMap.put("O_REG_DATE", jgUseRegistrationManage.getRegDate());
}
}
// 普通气瓶(非车用气瓶)的登记机关和登记日期从增补当时的单据信息取
if (CylinderTypeEnum.CYLINDER.getCode().equals(equCategoryStr) && "0".equals(whetherVehicleCylinder)) {
Map<String, String> useRegistration = commonMapper.queryUseRegistrationByRecord(record);
if (!ValidationUtil.isEmpty(useRegistration)) {
objMap.put("receiveCompanyCode", MapUtil.getStr(useRegistration, "receiveCompanyCode"));
objMap.put("O_REG_DATE", MapUtil.getStr(useRegistration,"auditPassDate"));
}
}
}
return businessBuilder.toString();
......
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