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

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

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