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

fix(jg):使用登记添加使用单位过滤条件

parent 50cabcdc
...@@ -138,6 +138,8 @@ public class JgMaintenanceContractDto extends BaseDto { ...@@ -138,6 +138,8 @@ public class JgMaintenanceContractDto extends BaseDto {
private String createUserId; private String createUserId;
@ApiModelProperty(value = "创建时间") @ApiModelProperty(value = "创建时间")
@JsonFormat(pattern = "yyyy-MM-dd")
@JsonSerialize(using = BizCustomDateSerializer.class)
private Date createDate; private Date createDate;
@TableField("instance_status") @TableField("instance_status")
......
...@@ -108,8 +108,12 @@ public class JgUseRegistrationDto extends BaseDto { ...@@ -108,8 +108,12 @@ public class JgUseRegistrationDto extends BaseDto {
private String dataType; private String dataType;
@ApiModelProperty(value = "使用单位code")
private String unitCode; private String unitCode;
@ApiModelProperty(value = "使用单位code:用作接收搜索条件")
private String useUnitCode;
private String isXixian; private String isXixian;
private String currentUserId; private String currentUserId;
......
...@@ -100,13 +100,16 @@ ...@@ -100,13 +100,16 @@
<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>
<if test="dto.useUnitCode != null and dto.useUnitCode != ''">
and ur.use_unit_credit_code = #{dto.useUnitCode}
</if>
<if test="roleIds != null and dto.dataType == 'supervision'"> <if test="roleIds != null and dto.dataType == 'supervision'">
<foreach collection='roleIds' item='role' open='and (' close=')' separator='or'> <foreach collection='roleIds' item='role' open='and (' close=')' separator='or'>
instance_status like concat('%',#{role},'%') instance_status like concat('%',#{role},'%')
</foreach> </foreach>
</if> </if>
<if test="dto.dataType == 'supervision' "> <if test="dto.dataType == 'supervision' ">
and ur.receive_company_code = #{dto.unitCode} AND ur.receive_company_code = #{dto.receiveCompanyCode}
AND ur.instance_id <![CDATA[<>]]> '' AND ur.instance_id <![CDATA[<>]]> ''
</if> </if>
<if test="dto.dataType == 'company' "> <if test="dto.dataType == 'company' ">
...@@ -163,6 +166,9 @@ ...@@ -163,6 +166,9 @@
<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>
<if test="dto.useUnitCode != null and dto.useUnitCode != ''">
and ur.use_unit_credit_code = #{dto.useUnitCode}
</if>
GROUP BY re.equip_transfer_id GROUP BY re.equip_transfer_id
</where>) </where>)
order by order by
......
...@@ -94,17 +94,18 @@ public class JgUseRegistrationController extends BaseController { ...@@ -94,17 +94,18 @@ public class JgUseRegistrationController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "列表全部数据查询", notes = "列表全部数据查询") @ApiOperation(httpMethod = "GET", value = "列表全部数据查询", notes = "列表全部数据查询")
@GetMapping(value = "/getList") @GetMapping(value = "/getList")
public ResponseModel<Page<Map<String, Object>>> getList(JgUseRegistrationDto dto, public ResponseModel<Page<Map<String, Object>>> getList(JgUseRegistrationDto dto,
@ApiParam(value = "排序字段", required = false) @RequestParam(value = "sort", required = false) String sort, @ApiParam(value = "排序字段") @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);
ReginParams info = getSelectedOrgInfo(); ReginParams info = getSelectedOrgInfo();
dto.setUnitCode(info.getCompany().getCompanyCode());
dto.setCurrentUserId(info.getUserModel().getUserId()); dto.setCurrentUserId(info.getUserModel().getUserId());
if (info.getCompany().getLevel().equals(BaseController.COMPANY_TYPE_COMPANY)) { if (info.getCompany().getLevel().equals(BaseController.COMPANY_TYPE_COMPANY)) {
dto.setDataType(BaseController.COMPANY_TYPE_COMPANY); dto.setDataType(BaseController.COMPANY_TYPE_COMPANY);
dto.setUnitCode(info.getCompany().getCompanyCode());
} else { } else {
dto.setDataType(BaseController.COMPANY_TYPE_SUPERVISION); dto.setDataType(BaseController.COMPANY_TYPE_SUPERVISION);
dto.setReceiveCompanyCode(info.getCompany().getCompanyCode());
} }
Page<Map<String, Object>> list = jgUseRegistrationServiceImpl.getList(dto, sort, page, dto.getRoleIds()); Page<Map<String, Object>> list = jgUseRegistrationServiceImpl.getList(dto, sort, page, dto.getRoleIds());
list.getRecords().forEach(x -> x.put("companyType", info.getCompany().getCompanyType())); list.getRecords().forEach(x -> x.put("companyType", info.getCompany().getCompanyType()));
......
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