Commit f7708a9a authored by suhuiguang's avatar suhuiguang

Merge branch 'develop_tzs_register' of…

Merge branch 'develop_tzs_register' of http://39.100.92.250:5000/moa/amos-boot-biz into develop_tzs_register
parents b8c3737c d0d46010
...@@ -50,6 +50,10 @@ public class EquCategoryConverter implements Converter<String> { ...@@ -50,6 +50,10 @@ public class EquCategoryConverter implements Converter<String> {
equipmentMap.put("客运缆车", "9200"); equipmentMap.put("客运缆车", "9200");
equipmentMap.put("客运拖牵索道", "9300"); equipmentMap.put("客运拖牵索道", "9300");
equipmentMap.put("水上游乐设施类", "6D00"); equipmentMap.put("水上游乐设施类", "6D00");
equipmentMap.put("曳引与强制驱动电梯", "3100");
equipmentMap.put("液压驱动电梯", "3200");
equipmentMap.put("自动扶梯与自动人行道", "3300");
equipmentMap.put("其它类型电梯", "3400");
} }
@Override @Override
......
...@@ -73,6 +73,16 @@ public class EquDefineConverter implements Converter<String> { ...@@ -73,6 +73,16 @@ public class EquDefineConverter implements Converter<String> {
equipmentMap.put("低位客运拖牵索道", "9310"); equipmentMap.put("低位客运拖牵索道", "9310");
equipmentMap.put("高位客运拖牵索道", "9320"); equipmentMap.put("高位客运拖牵索道", "9320");
equipmentMap.put("电动单梁起重机", "4170"); equipmentMap.put("电动单梁起重机", "4170");
equipmentMap.put("曳引驱动乘客电梯", "3110");
equipmentMap.put("曳引驱动载货电梯", "3120");
equipmentMap.put("强制驱动载货电梯", "3130");
equipmentMap.put("液压乘客电梯", "3210");
equipmentMap.put("液压载货电梯", "3220");
equipmentMap.put("自动扶梯", "3310");
equipmentMap.put("自动人行道", "3320");
equipmentMap.put("防爆电梯", "3410");
equipmentMap.put("消防员电梯", "3420");
equipmentMap.put("杂物电梯", "3430");
} }
@Override @Override
......
...@@ -22,6 +22,7 @@ public class EquListConverter implements Converter<String> { ...@@ -22,6 +22,7 @@ public class EquListConverter implements Converter<String> {
equipmentMap.put("压力管道", "8000"); equipmentMap.put("压力管道", "8000");
equipmentMap.put("大型游乐设施", "6000"); equipmentMap.put("大型游乐设施", "6000");
equipmentMap.put("客运索道", "9000"); equipmentMap.put("客运索道", "9000");
equipmentMap.put("电梯", "3000");
} }
@Override @Override
......
package com.yeejoin.amos.api.openapi.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.yeejoin.amos.api.openapi.converter.*;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotBlank;
import java.math.BigDecimal;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "西安电梯数据对接", description = "西安电梯数据对接")
public class XiAnElevatorExcelDto extends BaseDto {
@ExcelIgnore
private static final long serialVersionUID = 1L;
//----------------------------------------------------------------------基本信息
@ApiModelProperty(value = "设备种类")
@ExcelProperty(value = "设备种类", converter = EquListConverter.class)
@NotBlank(message = "设备种类不能为空")
private String equList;
@ApiModelProperty(value = "设备类别")
@ExcelProperty(value = "设备类别", converter = EquCategoryConverter.class)
@NotBlank(message = "设备类别不能为空")
private String equCategory;
@ApiModelProperty(value = "设备品种")
@ExcelProperty(value = "设备品种", converter = EquDefineConverter.class)
private String equDefine;
@ApiModelProperty(value = "单位内编号")
@ExcelProperty(value = "单位内编号")
private String useInnerCode;
@ApiModelProperty(value = "产品名称")
@ExcelProperty(value = "产品名称")
private String productName;
@ApiModelProperty(value = "设备型号")
@ExcelProperty(value = "设备型号")
@NotBlank(message = "设备型号不能为空")
private String equType;
@ApiModelProperty(value = "设备总价值(万元)")
@ExcelProperty(value = "设备总价值(万元)")
private String equPrice;
@ApiModelProperty(value = "有无设备代码")
@ExcelProperty(value = "有无设备代码", converter = EquCodeTypeConverter.class)
@NotBlank(message = "有无设备代码不能为空")
private String equCodeType;
@ApiModelProperty(value = "设备代码")
@ExcelProperty(value = "设备代码")
private String equCode;
@ApiModelProperty(value = "96333码")
@ExcelProperty(value = "96333码")
private String code96333;
@ApiModelProperty(value = "使用登记证编号")
@ExcelProperty(value = "使用登记证编号")
private String useOrgCode;
@ApiModelProperty(value = "注册代码")
@ExcelProperty(value = "注册代码")
private String record;
//-----------------------------------------------------------------------使用信息
@ApiModelProperty(value = "使用单位统一社会信用代码")
@ExcelProperty(value = "使用单位统一社会信用代码")
@NotBlank(message = "使用单位统一社会信用代码不能为空")
private String useUnitCode;
@ApiModelProperty(value = "使用单位名称")
@ExcelProperty(value = "使用单位名称")
@NotBlank(message = "使用单位名称不能为空")
private String useUnit;
@ApiModelProperty(value = "产权单位统一信用代码")
@ExcelProperty(value = "产权单位统一信用代码")
private String estateUnitCreditCode;
@ApiModelProperty(value = "产权单位统一信用代码")
@ExcelProperty(value = "产权单位统一信用代码")
private String estateUnitName;
@ApiModelProperty(value = "使用地点-省")
@ExcelProperty(value = "使用地点-省")
private String provinceName;
@ApiModelProperty(value = "使用地点-市")
@ExcelProperty(value = "使用地点-市")
private String cityName;
@ApiModelProperty(value = "使用地点-区/县")
@ExcelProperty(value = "使用地点-区/县")
private String countyName;
@ApiModelProperty(value = "使用地点-街道")
@ExcelProperty(value = "使用地点-街道")
private String factoryUseSiteStreet;
@ApiModelProperty(value = "详细地址")
@ExcelProperty(value = "详细地址")
private String address;
@ApiModelProperty(value = "使用地点经纬度")
@ExcelProperty(value = "使用地点经纬度")
private String longitudeLatitude;
@ApiModelProperty(value = "使用场所")
private String usePlace;
@ApiModelProperty(value = "安全管理员")
@ExcelProperty(value = "安全管理员")
private String safetyManager;
@ApiModelProperty(value = "安全管理员联系电话")
@ExcelProperty(value = "安全管理员联系电话")
private String phone;
@ApiModelProperty(value = "安全管理员身份证号")
@ExcelProperty(value = "安全管理员身份证号")
private String safetyManagerIDNumber;
//---------------------------------------------------------------制造信息
@ApiModelProperty(value = "制造单位统一社会信用代码")
@ExcelProperty(value = "制造单位统一社会信用代码")
@NotBlank(message = "制造单位统一社会信用代码不能为空")
private String produceUnitCreditCode;
@ApiModelProperty(value = "制造单位名称")
@ExcelProperty(value = "制造单位名称")
@NotBlank(message = "制造单位名称不能为空")
private String produceUnitName;
@ApiModelProperty(value = "制造许可编号")
@ExcelProperty(value = "制造许可编号")
@NotBlank(message = "制造许可编号不能为空")
private String produceLicenseNum;
@ApiModelProperty(value = "出厂编号/产品编码")
@ExcelProperty(value = "出厂编号/产品编码")
@NotBlank(message = "出厂编号/产品编码不能为空")
private String factoryNum;
@ApiModelProperty(value = "制造日期")
@ExcelProperty(value = "制造日期")
@DateTimeFormat("yyyy-MM-dd")
private String produceDate;
@ApiModelProperty(value = "是否进口")
@ExcelProperty(value = "是否进口", converter = ImportedConverter.class)
private String imported;
@ApiModelProperty(value = "制造国")
@ExcelProperty(value = "制造国")
private String produceCountry;
//---------------------------------------------------------------安装信息
@ApiModelProperty(value = "安装单位名称")
@ExcelProperty(value = "安装单位名称")
private String installUnitName;
@ApiModelProperty(value = "安装单位统一信用代码")
@ExcelProperty(value = "安装单位统一信用代码")
private String installUnitCreditCode;
@ApiModelProperty(value = "安装负责人")
@ExcelProperty(value = "安装负责人")
private String installLeaderName;
@ApiModelProperty(value = "安装负责人手机")
@ExcelProperty(value = "安装负责人手机")
private String installLeaderPhone;
@ApiModelProperty(value = "安装负责人身份证号")
@ExcelProperty(value = "安装负责人身份证号")
private String installLeaderIDNumber;
@ApiModelProperty(value = "安装日期")
@ExcelProperty(value = "安装日期")
@DateTimeFormat("yyyy-MM-dd")
private Date noticeDate;
//--------------------------------------------------------------------检验信息
@ApiModelProperty(value = "检验机构名称")
@ExcelProperty(value = "检验机构名称")
private String inspectOrgName;
@ApiModelProperty(value = "检验机构统一信用代码")
@ExcelProperty(value = "检验机构统一信用代码")
private String inspectOrgCode;
@ApiModelProperty(value = "检验机构统一信用代码")
private String inspectType;
@ApiModelProperty(value = "检验结论")
private String inspectConclusion;
@ApiModelProperty(value = "检验日期")
@ExcelProperty(value = "检验日期")
@DateTimeFormat("yyyy-MM-dd")
private Date inspectDate;
@ApiModelProperty(value = "下次检验日期")
@ExcelProperty(value = "下次检验日期")
@DateTimeFormat("yyyy-MM-dd")
private Date nextInspectDate;
@ApiModelProperty(value = "检验人员名称")
@ExcelProperty(value = "检验人员名称")
private String inspectStaff;
@ApiModelProperty(value = "检验人员身份证号")
@ExcelProperty(value = "检验人员身份证号")
private String inspectStaffIDNumber;
@ApiModelProperty(value = "检验报告编号")
@ExcelProperty(value = "检验报告编号")
private String inspectReportNo;
//--------------------------------------------------------------------维保信息
@ApiModelProperty(value = "维保单位统一信用代码")
@ExcelProperty(value = "维保单位统一信用代码")
private String meUnitCreditCode;
@ApiModelProperty(value = "维保单位")
@ExcelProperty(value = "维保单位")
private String meUnitName;
@ApiModelProperty(value = "维保合同开始时间")
@ExcelProperty(value = "维保合同开始时间")
@DateTimeFormat("yyyy-MM-dd")
private String informStart;
@ApiModelProperty(value = "维保合同结束时间")
@ExcelProperty(value = "维保合同结束时间")
@DateTimeFormat("yyyy-MM-dd")
private String informEnd;
@ApiModelProperty(value = "维保人员一")
@ExcelProperty(value = "维保人员一")
private String meMaster;
@ApiModelProperty(value = "维保人员一身份证号")
@ExcelProperty(value = "维保人员一身份证号")
private String meMasterId;
@ApiModelProperty(value = "维保人员一联系方式")
@ExcelProperty(value = "维保人员一联系方式")
private String meMasterPhone;
@ApiModelProperty(value = "维保人员二")
@ExcelProperty(value = "维保人员二")
private String meMaster1;
@ApiModelProperty(value = "维保人员二身份证号")
@ExcelProperty(value = "维保人员二身份证号")
private String meMaster1Id;
@ApiModelProperty(value = "维保人员二联系方式")
@ExcelProperty(value = "维保人员二联系方式")
private String meMaster1Phone;
//--------------------------------------------------------------------电梯索道----技术参数
@ApiModelProperty(value = "额定速度")
@ExcelProperty(value = "额定速度")
private BigDecimal ratedSpeed;
@ApiModelProperty(value = "额定速度(上行)")
@ExcelProperty(value = "额定速度(上行)")
private BigDecimal ratedSpeedUp;
@ApiModelProperty(value = "额定速度(下行)")
@ExcelProperty(value = "额定速度(下行)")
private BigDecimal ratedSpeedDown;
@ApiModelProperty(value = "提升高度(m)")
@ExcelProperty(value = "提升高度(m)")
private BigDecimal liftingHeight;
@ApiModelProperty(value = "额定载重量")
@ExcelProperty(value = "额定载重量")
private BigDecimal ratedLoadCapacity;
@ApiModelProperty(value = "层数(层)")
@ExcelProperty(value = "层数(层)")
private Integer storey;
@ApiModelProperty(value = "站数(站)")
@ExcelProperty(value = "站数(站)")
private Integer stand;
@ApiModelProperty(value = "门数")
@ExcelProperty(value = "门数")
private Integer numberDoors;
@ApiModelProperty(value = "控制方式")
@ExcelProperty(value = "控制方式", converter = DictParamsConverter.class)
private String controlMode;
@ApiModelProperty(value = "名义速度(m/s)")
@ExcelProperty(value = "名义速度(m/s)")
private BigDecimal nominalSpeed;
@ApiModelProperty(value = "倾斜角")
@ExcelProperty(value = "倾斜角")
private BigDecimal angleRoll;
@ApiModelProperty(value = "名义宽度(mm)")
@ExcelProperty(value = "名义宽度(mm)")
private BigDecimal nominalWidth;
@ApiModelProperty(value = "使用区段长度(m)")
@ExcelProperty(value = "使用区段长度(m)")
private BigDecimal useSectionLength;
@ApiModelProperty(value = "输送能力(P/h)")
@ExcelProperty(value = "输送能力(P/h)")
private String conveyingCapacity;
@ApiModelProperty(value = "油缸数量")
@ExcelProperty(value = "油缸数量")
private Integer numberCylinders;
@ApiModelProperty(value = "顶升型式")
@ExcelProperty(value = "顶升型式", converter = DictParamsConverter.class)
private String jackingType;
@ApiModelProperty(value = "整机防爆标志")
@ExcelProperty(value = "整机防爆标志")
private String explosionproofSignComplete;
@ApiModelProperty(value = "防爆等级")
@ExcelProperty(value = "防爆等级", converter = DictParamsConverter.class)
private String explosionproofGrade;
@ApiModelProperty(value = "轿门位置")
@ExcelProperty(value = "轿门位置")
private String doorPosition;
@ApiModelProperty(value = "原设备代码")
@ExcelIgnore
private String originalEquCode;
@ApiModelProperty(value = "序号")
@ExcelProperty(value = "序号")
private String xaSerial;
@ApiModelProperty(value = "资料是否齐全(0齐全, 1不齐全)-西安数据导入")
@ExcelIgnore
private Integer isCompleteXa;
}
\ No newline at end of file
...@@ -75,6 +75,8 @@ public class DictParamsConverter implements Converter<String> { ...@@ -75,6 +75,8 @@ public class DictParamsConverter implements Converter<String> {
dictMap.put("并联", "2"); dictMap.put("并联", "2");
dictMap.put("按钮", "3"); dictMap.put("按钮", "3");
dictMap.put("其他控制方式", "4"); dictMap.put("其他控制方式", "4");
dictMap.put("直接顶升", "1");
dictMap.put("间接顶升", "2");
} }
@Override @Override
......
...@@ -2574,12 +2574,14 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -2574,12 +2574,14 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
pBuilder.must(QueryBuilders.termQuery(EQU_CATEGORY_CODE, test)); pBuilder.must(QueryBuilders.termQuery(EQU_CATEGORY_CODE, test));
boolMust.must(pBuilder); boolMust.must(pBuilder);
} }
// 是否车用气瓶 //设备类别为气瓶时,添加是否车用气瓶字段
if (!ObjectUtils.isEmpty(map.getString(WHETHER_VEHICLE_CYLINDER))) { if (CylinderTypeEnum.CYLINDER.getCode().equals(map.getString(EQU_CATEGORY_CODE))) {
BoolQueryBuilder pBuilder = QueryBuilders.boolQuery(); Optional.ofNullable(map.getString(WHETHER_VEHICLE_CYLINDER))
String test = QueryParser.escape(map.getString(WHETHER_VEHICLE_CYLINDER)); .filter(s -> !s.trim().isEmpty())
pBuilder.must(QueryBuilders.termQuery(WHETHER_VEHICLE_CYLINDER, test)); .ifPresent(cylinder -> boolMust.must(
boolMust.must(pBuilder); QueryBuilders.boolQuery()
.must(QueryBuilders.termQuery(WHETHER_VEHICLE_CYLINDER, QueryParser.escape(cylinder)))
));
} }
// 是否撬装式压力容器 // 是否撬装式压力容器
if (!ObjectUtils.isEmpty(map.getString(WHETHER_SKID_MOUNTED_PRESSURE_VESSEL))) { if (!ObjectUtils.isEmpty(map.getString(WHETHER_SKID_MOUNTED_PRESSURE_VESSEL))) {
......
...@@ -54,15 +54,14 @@ import org.springframework.stereotype.Service; ...@@ -54,15 +54,14 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.yeejoin.amos.boot.module.jg.api.enums.VehicleApanageEnum.XIAN_YANG; import static com.yeejoin.amos.boot.module.jg.api.enums.VehicleApanageEnum.XIAN_YANG;
import static com.yeejoin.amos.boot.module.jg.api.enums.VehicleApanageEnum.XI_XIAN; import static com.yeejoin.amos.boot.module.jg.api.enums.VehicleApanageEnum.XI_XIAN;
...@@ -143,8 +142,6 @@ public class JgChangeVehicleRegistrationUnitServiceImpl extends BaseService<JgCh ...@@ -143,8 +142,6 @@ public class JgChangeVehicleRegistrationUnitServiceImpl extends BaseService<JgCh
dto.setOrgBranchCode(splitMaintenanceUnitCode[0]); dto.setOrgBranchCode(splitMaintenanceUnitCode[0]);
dto.setOrgBranchName(splitMaintenanceUnitCode[1]); dto.setOrgBranchName(splitMaintenanceUnitCode[1]);
} }
} }
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
...@@ -153,6 +150,9 @@ public class JgChangeVehicleRegistrationUnitServiceImpl extends BaseService<JgCh ...@@ -153,6 +150,9 @@ public class JgChangeVehicleRegistrationUnitServiceImpl extends BaseService<JgCh
try { try {
CompanyBo company = reginParams.getCompany(); CompanyBo company = reginParams.getCompany();
JgChangeVehicleRegistrationUnit dto = new JgChangeVehicleRegistrationUnit(); JgChangeVehicleRegistrationUnit dto = new JgChangeVehicleRegistrationUnit();
if (!ValidationUtil.isEmpty(map.get("changeCertificateList"))) {
dto.setChangeCertificate(JSON.toJSONString(map.get("changeCertificateList")));
}
if (!ObjectUtils.isEmpty(map.get("submit")) && SUBMIT_TYPE_FLOW.equals(map.get("submit").toString())) { if (!ObjectUtils.isEmpty(map.get("submit")) && SUBMIT_TYPE_FLOW.equals(map.get("submit").toString())) {
if (map.containsKey("dataList")) { if (map.containsKey("dataList")) {
List<Map<String, Object>> equipList = new ArrayList<>(); List<Map<String, Object>> equipList = new ArrayList<>();
...@@ -192,6 +192,9 @@ public class JgChangeVehicleRegistrationUnitServiceImpl extends BaseService<JgCh ...@@ -192,6 +192,9 @@ public class JgChangeVehicleRegistrationUnitServiceImpl extends BaseService<JgCh
// 更新 // 更新
JgChangeVehicleRegistrationUnit updateDto = this.getById(Long.parseLong(map.get("sequenceNbr").toString())); JgChangeVehicleRegistrationUnit updateDto = this.getById(Long.parseLong(map.get("sequenceNbr").toString()));
BeanUtil.copyProperties(map, updateDto); BeanUtil.copyProperties(map, updateDto);
if (!ValidationUtil.isEmpty(map.get("changeCertificateList"))) {
updateDto.setChangeCertificate(JSON.toJSONString(map.get("changeCertificateList")));
}
changeData(updateDto, reginParams.getCompany()); changeData(updateDto, reginParams.getCompany());
this.updateById(updateDto); this.updateById(updateDto);
BeanUtil.copyProperties(updateDto, dto); BeanUtil.copyProperties(updateDto, dto);
......
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
LEFT JOIN p_plan_task ppt ON pc.plan_task_id = ppt.id LEFT JOIN p_plan_task ppt ON pc.plan_task_id = ppt.id
LEFT JOIN p_check_input pci ON pc.id = pci.check_id LEFT JOIN p_check_input pci ON pc.id = pci.check_id
LEFT JOIN p_input_item pii ON pci.input_id = pii.id LEFT JOIN p_input_item pii ON pci.input_id = pii.id
LEFT JOIN p_check_shot pcs ON pci.check_id = pcs.check_id LEFT JOIN p_check_shot pcs ON pc.id = pcs.check_id
WHERE WHERE
pc.plan_task_id = #{planTaskId} pc.plan_task_id = #{planTaskId}
</select> </select>
......
...@@ -15,7 +15,6 @@ import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl; ...@@ -15,7 +15,6 @@ import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils; import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto;
import com.yeejoin.amos.boot.module.statistics.api.dto.TzBaseEnterpriseInfoDto; import com.yeejoin.amos.boot.module.statistics.api.dto.TzBaseEnterpriseInfoDto;
import com.yeejoin.amos.boot.module.statistics.api.entity.TzBaseEnterpriseInfo; import com.yeejoin.amos.boot.module.statistics.api.entity.TzBaseEnterpriseInfo;
import com.yeejoin.amos.boot.module.statistics.api.entity.TzsBaseInstitution; import com.yeejoin.amos.boot.module.statistics.api.entity.TzsBaseInstitution;
...@@ -42,7 +41,6 @@ import com.yeejoin.amos.boot.module.ymt.flc.api.mapper.RegUnitInfoMapper; ...@@ -42,7 +41,6 @@ import com.yeejoin.amos.boot.module.ymt.flc.api.mapper.RegUnitInfoMapper;
import org.apache.commons.compress.utils.Lists; import org.apache.commons.compress.utils.Lists;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
...@@ -358,40 +356,41 @@ public class EnterpriseBizByTCMServiceImpl { ...@@ -358,40 +356,41 @@ public class EnterpriseBizByTCMServiceImpl {
//查询列表信息 //查询列表信息
Page<HashMap<String, Object>> pageList = planTaskMapper.getPlanTaskInfo(page,map); Page<HashMap<String, Object>> pageList = planTaskMapper.getPlanTaskInfo(page,map);
//处理userName //处理userName
if(!CollectionUtils.isEmpty(pageList.getRecords())) { // 2025/04/14 htt 处理了源头的错误数据 故不需要转化了
Map<String, String> userMap = new HashMap<>(); // if(!CollectionUtils.isEmpty(pageList.getRecords())) {
List<String> userIds = new ArrayList<>(); // Map<String, String> userMap = new HashMap<>();
for (Map<String, Object> record : pageList.getRecords()) { // List<String> userIds = new ArrayList<>();
String ids = record.get("userName")+""; // for (Map<String, Object> record : pageList.getRecords()) {
if (StrUtil.isNotBlank(ids)) { // String ids = record.get("userName")+"";
for (String id : ids.split(",")) { // if (StrUtil.isNotBlank(ids)) {
userIds.add(id); // for (String id : ids.split(",")) {
} // userIds.add(id);
} // }
} // }
if(!CollectionUtils.isEmpty(userIds)){ // }
List<Map<String,String>> userinfoList =planTaskMapper.getUserByUserName(userIds); // if(!CollectionUtils.isEmpty(userIds)){
for (Map<String, String> userinfo : userinfoList) { // List<Map<String,String>> userinfoList =planTaskMapper.getUserByUserName(userIds);
userMap.put(userinfo.get("userName"),userinfo.get("realName")); // for (Map<String, String> userinfo : userinfoList) {
} // userMap.put(userinfo.get("userName"),userinfo.get("realName"));
} // }
for (Map<String, Object> record : pageList.getRecords()) { // }
String ids = record.get("userName")+""; // for (Map<String, Object> record : pageList.getRecords()) {
if (StrUtil.isNotBlank(ids)) { // String ids = record.get("userName")+"";
List<String> realNameList = new ArrayList<>(); // if (StrUtil.isNotBlank(ids)) {
for (String id : ids.split(",")) { // List<String> realNameList = new ArrayList<>();
if(StrUtil.isNotBlank(userMap.get(id))) { // for (String id : ids.split(",")) {
realNameList.add(userMap.get(id)); // if(StrUtil.isNotBlank(userMap.get(id))) {
} // realNameList.add(userMap.get(id));
} // }
if(!CollectionUtils.isEmpty(realNameList)) { // }
record.put("userName", realNameList.stream().collect(Collectors.joining(","))); // if(!CollectionUtils.isEmpty(realNameList)) {
}else{ // record.put("userName", realNameList.stream().collect(Collectors.joining(",")));
record.put("userName",""); // }else{
} // record.put("userName","");
} // }
} // }
} // }
// }
result.put("taskList",pageList); result.put("taskList",pageList);
//查询企业类型 //查询企业类型
......
...@@ -210,7 +210,7 @@ ...@@ -210,7 +210,7 @@
SELECT SELECT
${groupId} groupId, ${groupId} groupId,
tui.amos_user_id userId, tui.amos_user_id userId,
tui.amos_user_name userName, tui.name userName,
tui.unit_name, tui.unit_name,
tui.unit_code, tui.unit_code,
REPLACE ( tzei.unit_type, '#', ',' ) unitType, REPLACE ( tzei.unit_type, '#', ',' ) unitType,
......
...@@ -15,7 +15,6 @@ import com.yeejoin.amos.feign.privilege.model.CompanyModel; ...@@ -15,7 +15,6 @@ import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import com.yeejoin.amos.feign.privilege.model.DepartmentModel; import com.yeejoin.amos.feign.privilege.model.DepartmentModel;
import com.yeejoin.amos.feign.systemctl.Systemctl; import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.MessageModel; import com.yeejoin.amos.feign.systemctl.model.MessageModel;
import com.yeejoin.amos.patrol.business.bo.CheckInputSyncBo;
import com.yeejoin.amos.patrol.business.constants.XJConstant; import com.yeejoin.amos.patrol.business.constants.XJConstant;
import com.yeejoin.amos.patrol.business.dao.mapper.*; import com.yeejoin.amos.patrol.business.dao.mapper.*;
import com.yeejoin.amos.patrol.business.dao.repository.*; import com.yeejoin.amos.patrol.business.dao.repository.*;
...@@ -51,17 +50,13 @@ import org.springframework.cglib.beans.BeanMap; ...@@ -51,17 +50,13 @@ import org.springframework.cglib.beans.BeanMap;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.PageImpl;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.support.TransactionSynchronization;
import org.springframework.transaction.support.TransactionSynchronizationManager;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.persistence.EntityManager; import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext; import javax.persistence.PersistenceContext;
import javax.transaction.Transactional; import javax.transaction.Transactional;
import java.lang.reflect.InvocationTargetException;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -2116,33 +2111,35 @@ public class CheckServiceImpl implements ICheckService { ...@@ -2116,33 +2111,35 @@ public class CheckServiceImpl implements ICheckService {
List<CheckInputParam> checkItems = requestParam.getCheckItems(); List<CheckInputParam> checkItems = requestParam.getCheckItems();
Map<String,List<Map<String,Object>>> mapList = (Map<String,List<Map<String,Object>>>)JSON.parse(appCheckInput.toJSONString()); Map<String,List<Map<String,Object>>> mapList = (Map<String,List<Map<String,Object>>>)JSON.parse(appCheckInput.toJSONString());
List<AppCheckInputRespone> appCheckInputRespones = new ArrayList<>(); List<AppCheckInputRespone> appCheckInputRespones = new ArrayList<>();
if (!ObjectUtils.isEmpty(mapList.get("items"))){
for (Map<String,Object> map : mapList.get("items")) {
AppCheckInputRespone appCheckInputRespone = new AppCheckInputRespone();
CheckInputParam checkInputId = checkItems.stream().filter(x -> x.getInputItemId()== Long.valueOf(map.get("checkInputId").toString())).collect(Collectors.toList()).get(0);
try {
BeanUtils.copyProperties(appCheckInputRespone, map);
} catch (Exception e) {
e.printStackTrace();
return null;
}
CheckInput checkInput = setInputValueByItemType(new CheckInput(), appCheckInputRespone.getDataJson(), appCheckInputRespone.getItemType(), checkInputId, null);
if (XJConstant.NO.equals(checkInput.getIsOk())) {
planTask.setRiskStatus(XJConstant.RISK_NUM);
esTaskDetailDto.setIsRisk(XJConstant.NO_IS_RISK);
for (Map<String,Object> map : mapList.get("items")) { }
AppCheckInputRespone appCheckInputRespone = new AppCheckInputRespone(); if(ObjectUtils.isEmpty(planTask.getRiskStatus()) || planTask.getRiskStatus() == XJConstant.INIT_NUM) {
CheckInputParam checkInputId = checkItems.stream().filter(x -> x.getInputItemId()== Long.valueOf(map.get("checkInputId").toString())).collect(Collectors.toList()).get(0); planTask.setRiskStatus(XJConstant.NORISK_NUM);
try { esTaskDetailDto.setIsRisk(XJConstant.IS_RISK);
BeanUtils.copyProperties(appCheckInputRespone, map); }
} catch (Exception e) { appCheckInputRespone.setInputValue(checkInputId.getInputValue());
e.printStackTrace(); appCheckInputRespone.setPointInputImgUrls(ObjectUtils.isEmpty(checkInputId) ? new ArrayList<>() : checkInputId.getCheckInputImg());
return null; appCheckInputRespones.add(appCheckInputRespone);
}
CheckInput checkInput = setInputValueByItemType(new CheckInput(), appCheckInputRespone.getDataJson(), appCheckInputRespone.getItemType(), checkInputId, null);
if (XJConstant.NO.equals(checkInput.getIsOk())) {
planTask.setRiskStatus(XJConstant.RISK_NUM);
esTaskDetailDto.setIsRisk(XJConstant.NO_IS_RISK);
}
if(ObjectUtils.isEmpty(planTask.getRiskStatus()) || planTask.getRiskStatus() == XJConstant.INIT_NUM) {
planTask.setRiskStatus(XJConstant.NORISK_NUM);
esTaskDetailDto.setIsRisk(XJConstant.IS_RISK);
} }
appCheckInputRespone.setInputValue(checkInputId.getInputValue()); appCheckInput.put("items", appCheckInputRespones);
appCheckInputRespone.setPointInputImgUrls(ObjectUtils.isEmpty(checkInputId) ? new ArrayList<>() : checkInputId.getCheckInputImg());
appCheckInputRespones.add(appCheckInputRespone);
} }
appCheckInput.put("items", appCheckInputRespones);
esTaskDetailDto.setPointImgUrls(requestParam.getCheckRecordImg()); esTaskDetailDto.setPointImgUrls(requestParam.getCheckRecordImg());
esTaskDetailDto.setAppCheckInput(appCheckInput); esTaskDetailDto.setAppCheckInput(appCheckInput);
esTaskDetailDto.setRemark(requestParam.getRemark());
return esTaskDetailDto; return esTaskDetailDto;
} }
......
...@@ -574,17 +574,16 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -574,17 +574,16 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
throw new YeeException("删除数据内容不能为空"); throw new YeeException("删除数据内容不能为空");
} }
Set<Long> taskNos = new HashSet<>(); Set<Long> taskNos = new HashSet<>();
ArrayList<ESPlanTaskListDto> esPlanTaskListDtos = new ArrayList<>(); List<ESTaskDetailDto> esTaskDetailDtos = new ArrayList<>();
for (String id : strArry) { for (String id : strArry) {
esTaskDetailDtos.add(new ESTaskDetailDto().setId(id));
PlanTaskDetail planTkDet = planTaskDetail.findById(Long.parseLong(id)).get(); PlanTaskDetail planTkDet = planTaskDetail.findById(Long.parseLong(id)).get();
if (null != planTkDet) { if (null != planTkDet) {
taskNos.add(planTkDet.getTaskNo()); taskNos.add(planTkDet.getTaskNo());
esPlanTaskListDtos.add(new ESPlanTaskListDto().setId(Objects.toString(planTkDet.getTaskNo())));
} }
} }
// 删除es数据 // 删除对应的es数据 + 更新巡检点数
esPlanTaskList.deleteAll(esPlanTaskListDtos); this.handleEsPlanTaskListPointsByIds(Arrays.asList(strArry), taskNos.stream().map(Objects::toString).collect(Collectors.toList()));
List<ESTaskDetailDto> esTaskDetailDtos = planTaskDetailMapper.findAllByTaskNos(esPlanTaskListDtos.stream().map(ESPlanTaskListDto::getId).collect(Collectors.toList()));
esTaskDetail.deleteAll(esTaskDetailDtos); esTaskDetail.deleteAll(esTaskDetailDtos);
planTaskMapper.planTaskDet(strArry);// 删除数据 planTaskMapper.planTaskDet(strArry);// 删除数据
HashMap<String, Object> param = new HashMap<String, Object>(); HashMap<String, Object> param = new HashMap<String, Object>();
...@@ -593,6 +592,25 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -593,6 +592,25 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
planTaskMapper.updatePlanTaskPtInfo(param);// 更新主表,点数量,完成数量 planTaskMapper.updatePlanTaskPtInfo(param);// 更新主表,点数量,完成数量
} }
/**
* 删除任务中的巡检点 + 更新巡检点数 + 未开始数
* @param taskDetailIds
* @param taskIds
*/
private void handleEsPlanTaskListPointsByIds(List<String> taskDetailIds, List<String> taskIds) {
taskIds.forEach(taskId -> esPlanTaskList.findById(taskId).ifPresent(esPlanTaskListDto -> {
List<PlanTaskDetail> points = (List<PlanTaskDetail>) esPlanTaskListDto.getPoints();
List<PlanTaskDetail> filterPoints = points.stream().filter(point -> !taskDetailIds.contains(Objects.toString(point.getId()))).collect(Collectors.toList());
esPlanTaskList.deleteById(taskId);
if (!filterPoints.isEmpty()) {
esPlanTaskListDto.setPoints(filterPoints);
esPlanTaskListDto.setTaskPlanNum(Objects.toString(filterPoints.size()));
esPlanTaskListDto.setUnplan(Objects.toString(filterPoints.stream().filter(point -> "0".equals(point.getStatus())).count()));
esPlanTaskList.save(esPlanTaskListDto);
}
}));
}
@Override @Override
public List<PlanTaskVo> planTaskReport(String toke, String product, String appKey, PlanTaskPageParam param) { public List<PlanTaskVo> planTaskReport(String toke, String product, String appKey, PlanTaskPageParam param) {
List<PlanTaskVo> content = planTaskMapper.getPlanTaskInfoList(param); List<PlanTaskVo> content = planTaskMapper.getPlanTaskInfoList(param);
...@@ -2125,6 +2143,10 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -2125,6 +2143,10 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
if (!CollectionUtils.isEmpty(list)) { if (!CollectionUtils.isEmpty(list)) {
list.forEach(e -> { list.forEach(e -> {
e.put("executiveName", e.get("userName")); e.put("executiveName", e.get("userName"));
// 填充 routeName ,企业自查显示,区分不同的管控类型的计划
String planTaskId = Objects.toString(e.get("planTaskId"));
Long routeId = planTaskMapper.selectRoutId(planTaskId);
e.put("routeName", routeDao.getOne(routeId).getName());
}); });
} }
return new PageImpl<>(list, pageParam, totle); return new PageImpl<>(list, pageParam, totle);
......
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