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