Commit bc665a36 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 # Conflicts: # amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/mapper/JgUseRegistrationMapper.java # amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgUseRegistrationMapper.xml
parents 0203759d 8a64ba97
package com.yeejoin.amos.boot.module.jg.api.enums;
import lombok.Getter;
import java.util.Arrays;
import java.util.Optional;
/**
* 使用登记业务类型枚举
*
* @author Administrator
*/
@Getter
public enum RegOrgEnum {
/**
* 使用登记业务类型枚举
*/
REG_ORG("0", "非西安市场监督管理局"),
REG_ORG_610102("1", "新城区市场监督管理局"),
REG_ORG_610103("2", "碑林区市场监督管理局"),
REG_ORG_610104("3", "莲湖区市场监督管理局"),
REG_ORG_610111("4", "灞桥区市场监督管理局"),
REG_ORG_610112("5", "未央区市场监督管理局"),
REG_ORG_610113("6", "雁塔区市场监督管理局"),
REG_ORG_610114("7", "阎良区市场监督管理局"),
REG_ORG_610115("8", "临潼区市场监督管理局"),
REG_ORG_610116("9", "长安区市场监督管理局"),
REG_ORG_610122("10", "蓝田县市场监督管理局"),
REG_ORG_610124("11", "周至县市场监督管理局"),
REG_ORG_610125("12", "鄠邑区市场监督管理局"),
REG_ORG_610126("13", "高陵区市场监督管理局"),
REG_ORG_610132("14", "经开区分局"),
REG_ORG_610131("15", "高新区分局"),
REG_ORG_610169100("16", "港务浐灞分局"),
REG_ORG_610133("17", "曲江新区分局");
private final String code;
private final String name;
RegOrgEnum(String code, String name) {
this.code = code;
this.name = name;
}
public static Optional<String> getNameByCode(String code) {
return Arrays.stream(RegTypeEnum.values())
.filter(e -> e.getCode().equals(code))
.map(RegTypeEnum::getName)
.findFirst();
}
public static Optional<String> getCodeByName(String name) {
return Arrays.stream(RegTypeEnum.values())
.filter(e -> e.getName().equals(name))
.map(RegTypeEnum::getCode)
.findFirst();
}
}
......@@ -9,6 +9,7 @@ import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistration;
import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationEq;
import com.yeejoin.amos.boot.module.jg.api.vo.SortVo;
import com.yeejoin.amos.boot.module.jg.api.vo.tableDataExportVo.RegistrationVo;
import com.yeejoin.amos.boot.module.ymt.api.vo.XianElevatorVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
......@@ -145,6 +146,7 @@ public interface JgUseRegistrationMapper extends BaseMapper<JgUseRegistration> {
Page<JgNoticeToBeSubmitDto> queryRegistrationToBeSubmitPage(@Param("page") Page<JgNoticeToBeSubmitDto> page, @Param("companyCode")String companyCode);
List<XianElevatorVo> queryXianElevatorData(@Param("beginDate")String beginDate, @Param("endDate") String endDate);
List<JgUseRegistrationEq> selectListForInstallNoticeDiscard(@Param("records") List<String> records);
List<JgUseRegistrationEq> selectListForSelfDiscard(@Param("records") List<String> records);
......
......@@ -1928,6 +1928,70 @@
WHERE dedup.rn = 1
ORDER BY dedup.createDate DESC, dedup.applyNo DESC
</select>
<select id="queryXianElevatorData" resultType="com.yeejoin.amos.boot.module.ymt.api.vo.XianElevatorVo">
SELECT
ibjri.RECORD as regCode,
ibjfi.FACTORY_NUM as factoryNum,
joi.CODE96333 as spotCode,
ibjri.USE_ORG_CODE as regCertCode,
date_format(tjur.audit_pass_date , '%Y-%m-%d') as regCertTime,
date_format(tjur.create_date,'%Y-%m-%d') as applyDate,
ibjui.USE_INNER_CODE as useInnerCode,
ibjtpe.SXCSBHZZ_PRODUCT_NO as upProtectCode,
ibjtpe.JMMSZZ_MANUFACTURER as carLockEnterp,
ibjtpe.DCHCQ_MANUFACTURER as heavyBufferEnterp,
ibjtpe.QDZJ_RATED_SPEED as driveHostRatedSpeed,
ibjtpe.QDZJ_MANUFACTURER as driveHostProduceEnterp,
ibjtpe.XGXL_MEDIA_MODEL as suspensionMediumModel,
ibjtpe.JXYWYDBHZZ_MANUFACTURER as carMoveProtectEnterp,
ibjtpe.JXHCQ_PRODUCT_NO as carBufferCode,
ibjtpe.XGXL_MEDIA_TYPE as suspensionMediumCategory,--悬挂介质种类
ibjtpe.JXHCQ_MODEL as carBufferModel,
ibjtpe.XSQ_MODEL as limitModel,
ibjtpe.JXHCQ_MANUFACTURER as carBufferEnterp,
ibjtpe.CMMSZZ_MODEL as doorLockModel,
ibjtpe.AQQ_PRODUCT_NO as safeClamCode,
ibjtpe.CMMSZZ_MANUFACTURER as doorLockEnterp,
ibjtpe.QDZJ_RATED_POWER as driveHostRatedPower,
ibjtpe.SXCSBHZZ_MODEL as upProtectModel,
ibjtpe.CMMSZZ_PRODUCT_NO as doorLockCode,
ibjtpe.AQQ_MANUFACTURER as safeClamEnterp,
ibjtpe.DCHCQ_MODEL as heavyBufferModel,
tjur.RECEIVE_ORG_NAME as regOrgId,--注册机构
ibjtpe.QDZJ_MODEL as driveHostModel,
ibjtpe.AQQ_MODEL as safeClamModel,
ibjtpe.KZG_MANUFACTURER as controlCabEnterp,
ibjtpe.JMMSZZ_MODEL as carLockModel,
ibjtpe.SXCSBHZZ_MANUFACTURER as upProtectEnterp,
ibjtpe.XSQ_MANUFACTURER as limitEnterp,
ibjtpe.KZG_MODEL as controlCabModel,
ibjtpe.KZG_PRODUCT_NO as controlCabCode,
ibjtpe.QDZJ_PRODUCT_NO as driveHostCode,
ibjtpe.XSQ_PRODUCT_NO as limitCode,
ibjtpe.XGXL_MEDIA_SPECIFICATION as suspensionMediumSpec,
ibjtpe.JXYWYDBHZZ_MODEL as carMoveProtectModel,
ibjtpe.DCHCQ_PRODUCT_NO as heavyBufferCode,
ibjtpe.JXYWYDBHZZ_PRODUCT_NO as carMoveProtectCode,
ibjtpe.XGXL_MEDIA_NUMBER as suspensionMediumTotal,
ibjtpe.JMMSZZ_PRODUCT_NO as carLockCode,
ibjtpe.QDZJ_REDUCTION_RATIO as driveHostReduceRatio,
tjur.SUPERVISION_ORG_CODE as supervisionOrgCode,
ibjui.DATA_SOURCE as dataSource
FROM
tzs_jg_use_registration_eq tjure
LEFT JOIN tzs_jg_use_registration tjur ON tjur.sequence_nbr = tjure.equip_transfer_id
LEFT JOIN idx_biz_jg_use_info ibjui ON tjure.equ_id = ibjui."RECORD"
LEFT JOIN idx_biz_jg_register_info ibjri on ibjri."RECORD" = tjure.equ_id
LEFT JOIN idx_biz_jg_factory_info ibjfi on ibjfi."RECORD" = tjure.equ_id
LEFT JOIN idx_biz_jg_other_info joi ON joi."RECORD" = tjure.equ_id
LEFT JOIN idx_biz_jg_tech_params_elevator ibjtpe ON ibjtpe."RECORD" = tjure.equ_id
WHERE ibjri."EQU_LIST" = '3000'
AND tjur.status = '已完成'
AND (tjur.audit_pass_date between #{beginDate} and #{endDate})
AND tjur.supervision_org_code LIKE CONCAT('50*52', '%')
ORDER BY tjur.audit_pass_date
</select>
<select id="selectListForInstallNoticeDiscard" resultType="com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationEq">
SELECT
eq.sequence_nbr,
......
......@@ -8,7 +8,6 @@ import com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationDto;
import com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationManageDto;
import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum;
import com.yeejoin.amos.boot.module.jg.biz.service.IJgTableDataExportService;
import com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseEnterpriseInfoDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
......@@ -304,4 +303,18 @@ public class JgTableDataExportController extends BaseController {
}).start();
return ResponseHelper.buildResponse("后台处理中,请注意下载!");
}
/**
* 西安电梯设备数据导出
* @param beginDate 开始时间
* @param endDate 结束时间
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/exportXianElevatorData")
@ApiOperation(httpMethod = "GET", value = "西安电梯设备数据导出", notes = "西安电梯设备数据导出")
public void exportXianData(HttpServletResponse response,@ApiParam(value = "开始日期", required = true) @RequestParam String beginDate,
@ApiParam(value = "结束日期", required = true) @RequestParam String endDate) {
iJgTableDataExportService.exportXianElevatorData(response, beginDate, endDate);
}
}
......@@ -4,7 +4,6 @@ package com.yeejoin.amos.boot.module.jg.biz.service;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationDto;
import com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationManageDto;
import com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseEnterpriseInfoDto;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
......@@ -64,4 +63,6 @@ public interface IJgTableDataExportService {
void userInfoExport(String uuid, String ids, Map<String, Object> map);
void userInfoExportWithAdmin(String uuid, String ids, Map<String, Object> map);
void exportXianElevatorData(HttpServletResponse response, String beginDate, String endDate);
}
......@@ -9,7 +9,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.CompanyBo;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
......@@ -145,7 +144,7 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
private EventPublisher eventPublisher;
@Transactional(rollbackFor = Exception.class)
@GlobalTransactional(rollbackFor = Exception.class)
@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 600000)
public List<JgChangeRegistrationName> save2(String submitType, JSONObject requestParam) {
Map<String, JSONObject> jgRegistrationInfoMap = (Map<String, JSONObject>) JSONObject.parseObject(JSONObject.toJSONString(requestParam), Map.class);
return Collections.singletonList(this.save(submitType, jgRegistrationInfoMap));
......
......@@ -14,6 +14,7 @@ import com.yeejoin.amos.boot.biz.common.excel.ExcelUtil;
import com.yeejoin.amos.boot.biz.common.utils.RequestContextWrapper;
import com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationDto;
import com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationManageDto;
import com.yeejoin.amos.boot.module.jg.api.enums.RegOrgEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.RegTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.*;
import com.yeejoin.amos.boot.module.jg.api.vo.tableDataExportVo.*;
......@@ -25,6 +26,7 @@ import com.yeejoin.amos.boot.module.jg.biz.utils.DictUtil;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption;
import com.yeejoin.amos.boot.module.ymt.api.mapper.TzBaseEnterpriseInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.TzsUserInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.vo.XianElevatorVo;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import lombok.extern.slf4j.Slf4j;
......@@ -928,5 +930,19 @@ public class JgTableDataExportServiceImpl implements IJgTableDataExportService {
.fluentPut("time", new Date().getTime()));
}
@Override
public void exportXianElevatorData(HttpServletResponse response, String beginDate, String endDate) {
List<XianElevatorVo> exportData = registrationMapper.queryXianElevatorData(beginDate, endDate);
for (XianElevatorVo vo : exportData) {
vo.setRegOrgId(RegOrgEnum.getCodeByName(vo.getRegOrgId()).orElse(""));
boolean isXaHistory = Optional.ofNullable(vo.getDataSource())
.map(ds -> ds.contains("jg_his_xa"))
.orElse(false);
vo.setRegCode(isXaHistory ? vo.getRegCode() : "");
vo.setUseInnerCode(Optional.ofNullable(vo.getUseInnerCode())
.filter(v -> !"null".equalsIgnoreCase(v.trim()))
.orElse(""));
}
ExcelUtil.createTemplate(response, "西安电梯设备数据导出", "西安电梯设备数据导出", exportData, XianElevatorVo.class, null, false);
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.ymt.api.vo;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
/**
* 西安电梯VO
*/
@Data
public class XianElevatorVo {
@ExcelProperty(value = "设备注册代码(regCode)")
String regCode;
@ExcelProperty(value = "出厂编号/产品编码")
String factoryNum;
@ExcelProperty(value = "96333 识别码(spotCode)")
String spotCode;
@ExcelProperty(value = "使用登记证编号(regCertCode)")
String regCertCode;
@ExcelProperty(value = "使用登记日期(regCertTime)")
String regCertTime;
@ExcelProperty(value = "上行保护装置编号(upProtectCode)")
String upProtectCode;
@ExcelProperty(value = "轿门门锁制造单位(carLockEnterp)")
String carLockEnterp;
@ExcelProperty(value = "使用内部编码(useInnerCode)")
String useInnerCode;
@ExcelProperty(value = "对重缓冲器生产企业(heavyBufferEnterp)")
String heavyBufferEnterp;
@ExcelProperty(value = "驱动主机额定转速(driveHostRatedSpeed)")
String driveHostRatedSpeed;
@ExcelProperty(value = "驱动主机制造单位(driveHostProduceEnterp)")
String driveHostProduceEnterp;
@ExcelProperty(value = "悬挂介质型号(suspensionMediumModel)")
String suspensionMediumModel;
@ExcelProperty(value = "申请日期(applyDate,时间戳:毫秒)")
String applyDate;
@ExcelProperty(value = "轿厢意外移动保护装置制造单位(carMoveProtectEnterp)")
String carMoveProtectEnterp;
@ExcelProperty(value = "轿厢缓冲器编号(carBufferCode)")
String carBufferCode;
@ExcelProperty(value = "悬挂介质种类(suspensionMediumCategory)")
String suspensionMediumCategory;
@ExcelProperty(value = "轿厢缓冲器型号(carBufferModel)")
String carBufferModel;
@ExcelProperty(value = "轿厢限速器型号(limitModel)")
String limitModel;
@ExcelProperty(value = "轿厢缓冲器制造单位业(carBufferEnterp)")
String carBufferEnterp;
@ExcelProperty(value = "层门门锁型号(doorLockModel)")
String doorLockModel;
@ExcelProperty(value = "安全钳编码(safeClamCode)")
String safeClamCode;
@ExcelProperty(value = "层门门锁制造单位(doorLockEnterp)")
String doorLockEnterp;
@ExcelProperty(value = "驱动主机额定功率(driveHostRatedPower,单位:kW)")
String driveHostRatedPower;
@ExcelProperty(value = "上行保护装置型号(upProtectModel)")
String upProtectModel;
@ExcelProperty(value = "层门门锁编号(doorLockCode)")
String doorLockCode;
@ExcelProperty(value = "安全钳生产企业(safeClamEnterp)")
String safeClamEnterp;
@ExcelProperty(value = "对重缓冲器型号(heavyBufferModel)")
String heavyBufferModel;
@ExcelProperty(value = "注册机构(regOrgId)")
String regOrgId;
@ExcelProperty(value = "驱动主机型号(driveHostModel)")
String driveHostModel;
@ExcelProperty(value = "安全钳型号(safeClamModel)")
String safeClamModel;
@ExcelProperty(value = "控制柜制造单位(controlCabEnterp)")
String controlCabEnterp;
@ExcelProperty(value = "轿厢门锁型号(carLockModel)")
String carLockModel;
@ExcelProperty(value = "上行保护装置生产企业(upProtectEnterp)")
String upProtectEnterp;
@ExcelProperty(value = "轿厢限速器制造单位(limitEnterp)")
String limitEnterp;
@ExcelProperty(value = "控制柜型号(controlCabModel)")
String controlCabModel;
@ExcelProperty(value = "控制柜编码(controlCabCode)")
String controlCabCode;
@ExcelProperty(value = "驱动主机编码(driveHostCode)")
String driveHostCode;
@ExcelProperty(value = "轿厢限速器编号(limitCode)")
String limitCode;
@ExcelProperty(value = "悬挂介质规格(suspensionMediumSpec)")
String suspensionMediumSpec;
@ExcelProperty(value = "轿厢意外移动保护装置型号(carMoveProtectModel)")
String carMoveProtectModel;
@ExcelProperty(value = "对重缓冲器编码(heavyBufferCode")
String heavyBufferCode;
@ExcelProperty(value = "轿厢意外移动保护装置编号(carMoveProtectCode)")
String carMoveProtectCode;
@ExcelProperty(value = "悬挂介质数量(suspensionMediumTotal)")
String suspensionMediumTotal;
@ExcelProperty(value = "轿门锁编号(carLockCode)")
String carLockCode;
@ExcelProperty(value = "驱动主机减速比(driveHostReduceRatio)")
String driveHostReduceRatio;
@ExcelProperty(value = "限速器校验日期(governorVerificateDate)")
String governorVerificateDate;
@ExcelProperty(value = "限速器校验报告(governorVerificateReport)")
String governorVerificateReport;
@ExcelIgnore
String dataSource;
}
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