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

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

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