Commit 9c764b70 authored by 韩桐桐's avatar 韩桐桐

fix(jg):移装变更列表查询修改

parent 40be656c
......@@ -83,6 +83,9 @@ public class JgChangeRegistrationTransferDto extends BaseDto {
@ApiModelProperty (value = "使用登记编号")
private String useRegistrationCode;
@ApiModelProperty(value = "96333识别码")
private String code96333;
@ApiModelProperty (value = "流程实例id")
private String instanceId;
......@@ -122,6 +125,16 @@ public class JgChangeRegistrationTransferDto extends BaseDto {
private String dataType;
private String unitCode;
@ApiModelProperty(value = "申请日期,接收查询参数")
private String applicationDate;
@ApiModelProperty("设备品种")
private String equDefine;
@ApiModelProperty(value = "设备种类")
private String equList;
@ApiModelProperty (value = "下一节点可执行人")
private String nextExecuteUserIds;
......
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jg.api.dto.JgChangeRegistrationTransferDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgChangeRegistrationTransfer;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.jg.api.vo.SortVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
......@@ -20,7 +21,11 @@ public interface JgChangeRegistrationTransferMapper extends BaseMapper<JgChangeR
void updatePromoter(@Param ("id")Long id);
Page<Map<String, Object>> getListPage(@Param("page")Page<Map<String, Object>> page, @Param("dto") JgChangeRegistrationTransferDto dto , @Param("type") String type, @Param("currentUserId")String currentUserId);
Page<Map<String, Object>> getListPage(@Param("page")Page<Map<String, Object>> page,
@Param("sort") SortVo sortMap,
@Param("dto") JgChangeRegistrationTransferDto dto ,
@Param("type") String type,
@Param("currentUserId")String currentUserId);
@Select("select name from tz_equipment_category where code=#{code}")
String getEquiplistNameByEquiplist(String code);
......
......@@ -28,7 +28,7 @@ public interface IJgChangeRegistrationTransferService extends IService<JgChangeR
Map<String, Map<String, Object>> getTransferDetail(String sequenceNbr);
Page<Map<String, Object>> queryListForPage(Page<Map<String, Object>> page, JgChangeRegistrationTransferDto params, String companyTypeCode, String companyType);
Page<Map<String, Object>> queryListForPage(Page<Map<String, Object>> page,String sort, JgChangeRegistrationTransferDto params, String companyTypeCode, String companyType);
void flowExecute(Long sequenceNbr, String instanceId, String operate, String comment, String nextTaskId);
......
......@@ -8,11 +8,10 @@
</update>
<select id="getListPage" resultType="java.util.Map">
select * from
(select crt.sequence_nbr as sequenceNbr,
select
crt.sequence_nbr as sequenceNbr,
crt.audit_status as auditStatus,
crt.reg_date as regDate,
crt.use_unit_name as useUnitName,
crt.status,
crt.receive_org_name as receiveOrgName,
crt.apply_no as applyNo,
......@@ -23,18 +22,24 @@
crt.use_registration_code as useRegistrationCode,
crt.next_execute_user_ids as nextExecuteUserIds,
crt.create_user_id as createUserId,
crt.full_address as allAddress,
crt.next_task_id as nextTaskId,
use.USE_UNIT_NAME as useUnitName,
(SELECT name from tz_equipment_category where code = jri.EQU_CATEGORY) as equCategory,
jri.PRODUCT_NAME as productName,
jri.EQU_CODE as equCode,
use.USE_INNER_CODE as innerCode,
crteq.equ_id as equipId
crteq.equ_id as equipId,
oi.SUPERVISORY_CODE AS supervisoryCode,
oi.CODE96333 as code96333,
concat(use."PROVINCE_NAME", '', use."CITY_NAME", '', use."COUNTY_NAME", '', use."STREET_NAME") as allAddress,
use."ADDRESS" as detailedAddress,
(SELECT name from tz_equipment_category WHERE code = jri.EQU_LIST) AS equList,
(SELECT name from tz_equipment_category where code = jri.EQU_CATEGORY) as equCategory,
(SELECT name from tz_equipment_category where code = jri.EQU_DEFINE) as equDefine
from tzs_jg_change_registration_transfer crt
LEFT JOIN tzs_jg_change_registration_transfer_eq crteq on crt.sequence_nbr = crteq.equip_transfer_id
LEFT JOIN idx_biz_jg_register_info jri on crteq.equ_id = jri.RECORD
LEFT JOIN idx_biz_jg_use_info use on crteq.equ_id = use.RECORD
LEFT JOIN idx_biz_jg_other_info oi ON oi.RECORD = crteq.equ_id
<where>
and crt.is_delete = 0
<if test="dto.equCategory != null and dto.equCategory != ''">
......@@ -43,76 +48,49 @@
<if test="dto.auditStatus != null and dto.auditStatus != ''">
and crt.audit_status like concat('%', #{dto.auditStatus},'%')
</if>
<if test="dto.applicationDate != null and dto.applicationDate != ''">
and crt.reg_date like concat('%',DATE_FORMAT(#{dto.applicationDate},'%Y-%m-%d'),'%')
</if>
<if test="dto.equCode != null and dto.equCode != ''">
and jri.EQU_CODE like concat('%',#{dto.equCode},'%')
</if>
<if test="dto.useUnitCreditCode != null and dto.useUnitCreditCode != ''">
and crt.use_unit_credit_code = #{dto.useUnitCreditCode}
</if>
<if test="dto.receiveOrgCode != null and dto.receiveOrgCode != ''">
and crt.receive_company_code = #{dto.receiveOrgCode}
<if test="dto.equList != null and dto.equList != ''">
AND jri."EQU_LIST" = #{dto.equList}
</if>
<if test="type == 'supervision'">
AND crt.receive_company_code = #{dto.unitCode}
AND crt.instance_id <![CDATA[<>]]> ''
<if test="dto.equCategory != null and dto.equCategory != ''">
AND jri."equ_category" = #{dto.equCategory}
</if>
<if test="type == 'company'">
AND crt.use_unit_credit_code = #{dto.unitCode}
<if test="dto.equDefine != null and dto.equDefine != ''">
AND jri."EQU_DEFINE" = #{dto.equDefine}
</if>
<if test="dto.applyNo != null and dto.applyNo != ''">
and crt.apply_no like concat('%',#{dto.applyNo},'%')
<if test="dto.equCode != null and dto.equCode != ''">
AND jri."EQU_CODE" like concat('%',#{dto.equCode},'%')
</if>
<if test="dto.productName != null and dto.productName != ''">
and jri.PRODUCT_NAME like concat('%',#{dto.productName},'%')
<if test="dto.useRegistrationCode != null and dto.useRegistrationCode != ''">
AND crt.use_registration_code like concat('%',#{dto.useRegistrationCode},'%')
</if>
</where>
union
select crt.sequence_nbr as sequenceNbr,
crt.audit_status as auditStatus,
crt.reg_date as regDate,
crt.use_unit_name as useUnitName,
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,
crt.instance_id as instanceId,
crt.use_registration_code as useRegistrationCode,
crt.next_execute_user_ids as nextExecuteUserIds,
crt.create_user_id as createUserId,
crt.full_address as allAddress,
crt.next_task_id as nextTaskId,
use.USE_UNIT_NAME as useUnitName,
(SELECT name from tz_equipment_category where code = jri.EQU_CATEGORY) as equCategory,
jri.PRODUCT_NAME as productName,
jri.EQU_CODE as equCode,
use.USE_INNER_CODE as innerCode,
crteq.equ_id as equipId
from tzs_jg_change_registration_transfer crt
LEFT JOIN tzs_jg_change_registration_transfer_eq crteq on crt.sequence_nbr = crteq.equip_transfer_id
LEFT JOIN idx_biz_jg_register_info jri on crteq.equ_id = jri.RECORD
LEFT JOIN idx_biz_jg_use_info use on crteq.equ_id = use.RECORD
<where>
and crt.is_delete = 0
AND crt.transfer_to_user_ids like concat('%',#{currentUserId},'%')
<if test="dto.equCategory != null and dto.equCategory != ''">
and jri.EQU_CATEGORY = #{dto.equCategory}
</if>
<if test="dto.auditStatus != null and dto.auditStatus != ''">
and crt.audit_status = concat('%',#{dto.auditStatus},'%')
<if test="dto.code96333 != null and dto.code96333 != ''">
AND oi.CODE96333 like concat('%',#{dto.code96333},'%')
</if>
<if test="dto.equCode != null and dto.equCode != ''">
and jri.EQU_CODE like concat('%',#{dto.equCode},'%')
<if test="dto.supervisoryCode != null and dto.supervisoryCode != ''">
AND oi.SUPERVISORY_CODE like concat('%',#{dto.supervisoryCode},'%')
</if>
<if test="dto.useUnitCreditCode != null and dto.useUnitCreditCode != ''">
and crt.use_unit_credit_code = #{dto.useUnitCreditCode}
<if test="dto.allAddress != null and dto.allAddress != ''">
AND (
use."PROVINCE_NAME" LIKE CONCAT('%', #{dto.allAddress}, '%')
OR use."CITY_NAME" LIKE CONCAT('%', #{dto.allAddress}, '%')
OR use."COUNTY_NAME" LIKE CONCAT('%', #{dto.allAddress}, '%')
OR use."STREET_NAME" LIKE CONCAT('%', #{dto.allAddress}, '%')
)
</if>
<if test="dto.receiveOrgCode != null and dto.receiveOrgCode != ''">
and crt.receive_company_code = #{dto.receiveOrgCode}
and (crt.receive_company_code = #{dto.receiveOrgCode} or crt.transfer_to_user_ids like concat('%',#{currentUserId},'%'))
</if>
<if test="type == 'supervision'">
AND crt.receive_company_code = #{dto.unitCode}
AND (crt.receive_company_code = #{dto.unitCode} or crt.transfer_to_user_ids like concat('%',#{currentUserId},'%'))
AND crt.instance_id <![CDATA[<>]]> ''
</if>
<if test="type == 'company'">
......@@ -124,8 +102,12 @@
<if test="dto.productName != null and dto.productName != ''">
and jri.PRODUCT_NAME like concat('%',#{dto.productName},'%')
</if>
</where>)
order by recDate desc
</where>
order by
<if test="sort != null">
crt.${sort.field} ${sort.sortType},
</if>
recDate desc
</select>
</mapper>
......@@ -143,6 +143,7 @@ public class JgChangeRegistrationTransferController extends BaseController {
@ApiOperation(httpMethod = "GET",value = "移装变更登记登记分页查询", notes = "移装变更登记登记分页查询")
public ResponseModel<Page<Map<String, Object>>> queryForPage(@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size,
@RequestParam(value = "sort",required = false) String sort,
JgChangeRegistrationTransferDto params) {
Page<Map<String, Object>> page = new Page<>(current, size);
ReginParams reginParams = getSelectedOrgInfo();
......@@ -153,7 +154,7 @@ public class JgChangeRegistrationTransferController extends BaseController {
companyTypeCode = COMPANY_TYPE_SUPERVISION;
}
params.setUnitCode(reginParams.getCompany().getCompanyCode());
return ResponseHelper.buildResponse(jgChangeRegistrationTransferService.queryListForPage(page,params, companyTypeCode, reginParams.getCompany().getCompanyType()));
return ResponseHelper.buildResponse(jgChangeRegistrationTransferService.queryListForPage(page,sort,params, companyTypeCode, reginParams.getCompany().getCompanyType()));
}
/**
......
......@@ -22,6 +22,7 @@ import com.yeejoin.amos.boot.module.jg.api.mapper.*;
import com.yeejoin.amos.boot.module.jg.api.service.IJgChangeRegistrationTransferEqService;
import com.yeejoin.amos.boot.module.jg.api.service.IJgChangeRegistrationTransferService;
import com.yeejoin.amos.boot.module.jg.api.service.IJgRegistrationHistoryService;
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.ICmWorkflowService;
import com.yeejoin.amos.boot.module.jg.biz.service.ICommonService;
......@@ -637,8 +638,9 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
* @return
*/
@Override
public Page<Map<String, Object>> queryListForPage(Page<Map<String, Object>> page, JgChangeRegistrationTransferDto params, String companyTypeCode, String companyType) {
Page<Map<String, Object>> listPage = this.baseMapper.getListPage(page, params, companyTypeCode, RequestContext.getExeUserId());
public Page<Map<String, Object>> queryListForPage(Page<Map<String, Object>> page,String sort, JgChangeRegistrationTransferDto params, String companyTypeCode, String companyType) {
SortVo sortMap = commonService.sortFieldConversion(sort);
Page<Map<String, Object>> listPage = this.baseMapper.getListPage(page,sortMap, params, companyTypeCode, RequestContext.getExeUserId());
listPage.getRecords().forEach(x-> x.put("companyType",companyType));
return listPage;
}
......
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