Commit c9e2a995 authored by 朱晨阳's avatar 朱晨阳

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

parents 273c46eb ba51de05
......@@ -4,7 +4,7 @@ import lombok.Data;
@Data
public class CylinderFillingRecordStatisticsDto {
private String time;
private String fillingTime;
private String fillingQuantity;
private String offloadingVolume;
}
......@@ -183,4 +183,7 @@ public class JgUseRegistrationDto extends BaseDto {
@ApiModelProperty(value = " 监察处置机构代码")
private String supervisionOrgCode;
@ApiModelProperty(value = "属地监管机构代码")
private String orgBranchCode;
}
......@@ -274,4 +274,16 @@ public class JgUseRegistration extends BaseEntity {
@TableField("origin_project_contraption_ids")
private String originProjectContraptionIds;
/**
* 属地监管部门code
*/
@TableField(value = "org_branch_code")
private String orgBranchCode;
/**
* 属地监管部门name
*/
@TableField(value = "org_branch_name")
private String orgBranchName;
}
......@@ -73,6 +73,9 @@
<if test="param.useUnitCreditCode != null and param.useUnitCreditCode != ''">
AND isn.use_unit_credit_code = #{param.useUnitCreditCode}
</if>
<if test="param.orgBranchCode != null and param.orgBranchCode != ''">
AND isn.org_branch_code LIKE concat(#{param.orgBranchCode},'%')
</if>
</if>
<if test="type == 'supervision'">
<choose>
......
......@@ -55,6 +55,7 @@
ur.audit_status as auditStatus,
date_format(ur.reg_date,'%Y-%m-%d') as regDate,
ur.use_unit_name as useUnitName,
ur.org_branch_code as orgBranchCode,
ur.status,
ur.receive_org_name as receiveOrgName,
ur.use_address as place,
......@@ -181,6 +182,9 @@
<if test="dto.useUnitCode != null and dto.useUnitCode != ''">
and use_unit_credit_code = #{dto.useUnitCode}
</if>
<if test="dto.orgBranchCode != null and dto.orgBranchCode != ''">
and orgBranchCode like concat(#{dto.orgBranchCode},'%')
</if>
<if test="dto.auditPassDateStart != null and dto.auditPassDateEnd != null">
AND auditPassDate BETWEEN #{dto.auditPassDateStart} AND #{dto.auditPassDateEnd}
</if>
......
......@@ -1863,6 +1863,8 @@ public class DataDockServiceImpl {
.setCreateUserName(paramsDto.getExecUserName())
.setProjectContraptionId(String.valueOf(proCon.getSequenceNbr()))
.setProjectContraption(paramsDto.getProjectContraption())
.setOrgBranchCode(paramsDto.getOrgBranchCode())
.setOrgBranchName(paramsDto.getOrgBranchName())
.setRegDate(new Date());
useReg.setSequenceNbr(useRegseq);
jgUseRegistrationServiceImpl.save(useReg);
......
......@@ -397,6 +397,10 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
idxBizJgRegisterInfoMapper.updateUseOrgCodeByEquip(String.valueOf(map.get("equipId")), flag ? useRegistrationCode : useOrgCode);
// 生成监管码、96333码(管道合并到有证不生成)
createCode(map, jgUseRegistration, registerInfo, useInfo, otherInfo);
if ("2".equals(jgUseRegistration.getRegType()) && "3000".equals(map.getString("equList"))) {
// 电梯处理维保信息
this.historyEquUpdateMaintenanceInfo(map);
}
}
private void updateOrCreateInspectionDetection(Map<String, Object> equipment, JgUseRegistration jgUseRegistration, IdxBizJgRegisterInfo registerInfo) {
......@@ -602,6 +606,14 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
}
});
}
// 属地监管部门
Optional.ofNullable(map.get("orgBranchCode").toString())
.filter(code -> code.contains("_"))
.map(code -> code.split("_"))
.ifPresent(splitOrgBranchCode -> {
jgUseRegistration.setOrgBranchCode(splitOrgBranchCode[0]);
jgUseRegistration.setOrgBranchName(splitOrgBranchCode[1]);
});
jgUseRegistration.setUseAddress(jgUseRegistration.getUseAddress() + map.get("address"));
if (map.containsKey("type") && "edit".equals(String.valueOf(map.get("type")))) {
jgUseRegistration.setUseUnitCreditCode(null);
......@@ -825,6 +837,14 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
useRegistration.setReceiveCompanyCode(result.getCompanyCode());
useRegistration.setReceiveOrgName(splitReceiveOrgCode[1]);
});
// 属地监管部门
Optional.ofNullable(useRegistration.getOrgBranchCode())
.filter(code -> code.contains("_"))
.map(code -> code.split("_"))
.ifPresent(splitOrgBranchCode -> {
useRegistration.setOrgBranchCode(splitOrgBranchCode[0]);
useRegistration.setOrgBranchName(splitOrgBranchCode[1]);
});
// 安全管理员
Optional.ofNullable(map.getString("safetyManager"))
......@@ -3587,6 +3607,14 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
});
useStreetName = atomicUseStreet.get();
}
// 属地监管部门
Optional.ofNullable(map.get("orgBranchCode").toString())
.filter(code -> code.contains("_"))
.map(code -> code.split("_"))
.ifPresent(splitOrgBranchCode -> {
jgUseRegistration.setOrgBranchCode(splitOrgBranchCode[0]);
jgUseRegistration.setOrgBranchName(splitOrgBranchCode[1]);
});
jgUseRegistration.setUseAddress(jgUseRegistration.getUseAddress() + map.get("address"));
if (map.containsKey("edit") && "1".equals(String.valueOf(map.get("edit")))) {
......
......@@ -65,13 +65,14 @@
E.supervise_org_code LIKE concat ( #{orgCode}, '%' )
</select>
<select id="countEnterpriseUsed" resultType="java.lang.Long">
SELECT COUNT
( DISTINCT ( E.app_id ) )
FROM
tz_cylinder_filling_record
T INNER JOIN tz_base_enterprise_info E ON T.app_id = E.app_id and E.unit_type like '%充装单位%'
WHERE
E.supervise_org_code LIKE concat ( #{orgCode}, '%' )
SELECT COUNT(1)
FROM tz_base_enterprise_info E
WHERE E.unit_type LIKE '%充装单位%' AND E.supervise_org_code LIKE concat ( #{orgCode}, '%' )
AND EXISTS (
SELECT 1
FROM tz_cylinder_filling_record T
WHERE T.app_id = E.app_id
)
</select>
<select id="getStationRateSubPage"
resultType="com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseEnterpriseInfoDto">
......
......@@ -445,14 +445,16 @@ public class CylinderDPStatisticsServiceImpl {
fillingRecord = cylinderInfoMapper.queryFillingRecordByOrgCode(orgCode, LocalDate.now().minusDays(29).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")),null);
offloading = cylinderInfoMapper.queryoffloadingByOrgCode(orgCode, LocalDate.now().minusDays(29).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")),null);
}
Map<String, String> fillingRecordMap = fillingRecord.stream().collect(Collectors.toMap(CylinderFillingRecordStatisticsDto::getTime, CylinderFillingRecordStatisticsDto::getFillingQuantity));
Map<String, String> offloadingMap = offloading.stream().collect(Collectors.toMap(CylinderFillingRecordStatisticsDto::getTime, CylinderFillingRecordStatisticsDto::getOffloadingVolume));
Map<String, String> fillingRecordMap = fillingRecord.stream().collect(Collectors.toMap(CylinderFillingRecordStatisticsDto::getFillingTime, CylinderFillingRecordStatisticsDto::getFillingQuantity));
Map<String, String> offloadingMap = offloading.stream().collect(Collectors.toMap(CylinderFillingRecordStatisticsDto::getFillingTime, CylinderFillingRecordStatisticsDto::getOffloadingVolume));
List<CylinderFillingRecordStatisticsDto> data = new ArrayList<>();
for (String key : times) {
CylinderFillingRecordStatisticsDto dayData = new CylinderFillingRecordStatisticsDto();
dayData.setTime(key);
dayData.setFillingQuantity(fillingRecordMap.getOrDefault(key, "0"));
dayData.setOffloadingVolume(offloadingMap.getOrDefault(key, "0"));
dayData.setFillingTime(key);
String filling = fillingRecordMap.getOrDefault(key, "0");
dayData.setFillingQuantity(filling.equals("0") ? filling : Double.valueOf(filling).toString());
String offloadingRecord = offloadingMap.getOrDefault(key, "0");
dayData.setOffloadingVolume(offloadingRecord.equals("0") ? offloadingRecord : Double.valueOf(offloadingRecord).toString());
data.add(dayData);
}
return data;
......
......@@ -15,11 +15,15 @@ public class DateUtils {
public static Date calculateEndOfMonth(Date currentDate) {
LocalDateTime localDateTime = toLocalDateTime(currentDate);
LocalDateTime endOfMonth = localDateTime.with(localDateTime.withDayOfMonth(localDateTime.getMonth().maxLength())
// 获取当前月份的实际天数(考虑闰年)
int lastDay = localDateTime.getMonth().length(localDateTime.toLocalDate().isLeapYear());
// 直接设置为本月最后一天 23:59:59.999
LocalDateTime endOfMonth = localDateTime
.withDayOfMonth(lastDay)
.withHour(23)
.withMinute(59)
.withSecond(59)
.withNano(999999999));
.withNano(999_999_999);
return toDate(endOfMonth);
}
......
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