Commit ae17ed84 authored by 曹盼盼's avatar 曹盼盼

修改任务跳转逻辑 ,修改企业分页

parent f7221b82
package com.yeejoin.amos.boot.module.ugp.api.entity; package com.yeejoin.amos.boot.module.ugp.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
...@@ -50,6 +51,10 @@ public class Task extends BaseEntity { ...@@ -50,6 +51,10 @@ public class Task extends BaseEntity {
private String type; private String type;
private Long unitId; private Long unitId;
@TableField(exist = false)
private String extend; //url路径
......
package com.yeejoin.amos.boot.module.ugp.api.mapper; package com.yeejoin.amos.boot.module.ugp.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.module.ugp.api.entity.Task; import com.yeejoin.amos.boot.module.ugp.api.entity.Task;
import org.apache.ibatis.annotations.Mapper;
/** /**
* 监检任务表 Mapper 接口 * 监检任务表 Mapper 接口
...@@ -9,6 +11,9 @@ import com.yeejoin.amos.boot.module.ugp.api.entity.Task; ...@@ -9,6 +11,9 @@ import com.yeejoin.amos.boot.module.ugp.api.entity.Task;
* @author duanwei * @author duanwei
* @date 2022-10-19 * @date 2022-10-19
*/ */
@Mapper
public interface TaskMapper extends BaseMapper<Task> { public interface TaskMapper extends BaseMapper<Task> {
IPage getTask(IPage page,String type,Long unitId);
} }
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!--namespace接口和xml配置文件的对应-->
<mapper namespace="com.yeejoin.amos.boot.module.ugp.api.mapper.TaskMapper">
<select id="getTask" resultType="com.yeejoin.amos.boot.module.ugp.api.entity.Task">
select tk.* ,tp.`url` as extend
from tz_ugp_task tk ,
tz_ugp_path tp
where tk.title =tp.`name` and
tk.`status` =tp.`status`
and tk.unit_id =#{unitId}
<if test="type !=null and !=''">
and tk.task_type =#{type}
</if>
</select>
</mapper>
\ No newline at end of file
...@@ -8,6 +8,7 @@ import com.yeejoin.amos.boot.biz.common.utils.NameUtils; ...@@ -8,6 +8,7 @@ import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import com.yeejoin.amos.boot.module.ugp.api.Enum.TaskTypeEnum; import com.yeejoin.amos.boot.module.ugp.api.Enum.TaskTypeEnum;
import com.yeejoin.amos.boot.module.ugp.api.dto.TaskDto; import com.yeejoin.amos.boot.module.ugp.api.dto.TaskDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.Task; import com.yeejoin.amos.boot.module.ugp.api.entity.Task;
import com.yeejoin.amos.boot.module.ugp.api.mapper.TaskMapper;
import com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify; import com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify;
import com.yeejoin.amos.boot.module.ugp.biz.service.impl.OrgServiceImpl; import com.yeejoin.amos.boot.module.ugp.biz.service.impl.OrgServiceImpl;
import com.yeejoin.amos.boot.module.ugp.biz.service.impl.TaskServiceImpl; import com.yeejoin.amos.boot.module.ugp.biz.service.impl.TaskServiceImpl;
...@@ -45,6 +46,8 @@ public class TaskController { ...@@ -45,6 +46,8 @@ public class TaskController {
@Autowired @Autowired
OrgServiceImpl orgService; OrgServiceImpl orgService;
@Autowired
TaskMapper taskMapper;
/** /**
...@@ -158,13 +161,14 @@ public class TaskController { ...@@ -158,13 +161,14 @@ public class TaskController {
public ResponseModel<IPage<Task>> getTaskList(@RequestParam(value = "status",required = false) String type,Long current,Long size){ public ResponseModel<IPage<Task>> getTaskList(@RequestParam(value = "status",required = false) String type,Long current,Long size){
Long unitId = orgService.getReginParams().getBusinessInfo().getCompanySequenceNbr(); Long unitId = orgService.getReginParams().getBusinessInfo().getCompanySequenceNbr();
IPage<Task> page = new Page(current,size); IPage<Task> page = new Page(current,size);
LambdaQueryWrapper<Task> wrapper = new LambdaQueryWrapper<>(); /* LambdaQueryWrapper<Task> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(Task::getUnitId,unitId); wrapper.eq(Task::getUnitId,unitId);
if(!ValidationUtil.isEmpty(type)){ if(!ValidationUtil.isEmpty(type)){
wrapper.eq(Task::getTaskType,type); wrapper.eq(Task::getTaskType,type);
} }
iTzUgpTaskService.page(page, wrapper); iTzUgpTaskService.page(page, wrapper);*/
return ResponseHelper.buildResponse(page); IPage task = taskMapper.getTask(page, type, unitId);
return ResponseHelper.buildResponse(task);
} }
/** /**
......
...@@ -114,6 +114,9 @@ public class CompanyServiceImpl extends BaseService<CompanyDto, Company, Company ...@@ -114,6 +114,9 @@ public class CompanyServiceImpl extends BaseService<CompanyDto, Company, Company
}); });
}); });
page1.setRecords(list); page1.setRecords(list);
if (!ValidationUtil.isEmpty(list)) {
page1.setTotal(list.size());
}
return page1; return page1;
}else if (OrgEnum.监检机构.getKey().equals(companyType)){ }else if (OrgEnum.监检机构.getKey().equals(companyType)){
wrapper.eq(SuperviseRule::getInspectionUnitId,companySequenceNbr); wrapper.eq(SuperviseRule::getInspectionUnitId,companySequenceNbr);
...@@ -136,10 +139,16 @@ public class CompanyServiceImpl extends BaseService<CompanyDto, Company, Company ...@@ -136,10 +139,16 @@ public class CompanyServiceImpl extends BaseService<CompanyDto, Company, Company
}); });
}); });
page1.setRecords(list); page1.setRecords(list);
if (!ValidationUtil.isEmpty(list)) {
page1.setTotal(list.size());
}
return page1; return page1;
} }
} }
if (!ValidationUtil.isEmpty(list)) {
page1.setTotal(list.size());
}
return page1; return page1;
} }
......
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