Merge branch 'lixuetao'
This commit is contained in:
@@ -96,6 +96,19 @@ public class ReportManageConroller {
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 报告列表
|
||||
* @param vo
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@ApiOperation("报告列表")
|
||||
@PostMapping("/page")
|
||||
public ResponseMessage page(@RequestBody ReportQueryVo vo) throws Exception {
|
||||
IPage<ReportVo> list = reportService.page(vo);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 报告列表(带权限验证)
|
||||
* @param vo
|
||||
|
||||
@@ -34,4 +34,6 @@ public interface ReportDao extends BaseMapper<ReportEntity> {
|
||||
List<String> getReportDateList(@Param("usid")String usid);
|
||||
|
||||
IPage<ReportVo> getAddReportPage(IPage<ReportEntity> page, @Param("pageVO") ReportQueryVo vo);
|
||||
|
||||
IPage<ReportVo> page(IPage<ReportEntity> page,@Param("pageVO") ReportQueryVo vo);
|
||||
}
|
||||
|
||||
@@ -49,4 +49,6 @@ public interface IReportService {
|
||||
String reportHtml(String id);
|
||||
|
||||
IPage<ReportVo> addReportPage(ReportQueryVo vo) throws Exception;
|
||||
|
||||
IPage<ReportVo> page(ReportQueryVo vo);
|
||||
}
|
||||
|
||||
@@ -372,6 +372,30 @@ public class IReportServiceImpl extends ServiceImpl<ReportDao, ReportEntity>
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<ReportVo> page(ReportQueryVo vo) {
|
||||
IPage<ReportEntity> page = new Page<>();
|
||||
page.setCurrent(vo.getPageNo());
|
||||
page.setSize(vo.getPageSize());
|
||||
//判断是不是管理员
|
||||
boolean admin = false;
|
||||
List<RoleEO> roleEOList = roleEODao.selectByuserId(UserUtils.getUserId());
|
||||
for (RoleEO roleEO : roleEOList) {
|
||||
if ("管理员".equals(roleEO.getName())){
|
||||
admin= !admin;
|
||||
}
|
||||
}
|
||||
if (admin) {
|
||||
vo.setUsid(null);
|
||||
} else {
|
||||
vo.setUsid(UserUtils.getUserId());
|
||||
}
|
||||
|
||||
IPage<ReportVo> list = reportDao.page(page, vo);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建htmlstring
|
||||
*
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.adc.da.report.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
@@ -27,6 +26,10 @@ public class ReportVo {
|
||||
*/
|
||||
private String keyContent;
|
||||
|
||||
/**
|
||||
* 权限
|
||||
*/
|
||||
private Integer power;
|
||||
/**
|
||||
* 主要内容
|
||||
*/
|
||||
|
||||
@@ -223,6 +223,62 @@
|
||||
|
||||
|
||||
|
||||
</select>
|
||||
<select id="page" resultType="com.adc.da.report.vo.ReportVo">
|
||||
|
||||
SELECT
|
||||
eo.id,
|
||||
eo.NAME,
|
||||
eo.keycontent,
|
||||
eo.maincontent,
|
||||
eo.DEPARTMENT,
|
||||
eo.YEAR,
|
||||
eo.fileid,
|
||||
eo.confidentialLevel,
|
||||
eo.privacyLevel,
|
||||
pa.report_id,
|
||||
pa.user_id,
|
||||
pa.power
|
||||
FROM
|
||||
TT_REPORT_MANAGE eo
|
||||
LEFT JOIN tr_report_user ru ON eo.id = ru.reportId
|
||||
LEFT JOIN power_apply pa ON pa.report_id = eo.id
|
||||
WHERE
|
||||
eo.DEL_FLAG = 0
|
||||
<if test="pageVO.usid !='' and pageVO.usid != null">
|
||||
and (ru.userId = #{pageVO.usid}
|
||||
or eo.id in (
|
||||
SELECT tt.report_id from power_apply tt WHERE tt.user_id = #{pageVO.usid})
|
||||
)
|
||||
</if>
|
||||
<if test="pageVO.usid !='' and pageVO.usid != null">
|
||||
|
||||
</if>
|
||||
<if test="pageVO.name !='' and pageVO.name != null">
|
||||
and name like CONCAT(CONCAT('%',#{pageVO.name}),'%')
|
||||
</if>
|
||||
<if test="pageVO.keyContent !='' and pageVO.keyContent != null">
|
||||
and keycontent like CONCAT(CONCAT('%',#{pageVO.keyContent}),'%')
|
||||
</if>
|
||||
<!--年份搜索-->
|
||||
<if test="pageVO.year != null and pageVO.year.size() > 0">
|
||||
and year in
|
||||
<foreach collection="pageVO.year" item="year" open="(" separator="," close=")">
|
||||
#{year}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<if test="pageVO.ids != null and pageVO.ids.size() > 0">
|
||||
and eo.id in
|
||||
<foreach collection="pageVO.ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
GROUP BY
|
||||
eo.id
|
||||
ORDER BY
|
||||
eo.updateDate DESC
|
||||
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
+17
-8
@@ -28,10 +28,13 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.Duration;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.util.*;
|
||||
|
||||
import static com.adc.da.wkflow.util.date.DateTools.disposeApprovalTime;
|
||||
|
||||
@Api(tags = "流程明细管理")
|
||||
@RestController
|
||||
@RequestMapping("/${restPath}/task")
|
||||
@@ -58,7 +61,7 @@ public class TaskController {
|
||||
@ApiOperation(value = "流程实例明细列表")
|
||||
@ApiImplicitParam(name = "prcNum", value = "流程实例id")
|
||||
@GetMapping("/get_list_by_instance")
|
||||
public List<Map<String, Object>> get_list_by_instance(String prcNum,String sortWord,String shunxu) {
|
||||
public List<Map<String, Object>> get_list_by_instance(String prcNum,String sortWord,String shunxu) throws ParseException {
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq("PRC_NUM",prcNum);
|
||||
BusProcessName one = iBusProcessNameService.getOne(queryWrapper);
|
||||
@@ -130,11 +133,17 @@ public class TaskController {
|
||||
historicTaskInstance.put("approvalResult",formValsJsonMap.get("flag")!=null ? formValsJsonMap.get("flag"):"");
|
||||
historicTaskInstance.put("approvalFile",formValsJsonMap.get("approvalFile")!=null ? formValsJsonMap.get("approvalFile"):"");
|
||||
}
|
||||
Date createTime = (Date) historicTaskInstance.get("createTime");
|
||||
Date endTime = (Date) historicTaskInstance.get("endTime");
|
||||
if(endTime!=null){
|
||||
long approvalTime = disposeApprovalTime(createTime,endTime);
|
||||
historicTaskInstance.put("approvalTime",approvalTime + "小时");
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Date createTime = sdf.parse((String)historicTaskInstance.get("createTime"));
|
||||
Object endTime1 = historicTaskInstance.get("endTime");
|
||||
if(endTime1!=null){
|
||||
Date endTime = sdf.parse((String)endTime1);
|
||||
// long approvalTime = disposeApprovalTime(createTime,endTime);
|
||||
LocalDateTime startDateTime = LocalDateTime.ofInstant(createTime.toInstant(), ZoneId.systemDefault());
|
||||
LocalDateTime endDateTime = LocalDateTime.ofInstant(endTime.toInstant(), ZoneId.systemDefault());
|
||||
|
||||
long days = Duration.between(startDateTime.toLocalDate().atStartOfDay(), endDateTime.toLocalDate().atStartOfDay()).toDays() + 1;
|
||||
historicTaskInstance.put("approvalTime",days + "天");
|
||||
}
|
||||
}
|
||||
if(StringUtils.isNotBlank(sortWord)){
|
||||
|
||||
@@ -10,6 +10,9 @@ import org.activiti.engine.repository.ProcessDefinition;
|
||||
import org.activiti.engine.runtime.ProcessInstance;
|
||||
import org.activiti.engine.task.Task;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -177,12 +180,19 @@ public class ActivitiTools {
|
||||
map.put("assignee", model.getAssignee());
|
||||
map.put("category", model.getCategory());
|
||||
map.put("claimTime", model.getClaimTime());
|
||||
map.put("createTime", model.getCreateTime());
|
||||
LocalDateTime dt = LocalDateTime.ofInstant(model.getCreateTime().toInstant(), ZoneId.systemDefault());
|
||||
String createTime = dt.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||
map.put("createTime",createTime);
|
||||
map.put("deleteReason", model.getDeleteReason());
|
||||
map.put("description", model.getDescription());
|
||||
map.put("dueDate", model.getDueDate());
|
||||
map.put("drationInMillis", model.getDurationInMillis());
|
||||
map.put("endTime", model.getEndTime());
|
||||
String endTime = null;
|
||||
if (model.getEndTime() != null){
|
||||
LocalDateTime end = LocalDateTime.ofInstant(model.getEndTime().toInstant(), ZoneId.systemDefault());
|
||||
endTime = end.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||
}
|
||||
map.put("endTime", endTime);
|
||||
map.put("executionId", model.getExecutionId());
|
||||
map.put("formKey", model.getFormKey());
|
||||
map.put("id", model.getId());
|
||||
|
||||
Reference in New Issue
Block a user