Commit fc74b1ee authored by 韩桐桐's avatar 韩桐桐

fix(jg):设备注销列表查询修改

parent c58b2f05
...@@ -109,12 +109,23 @@ public class JgScrapCancelDto extends BaseDto { ...@@ -109,12 +109,23 @@ public class JgScrapCancelDto extends BaseDto {
@ApiModelProperty(value = "转办后执行人的Id逗号分割") @ApiModelProperty(value = "转办后执行人的Id逗号分割")
private String transferToUserIds; private String transferToUserIds;
@ApiModelProperty(value = "设备代号") @ApiModelProperty("设备品种")
private String equList; private String equDefine;
@ApiModelProperty(value = "设备种类")
private String equList;
@ApiModelProperty(value = "设备类别") @ApiModelProperty(value = "设备类别")
private String equCategoryDesc; private String equCategory;
@ApiModelProperty(value = "设备代码")
private String equCode;
@ApiModelProperty(value = "使用登记证编号")
private String useRegistrationCode;
@ApiModelProperty(value = "96333识别码")
private String code96333;
@ApiModelProperty(value = "设备名称") @ApiModelProperty(value = "设备名称")
private String productName; private String productName;
...@@ -125,4 +136,7 @@ public class JgScrapCancelDto extends BaseDto { ...@@ -125,4 +136,7 @@ public class JgScrapCancelDto extends BaseDto {
@ApiModelProperty (value = "其他附件") @ApiModelProperty (value = "其他附件")
private String otherAccessories; private String otherAccessories;
@ApiModelProperty(value = "申请日期,接收查询参数")
private String applicationDate;
} }
...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
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.JgScrapCancelDto; import com.yeejoin.amos.boot.module.jg.api.dto.JgScrapCancelDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgScrapCancel; import com.yeejoin.amos.boot.module.jg.api.entity.JgScrapCancel;
import com.yeejoin.amos.boot.module.jg.api.vo.SortVo;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
...@@ -18,6 +19,7 @@ import java.util.Map; ...@@ -18,6 +19,7 @@ import java.util.Map;
public interface JgScrapCancelMapper extends BaseMapper<JgScrapCancel> { public interface JgScrapCancelMapper extends BaseMapper<JgScrapCancel> {
Page<Map<String, Object>> getListPage(@Param("page") Page<Map<String, Object>> page, Page<Map<String, Object>> getListPage(@Param("page") Page<Map<String, Object>> page,
@Param("sort") SortVo sortMap,
@Param("dto") JgScrapCancelDto dto, @Param("dto") JgScrapCancelDto dto,
@Param("roleIds") List<String> roleIds, @Param("roleIds") List<String> roleIds,
@Param("orgCode") String orgCode, @Param("orgCode") String orgCode,
......
...@@ -10,69 +10,113 @@ ...@@ -10,69 +10,113 @@
<select id="getListPage" resultType="java.util.Map"> <select id="getListPage" resultType="java.util.Map">
select ur.sequence_nbr as sequenceNbr, select tjsc.sequence_nbr as sequenceNbr,
ur.instance_id as instanceId, tjsc.instance_id as instanceId,
ur.create_user_id as createUserId, tjsc.create_user_id as createUserId,
ur.audit_status as auditStatus, tjsc.audit_status as auditStatus,
DATE_FORMAT(ur.rec_date,'%Y-%m-%d') as recDate, DATE_FORMAT(tjsc.rec_date,'%Y-%m-%d') as recDate,
DATE_FORMAT(ur.create_date,'%Y-%m-%d') as createDate, DATE_FORMAT(tjsc.create_date,'%Y-%m-%d') as createDate,
ur.receive_org_code as receiveOrgCode, tjsc.receive_org_code as receiveOrgCode,
ur.receive_org_name as receiveOrgName, tjsc.receive_org_name as receiveOrgName,
ur.receive_company_code as receiveCompanyCode, tjsc.receive_company_code as receiveCompanyCode,
ur.cancel_certificate as cancelCertificate, tjsc.cancel_certificate as cancelCertificate,
ur.cancel_type as cancelType, tjsc.cancel_type as cancelType,
ur.apply_no as applyNo, tjsc.apply_no as applyNo,
ur.status, tjsc.status,
ur.remark, tjsc.remark,
ur.instance_status as instanceStatus, tjsc.instance_status as instanceStatus,
ur.promoter, tjsc.promoter,
ur.next_execute_user_ids as nextExecuteUserIds, tjsc.next_execute_user_ids as nextExecuteUserIds,
ur.supervisory_code as supervisoryCode, tjsc.supervisory_code as supervisoryCode,
ur.next_task_id as nextTaskId, tjsc.next_task_id as nextTaskId,
ifnull(ur.next_execute_ids,'') as nextExecuteIds, ifnull(tjsc.next_execute_ids,'') as nextExecuteIds,
DATE_FORMAT(ur.audit_pass_date,'%Y-%m-%d') as auditPassDate, DATE_FORMAT(tjsc.audit_pass_date,'%Y-%m-%d') as auditPassDate,
use.USE_UNIT_CREDIT_CODE as useUnitCreditCode, use.USE_UNIT_CREDIT_CODE as useUnitCreditCode,
ur.use_unit_name as useUnitName, tjsc.use_unit_name as useUnitName,
ur.use_unit_code as useUnitCode, tjsc.use_unit_code as useUnitCode,
(SELECT name from tz_equipment_category where code = jri.EQU_CATEGORY) as equCategory, jri.USE_ORG_CODE AS useRegistrationCode,
jri.EQU_DEFINE as equDefine,
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,
use.ADDRESS as address, use.ADDRESS as address,
CONCAT(use.PROVINCE_NAME,'', use.CITY_NAME, '', use.COUNTY_NAME, '', use.street_name, use.ADDRESS, '') AS place, oi.SUPERVISORY_CODE AS supervisoryCode,
oi.CODE96333 as code96333,
(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,
CONCAT(use.PROVINCE_NAME,'', use.CITY_NAME, '', use.COUNTY_NAME, '', use.street_name) AS place,
use."ADDRESS" as detailedAddress,
re.equ_id as equipId re.equ_id as equipId
from tzs_jg_scrap_cancel ur from tzs_jg_scrap_cancel tjsc
LEFT JOIN tzs_jg_scrap_cancel_eq re on ur.sequence_nbr = re.equip_transfer_id LEFT JOIN tzs_jg_scrap_cancel_eq re on tjsc.sequence_nbr = re.equip_transfer_id
LEFT JOIN idx_biz_jg_register_info jri on re.equ_id = jri.RECORD LEFT JOIN idx_biz_jg_register_info jri on re.equ_id = jri.RECORD
LEFT JOIN idx_biz_jg_use_info use on re.equ_id = use.RECORD LEFT JOIN idx_biz_jg_use_info use on re.equ_id = use.RECORD
LEFT JOIN idx_biz_jg_other_info oi ON oi.RECORD = re.equ_id
<where> <where>
and ur.is_delete = 0 and tjsc.is_delete = 0
<if test="dto.auditStatus != null and dto.auditStatus != ''"> <if test="dto.auditStatus != null and dto.auditStatus != ''">
and ur.audit_status = #{dto.auditStatus} and tjsc.audit_status = #{dto.auditStatus}
</if> </if>
<if test="dto.applyNo != null and dto.applyNo != ''"> <if test="dto.applyNo != null and dto.applyNo != ''">
and ur.apply_no like concat('%',#{dto.applyNo},'%') and tjsc.apply_no like concat('%',#{dto.applyNo},'%')
</if> </if>
<if test="dto.cancelType != null and dto.cancelType != ''"> <if test="dto.cancelType != null and dto.cancelType != ''">
and ur.cancel_type = #{dto.cancelType} and tjsc.cancel_type = #{dto.cancelType}
</if>
<if test="dto.receiveCompanyCode != null and dto.receiveCompanyCode != ''">
and tjsc.receive_company_code = #{dto.receiveCompanyCode}
</if>
<if test="dto.applicationDate != null and dto.applicationDate != ''">
and tjsc.create_date like concat('%',DATE_FORMAT(#{dto.applicationDate},'%Y-%m-%d'),'%')
</if>
<if test="dto.equList != null and dto.equList != ''">
AND jri."EQU_LIST" = #{dto.equList}
</if>
<if test="dto.equCategory != null and dto.equCategory != ''">
AND jri."equ_category" = #{dto.equCategory}
</if>
<if test="dto.equDefine != null and dto.equDefine != ''">
AND jri."EQU_DEFINE" = #{dto.equDefine}
</if>
<if test="dto.equCode != null and dto.equCode != ''">
AND jri."EQU_CODE" like concat('%',#{dto.equCode},'%')
</if>
<if test="dto.useRegistrationCode != null and dto.useRegistrationCode != ''">
AND jri."USE_ORG_CODE" like concat('%',#{dto.useRegistrationCode},'%')
</if>
<if test="dto.code96333 != null and dto.code96333 != ''">
AND oi.CODE96333 like concat('%',#{dto.code96333},'%')
</if>
<if test="dto.supervisoryCode != null and dto.supervisoryCode != ''">
AND oi.SUPERVISORY_CODE like concat('%',#{dto.supervisoryCode},'%')
</if>
<if test="dto.fullAddress != null and dto.fullAddress != ''">
AND (
use."PROVINCE_NAME" LIKE CONCAT('%', #{dto.fullAddress}, '%')
OR use."CITY_NAME" LIKE CONCAT('%', #{dto.fullAddress}, '%')
OR use."COUNTY_NAME" LIKE CONCAT('%', #{dto.fullAddress}, '%')
OR use."STREET_NAME" LIKE CONCAT('%', #{dto.fullAddress}, '%')
)
</if> </if>
<if test="roleIds != null and dto.type == 'supervision'"> <if test="roleIds != null and dto.type == 'supervision'">
<foreach collection='roleIds' item='role' open='and (' close=')' separator='or'> <foreach collection='roleIds' item='role' open='and (' close=')' separator='or'>
ur.instance_status like concat('%',#{role},'%') tjsc.instance_status like concat('%',#{role},'%')
or ur.create_user_id = #{dto.createUserId} or tjsc.create_user_id = #{dto.createUserId}
</foreach> </foreach>
</if> </if>
<if test="dto.type == 'supervision'"> <if test="dto.type == 'supervision'">
and ( ur.receive_org_code = #{orgCode} or ur.transfer_to_user_ids like concat('%',#{currentUserId},'%')) and ( tjsc.receive_org_code = #{orgCode} or tjsc.transfer_to_user_ids like concat('%',#{currentUserId},'%'))
AND ur.instance_id <![CDATA[<>]]> '' AND tjsc.instance_id <![CDATA[<>]]> ''
</if> </if>
<if test="dto.type == 'company' "> <if test="dto.type == 'company' ">
and (ur.use_unit_code = #{orgCode} or ur.transfer_to_user_ids like concat('%',#{currentUserId},'%')) and (tjsc.use_unit_code = #{orgCode} or tjsc.transfer_to_user_ids like concat('%',#{currentUserId},'%'))
</if> </if>
</where> </where>
order by ur.rec_date desc order by
<if test="sort != null">
tjsc.${sort.field} ${sort.sortType},
</if>
tjsc.rec_date desc
</select> </select>
<select id="getDetail" resultType="java.util.Map"> <select id="getDetail" resultType="java.util.Map">
SELECT jri.EQU_CODE as equCode, SELECT jri.EQU_CODE as equCode,
......
...@@ -109,11 +109,12 @@ public class JgScrapCancelController extends BaseController { ...@@ -109,11 +109,12 @@ public class JgScrapCancelController extends BaseController {
@ApiOperation(httpMethod = "POST", value = "列表全部数据查询", notes = "列表全部数据查询") @ApiOperation(httpMethod = "POST", value = "列表全部数据查询", notes = "列表全部数据查询")
@PostMapping(value = "/getList") @PostMapping(value = "/getList")
public ResponseModel<Page<Map<String, Object>>> getList(JgScrapCancelDto dto, public ResponseModel<Page<Map<String, Object>>> getList(JgScrapCancelDto dto,
@RequestParam(value = "sort",required = false) String sort,
@RequestParam(value = "current") int current, @RequestParam(value = "current") int current,
@RequestParam(value = "size") int size) { @RequestParam(value = "size") int size) {
Page<Map<String, Object>> page = new Page<>(current, size); Page<Map<String, Object>> page = new Page<>(current, size);
dto.setType(String.valueOf(iJgInstallationNoticeService.getCompanyType().get("companyLevel"))); dto.setType(String.valueOf(iJgInstallationNoticeService.getCompanyType().get("companyLevel")));
return ResponseHelper.buildResponse(jgScrapCancelService.getList(dto, page, dto.getRoleIds())); return ResponseHelper.buildResponse(jgScrapCancelService.getList(dto,sort, page, dto.getRoleIds()));
} }
......
...@@ -19,6 +19,7 @@ import com.yeejoin.amos.boot.module.jg.api.enums.WorkFlowStatusEnum; ...@@ -19,6 +19,7 @@ import com.yeejoin.amos.boot.module.jg.api.enums.WorkFlowStatusEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgScrapCancelEqMapper; import com.yeejoin.amos.boot.module.jg.api.mapper.JgScrapCancelEqMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgScrapCancelMapper; import com.yeejoin.amos.boot.module.jg.api.mapper.JgScrapCancelMapper;
import com.yeejoin.amos.boot.module.jg.api.service.IJgScrapCancelService; import com.yeejoin.amos.boot.module.jg.api.service.IJgScrapCancelService;
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.jg.flc.api.fegin.WorkFlowFeignService; import com.yeejoin.amos.boot.module.jg.flc.api.fegin.WorkFlowFeignService;
...@@ -109,12 +110,13 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc ...@@ -109,12 +110,13 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc
return "1".equals(type) ? BusinessTypeEnum.JG_EQUIPMENT_CANCEL : BusinessTypeEnum.JG_EQUIPMENT_MOVE; return "1".equals(type) ? BusinessTypeEnum.JG_EQUIPMENT_CANCEL : BusinessTypeEnum.JG_EQUIPMENT_MOVE;
} }
public Page<Map<String, Object>> getList(JgScrapCancelDto dto, Page<Map<String, Object>> page, List<String> roleIds) { public Page<Map<String, Object>> getList(JgScrapCancelDto dto,String sort, Page<Map<String, Object>> page, List<String> roleIds) {
ReginParams reginParams = this.getSelectedOrgInfo(); ReginParams reginParams = this.getSelectedOrgInfo();
String orgCode = reginParams.getCompany().getCompanyCode(); String orgCode = reginParams.getCompany().getCompanyCode();
dto.setCreateUserId(reginParams.getUserModel().getUserId()); dto.setCreateUserId(reginParams.getUserModel().getUserId());
String currentUserId = reginParams.getUserModel().getUserId(); String currentUserId = reginParams.getUserModel().getUserId();
Page<Map<String, Object>> listPage = this.baseMapper.getListPage(page, dto, roleIds, orgCode, currentUserId); SortVo sortMap = commonService.sortFieldConversion(sort);
Page<Map<String, Object>> listPage = this.baseMapper.getListPage(page,sortMap, dto, roleIds, orgCode, currentUserId);
listPage.getRecords().forEach(item -> { listPage.getRecords().forEach(item -> {
if (item.containsKey("auditStatus") && Objects.nonNull(item.get("auditStatus"))) { if (item.containsKey("auditStatus") && Objects.nonNull(item.get("auditStatus"))) {
item.put("auditStatusDesc", item.get("auditStatus").toString()); item.put("auditStatusDesc", item.get("auditStatus").toString());
......
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