提交 a294d087 authored 作者: 任建宇's avatar 任建宇
...@@ -72,19 +72,24 @@ public class FileController { ...@@ -72,19 +72,24 @@ public class FileController {
@ApiOperation(value = "获取文件地址") @ApiOperation(value = "获取文件地址")
@RequestMapping(value = "/getFilePath", method = RequestMethod.GET) @RequestMapping(value = "/getFilePath", method = RequestMethod.GET)
public CommonResult<String> downLoad(String fileName) throws Exception { public CommonResult<FileInfo> downLoad(String fileName) throws Exception {
String filePath = null; String filePath = null;
if (StringUtils.isNotBlank(fileName)) {
QueryWrapper<FileInfo> qw = new QueryWrapper<FileInfo>(); QueryWrapper<FileInfo> qw = new QueryWrapper<FileInfo>();
if (StringUtils.isNotBlank(fileName)) {
qw.eq("file_name", fileName); qw.eq("file_name", fileName);
}
FileInfo entity = service.getOne(qw); FileInfo entity = service.getOne(qw);
if (entity.getId() == null) { if (entity.getId() == null) {
throw new CrmebException("没有找到该文件!"); throw new CrmebException("没有找到该文件!");
} }
fileName = entity.getOriginalFileName(); fileName = entity.getOriginalFileName();
filePath = entity.getPath()+"/"+entity.getFileName()+entity.getSuffixName(); filePath = entity.getPath()+"/"+entity.getFileName()+entity.getSuffixName();
if(filePath!=null) {
entity.setPath(filePath);
} }
return CommonResult.success(filePath); return CommonResult.success(entity);
} }
// 处理文件上传 // 处理文件上传
......
...@@ -69,9 +69,9 @@ public class ProjectController { ...@@ -69,9 +69,9 @@ public class ProjectController {
//添加历史记录 //添加历史记录
ProjectRecord record = new ProjectRecord(); ProjectRecord record = new ProjectRecord();
if(projectRecord.getType().equals("2")) { if(projectRecord.getType().equals("2")) {
record.setDescribes("由"+systemAdminResponse.getAccount()+"编辑"); record.setDescribes("由"+systemAdminResponse.getRealName()+"编辑");
}else { }else {
record.setDescribes("由"+systemAdminResponse.getAccount()+"创建"); record.setDescribes("由"+systemAdminResponse.getRealName()+"创建");
} }
record.setProjectId(projectRecord.getProjectId()); record.setProjectId(projectRecord.getProjectId());
record.setUserName(systemAdminResponse.getAccount()); record.setUserName(systemAdminResponse.getAccount());
......
...@@ -28,8 +28,8 @@ public class ProjectFile { ...@@ -28,8 +28,8 @@ public class ProjectFile {
private String projectId; private String projectId;
@ApiModelProperty("附件名称") @ApiModelProperty("附件名称")
private String fileName; private String fileName;
@ApiModelProperty("file路径") @ApiModelProperty(value="原文件名")
private String file; private String originalFileName;
@ApiModelProperty("文件大小") @ApiModelProperty("文件大小")
private String size; private String size;
@ApiModelProperty("上传时间") @ApiModelProperty("上传时间")
......
...@@ -133,17 +133,21 @@ public class TimeApplyChangeController { ...@@ -133,17 +133,21 @@ public class TimeApplyChangeController {
entity.setRemark(form.getRemark()); entity.setRemark(form.getRemark());
boolean b = timeApplyChangeService.updateById(entity); boolean b = timeApplyChangeService.updateById(entity);
if (b) { if (b) {
if(entity.getStatus1().equals("1") && entity.getStatus2().equals("4")) {
StatisticsProject project = projectService.getById(entity.getProjectId()); StatisticsProject project = projectService.getById(entity.getProjectId());
if(project!=null) {
project.setTotalApplyTime(project.getTotalApplyTime().add(entity.getChangeTime())); project.setTotalApplyTime(project.getTotalApplyTime().add(entity.getChangeTime()));
project.setToBeAllocated(project.getToBeAllocated().add(entity.getChangeTime())); project.setToBeAllocated(project.getToBeAllocated().add(entity.getChangeTime()));
projectService.updateById(project); projectService.updateById(project);
}
QueryWrapper<Team> qw = new QueryWrapper<Team>(); QueryWrapper<Team> qw = new QueryWrapper<Team>();
qw.eq("department_id", entity.getDepartmentId()); qw.eq("department_id", entity.getDepartmentId());
qw.eq("project_id", entity.getProjectId()); qw.eq("project_id", entity.getProjectId());
Team team = teamService.getOne(qw); Team team = teamService.getOne(qw);
team.setTotal(team.getTotal().add(entity.getChangeTime())); team.setTotal(team.getTotal().add(entity.getChangeTime()));
team.setToBeAllocated(team.getToBeAllocated().add(entity.getChangeTime())); team.setToBeAllocated(team.getToBeAllocated().add(entity.getChangeTime()));
teamService.update(team, qw); teamService.updateById(team);
}
} }
return CommonResult.success(); return CommonResult.success();
} }
......
...@@ -6,6 +6,7 @@ import java.util.List; ...@@ -6,6 +6,7 @@ import java.util.List;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zrqx.olive.timeApply.model.TimeApplyChange; import com.zrqx.olive.timeApply.model.TimeApplyChange;
import com.zrqx.olive.timeApply.request.TimeApplyChangeForm; import com.zrqx.olive.timeApply.request.TimeApplyChangeForm;
...@@ -18,41 +19,39 @@ import com.zrqx.olive.timeApply.vo.TimeApplyVo; ...@@ -18,41 +19,39 @@ import com.zrqx.olive.timeApply.vo.TimeApplyVo;
public interface TimeApplyChangeDao extends BaseMapper<TimeApplyChange>{ public interface TimeApplyChangeDao extends BaseMapper<TimeApplyChange>{
String PARAM_VALUE = "t.id,a.project,a.name,t.total_apply_time,c.status1 changeStatus1,c.status2 changeStatus2" String PARAM_VALUE = "select c.id,a.id projectId,a.project,a.name,c.change_time,c.status1 changeStatus1,c.status2 changeStatus2"
+"from t_statistics_project a left join time_apply_change c on a.id = c.timeApplyId where 1=1 and t.status=1 "; +",DATE_FORMAT(c.create_time,'%Y-%m-%d %H:%i:%s') create_time,DATE_FORMAT(a.start_time,'%Y-%m-%d') start_time,"
+ "DATE_FORMAT(a.end_time,'%Y-%m-%d') end_time "
+ "from t_statistics_project a left join time_apply_change c on a.id = c.project_id where 1=1 ";
@Select("<script>" @Select("<script>"
+ PARAM_VALUE + PARAM_VALUE
+ " and (c.status1 = '0' or c.status2 = '3') " + " and (c.status1 = '0' or c.status2 = '3') "
+ " group by t.id " + " group by c.id "
+ "</script>") + "</script>")
List<TimeApplyVo> pageTimeApply1(); List<TimeApplyVo> pageTimeApplyChange1();
@Select("<script>" @Select("<script>"
+ PARAM_VALUE + PARAM_VALUE
+ " or c.status1 = '0' " + " and c.status1 = '0' "
+ " and c.status1 != '7'" + " group by c.id "
+ " and c.status2 != '8' "
+ " group by t.id "
+ "</script>") + "</script>")
List<TimeApplyVo> pageTimeApply2(); List<TimeApplyVo> pageTimeApplyChange2();
@Select("<script>" @Select("<script>"
+ PARAM_VALUE + PARAM_VALUE
+ " or c.status2 = 3 " + " and c.status2 = 3 "
+ " and c.status1 != '7'" + " group by c.id "
+ " and c.status2 != '8' "
+ " group by t.id "
+ "</script>") + "</script>")
List<TimeApplyVo> pageTimeApply3(); List<TimeApplyVo> pageTimeApplyChange3();
@Select("<script>" @Select("<script>"
+ " select sum(change_time) from time_apply_change where project_id = #{id} and status1 = '1' and status2 = '4' " + " select sum(change_time) from time_apply_change where project_id = #{id} and status1 = '0' and status2 = '3' "
+ "</script>") + "</script>")
Double selectforTime(String id); Double selectforTime(String id);
@Select("<script>" @Select("<script>"
+ " select sum(change_time) from time_apply_change where project_id = #{id} and department_id = #{departmentId}" + " select sum(change_time) from time_apply_change where project_id = #{id} and department_id = #{departmentId} and status1 = '1' and status2 = '4'"
+ "</script>") + "</script>")
Double timeApplyChangeMapper(@Param("id")String id,@Param("departmentId")String departmentId); Double timeApplyChangeMapper(@Param("id")String id,@Param("departmentId")String departmentId);
...@@ -149,4 +148,8 @@ public interface TimeApplyChangeDao extends BaseMapper<TimeApplyChange>{ ...@@ -149,4 +148,8 @@ public interface TimeApplyChangeDao extends BaseMapper<TimeApplyChange>{
+ "</if>" + "</if>"
+ "</script>") + "</script>")
List<TimeApplyChangeVo> pageTimeApply2(@Param("form") TimeApplyChangeForm form); List<TimeApplyChangeVo> pageTimeApply2(@Param("form") TimeApplyChangeForm form);
@Select("<script>"
+ " select * from time_apply_change where project_id = #{projectId} GROUP BY department_id"
+ "</script>")
List<TimeApplyChange> selectListDepartmentName(@Param("projectId") String projectId);
} }
...@@ -10,9 +10,9 @@ public class CheckTimeApplyStatusForm { ...@@ -10,9 +10,9 @@ public class CheckTimeApplyStatusForm {
@ApiModelProperty("申请单、变更单id") @ApiModelProperty("申请单、变更单id")
private Integer id; private Integer id;
@ApiModelProperty("chi总:0:待审核 1:审核通过 ,7:未通过") @ApiModelProperty("chi总:0:待审核 1:审核通过 ,2:未通过")
private String status1; private String status1;
@ApiModelProperty("yun总:3:待审核 4:审核通过,8:未通过") @ApiModelProperty("yun总:3:待审核 4:审核通过,5:未通过")
private String status2; private String status2;
@ApiModelProperty("审核不通过原因") @ApiModelProperty("审核不通过原因")
private String remark; private String remark;
......
...@@ -52,23 +52,26 @@ public class TimeApplyChangeServiceImpl extends ServiceImpl<TimeApplyChangeDao,T ...@@ -52,23 +52,26 @@ public class TimeApplyChangeServiceImpl extends ServiceImpl<TimeApplyChangeDao,T
PageHelper.startPage(pageParamRequest.getPage(), pageParamRequest.getLimit()); PageHelper.startPage(pageParamRequest.getPage(), pageParamRequest.getLimit());
List<TimeApplyVo> list = new ArrayList<TimeApplyVo>(); List<TimeApplyVo> list = new ArrayList<TimeApplyVo>();
//获取登录人 //获取登录人
String value = request.getRealName(); String value = request.getAccount();
if ("duan".equals(value)) { if ("duan".equals(value)) {
//查看所有没有最终审核完成的数据还有未审核的变更单 //查看所有没有最终审核完成的数据还有未审核的变更单
list = timeApplyChangeMapper.pageTimeApply1(); list = timeApplyChangeMapper.pageTimeApplyChange1();
}else if ("chi".equals(value)) { }else if ("chi".equals(value)) {
//查看,自己未审核的数据(变更) //查看,自己未审核的数据(变更)
list = timeApplyChangeMapper.pageTimeApply2(); list = timeApplyChangeMapper.pageTimeApplyChange2();
}else if ("yun".equals(value)) { }else if ("yun".equals(value)) {
//查看,自己未审核的数据(变更) //查看,自己未审核的数据(变更)
list = timeApplyChangeMapper.pageTimeApply3(); list = timeApplyChangeMapper.pageTimeApplyChange3();
} }
list.forEach(vo ->{ list.forEach(vo ->{
Double time = timeApplyChangeMapper.selectforTime(vo.getProjectId()) == null ? 0.0 : timeApplyChangeMapper.selectforTime(vo.getProjectId()); Double time = timeApplyChangeMapper.selectforTime(vo.getProjectId()) == null ? 0.0 : timeApplyChangeMapper.selectforTime(vo.getProjectId());
BigDecimal add = vo.getTotalApplyTime().add(new BigDecimal(time)); if(time!=null && time!=0.0 ) {
vo.setTotalApplyTime(add); //BigDecimal add = vo.getTotalApplyTime().add(new BigDecimal(time));
vo.setTotalApplyTime(new BigDecimal(time));
}
//chi审核状态 //chi审核状态
if ("1".equals(vo.getStatus1())){ if ("1".equals(vo.getStatus1())){
vo.setStatus1Zh("已审核"); vo.setStatus1Zh("已审核");
...@@ -164,16 +167,11 @@ public class TimeApplyChangeServiceImpl extends ServiceImpl<TimeApplyChangeDao,T ...@@ -164,16 +167,11 @@ public class TimeApplyChangeServiceImpl extends ServiceImpl<TimeApplyChangeDao,T
vo.setEndTime("-"); vo.setEndTime("-");
} }
vo.setHeadName(project.getName()); vo.setHeadName(project.getName());
QueryWrapper<TimeApplyChange> queryWrapper = new QueryWrapper<TimeApplyChange>(); List<TimeApplyChange> list = timeApplyChangeMapper.selectListDepartmentName(id);
if(id!=null) {
queryWrapper.eq("project_id", id);
}
List<TimeApplyChange> list = timeApplyChangeMapper.selectList(queryWrapper);
for (TimeApplyChange timeApplyChange : list) { for (TimeApplyChange timeApplyChange : list) {
TimeApplyTableListVo vo1 = new TimeApplyTableListVo(); TimeApplyTableListVo vo1 = new TimeApplyTableListVo();
Double designApplyTimeChange = timeApplyChangeMapper.timeApplyChangeMapper(id,timeApplyChange.getDepartmentName()) == null ? 0.0 : timeApplyChangeMapper.timeApplyChangeMapper(id,timeApplyChange.getDepartmentName()); Double designApplyTimeChange = timeApplyChangeMapper.timeApplyChangeMapper(id,timeApplyChange.getDepartmentId().toString()) == null ? 0.0 : timeApplyChangeMapper.timeApplyChangeMapper(id,timeApplyChange.getDepartmentId().toString());
BigDecimal applyTimeChangeValue = timeApplyChange.getChangeTime().add(new BigDecimal(designApplyTimeChange)); vo1.setApplyTime(new BigDecimal(designApplyTimeChange));
vo1.setApplyTime(applyTimeChangeValue);
vo1.setDepartmentId(timeApplyChange.getDepartmentId()); vo1.setDepartmentId(timeApplyChange.getDepartmentId());
vo1.setDepartmentName(timeApplyChange.getDepartmentName()); vo1.setDepartmentName(timeApplyChange.getDepartmentName());
teamRequest.add(vo1); teamRequest.add(vo1);
...@@ -236,6 +234,15 @@ public class TimeApplyChangeServiceImpl extends ServiceImpl<TimeApplyChangeDao,T ...@@ -236,6 +234,15 @@ public class TimeApplyChangeServiceImpl extends ServiceImpl<TimeApplyChangeDao,T
}else if ("5".equals(vo.getStatus2())) { }else if ("5".equals(vo.getStatus2())) {
vo.setStatus2Zh("审核不通过"); vo.setStatus2Zh("审核不通过");
} }
/*
* SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
* if(vo.getCreateTime()!=null) { String createTime =
* sf.format(vo.getCreateTime()); vo.setCreateTime(createTime); }
* if(vo.getCheckTime1()!=null) { String checkTime1 =
* sf.format(vo.getCheckTime1()); vo.setCheckTime1(checkTime1); }
* if(vo.getCheckTime2()!=null) { String checkTime2 =
* sf.format(vo.getCheckTime2()); vo.setCheckTime2(checkTime2); }
*/
}; };
return new PageInfo<TimeApplyChangeVo>(list); return new PageInfo<TimeApplyChangeVo>(list);
} }
......
...@@ -23,16 +23,16 @@ public class TimeApplyChangeVo{ ...@@ -23,16 +23,16 @@ public class TimeApplyChangeVo{
@ApiModelProperty("变更备注原因") @ApiModelProperty("变更备注原因")
private String reason; private String reason;
@ApiModelProperty("变更时间") @ApiModelProperty("变更时间")
private Date createTime; private String createTime;
@ApiModelProperty("审核状态 0:待审核 1:已审核 2:审核未通过") @ApiModelProperty("审核状态 0:待审核 1:已审核 2:审核未通过")
private String status1; private String status1;
@ApiModelProperty("池总审核时间") @ApiModelProperty("池总审核时间")
private Date checkTime1; private String checkTime1;
@ApiModelProperty("审核状态 3:待审核4:已审核 5:审核未通过") @ApiModelProperty("审核状态 3:待审核4:已审核 5:审核未通过")
private String status2; private String status2;
@ApiModelProperty("云总审核时间") @ApiModelProperty("云总审核时间")
private Date checkTime2; private String checkTime2;
@ApiModelProperty("变更申请id") @ApiModelProperty("变更申请id")
private Integer timeApplyId; private Integer timeApplyId;
@ApiModelProperty("审核不通过原因") @ApiModelProperty("审核不通过原因")
...@@ -47,5 +47,5 @@ public class TimeApplyChangeVo{ ...@@ -47,5 +47,5 @@ public class TimeApplyChangeVo{
@ApiModelProperty("云总审核状态") @ApiModelProperty("云总审核状态")
private String status2Zh; private String status2Zh;
@ApiModelProperty("变更后工时") @ApiModelProperty("变更后工时")
private Double totalChangeTime; private BigDecimal totalChangeTime;
} }
...@@ -15,7 +15,5 @@ public class TimeApplyTableListVo { ...@@ -15,7 +15,5 @@ public class TimeApplyTableListVo {
private Integer departmentId; private Integer departmentId;
@ApiModelProperty(value = "部门名称" ) @ApiModelProperty(value = "部门名称" )
private String departmentName; private String departmentName;
@ApiModelProperty("变更申请id")
private Integer timeApplyId;
} }
...@@ -14,24 +14,24 @@ public class TimeApplyVo { ...@@ -14,24 +14,24 @@ public class TimeApplyVo {
//项目名 负责人 启动时间 截止时间 总工时 审核状态 //项目名 负责人 启动时间 截止时间 总工时 审核状态
@ApiModelProperty("id") @ApiModelProperty("id")
private Integer id; private Integer id;
@ApiModelProperty("项目名称") @ApiModelProperty("项目id")
private String projectId; private String projectId;
@ApiModelProperty("项目名称")
private String project;
@ApiModelProperty("负责人") @ApiModelProperty("负责人")
private String name; private String name;
@ApiModelProperty("总工时") @ApiModelProperty("总工时")
private BigDecimal totalApplyTime; private BigDecimal totalApplyTime;
@ApiModelProperty("申请时间") @ApiModelProperty("申请时间")
private Date createTime; private String createTime;
@ApiModelProperty("项目状态: 1 进行中 2开发完成 3试运行 4验收完成 5已关闭 ") @ApiModelProperty("项目状态: 1 进行中 2开发完成 3试运行 4验收完成 5已关闭 ")
private String status; private String status;
@ApiModelProperty("项目状态: 1 进行中 2开发完成 3试运行 4验收完成 5已关闭 ") @ApiModelProperty("项目状态: 1 进行中 2开发完成 3试运行 4验收完成 5已关闭 ")
private String status_Name; private String status_Name;
@ApiModelProperty("项目启动时间") @ApiModelProperty("项目启动时间")
@JSONField(format="yyyy-MM-dd") private String startTime;
private Date startTime;
@ApiModelProperty("项目截止时间") @ApiModelProperty("项目截止时间")
@JSONField(format="yyyy-MM-dd") private String endTime;
private Date endTime;
@ApiModelProperty("申请状态 0:未申请 1:已申请") @ApiModelProperty("申请状态 0:未申请 1:已申请")
private String status_1; private String status_1;
@ApiModelProperty("chi总经理状态") @ApiModelProperty("chi总经理状态")
......
...@@ -100,7 +100,7 @@ public interface TaskDao extends BaseMapper<Task> { ...@@ -100,7 +100,7 @@ public interface TaskDao extends BaseMapper<Task> {
+ " AND a.department_id = #{id} " + " AND a.department_id = #{id} "
+ "</if>" + "</if>"
+ "<if test = 'userId!=null and userId!=\"\"'> " + "<if test = 'userId!=null and userId!=\"\"'> "
+ " AND a.user_id = #{id} " + " AND a.user_id = #{userId} "
+ "</if>" + "</if>"
+ "</script>") + "</script>")
BigDecimal queryConsume(String id,Integer userId,Integer departmentId); BigDecimal queryConsume(String id,Integer userId,Integer departmentId);
...@@ -115,7 +115,7 @@ public interface TaskDao extends BaseMapper<Task> { ...@@ -115,7 +115,7 @@ public interface TaskDao extends BaseMapper<Task> {
+ " and (task_status=1 or task_status=2)" + " and (task_status=1 or task_status=2)"
+ "</if>" + "</if>"
+ "<if test = 'userId!=null and userId!=\"\"'> " + "<if test = 'userId!=null and userId!=\"\"'> "
+ " AND a.user_id = #{id} " + " AND a.user_id = #{userId} "
+ " and (task_status=1 or task_status=2 or task_status=3)" + " and (task_status=1 or task_status=2 or task_status=3)"
+ "</if>" + "</if>"
+ "</script>") + "</script>")
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论