Browse Source

增加按项目状态筛选功能

master
Jinyuanyuan 6 months ago
parent
commit
cabea9dcb2
  1. 4
      huzhou/src/main/java/com/easy/admin/modules/huzhou/controller/HuzhouPlanController.java
  2. 9
      huzhou/src/main/java/com/easy/admin/modules/huzhou/controller/HuzhouProjectController.java
  3. 5
      huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/HuzhouProjectinfoMapper.java
  4. 45
      huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/mapping/HuzhouProjectinfoMapper.xml
  5. 2
      huzhou/src/main/java/com/easy/admin/modules/huzhou/service/IHuzhouPlaninfoService.java
  6. 3
      huzhou/src/main/java/com/easy/admin/modules/huzhou/service/IHuzhouProjectinfoService.java
  7. 6
      huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouPlaninfoServiceImpl.java
  8. 33
      huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouProjectinfoServiceImpl.java

4
huzhou/src/main/java/com/easy/admin/modules/huzhou/controller/HuzhouPlanController.java

@ -51,10 +51,10 @@ public class HuzhouPlanController {
* @return 返回值
*/
@GetMapping("/projectPlanPageList")
public Result<IPage<HuzhouProjectinfoOV>> projectPlanPageList(HuzhouProjectinfo projectinfo,
public Result<IPage<HuzhouProjectinfoOV>> projectPlanPageList(HuzhouProjectinfo projectinfo,String newStage,
@RequestParam(name="current", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize){
IPage<HuzhouProjectinfoOV> infoPageList =planinfoService.projectPlanPageList(projectinfo, pageNo, pageSize);
IPage<HuzhouProjectinfoOV> infoPageList =planinfoService.projectPlanPageList(projectinfo, pageNo, pageSize,newStage);
return Result.OK(infoPageList);
}

9
huzhou/src/main/java/com/easy/admin/modules/huzhou/controller/HuzhouProjectController.java

@ -106,11 +106,11 @@ public class HuzhouProjectController {
*/
@ResponseResult
@GetMapping("/getProjectInfoAndChildPageList")
public IPage<HuzhouProjectinfoOV> queryPageList(HuzhouProjectinfo projectinfo,
public IPage<HuzhouProjectinfoOV> queryPageList(HuzhouProjectinfo projectinfo, String newStage,
@RequestParam(name="current", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize){
projectinfo.setStage(projectinfo.getStage());
IPage<HuzhouProjectinfoOV> pageList = projectinfoService.getProjectInfoAndChildPageList(projectinfo, pageNo, pageSize);
IPage<HuzhouProjectinfoOV> pageList = projectinfoService.getProjectInfoAndChildPageList(projectinfo, pageNo, pageSize,newStage);
return pageList;
}
@ -153,11 +153,10 @@ public class HuzhouProjectController {
*/
@GetMapping("/projectArchivePageList")
public Result<?> projectArchivePageList(HuzhouProjectinfo projectinfo,
public Result<?> projectArchivePageList(HuzhouProjectinfo projectinfo,String newStage,
@RequestParam(name="current", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize){
projectinfo.setStage("2");
IPage<HuzhouProjectinfoOV> pageList = projectinfoService.getProjectInfoAndChildPageList(projectinfo, pageNo, pageSize);
IPage<HuzhouProjectinfoOV> pageList = projectinfoService.getProjectInfoAndChildPageList(projectinfo, pageNo, pageSize,newStage);
return Result.OK(pageList);
}

5
huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/HuzhouProjectinfoMapper.java

@ -33,6 +33,11 @@ public interface HuzhouProjectinfoMapper extends BaseMapper<HuzhouProjectinfo> {
* @return Page<HuzhouProjectinfoOV>
*/
Page<HuzhouProjectinfoOV> getProjectAndChildInfoPageList(Page page, HuzhouProjectinfo info);
Page<HuzhouProjectinfoOV> getProjectAndChildInfoPageListNew(Page page, HuzhouProjectinfo info,@Param("stageList") List<String> stageList);
/**
* 获取项目信息和子项目信息列表
* @param info 查询条件

45
huzhou/src/main/java/com/easy/admin/modules/huzhou/dao/mapping/HuzhouProjectinfoMapper.xml

@ -160,6 +160,51 @@ order by create_date desc
</where>
order by u.create_date desc
</select>
<select id="getProjectAndChildInfoPageListNew" resultMap="HuzhouProjectinfoMap" parameterType="com.easy.admin.modules.huzhou.entity.HuzhouProjectinfo">
SELECT * from huzhou_projectinfo u
<where>
<include refid="selectAuthSql"/>
<if test="info.projectName!=null and info.projectName!=''">
<bind name="tempStr" value="'%' + info.projectName + '%'" />
and u.project_name like #{tempStr}
</if>
<if test="info.adminDivision!=null and info.adminDivision!=''">
<bind name="tempStr" value="'%' + info.adminDivision + '%'" />
and u.admin_division like #{tempStr}
</if>
<if test="info.dutyWorkplace!=null and info.dutyWorkplace!=''">
<bind name="tempStr" value="'%' + info.dutyWorkplace + '%'" />
and u.duty_workplace like #{tempStr}
</if>
<if test="info.workplaceProperties!=null and info.workplaceProperties!=''">
<bind name="tempStr" value="'%' + info.workplaceProperties + '%'" />
and u.workplace_properties like #{tempStr}
</if>
<if test="info.dutyWorkplace!=null and info.dutyWorkplace!=''">
<bind name="tempStr" value="'%' + info.dutyWorkplace + '%'" />
and u.duty_workplace like #{tempStr}
</if>
<if test="info.reformName!=null and info.reformName!=''">
and u.reform_name = #{info.reformName}
</if>
<if test="info.superLeader!=null and info.superLeader!=''">
and u.super_leader = #{info.superLeader}
</if>
<if test="info.stage!=null and info.stage!=''">
and u.stage &gt;= #{info.stage}
</if>
<choose>
<when test="stageList!=null">
and u.stage in
<foreach item="stage" index="index" collection="stageList" open="(" separator="," close=")">
#{stage}
</foreach>
</when>
</choose>
</where>
order by u.create_date desc
</select>
<select id="selectchildrenMapList" resultType="com.easy.admin.modules.huzhou.entity.HuzhouSubProjectinfo">
select * from huzhou_sub_projectinfo where project_id = #{id} order by create_date desc
</select>

2
huzhou/src/main/java/com/easy/admin/modules/huzhou/service/IHuzhouPlaninfoService.java

@ -73,6 +73,8 @@ public interface IHuzhouPlaninfoService extends IService<HuzhouPlaninfo> {
* @return 返回值
*/
IPage<HuzhouProjectinfoOV> projectPlanPageList(HuzhouProjectinfo projectinfo, Integer pageNo, Integer pageSize);
IPage<HuzhouProjectinfoOV> projectPlanPageList(HuzhouProjectinfo projectinfo, Integer pageNo, Integer pageSize,String newStage);
/**
* 上传计划信息创建审批流程
* @param multipartFile 模板文件

3
huzhou/src/main/java/com/easy/admin/modules/huzhou/service/IHuzhouProjectinfoService.java

@ -49,8 +49,9 @@ public interface IHuzhouProjectinfoService extends IService<HuzhouProjectinfo> {
* @param pageSize 页数
* @return 返回值
*/
IPage<HuzhouProjectinfoOV> getProjectInfoAndChildPageList(HuzhouProjectinfo projectinfo, Integer pageNo, Integer pageSize);
IPage<HuzhouProjectinfoOV> getProjectInfoAndChildPageList(HuzhouProjectinfo projectinfo, Integer pageNo, Integer pageSize,String newStage);
IPage<HuzhouProjectinfoOV> getProjectInfoAndChildPageList(HuzhouProjectinfo projectinfo, Integer pageNo, Integer pageSize);
/**
* 管理人员批量导入项目

6
huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouPlaninfoServiceImpl.java

@ -597,6 +597,12 @@ public class HuzhouPlaninfoServiceImpl extends ServiceImpl<HuzhouPlaninfoMapper,
return infoPageList;
}
@Override
public IPage<HuzhouProjectinfoOV> projectPlanPageList(HuzhouProjectinfo projectinfo, Integer pageNo, Integer pageSize, String newStage) {
IPage<HuzhouProjectinfoOV> infoPageList = projectinfoService.getProjectInfoAndChildPageList(projectinfo, pageNo, pageSize,newStage);
return infoPageList;
}
@Override
public void submitPlaninfoUploadFile(MultipartFile multipartFile, String projectid) throws Exception {
//解析项目计划文件

33
huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouProjectinfoServiceImpl.java

@ -386,6 +386,39 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM
return projectInfoPageList;
}
@Override
public IPage<HuzhouProjectinfoOV> getProjectInfoAndChildPageList(HuzhouProjectinfo projectinfo, Integer pageNo, Integer pageSize, String newStage) {
Page page = new Page(pageNo, pageSize);
ProjectInfoAuthSelect projectInfoAuthSelect = CommonUtils.setGetProjectInfoAuth(projectinfo);
Page<HuzhouProjectinfoOV> projectAndChildInfoPageList;
if(newStage!=null){
List<String> stageList = Arrays.stream(newStage.split(",")).collect(Collectors.toList());
projectAndChildInfoPageList = projectinfoMapper.getProjectAndChildInfoPageListNew(page,projectInfoAuthSelect,stageList);
}else {
projectAndChildInfoPageList = projectinfoMapper.getProjectAndChildInfoPageList(page,projectInfoAuthSelect);
}
List<HuzhouProjectinfoOV> records = projectAndChildInfoPageList.getRecords();
records.forEach(item->{
item.setMissingSubprojects(false);//设置默认是false
double subTotalMoney =0;//子项目的总金额
List<HuzhouSubProjectinfo> subProjectinfoList = item.getChildren();
if (subProjectinfoList.size()>0){
subTotalMoney= subProjectinfoList.stream().mapToDouble(HuzhouProjectinfo::getTotalMoney).sum();//计算子项目总金额总和
Double totalMoney = item.getTotalMoney();
if(subTotalMoney!=0&&totalMoney!=subTotalMoney){
item.setMissingSubprojects(true);//子项目金额总和和主项目不一致
}
}else{
//没有子项目
item.setChildren(null);
}
});
return projectAndChildInfoPageList;
}
@Override
public IPage<HuzhouProjectinfoOV> getProjectInfoAndChildPageList(HuzhouProjectinfo projectinfo, Integer pageNo, Integer pageSize) {
Page page = new Page(pageNo, pageSize);

Loading…
Cancel
Save