Commit 219dbf91 authored by tianbo's avatar tianbo

Merge branch 'develop_tzs_register' of…

Merge branch 'develop_tzs_register' of http://36.40.66.175:5000/moa/amos-boot-biz into develop_tzs_register
parents e34c09dc 6349d14d
......@@ -189,12 +189,16 @@ public class JgMaintainNoticeDto extends BaseDto {
@ApiModelProperty(value = "节点执行人")
private String promoter;
@ApiModelProperty(value = "设备类别")
@ApiModelProperty(value = "设备种类")
private String equListCode;
@ApiModelProperty(value = "设备类别名称")
private String equCategory;
@ApiModelProperty(value = "设备品种")
private String equDefine;
private List<String> roleIds;
private String dataType;
......@@ -215,4 +219,13 @@ public class JgMaintainNoticeDto extends BaseDto {
@ApiModelProperty(value = "下一节点可执行人逗号分割")
private String nextExecuteUserIds;
@ApiModelProperty(value = "告知书编码")
private String informNumber;
@ApiModelProperty(value = "code96333代码")
private String code96333;
@ApiModelProperty(value = "设备代码")
private String equCode;
}
......@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.jg.api.mapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jg.api.dto.JgMaintainNoticeDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgMaintainNotice;
import com.yeejoin.amos.boot.module.jg.api.vo.SortVo;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;
......@@ -24,7 +25,8 @@ public interface JgMaintainNoticeMapper extends CustomBaseMapper<JgMaintainNotic
* @param type 类型:enterprise-企业端、supervision-监管端
* @return 维修告知列表
*/
Page<JgMaintainNotice> queryForPage(Page<JgMaintainNotice> page,
Page<Map<String,Object>> queryForPage(Page<JgMaintainNotice> page,
@Param("sort") SortVo sortMap,
@Param("param") JgMaintainNoticeDto model,
@Param("type") String type,
@Param("orgCode") String orgCode,
......
......@@ -40,7 +40,7 @@ public interface IJgMaintainNoticeService extends IService<JgMaintainNotice> {
* @param model 查询参数
* @return 维修告知列表
*/
Page<JgMaintainNoticeDto> queryForJgMaintainNoticePage(Page<JgMaintainNotice> page, JgMaintainNoticeDto model, ReginParams reginParams);
Page<Map<String,Object>> queryForJgMaintainNoticePage(Page<JgMaintainNotice> page,String sort, JgMaintainNoticeDto model, ReginParams reginParams);
/**
* 批量删除
......
......@@ -7,22 +7,89 @@
where sequence_nbr = #{id}
</update>
<select id="queryForPage" resultType="com.yeejoin.amos.boot.module.jg.api.entity.JgMaintainNotice">
<select id="queryForPage" resultType="java.util.Map">
select
isn.*,
concat(ibjui."PROVINCE_NAME", '', ibjui."CITY_NAME", '', ibjui."COUNTY_NAME", '', ibjui."STREET_NAME", '', ibjui."ADDRESS") as fullAddress,
(select ibjoi.SUPERVISORY_CODE from idx_biz_jg_other_info ibjoi where isneq.equ_id = ibjoi.RECORD) as supervisoryCode
isn.sequence_nbr AS sequenceNbr,
isn.apply_no AS applyNo,
DATE_FORMAT(isn.notice_date,'%Y-%m-%d') AS noticeDate,
isn.notice_status AS noticeStatus,
isn.install_unit_credit_code AS installUnitCreditCode,
isn.install_unit_name AS installUnitName,
isn.equip_num AS equipNum,
isn.instance_id AS instanceId,
isn.next_executor_ids AS nextExecutorIds,
isn.execute_sequence AS executeSequence,
DATE_FORMAT(isn.rec_date,'%Y-%m-%d') AS recDate,
DATE_FORMAT(isn.create_date,'%Y-%m-%d') AS createDate,
isn.rec_user_id AS recUserId,
isn.create_user_id AS createUserId,
isn.rec_user_name AS recUserName,
isn.create_user_name AS createUserName,
isn.is_delete AS isDelete,
isn.remark AS remark,
isn.instance_status AS instanceStatus,
DATE_FORMAT(isn.accept_date,'%Y-%m-%d') AS acceptDate,
isn.province AS province,
isn.city AS city,
isn.county AS county,
isn.street AS street,
isn.address AS address,
DATE_FORMAT(isn.plan_date,'%Y-%m-%d') AS planDate,
isn.receive_company_code AS receiveCompanyCode,
isn.receive_org_name AS receiveOrgName,
isn.construction_manager AS constructionManager,
isn.construction_manager_id AS constructionManagerId,
isn.construction_manager_phone AS constructionManagerPhone,
isn.inspection_unit_credit_code AS inspectionUnitCreditCode,
isn.inspection_unit_name AS inspectionUnitName,
isn.entrusting_unit_credit_code AS entrustingUnitCreditCode,
isn.entrusting_unit_name AS entrustingUnitName,
isn.power_of_attorney AS powerOfAttorney,
isn.construction_contract AS constructionContract,
isn.is_signed_with_a AS isSignedWithA,
isn.use_unit_credit_code AS useUnitCreditCode,
isn.use_unit_name AS useUnitName,
isn.maintain_type AS maintainType,
isn.is_inspected AS isInspected,
isn.receive_org_code AS receiveOrgCode,
isn.factory_use_site_street AS factoryUseSiteStreet,
isn.street_name AS streetName,
isn.province_name AS provinceName,
isn.city_name AS cityName,
isn.county_name AS countyName,
isn.notice_report_url AS noticeReportUrl,
isn.promoter AS promoter,
isn.equ_list_code AS equListCode,
isn.equ_category AS equCategory,
isn.next_execute_ids AS nextExecuteIds,
isn.status AS status,
isn.next_task_id AS nextTaskId,
isn.create_user_company_name AS createUserCompanyName,
isn.next_execute_user_ids AS nextExecuteUserIds,
isn.transfer_to_user_ids AS transferToUserIds,
isn.inform_number AS informNumber,
isn.receive_company_org_code AS receiveCompanyOrgCode,
ri.EQU_CODE AS equCode,
(SELECT name from tz_equipment_category ec WHERE ec.code = ri.EQU_LIST) AS equListName,
(select name from tz_equipment_category ec WHERE ec.code = ri.EQU_DEFINE) AS equDefineName,
concat(ibjui."PROVINCE_NAME", '', ibjui."CITY_NAME", '', ibjui."COUNTY_NAME", '', ibjui."STREET_NAME") as
fullAddress,
ibjui."ADDRESS" as detailedAddress,
ibjoi.SUPERVISORY_CODE as supervisoryCode,
ibjoi.CODE96333 as code96333
FROM tzs_jg_maintain_notice isn
left join tzs_jg_maintain_notice_eq isneq on isn.sequence_nbr = isneq.equip_transfer_id
LEFT JOIN idx_biz_jg_use_info ibjui on isneq.equ_id = ibjui.RECORD
LEFT JOIN idx_biz_jg_register_info ri ON isneq.equ_id = ri.record
LEFT JOIN idx_biz_jg_other_info ibjoi ON isneq.equ_id = ibjoi.RECORD
<where>
isn.is_delete = 0
<if test="param != null ">
<if test="param.applyNo != null and param.applyNo != ''">
AND isn.apply_no LIKE CONCAT('%', #{param.applyNo}, '%')
</if>
<if test="param.receiveOrgCode != null and param.receiveOrgCode != ''">
AND isn.receive_org_code = #{param.receiveOrgCode}
<if test="param.receiveCompanyCode != null and param.receiveCompanyCode != ''">
AND isn.receive_company_code = #{param.receiveCompanyCode}
</if>
<if test="param.useUnitCreditCode != null and param.useUnitCreditCode != ''">
AND isn.use_unit_credit_code = #{param.useUnitCreditCode}
......@@ -39,16 +106,55 @@
<if test="param.maintainType != null and param.maintainType != ''">
AND isn.maintain_type = #{param.maintainType}
</if>
<if test="param.informNumber != null and param.informNumber != ''">
AND isn.inform_number like concat('%',#{param.informNumber},'%')
</if>
<if test="param.supervisoryCode != null and param.supervisoryCode != ''">
AND ibjoi.supervisory_code like concat('%',#{param.supervisoryCode},'%')
</if>
<if test="param.installUnitCreditCode != null and param.installUnitCreditCode != ''">
AND isn.install_unit_credit_code like concat('%',#{param.installUnitCreditCode},'%')
</if>
<if test="param.code96333 != null and param.code96333 != ''">
AND ibjoi.code96333 like concat('%',#{param.code96333},'%')
</if>
<if test="param.equCode != null and param.equCode != ''">
AND ri.EQU_CODE like concat('%',#{param.equCode},'%')
</if>
<if test="param.noticeDate != null">
AND isn.notice_date like concat('%',DATE_FORMAT(#{param.noticeDate},'%Y-%m-%d'),'%')
</if>
<if test="param.equListCode != null and param.equListCode != ''">
AND ri."EQU_LIST" = #{param.equListCode}
</if>
<if test="param.equCategory != null and param.equCategory != ''">
AND ri."equ_category" = #{param.equCategory}
</if>
<if test="param.equDefine != null and param.equDefine != ''">
AND ri."EQU_DEFINE" = #{param.equDefine}
</if>
<if test="param.fullAddress != null and param.fullAddress != ''">
AND (
ibjui."PROVINCE_NAME" LIKE CONCAT('%', #{param.fullAddress}, '%')
OR ibjui."CITY_NAME" LIKE CONCAT('%', #{param.fullAddress}, '%')
OR ibjui."COUNTY_NAME" LIKE CONCAT('%', #{param.fullAddress}, '%')
OR ibjui."STREET_NAME" LIKE CONCAT('%', #{param.fullAddress}, '%')
)
</if>
</if>
<if test="type != 'company'">
AND isn.instance_id <![CDATA[<>]]> ''
AND (isn.receive_company_code = #{orgCode} or isn.transfer_to_user_ids like concat('%',#{userId},'%'))
</if>
<if test="type == 'company'">
AND (isn.install_unit_credit_code = #{orgCode} or isn.transfer_to_user_ids like concat('%',#{userId},'%'))
AND (isn.install_unit_credit_code = #{orgCode} or isn.transfer_to_user_ids like
concat('%',#{userId},'%'))
</if>
</where>
ORDER BY
<if test="sort != null">
isn.${sort.field} ${sort.sortType},
</if>
isn.apply_no DESC
</select>
......
......@@ -370,7 +370,11 @@
</sql>
<select id="queryForUnitPipelineEquipmentPage" resultType="com.alibaba.fastjson.JSONObject">
<include refid="page-list-pipeline"/>
WHERE ri."EQU_CATEGORY" = '8300' and ui."DATA_SOURCE" = 'jg'
WHERE
ri."EQU_CATEGORY" = '8300'
and ui."DATA_SOURCE" = 'jg'
and NOT(ui."EQU_STATE" is not null )
and NOT(ri."USE_ORG_CODE" is not null )
<if test="jsonObject.useUnitCreditCode != null and jsonObject.useUnitCreditCode != ''" >
and ui."USE_UNIT_CREDIT_CODE" = #{jsonObject.useUnitCreditCode}
</if>
......@@ -422,9 +426,14 @@
</sql>
<select id="queryForUnitVesselEquipmentPage" resultType="com.alibaba.fastjson.JSONObject">
<include refid="page-list-vessel"/>
WHERE ri."EQU_CATEGORY" = '2300' and ui."DATA_SOURCE" = 'jg' and (ri.whether_vehicle_cylinder is null or ri.whether_vehicle_cylinder != 1)
<if test="jsonObject.useUnitCreditCode != null and jsonObject.useUnitCreditCode != ''" >
and ui."USE_UNIT_CREDIT_CODE" = #{jsonObject.useUnitCreditCode}
WHERE
ri."EQU_CATEGORY" = '2300'
and ui."DATA_SOURCE" = 'jg'
and NOT(ui."EQU_STATE" is not null )
and NOT(ri."USE_ORG_CODE" is not null )
and (ri.whether_vehicle_cylinder is null or ri.whether_vehicle_cylinder != 1)
<if test="jsonObject.useUnitCreditCode != null and jsonObject.useUnitCreditCode != ''">
and ui."USE_UNIT_CREDIT_CODE" = #{jsonObject.useUnitCreditCode}
</if>
<if test="jsonObject.record != null and jsonObject.record != ''" >
and ui."RECORD" = #{jsonObject.record}
......
......@@ -123,14 +123,15 @@ public class JgMaintainNoticeController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/page")
@ApiOperation(httpMethod = "POST", value = "维修告知分页查询", notes = "维修告知分页查询")
public ResponseModel<Page<JgMaintainNoticeDto>> queryForPage(
public ResponseModel<Page<Map<String,Object>>> queryForPage(
@ApiParam(value = "当前页码", required = true) @RequestParam(value = "current", defaultValue = "1") int current,
@ApiParam(value = "每页大小", required = true) @RequestParam(value = "size", defaultValue = "20") int size,
@ApiParam(value = "排序字段",required = false) @RequestParam(value = "sort",required = false) String sort,
@RequestBody(required = false) JgMaintainNoticeDto model
) {
Page<JgMaintainNotice> page = new Page<>(current, size);
ReginParams reginParams = getSelectedOrgInfo();
return ResponseHelper.buildResponse(iJgMaintainNoticeService.queryForJgMaintainNoticePage(page, model, reginParams));
return ResponseHelper.buildResponse(iJgMaintainNoticeService.queryForJgMaintainNoticePage(page, sort, model, reginParams));
}
/**
......
......@@ -1484,12 +1484,10 @@ public class CommonServiceImpl implements ICommonService {
String equCategory = equipRegistrationInfo.getEquCategory(); // 设备类别 "3100"
String equDefine = equipRegistrationInfo.getEquDefine(); // 设备品种 "3110"
if (!ObjectUtils.isEmpty(equCategory)) {
// 设备种类简称
String equCategoryAbbrName = Optional.ofNullable(CylinderTypeEnum.CYLINDER.getCode().equals(equCategory) ?
CylinderTypeEnum.CYLINDER.getName() : equCategory)
.map(category -> category.substring(0, 1))
.map(EquipTypeEnum::getMessage)
.orElse(null);
// 设备种类简称,如果是气瓶返回瓶
String equCategoryAbbrName = CylinderTypeEnum.CYLINDER.getCode().equals(equCategory) ?
CylinderTypeEnum.CYLINDER.getName() :
EquipTypeEnum.getMessage(equCategory.substring(0, 1));
// 设备代码中间两位
String equipType2MidDigits;
......
......@@ -23,6 +23,7 @@ import com.yeejoin.amos.boot.module.jg.api.mapper.JgMaintainNoticeEqMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgMaintainNoticeMapper;
import com.yeejoin.amos.boot.module.jg.api.service.IJgInstallationNoticeService;
import com.yeejoin.amos.boot.module.jg.api.service.IJgMaintainNoticeService;
import com.yeejoin.amos.boot.module.jg.api.vo.SortVo;
import com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient;
import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgRegisterInfoService;
import com.yeejoin.amos.boot.module.jg.biz.utils.WordTemplateUtils;
......@@ -304,28 +305,25 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
* @return 维修告知列表
*/
@Override
public Page<JgMaintainNoticeDto> queryForJgMaintainNoticePage(Page<JgMaintainNotice> page, JgMaintainNoticeDto model, ReginParams reginParams) {
public Page<Map<String,Object>> queryForJgMaintainNoticePage(Page<JgMaintainNotice> page, String sort, JgMaintainNoticeDto model, ReginParams reginParams) {
String orgCode = reginParams.getCompany().getCompanyCode();
String type = reginParams.getCompany().getLevel();
String userId = reginParams.getUserModel().getUserId();
SortVo sortMap = commonService.sortFieldConversion(sort);
List<DataDictionary> dictionaries = dataDictionaryService.getByType("WXLX");
Page<JgMaintainNotice> noticePage = jgMaintainNoticeMapper.queryForPage(page, model, type, orgCode, userId);
Page<JgMaintainNoticeDto> noticeDtoPage = new Page<>();
BeanUtils.copyProperties(noticePage, noticeDtoPage, "records");
List<JgMaintainNoticeDto> records = noticePage.getRecords().stream().map(notice -> {
JgMaintainNoticeDto noticeDto = new JgMaintainNoticeDto();
BeanUtils.copyProperties(notice, noticeDto);
if (Objects.nonNull(notice.getNoticeStatus())) {
String noticeStatusDesc = FlowStatusEnum.getNameByType(Long.valueOf(notice.getNoticeStatus()));
noticeDto.setNoticeStatusDesc(noticeStatusDesc);
}
if (Objects.nonNull(notice.getMaintainType())) {
noticeDto.setMaintainTypeDesc(dictionaries.stream().filter(d -> notice.getMaintainType().equals(d.getCode())).map(DataDictionary::getName).collect(Collectors.joining()));
}
return noticeDto;
}).collect(java.util.stream.Collectors.toList());
noticeDtoPage.setRecords(records);
return noticeDtoPage;
Page<Map<String,Object>> noticePage = jgMaintainNoticeMapper.queryForPage(page,sortMap, model, type, orgCode, userId);
List<Map<String, Object>> mappedRecords = noticePage.getRecords().stream().peek(notice -> {
Optional<Long> noticeStatusOpt = Optional.ofNullable((String) notice.get("noticeStatus")).map(Long::valueOf);
noticeStatusOpt.ifPresent(status -> {
String noticeStatusDesc = FlowStatusEnum.getNameByType(status);
notice.put("noticeStatusDesc", noticeStatusDesc);
String maintainTypeDesc = dictionaries.stream().filter(d -> notice.get("maintainType").equals(d.getCode())).map(DataDictionary::getName).collect(Collectors.joining());
notice.put("maintainTypeDesc", maintainTypeDesc);
});
}).collect(Collectors.toList());
noticePage.setRecords(mappedRecords);
return noticePage;
}
/**
......
......@@ -268,9 +268,9 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
public void addNotInDJJGDictionary(List<BaseUnitLicence> baseUnitLicences) {
List<String> approvedOrganList = baseUnitLicences.stream()
.map(BaseUnitLicence::getApprovedOrgan)
.distinct()
.collect(Collectors.toList());
List<DataDictionary> allDictionaryList = this.initAllDataDictionaryList();
Set<String> existingNames = allDictionaryList.stream()
.filter(d -> d.getType().equals(DICT_TYPE_DJJG))
.map(DataDictionary::getName)
......
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