Commit f8e871d5 authored by lisong's avatar lisong

修改户用光伏导入导出

parent e381f685
......@@ -25,6 +25,7 @@ public class HouseholdPvExport {
private String address;
private String postcode;
private String serviceAddress;
private String isPermanently;
/**
* 合同信息
*/
......
......@@ -25,25 +25,28 @@ public class HouseholdPvImport {
@ExcelProperty(value = "身份证号", index = 5)
private String idNumber;
@ColumnWidth(20)
@ExcelProperty(value = "证件过期时间", index = 6)
@ExcelProperty(value = "是否长期有效", index = 6)
private String isPermanently;
@ColumnWidth(20)
@ExcelProperty(value = "证件过期时间", index = 7)
private String expiryTime;
@ColumnWidth(15)
@ExcelProperty(value = "签发机关", index = 7)
@ExcelProperty(value = "签发机关", index = 8)
private String issuingAuthority;
@ColumnWidth(15)
@ExcelProperty(value = "户籍地址", index = 8)
@ExcelProperty(value = "户籍地址", index = 9)
private String residenceAddress;
@ColumnWidth(15)
@ExcelProperty(value = "手机号码", index = 9)
@ExcelProperty(value = "手机号码", index = 10)
private String phone;
@ColumnWidth(15)
@ExcelProperty(value = "居住地", index = 10)
@ExcelProperty(value = "居住地", index = 11)
private String address;
@ColumnWidth(15)
@ExcelProperty(value = "居住地邮编", index = 11)
@ExcelProperty(value = "居住地邮编", index = 12)
private String postcode;
@ColumnWidth(15)
@ExcelProperty(value = "送达地址", index = 12)
@ExcelProperty(value = "送达地址", index = 13)
private String serviceAddress;
......
......@@ -18,6 +18,11 @@
hp.postcode,
hp.service_address AS serviceAddress,
hp.district_id AS districtId,
CASE
hp.is_permanently
WHEN 1 THEN
'是' ELSE '否'
END AS isPermanently,
hpc.number AS contactNumber,
hpc.period,
hpc.description ,
......
......@@ -312,12 +312,13 @@ public class HouseholdPvController extends BaseController {
row.createCell(4).setCellValue(ObjectUtils.isEmpty(item.getName()) ? "" : item.getName());
row.createCell(5).setCellValue(ObjectUtils.isEmpty(item.getSex()) ? "" : item.getSex());
row.createCell(6).setCellValue(ObjectUtils.isEmpty(item.getIdNumber()) ? "" : item.getIdNumber());
row.createCell(7).setCellValue(ObjectUtils.isEmpty(item.getExpiryTime()) ? "" : item.getExpiryTime());
row.createCell(8).setCellValue(ObjectUtils.isEmpty(item.getIssuingAuthority()) ? "" : item.getIssuingAuthority());
row.createCell(9).setCellValue(ObjectUtils.isEmpty(item.getResidenceAddress()) ? "" : item.getResidenceAddress());
row.createCell(10).setCellValue(ObjectUtils.isEmpty(item.getPhone()) ? "" : item.getPhone());
row.createCell(11).setCellValue(ObjectUtils.isEmpty(item.getAddress()) ? "" : item.getAddress());
row.createCell(12).setCellValue(ObjectUtils.isEmpty(item.getPostcode()) ? "" : item.getPostcode());
row.createCell(7).setCellValue(ObjectUtils.isEmpty(item.getIsPermanently()) ? "" : item.getIsPermanently());
row.createCell(8).setCellValue(ObjectUtils.isEmpty(item.getExpiryTime()) ? "" : item.getExpiryTime());
row.createCell(9).setCellValue(ObjectUtils.isEmpty(item.getIssuingAuthority()) ? "" : item.getIssuingAuthority());
row.createCell(10).setCellValue(ObjectUtils.isEmpty(item.getResidenceAddress()) ? "" : item.getResidenceAddress());
row.createCell(11).setCellValue(ObjectUtils.isEmpty(item.getPhone()) ? "" : item.getPhone());
row.createCell(12).setCellValue(ObjectUtils.isEmpty(item.getAddress()) ? "" : item.getAddress());
row.createCell(13).setCellValue(ObjectUtils.isEmpty(item.getPostcode()) ? "" : item.getPostcode());
}
// 合同信息
num = 1;
......
......@@ -161,17 +161,19 @@ public class HouseholdPvDistrictServiceImpl extends BaseService<HouseholdPvDistr
CompanyTreeDto dto = new CompanyTreeDto();
BeanUtils.copyProperties(item, dto, "children");
Map<String, Object> detail = (Map<String, Object>) item.getObject();
if (!ObjectUtils.isEmpty(detail)) {
dto.setLevel(detail.getOrDefault(STATION_LEVEL, "").toString());
if (!ObjectUtils.isEmpty(detail.get(STATION_LEVEL)) && "station".equals(detail.get(STATION_LEVEL))){
dto.setDisabled(false);
}else {
dto.setDisabled(true);
if (!ObjectUtils.isEmpty(detail) && !ObjectUtils.isEmpty(detail.get(STATION_LEVEL)) && !detail.get(STATION_LEVEL).equals("debug_division")){
if (!ObjectUtils.isEmpty(detail)) {
dto.setLevel(detail.getOrDefault(STATION_LEVEL, "").toString());
if (!ObjectUtils.isEmpty(detail.get(STATION_LEVEL)) && "station".equals(detail.get(STATION_LEVEL))){
dto.setDisabled(false);
}else {
dto.setDisabled(true);
}
}
result.add(dto);
if (!ObjectUtils.isEmpty(item.getChildren())) {
change(item.getChildren(), result);
}
}
result.add(dto);
if (!ObjectUtils.isEmpty(item.getChildren())) {
change(item.getChildren(), result);
}
});
}
......
......@@ -158,7 +158,10 @@ public class HouseholdPvServiceImpl extends BaseService<HouseholdPvDto, Househol
if (ObjectUtils.isEmpty(dto.getIdNumber())) {
return "第 " + line + " 行身份证号不能为空!";
}
if (ObjectUtils.isEmpty(dto.getExpiryTime())) {
if (ObjectUtils.isEmpty(dto.getIsPermanently())) {
return "第 " + line + " 是否长期有效不能为空!";
}
if ("否".equals(dto.getIsPermanently()) && ObjectUtils.isEmpty(dto.getExpiryTime())) {
return "第 " + line + " 行证件过期时间不能为空!";
}
if (ObjectUtils.isEmpty(dto.getIssuingAuthority())) {
......@@ -275,6 +278,10 @@ public class HouseholdPvServiceImpl extends BaseService<HouseholdPvDto, Househol
householdPv.setBizOrgCode(getOrgCode(householdPv.getDistrictId()));
}
}
// 是否长期有效
if (!ObjectUtils.isEmpty(item.getIsPermanently())) {
householdPv.setIsPermanently("是".equals(item.getIsPermanently()) ? "1" : "0");
}
householdPvs.add(householdPv);
});
this.saveBatch(householdPvs);
......
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