Commit 55ff5fdd authored by 韩桐桐's avatar 韩桐桐

fix(jg):设备移交列表查询修改

parent c13eedd1
......@@ -121,6 +121,12 @@ public class JgEquipTransferDto extends BaseDto {
@ApiModelProperty(value = "设备地址")
private String equAddress;
@ApiModelProperty(value = "详细地址")
private String detailedAddress;
@ApiModelProperty(value = "96333识别码")
private String code96333;
@ApiModelProperty(value = "流程建议")
private String processAdvice;
......
......@@ -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.JgEquipTransferDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgEquipTransfer;
import com.yeejoin.amos.boot.module.jg.api.vo.SortVo;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;
import java.util.List;
......@@ -15,7 +16,10 @@ import java.util.Map;
* @date 2023-12-20
*/
public interface JgEquipTransferMapper extends CustomBaseMapper<JgEquipTransfer> {
Page<JgEquipTransferDto> queryForPage(Page<JgEquipTransferDto> page, @Param("param") JgEquipTransferDto model, @Param("currentUserId") String currentUserId);
Page<JgEquipTransferDto> queryForPage(Page<JgEquipTransferDto> page,
@Param("sort") SortVo sortMap,
@Param("param") JgEquipTransferDto model,
@Param("currentUserId") String currentUserId);
@MapKey("sequenceNbr")
List<Map<String, Object>> queryEquipInformation(Long sequenceNbr);
......
......@@ -23,8 +23,7 @@ public interface IJgEquipTransferService extends IService<JgEquipTransfer> {
* @param dto 查询参数
* @return 设备移交分页列表
*/
Page<JgEquipTransferDto> queryForJgEquipTransferPage(Page<JgEquipTransferDto> page, JgEquipTransferDto dto, ReginParams reginParams);
Page<JgEquipTransferDto> queryForJgEquipTransferPage(Page<JgEquipTransferDto> page,String sort, JgEquipTransferDto dto, ReginParams reginParams);
/**
* 根据sequenceNbr查询
*
......
......@@ -47,6 +47,9 @@
<if test="dto.supervisoryCode != null and dto.supervisoryCode != ''">
and ur.supervisory_code like concat('%',#{dto.supervisoryCode},'%')
</if>
<if test="dto.applyNo != null and dto.applyNo != ''">
and ur.apply_no like concat('%',#{dto.applyNo},'%')
</if>
<if test="dto.useRegistrationCode != null and dto.useRegistrationCode != ''">
and ur.use_registration_code like concat('%',#{dto.useRegistrationCode},'%')
</if>
......
......@@ -11,13 +11,13 @@
select
crt.sequence_nbr as sequenceNbr,
crt.audit_status as auditStatus,
crt.reg_date as regDate,
DATE_FORMAT(crt.reg_date,'%Y-%m-%d') as regDate,
crt.status,
crt.receive_org_name as receiveOrgName,
crt.apply_no as applyNo,
crt.next_executor_ids AS nextExecutorIds,
crt.promoter,
crt.rec_date as recDate,
DATE_FORMAT(crt.rec_date,'%Y-%m-%d') as recDate,
crt.instance_id as instanceId,
crt.use_registration_code as useRegistrationCode,
crt.next_execute_user_ids as nextExecuteUserIds,
......
......@@ -48,13 +48,15 @@
fi.ins_use_maintain_explain AS insUseMaintainExplain,
ui.safety_manager AS safetyManager,
ui.phone AS safetyManagerPhone,
CONCAT_WS('',ui.PROVINCE_NAME, ui.CITY_NAME, ui.COUNTY_NAME, ui.STREET_NAME, ui.ADDRESS) AS equAddress,
CONCAT_WS('',ui.PROVINCE_NAME, ui.CITY_NAME, ui.COUNTY_NAME, ui.STREET_NAME) AS equAddress,
ui."ADDRESS" as detailedAddress,
ui.USE_INNER_CODE AS useInnerCode,
jet.create_date AS createDate,
jet.next_execute_user_ids as nextExecuteUserIds,
jet.create_user_id as createUserId,
jet.next_task_id as nextTaskId,
(select SUPERVISORY_CODE from idx_biz_jg_other_info oi WHERE oi.record = ete.equ_id) AS supervisoryCode,
oi.SUPERVISORY_CODE AS supervisoryCode,
oi.CODE96333 as code96333,
(select name from tz_equipment_category tec1 where tec1.code = ri."EQU_LIST") AS equList,
(select name from tz_equipment_category tec2 where tec2.code = ri."EQU_CATEGORY") AS equCategory,
(select name from tz_equipment_category tec3 where tec3.code = ri."EQU_DEFINE") AS equDefine
......@@ -65,9 +67,31 @@
LEFT JOIN idx_biz_jg_design_info di ON di.record = ete.equ_id
LEFT JOIN idx_biz_jg_factory_info fi ON fi.record = ete.equ_id
LEFT JOIN idx_biz_jg_use_info ui ON ui.record = ete.equ_id
LEFT JOIN idx_biz_jg_other_info oi ON oi.RECORD = ete.equ_id
<where>
jet.is_delete = false
<if test="param != null ">
<if test="param.equList != null and param.equList != ''">
AND ri."EQU_LIST" = #{param.equList}
</if>
<if test="param.useOrgCode != null and param.useOrgCode != ''">
AND ri."use_org_code" like concat('%',#{param.useOrgCode},'%')
</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.equCode != null and param.equCode != ''">
AND ri."EQU_CODE" like concat('%',#{param.equCode},'%')
</if>
<if test="param.code96333 != null and param.code96333 != ''">
AND oi.CODE96333 like concat('%',#{param.code96333},'%')
</if>
<if test="param.supervisoryCode != null and param.supervisoryCode != ''">
AND oi.SUPERVISORY_CODE like concat('%',#{param.supervisoryCode},'%')
</if>
<if test="param.applyNo != null and param.applyNo != ''">
AND jet.apply_no LIKE CONCAT('%', #{param.applyNo}, '%')
</if>
......@@ -83,6 +107,14 @@
<if test="param.applyDate != null and param.applyDate != ''">
AND date_format(jet.apply_date, '%Y-%m-%d') = #{param.applyDate}
</if>
<if test="param.equAddress != null and param.equAddress != ''">
AND (
ui."PROVINCE_NAME" LIKE CONCAT('%', #{param.equAddress}, '%')
OR ui."CITY_NAME" LIKE CONCAT('%', #{param.equAddress}, '%')
OR ui."COUNTY_NAME" LIKE CONCAT('%', #{param.equAddress}, '%')
OR ui."STREET_NAME" LIKE CONCAT('%', #{param.equAddress}, '%')
)
</if>
</if>
<choose>
<when test="param.useUnitCodeFilter != '' and param.useUnitCodeFilter != null and
......@@ -106,7 +138,11 @@
</otherwise>
</choose>
</where>
ORDER BY jet.apply_date DESC
ORDER BY
<if test="sort != null">
jet.${sort.field} ${sort.sortType},
</if>
jet.apply_date DESC
</select>
<select id="queryEquipInformation" resultType="java.util.Map">
select
......
......@@ -94,6 +94,9 @@
<if test="dto.useUnitName != null and dto.useUnitName != ''">
and ur.use_unit_name like concat('%',#{dto.useUnitName},'%')
</if>
<if test="dto.applyNo != null and dto.applyNo != ''">
and ur.apply_no like concat('%',#{dto.applyNo},'%')
</if>
<if test="dto.useRegistrationCode != null and dto.useRegistrationCode != ''">
and ur.use_registration_code like concat('%',#{dto.useRegistrationCode},'%')
</if>
......@@ -154,6 +157,9 @@
<if test="dto.useUnitName != null and dto.useUnitName != ''">
and ur.use_unit_name like concat('%',#{dto.useUnitName},'%')
</if>
<if test="dto.applyNo != null and dto.applyNo != ''">
and ur.apply_no like concat('%',#{dto.applyNo},'%')
</if>
<if test="dto.useRegistrationCode != null and dto.useRegistrationCode != ''">
and ur.use_registration_code like concat('%',#{dto.useRegistrationCode},'%')
</if>
......
......@@ -112,9 +112,10 @@ public class JgEquipTransferController extends BaseController {
@ApiOperation(httpMethod = "POST", value = "设备移交分页查询", notes = "设备移交分页查询")
public ResponseModel<Page<JgEquipTransferDto>> queryForPage(@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size,
@RequestParam(value = "sort",required = false) String sort,
@RequestBody(required = false) JgEquipTransferDto dto) {
Page<JgEquipTransferDto> page = new Page<>(current, size);
return ResponseHelper.buildResponse(jgEquipTransferServiceImpl.queryForJgEquipTransferPage(page, dto, getSelectedOrgInfo()));
return ResponseHelper.buildResponse(jgEquipTransferServiceImpl.queryForJgEquipTransferPage(page,sort, dto, getSelectedOrgInfo()));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
......
......@@ -21,6 +21,7 @@ import com.yeejoin.amos.boot.module.jg.api.mapper.JgEquipTransferEqMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgEquipTransferMapper;
import com.yeejoin.amos.boot.module.jg.api.service.IJgEquipTransferService;
import com.yeejoin.amos.boot.module.jg.api.service.IJgInstallationNoticeService;
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.ymt.api.common.BaseException;
......@@ -43,7 +44,6 @@ import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StopWatch;
import org.springframework.util.StringUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.rdbms.service.BaseService;
......@@ -540,7 +540,7 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
}
@Override
public Page<JgEquipTransferDto> queryForJgEquipTransferPage(Page<JgEquipTransferDto> page, JgEquipTransferDto dto, ReginParams reginParams) {
public Page<JgEquipTransferDto> queryForJgEquipTransferPage(Page<JgEquipTransferDto> page, String sort, JgEquipTransferDto dto, ReginParams reginParams) {
CompanyBo company = reginParams.getCompany();
Map<String, Object> companyTypeMap = jrmInstallationNoticeService.getCompanyType();
String companyLevel = getStringFromMap(companyTypeMap, "companyLevel");
......@@ -553,7 +553,8 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
dto.setInstallUnitCodeFilter(company.getCompanyCode());
}
}
Page<JgEquipTransferDto> equipTransferPage = this.baseMapper.queryForPage(page, dto, reginParams.getUserModel().getUserId());
SortVo sortMap = commonService.sortFieldConversion(sort);
Page<JgEquipTransferDto> equipTransferPage = this.baseMapper.queryForPage(page,sortMap, dto, reginParams.getUserModel().getUserId());
equipTransferPage.getRecords().forEach(transfer -> {
if (Objects.nonNull(transfer.getApplyStatus())) {
transfer.setApplyStatusDesc(FlowStatusEnum.getNameByType(Long.valueOf(transfer.getApplyStatus())));
......
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