4ac95c0a 张雷

增加单点登录接口、OA待办对接接口、禅道BUG修改

1 个父辈 c937ee54
......@@ -76,11 +76,6 @@ public class AjhMeetingController {
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
Result<IPage<AjhMeeting>> result = new Result<IPage<AjhMeeting>>();
// if(ajhMeeting.getStartTime()!=null&&ajhMeeting.getEndTime()!=null){
// String startTime = ajhMeeting.getStartTime()+" 00:00:00";
// String endTime = ajhMeeting.getEndTime()+" 23:59:59";
// queryWrapper.between("start_time", startTime, endTime);
// }
Page<AjhMeeting> page = new Page<AjhMeeting>(pageNo, pageSize);
IPage<AjhMeeting> pageList = ajhMeetingService.queryPageList(page, ajhMeeting);
result.setSuccess(true);
......
......@@ -89,10 +89,9 @@ public class AjhMeetingSendController {
queryWrapper.like(ConvertUtils.isNotEmpty(ajhMeetingSend.getMeetTitle()),"meet_title",ajhMeetingSend.getMeetTitle());
queryWrapper.between(ConvertUtils.isNotEmpty(ajhMeetingSend.getMeetStartTime()),"meet_start_time",
ajhMeetingSend.getMeetStartTime()+" 00:00:00",ajhMeetingSend.getMeetEndTime()+" 23:59:59");
queryWrapper.orderByDesc("send_status");
Page<AjhMeetingSend> page = new Page<AjhMeetingSend>(pageNo, pageSize);
IPage<AjhMeetingSend> pageList = ajhMeetingSendService.queryPage(page, queryWrapper);
result.setSuccess(true);
result.setResult(pageList);
return result;
......
......@@ -87,7 +87,8 @@ public interface AjhRectificationInfoMapper extends BaseMapper<AjhRectificationI
* @param endDate
* @return
*/
List<RectificationInfoAnalyseVO.XAndCount> areaList(@Param("startDate") LocalDateTime startDate, @Param("endDate") LocalDateTime endDate);
List<RectificationInfoAnalyseVO.XAndCount> areaList(@Param("startDate") LocalDateTime startDate, @Param("endDate") LocalDateTime endDate,
@Param("departId") String departId);
/**
* 雷达图:安全隐患伤害类别
......
......@@ -46,7 +46,7 @@
<if test="ajhMeeting.meetCategory !=null and ajhMeeting.meetCategory!=''">
AND m.meet_category = #{ajhMeeting.meetCategory}
</if>
order by m.create_time desc
order by m.create_time desc,m.send_status asc
</select>
<select id="getDataById" resultType="com.skua.modules.ajh.vo.AjhMeetingVO">
......
......@@ -162,17 +162,26 @@
) t
group by ym;
</select>
<select id="areaList" resultType="com.skua.modules.ajh.vo.RectificationInfoAnalyseVO$XAndCount">
<!--要求:要返回所有的字典项-->
select dic.struct_name x, count
from (
select ri.rec_ord_body,count(*) count
from ajh_rectification_info ri
where rec_ord_report_date between #{startDate} and #{endDate}
where rec_ord_report_date between #{startDate} and #{endDate}
group by ri.rec_ord_body
) t
right join sys_struct_dict dic on t.rec_ord_body = dic.id
where 1=1
<if test="departId!=null and departId!=''">
and dic.depart_id in
<foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
<select id="classifyList" resultType="java.lang.String">
select GROUP_CONCAT(rec_ord_classify)
from ajh_rectification_info ri
......
......@@ -255,7 +255,7 @@ public class AjhRectificationInfoServiceImpl extends ServiceImpl<AjhRectificatio
vo.setLevelHistogramList(mapper.levelHistogramList(startDate, endDate, departId));
vo.setDutyHistogramList(mapper.dutyHistogramList(startDate, endDate, departId));
vo.setAreaList(mapper.areaList(startDate, endDate));
vo.setAreaList(mapper.areaList(startDate, endDate, departId));
//雷达图:安全隐患伤害类别 (因为一个安全隐患可以选择多个[伤害类别],所以统计会复杂些)-------------------------------------------------------------------------------------------
List<RectificationInfoAnalyseVO.XAndCount> classifyList = new LinkedList<>();
......
package com.skua.modules.flow.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.skua.modules.flow.core.entity.BladeFlow;
import com.skua.modules.flow.core.entity.FlowAssemblyEntity;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* 流程业务类
*
* @author Jkadmin
*/
public interface FlowForThirdBusinessService {
/**
* 流程待签列表
* @param bladeFlow 流程类
* @return
*/
List<BladeFlow> selectClaimPage(BladeFlow bladeFlow, String userId, String roles);
/**
* 流程待办列表
* @param bladeFlow 流程类
* @return
*/
List<BladeFlow> selectTodoPage(BladeFlow bladeFlow, String userId);
}
......@@ -4,20 +4,28 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.skua.core.api.ISysBaseAPI;
import com.skua.core.api.vo.Result;
import com.skua.core.aspect.annotation.AutoLog;
import com.skua.core.context.BaseContextHandler;
import com.skua.core.context.SpringContextUtils;
import com.skua.core.util.DateUtils;
import com.skua.modules.equipment.entity.EquipmentMaintainTask;
import com.skua.modules.equipment.service.IEquipmentMaintainTaskService;
import com.skua.modules.flow.business.service.FlowBusinessService;
import com.skua.modules.flow.core.entity.BladeFlow;
import com.skua.modules.flow.core.utils.TaskUtil;
import com.skua.modules.flow.service.FlowForThirdBusinessService;
import com.skua.modules.inspection.entity.InspectionUserWorkingGroup;
import com.skua.modules.inspection.service.IInspectionTaskService;
import com.skua.modules.inspection.service.IInspectionUserWorkingGroupService;
import com.skua.modules.process.vo.ProcessStatisticsVO;
import com.skua.modules.process.vo.ThirdProcessVO;
import com.skua.modules.quartz.util.BaseUtil;
import com.skua.modules.system.entity.SysUser;
import com.skua.modules.system.entity.SysUserRole;
import com.skua.modules.system.service.ISysUserRoleService;
import com.skua.modules.system.service.ISysUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
......@@ -27,8 +35,9 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
@Slf4j
@Api(tags="测试流程")
......@@ -37,15 +46,21 @@ import java.util.List;
public class ProcessStatisticsController {
@Autowired
private ISysUserService sysUserService;
@Autowired
private ISysBaseAPI sysBaseAPI;
@Autowired
private FlowBusinessService flowBusinessService;
@Autowired
private FlowForThirdBusinessService flowForThirdBusinessService;
@Autowired
private IEquipmentMaintainTaskService equipMaintainExecuteService;
@Autowired
private IInspectionTaskService inspectionTaskService;
@Autowired
private IInspectionUserWorkingGroupService inspectionUserWorkingGroupService;
/* 问题上报流程 problemReport
/* 问题上报流程 problemReport
设备维修流程 EquipmentRepair
设备缺陷管理 EquipmentDefectManagement
事故事件流程 EmergencyRiskEvent
......@@ -60,9 +75,6 @@ public class ProcessStatisticsController {
public Result<List<ProcessStatisticsVO>> statistics() {
Result<List<ProcessStatisticsVO>> result = new Result<List<ProcessStatisticsVO>>();
List<ProcessStatisticsVO> processStatisticsList = new ArrayList<>();
/* String taskUser = TaskUtil.getTaskUser();
String taskGroup = TaskUtil.getCandidateGroup();*/
String userId = BaseContextHandler.getUserId();
IPage<BladeFlow> page = new Page<BladeFlow>();
page.setCurrent(1);
......@@ -70,8 +82,6 @@ public class ProcessStatisticsController {
BladeFlow bladeFlow = new BladeFlow();
try {
//巡检任务、维修任务、保养任务、危险作业、事故事件、安全隐患、、药剂入库
String process_key = "AjhRectification";
processStatisticsList.add( queryProcessStatistics("安全隐患", process_key,page,bladeFlow) ) ;
process_key = "problemReport";
......@@ -91,8 +101,6 @@ public class ProcessStatisticsController {
ProcessStatisticsVO maintainerProcessStatisticsVO = new ProcessStatisticsVO("保养任务" ,"" , "0", baoyangTodoCount.toString() );
processStatisticsList.add( maintainerProcessStatisticsVO );
//巡检
//得到巡检任务
//得到进行中的任务
......@@ -155,20 +163,7 @@ public class ProcessStatisticsController {
return result;
}
/***
* @param process_key
* @return
*/
/* private ProcessStatisticsVO queryProcessStatistics(String processName,String process_key,String taskUser , String taskGroup){
TaskQuery taskQuery = taskService.createTaskQuery();
taskQuery.processDefinitionKey( process_key );
Long todoCount = taskQuery.taskAssignee(taskUser).count();//代办人数
Long claimCount = taskQuery.taskCandidateGroupIn( Func.toStrList(taskGroup) ).count() ;//todoCount
return new ProcessStatisticsVO(processName ,process_key , todoCount.toString(), claimCount.toString() );
}*/
private ProcessStatisticsVO queryProcessStatistics(String processName, String process_key, IPage<BladeFlow> page,BladeFlow bladeFlow){
private ProcessStatisticsVO queryProcessStatistics(String processName, String process_key, IPage<BladeFlow> page,BladeFlow bladeFlow){
// String repairProcessDefinitionKey = "equipServicewx";
bladeFlow.setProcessDefinitionKey(process_key);
long repairClaimCount = flowBusinessService.selectClaimPage(page, bladeFlow).getTotal();
......@@ -177,4 +172,56 @@ public class ProcessStatisticsController {
return new ProcessStatisticsVO(processName ,process_key , repairToDoCount+"", repairClaimCount+"" );
}
@AutoLog(value = "第三方获取待办流程" )
@ApiOperation(value="第三方获取待办流程", notes="第三方获取待办流程")
@GetMapping(value = "/getProcessByPhone")
public Result<Map<String,Object>> getProcessByPhone(String phone) {
Result<Map<String,Object>> result = new Result<Map<String,Object>>();
Map<String,Object> map = new HashMap<>();
List<ThirdProcessVO> list = new ArrayList<>();
SysUser sysUser = sysUserService.getUserByPhone(phone);
if(sysUser!=null){
String userName = sysUser.getRealname();
BladeFlow bladeFlow = new BladeFlow();
List<BladeFlow> claimList = new ArrayList<>();
List<BladeFlow> todoList = new ArrayList<>();
List<String> roleList = sysBaseAPI.getRolesByUserId(sysUser.getId());
String roles = roleList.stream().map(s -> s.trim()).collect(Collectors.joining(","));
if(roleList.size() > 0){
claimList = flowForThirdBusinessService.selectClaimPage(bladeFlow, sysUser.getId(), roles);
for (BladeFlow claim : claimList) {
ThirdProcessVO claimVO = new ThirdProcessVO();
claimVO.setMsgid(claim.getTaskId());
claimVO.setMessagenote(claim.getBusinessDesc());
if(claim.getCreateTime()!=null){
claimVO.setSenddate(DateUtils.format(new Date(), "YYYY-MM-dd"));
}
claimVO.setCheckcode(phone);
claimVO.setCheckname(userName);
claimVO.setSendercode(phone);
claimVO.setSendername(userName);
list.add(claimVO);
}
}
todoList = flowForThirdBusinessService.selectTodoPage(bladeFlow, sysUser.getId());
for (BladeFlow todo : todoList) {
ThirdProcessVO todoVO = new ThirdProcessVO();
todoVO.setMsgid(todo.getTaskId());
todoVO.setMessagenote(todo.getBusinessDesc());
if(todo.getCreateTime()!=null){
todoVO.setSenddate(DateUtils.format(new Date(), "YYYY-MM-dd"));
}
todoVO.setCheckcode(phone);
todoVO.setCheckname(userName);
todoVO.setSendercode(phone);
todoVO.setSendername(userName);
list.add(todoVO);
}
}
map.put("DATAS",list);
map.put("COUNT",list.size());
result.setResult(map);
return result;
}
}
......
package com.skua.modules.process.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value="待办数据传输对象", description="待办数据传输对象")
public class ThirdProcessVO {
@ApiModelProperty(value = "待办唯一标识ID")
private String msgid;
@ApiModelProperty(value = "PC端待办链接")
private String messageurlpc;
@ApiModelProperty(value = "移动端待办链接")
private String messageurlmobile;
@ApiModelProperty(value = "创建人手机号")
private String sendercode;
@ApiModelProperty(value = "创建人姓名")
private String sendername;
@ApiModelProperty(value = "待办标题")
private String messagenote;
@ApiModelProperty(value = "待办接收日期")
private String senddate;
@ApiModelProperty(value = "审批人手机号")
private String checkcode;
@ApiModelProperty(value = "审批人姓名")
private String checkname;
}
......@@ -46,6 +46,7 @@ public class ShiroConfig {
filterChainDefinitionMap.put("/sys/login", "anon"); //登录接口排除
filterChainDefinitionMap.put("/sys/appLogin", "anon"); //移动端登录接口排除
filterChainDefinitionMap.put("/sys/thirdLogin", "anon"); //三方系统登录接口排除
filterChainDefinitionMap.put("/sys/sso/login", "anon"); //单点登录接口排除
filterChainDefinitionMap.put("/sys/logout", "anon"); //登出接口排除
filterChainDefinitionMap.put("/sys/getEncryptedString", "anon"); //获取加密串
filterChainDefinitionMap.put("/sys/sms", "anon");//短信验证码
......@@ -64,7 +65,7 @@ public class ShiroConfig {
filterChainDefinitionMap.put("/web/erp/materialAcceptanceForm/senderSign", "anon");//采购入库,送货方签名
filterChainDefinitionMap.put("/web/erp/materialIN/queryById", "anon");//采购入库,查询采购入库信息
filterChainDefinitionMap.put("/generic/**", "anon");//pdf预览需要文件
filterChainDefinitionMap.put("/generic/**", "anon");//pdf预览需要文
filterChainDefinitionMap.put("/web/process/getProcessByPhone", "anon");//第三方获取待办事
filterChainDefinitionMap.put("/", "anon");
filterChainDefinitionMap.put("/doc.html", "anon");
filterChainDefinitionMap.put("/**/*.js", "anon");
......
......@@ -11,6 +11,8 @@ import java.util.Objects;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.skua.core.util.encryption.MD5Util;
import com.skua.modules.system.vo.SsoLogin;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -184,6 +186,39 @@ public class LoginController {
return result;
}
/**
* 单点登录接口
* @param ssoLogin
* @return
*/
@RequestMapping(value = "/sso/login", method = RequestMethod.POST)
@ApiOperation("单点登录接口")
public Result<JSONObject> ssoLogin(@RequestBody SsoLogin ssoLogin){
Result<JSONObject> result = new Result<JSONObject>();
String phone = ssoLogin.getPhone();//手机号
String time = ssoLogin.getTime();//时间戳
String sign = ssoLogin.getSign();//加密信息
String key = "szhqydn";//约定标识
SysUser sysUser = sysUserService.getUserByPhone(ssoLogin.getPhone());
if(sysUser!=null){
String origin = key + time + phone;//标识
String md5 = MD5Util.MD5Encode(origin, null);
if(sign.equals(md5)){
//校验用户是否有效
result = sysUserService.checkUserIsEffective(sysUser);
if (!result.isSuccess()) {
return result;
}
//用户登录信息
userInfo(sysUser, result);
sysBaseAPI.addLog("手机号: " + phone + ",单点登录成功!", CommonConstant.LOG_TYPE_1, null);
}
}else{
result.error500("手机号不存在本系统");
}
return result;
}
@RequestMapping(value = "/getSv30Token", method = RequestMethod.POST)
@ApiOperation("SV30获取token")
public Result<JSONObject> getSv30Token(){
......
package com.skua.modules.system.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 单点登陆参数
*/
@Data
@ApiModel(value="SsoLogin", description="单点登陆参数")
public class SsoLogin {
@ApiModelProperty(value = "手机号")
private String phone;
@ApiModelProperty(value = "时间戳")
private String time;
@ApiModelProperty(value = "加密信息")
private String sign;
@ApiModelProperty(value = "约定标识")
private String key;
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!