优化
This commit is contained in:
@ -1,14 +1,21 @@
|
|||||||
package com.ruoyi.web.controller.common;
|
package com.ruoyi.web.controller.common;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.ruoyi.bgt.domain.BgtProjectRecruitApply;
|
import com.ruoyi.bgt.domain.BgtProjectRecruitApply;
|
||||||
|
import com.ruoyi.bgt.domain.dto.BgtGetAnnexDTO;
|
||||||
import com.ruoyi.bgt.domain.dto.BgtGetWgzAnnexDTO;
|
import com.ruoyi.bgt.domain.dto.BgtGetWgzAnnexDTO;
|
||||||
import com.ruoyi.bgt.service.IBgtProjectRecruitApplyService;
|
import com.ruoyi.bgt.service.IBgtProjectRecruitApplyService;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
import com.ruoyi.common.domain.Annex;
|
import com.ruoyi.common.domain.Annex;
|
||||||
|
import com.ruoyi.common.domain.dto.AnnexListDTO;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
import com.ruoyi.common.exception.BaseException;
|
import com.ruoyi.common.exception.BaseException;
|
||||||
import com.ruoyi.common.service.IAnnexService;
|
import com.ruoyi.common.service.IAnnexService;
|
||||||
import com.ruoyi.common.utils.PageUtils;
|
import com.ruoyi.common.utils.PageUtils;
|
||||||
@ -16,13 +23,14 @@ import io.swagger.annotations.Api;
|
|||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import static com.ruoyi.common.constant.Constants.BGT;
|
||||||
import static com.ruoyi.common.constant.Constants.WGZ;
|
import static com.ruoyi.common.constant.Constants.WGZ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -75,17 +83,16 @@ public class AnnexController extends BaseController {
|
|||||||
// return AjaxResult.success(iAnnexService.queryById(id));
|
// return AjaxResult.success(iAnnexService.queryById(id));
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// /**
|
/**
|
||||||
// * 新增附件
|
* 新增附件
|
||||||
// */
|
*/
|
||||||
// @ApiOperation("新增附件")
|
@ApiOperation("新增附件")
|
||||||
// @PreAuthorize("@ss.hasPermi('common:annex:add')")
|
@Log(title = "附件", businessType = BusinessType.INSERT)
|
||||||
// @Log(title = "附件", businessType = BusinessType.INSERT)
|
@RepeatSubmit
|
||||||
// @RepeatSubmit
|
@PostMapping()
|
||||||
// @PostMapping()
|
public AjaxResult<Boolean> add(@Validated @RequestBody AnnexListDTO bo) {
|
||||||
// public AjaxResult<Void> add(@Validated @RequestBody Annex bo) {
|
return AjaxResult.success(iAnnexService.saveBatch(bo.getList()));
|
||||||
// return toAjax(iAnnexService.insert(bo) ? 1 : 0);
|
}
|
||||||
// }
|
|
||||||
//
|
//
|
||||||
// /**
|
// /**
|
||||||
// * 修改附件
|
// * 修改附件
|
||||||
@ -99,17 +106,16 @@ public class AnnexController extends BaseController {
|
|||||||
// return toAjax(iAnnexService.update(bo) ? 1 : 0);
|
// return toAjax(iAnnexService.update(bo) ? 1 : 0);
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// /**
|
/**
|
||||||
// * 删除附件
|
* 删除附件
|
||||||
// */
|
*/
|
||||||
// @ApiOperation("删除附件")
|
@ApiOperation("删除附件")
|
||||||
// @PreAuthorize("@ss.hasPermi('common:annex:remove')")
|
@Log(title = "附件" , businessType = BusinessType.DELETE)
|
||||||
// @Log(title = "附件" , businessType = BusinessType.DELETE)
|
@DeleteMapping("/{ids}")
|
||||||
// @DeleteMapping("/{ids}")
|
public AjaxResult<Boolean> remove(@NotEmpty(message = "主键不能为空")
|
||||||
// public AjaxResult<Void> remove(@NotEmpty(message = "主键不能为空")
|
@PathVariable String[] ids) {
|
||||||
// @PathVariable String[] ids) {
|
return AjaxResult.success(iAnnexService.deleteWithValidByIds(Arrays.asList(ids), true));
|
||||||
// return toAjax(iAnnexService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0);
|
}
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation("包工头获取务工者附件")
|
@ApiOperation("包工头获取务工者附件")
|
||||||
@ -133,4 +139,15 @@ public class AnnexController extends BaseController {
|
|||||||
Page<Annex> result = iAnnexService.page(PageUtils.buildPage(), wrapper);
|
Page<Annex> result = iAnnexService.page(PageUtils.buildPage(), wrapper);
|
||||||
return PageUtils.buildDataInfo(result);
|
return PageUtils.buildDataInfo(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("获取包工头附件")
|
||||||
|
@GetMapping("/getBgtAnnex")
|
||||||
|
public AjaxResult<List<Annex>> getBgtAnnex(BgtGetAnnexDTO dto) {
|
||||||
|
LambdaQueryWrapper<Annex> wrapper = Wrappers.<Annex>lambdaQuery()
|
||||||
|
.eq(Annex::getUserId, dto.getUserId())
|
||||||
|
.eq(Annex::getUserType, BGT)
|
||||||
|
.eq(StrUtil.isNotBlank(dto.getAnnexType()),Annex::getAnnexType, dto.getAnnexType());
|
||||||
|
return AjaxResult.success(iAnnexService.list(wrapper));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,35 @@
|
|||||||
|
package com.ruoyi.common.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目任务状态
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
public enum TaskApplyStatus
|
||||||
|
{
|
||||||
|
APPLY("0", "申情中"),
|
||||||
|
PASS("1", "已同意"),
|
||||||
|
REFUSE("2", "已拒绝"),
|
||||||
|
CANCEL("3", "已取消"),
|
||||||
|
;
|
||||||
|
|
||||||
|
private final String code;
|
||||||
|
private final String info;
|
||||||
|
|
||||||
|
TaskApplyStatus(String code, String info)
|
||||||
|
{
|
||||||
|
this.code = code;
|
||||||
|
this.info = info;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCode()
|
||||||
|
{
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInfo()
|
||||||
|
{
|
||||||
|
return info;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,23 @@
|
|||||||
|
package com.ruoyi.bgt.domain.dto;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@ApiModel("App包工头查看附件查询对象")
|
||||||
|
public class BgtGetAnnexDTO {
|
||||||
|
|
||||||
|
@ApiModelProperty("用户ID")
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
@ApiModelProperty("附件类型")
|
||||||
|
private String annexType;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
package com.ruoyi.common.domain.dto;
|
||||||
|
|
||||||
|
import com.ruoyi.common.domain.Annex;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@ApiModel("附件对象")
|
||||||
|
public class AnnexListDTO {
|
||||||
|
private List<Annex> list;
|
||||||
|
}
|
@ -19,6 +19,7 @@ public class FbsTaskApplyListDTO {
|
|||||||
@NotNull(message = "任务id不能为空")
|
@NotNull(message = "任务id不能为空")
|
||||||
private Long taskId;
|
private Long taskId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "申请状态(0=申请中,1=已同意,2=已拒绝,3=已取消)",hidden = true)
|
||||||
|
private String applyStatus;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
|||||||
import com.ruoyi.common.enums.AuditStatus;
|
import com.ruoyi.common.enums.AuditStatus;
|
||||||
import com.ruoyi.common.enums.ProjectTaskStatus;
|
import com.ruoyi.common.enums.ProjectTaskStatus;
|
||||||
import com.ruoyi.common.enums.RecruitApplyStatus;
|
import com.ruoyi.common.enums.RecruitApplyStatus;
|
||||||
|
import com.ruoyi.common.enums.TaskApplyStatus;
|
||||||
import com.ruoyi.common.util.DataUtil;
|
import com.ruoyi.common.util.DataUtil;
|
||||||
import com.ruoyi.common.utils.DateUtils;
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
import com.ruoyi.common.utils.PageUtils;
|
import com.ruoyi.common.utils.PageUtils;
|
||||||
@ -324,6 +325,10 @@ public class FbsProjectTaskServiceImpl extends ServicePlusImpl<FbsProjectTaskMap
|
|||||||
fbsTaskApplyListDTO.setPageNum(1);
|
fbsTaskApplyListDTO.setPageNum(1);
|
||||||
fbsTaskApplyListDTO.setPageSize(3);
|
fbsTaskApplyListDTO.setPageSize(3);
|
||||||
fbsTaskApplyListDTO.setTaskId(task.getId());
|
fbsTaskApplyListDTO.setTaskId(task.getId());
|
||||||
|
|
||||||
|
if(task.getUserId()!=null){
|
||||||
|
fbsTaskApplyListDTO.setApplyStatus(TaskApplyStatus.PASS.getCode());
|
||||||
|
}
|
||||||
TableDataInfo<FbsProjectTaskApplyListVO> applyList = fbsProjectTaskApplyService.queryPageListByTaskId(fbsTaskApplyListDTO);
|
TableDataInfo<FbsProjectTaskApplyListVO> applyList = fbsProjectTaskApplyService.queryPageListByTaskId(fbsTaskApplyListDTO);
|
||||||
fbsProjectTaskListVO.setApplyList(applyList.getRows());
|
fbsProjectTaskListVO.setApplyList(applyList.getRows());
|
||||||
fbsProjectTaskListVOS.add(fbsProjectTaskListVO);
|
fbsProjectTaskListVOS.add(fbsProjectTaskListVO);
|
||||||
|
@ -28,6 +28,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
from fbs_project_task_apply fpta
|
from fbs_project_task_apply fpta
|
||||||
left join bgt_user bu on fpta.user_id = bu.user_id
|
left join bgt_user bu on fpta.user_id = bu.user_id
|
||||||
where fpta.task_id = #{dto.taskId}
|
where fpta.task_id = #{dto.taskId}
|
||||||
|
<if test="dto.applyStatus != null and dto.applyStatus != ''">
|
||||||
|
and fpta.apply_status = #{dto.applyStatus}
|
||||||
|
</if>
|
||||||
order by fpta.id desc
|
order by fpta.id desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user