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