add: 联调
This commit is contained in:
@@ -50,6 +50,7 @@ public class ShiroConfig {
|
||||
shiroFilter.setFilters(filters);
|
||||
|
||||
Map<String, String> filterMap = new LinkedHashMap<>();
|
||||
filterMap.put("/tickets/tickets/info/**", "anon");
|
||||
filterMap.put("/webjars/**", "anon");
|
||||
filterMap.put("/druid/**", "anon");
|
||||
filterMap.put("/app/**", "anon");
|
||||
@@ -66,6 +67,7 @@ public class ShiroConfig {
|
||||
filterMap.put("/js/**", "anon");
|
||||
filterMap.put("/img/**", "anon");
|
||||
filterMap.put("/fonts/**", "anon");
|
||||
|
||||
filterMap.put("/**", "oauth2");
|
||||
shiroFilter.setFilterChainDefinitionMap(filterMap);
|
||||
|
||||
|
||||
@@ -69,13 +69,11 @@ public class FlwDeployController {
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/flowDef/{id}")
|
||||
public R flowDef(@PathVariable("id") String id){
|
||||
if(id == null){
|
||||
return R.error("流程定义ID不能为空!");
|
||||
}
|
||||
@RequestMapping(value = "/flowDef")
|
||||
public R flowDef(){
|
||||
|
||||
// 我们通过BpmnModel对象来处理
|
||||
R r = deployService.flowDef(id);
|
||||
R r = deployService.flowDef();
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
@@ -28,10 +28,7 @@ public class FlwInstanceController {
|
||||
*/
|
||||
@RequestMapping("/startFlowInstance")
|
||||
public R startFlowInstance(@RequestParam Map<String, Object> params){
|
||||
Object id = params.get("id");
|
||||
if(id == null){
|
||||
return R.error("流程定义ID必须要传递");
|
||||
}
|
||||
|
||||
instanceService.startFlowInstance(params);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@@ -16,5 +16,5 @@ public interface FlwDeployService {
|
||||
|
||||
String flowXML(String id);
|
||||
|
||||
R flowDef(String id);
|
||||
R flowDef();
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ import org.flowable.engine.repository.ProcessDefinition;
|
||||
import org.flowable.engine.repository.ProcessDefinitionQuery;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -47,6 +48,10 @@ public class FlwDeployServiceImpl extends FlowServiceNoFactory implements FlwDep
|
||||
@Autowired
|
||||
private SysRoleService roleService;
|
||||
|
||||
@Value("${ProcessInstance.defId}")
|
||||
private String defId;
|
||||
|
||||
|
||||
/**
|
||||
* 查询分页的数据
|
||||
*
|
||||
@@ -176,8 +181,8 @@ public class FlwDeployServiceImpl extends FlowServiceNoFactory implements FlwDep
|
||||
}
|
||||
|
||||
@Override
|
||||
public R flowDef(String id) {
|
||||
BpmnModel bpmnModel = repositoryService.getBpmnModel(id);
|
||||
public R flowDef() {
|
||||
BpmnModel bpmnModel = repositoryService.getBpmnModel(defId);
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
// 从BpmnModel对象中获取相关的 userTask 信息
|
||||
Process mainProcess = bpmnModel.getMainProcess();
|
||||
|
||||
@@ -89,7 +89,7 @@ public class FlwInstanceServiceImpl extends FlowServiceNoFactory implements FlwI
|
||||
SysUserEntity loginUser = ShiroUtils.getUserEntity();
|
||||
// 获取需要发起的流程信息
|
||||
String ticketsId = (String) params.get("ticketsId");
|
||||
|
||||
Long userId = Long.valueOf((String) params.get("user1"));
|
||||
Map<String, Object> variable = new HashMap<>();
|
||||
// 结合传递过来的数据动态的绑定流程变量
|
||||
Set<String> keys = params.keySet();
|
||||
@@ -99,12 +99,14 @@ public class FlwInstanceServiceImpl extends FlowServiceNoFactory implements FlwI
|
||||
identityService.setAuthenticatedUserId(ShiroUtils.getUserId().toString());
|
||||
// 启动流程
|
||||
ProcessInstance processInstance = runtimeService.startProcessInstanceById(defId, variable);
|
||||
SysUserEntity user = sysUserService.getById(Long.valueOf((String) params.get("user1")));
|
||||
SysUserEntity user = sysUserService.getById(userId);
|
||||
//更新工单审批id
|
||||
TicketsEntity ticketsEntity = new TicketsEntity();
|
||||
ticketsEntity.setTicketsId(Long.valueOf(ticketsId));
|
||||
ticketsEntity.setStatus(TicketsStatusEnums.CHECKED.getCode());
|
||||
ticketsEntity.setProcessInstance(processInstance.getProcessInstanceId());
|
||||
ticketsEntity.setDeptPeople(user.getNickname());
|
||||
ticketsEntity.setAssignUserId(userId);
|
||||
ticketsService.updateById(ticketsEntity);
|
||||
|
||||
if (StrUtil.isEmpty(user.getWexinId())){
|
||||
@@ -328,8 +330,8 @@ public class FlwInstanceServiceImpl extends FlowServiceNoFactory implements FlwI
|
||||
|
||||
@Override
|
||||
public R completeTaskById(Map<String, Object> params) {
|
||||
String processInstance = (String) params.get("process_instance");
|
||||
String ticketsId = (String) params.get("ticketsId");
|
||||
String processInstance = (String) params.get("processInstance");
|
||||
Integer ticketsId = (Integer) params.get("ticketsId");
|
||||
if(StringUtils.isBlank(processInstance)){
|
||||
return R.error("流程Id不能为空");
|
||||
}
|
||||
|
||||
@@ -96,4 +96,6 @@ public class SysUserEntity implements Serializable {
|
||||
|
||||
private String wexinId;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -89,10 +89,10 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
|
||||
user.setPassword(new Sha256Hash(user.getPassword(), salt).toHex());
|
||||
user.setSalt(salt);
|
||||
this.save(user);
|
||||
|
||||
|
||||
//检查角色是否越权
|
||||
checkRole(user);
|
||||
|
||||
|
||||
//保存用户与角色关系
|
||||
sysUserRoleService.saveOrUpdate(user.getUserId(), user.getRoleIdList());
|
||||
}
|
||||
@@ -106,10 +106,10 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
|
||||
user.setPassword(new Sha256Hash(user.getPassword(), user.getSalt()).toHex());
|
||||
}
|
||||
this.updateById(user);
|
||||
|
||||
|
||||
//检查角色是否越权
|
||||
//checkRole(user);
|
||||
|
||||
|
||||
//保存用户与角色关系
|
||||
sysUserRoleService.saveOrUpdate(user.getUserId(), user.getRoleIdList());
|
||||
}
|
||||
@@ -143,7 +143,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
|
||||
/*if(user.getCreateUserId() == Constant.SUPER_ADMIN){
|
||||
return ;
|
||||
}*/
|
||||
|
||||
|
||||
//查询用户创建的角色列表
|
||||
List<Long> roleIdList = sysRoleService.queryRoleIdList(user.getCreateUserId());
|
||||
|
||||
@@ -152,4 +152,6 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
|
||||
throw new RRException("新增用户所选角色,不是本人创建");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.boge.modules.tickets.controller;
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
import com.boge.modules.tickets.dto.TicketsDTO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -48,9 +49,9 @@ public class TicketsController {
|
||||
@RequestMapping("/info/{ticketsId}")
|
||||
//@RequiresPermissions("tickets:tickets:info")
|
||||
public R info(@PathVariable("ticketsId") String ticketsId){
|
||||
TicketsEntity tickets = ticketsService.getById(ticketsId);
|
||||
TicketsDTO ticketsDTO = ticketsService.getTicketsById(ticketsId);
|
||||
|
||||
return R.ok().put("tickets", tickets);
|
||||
return R.ok().put("tickets", ticketsDTO);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,17 +1,20 @@
|
||||
package com.boge.modules.tickets.dao;
|
||||
|
||||
import com.boge.modules.tickets.dto.TicketsDTO;
|
||||
import com.boge.modules.tickets.entity.TicketsEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* @author ls
|
||||
* @email dengpbs@163.com
|
||||
* @date 2025-03-05 14:29:12
|
||||
*/
|
||||
@Mapper
|
||||
public interface TicketsDao extends BaseMapper<TicketsEntity> {
|
||||
|
||||
|
||||
|
||||
TicketsDTO getTicketsDTOById(String ticketsId);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.boge.modules.tickets.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class TicketsDTO {
|
||||
/**
|
||||
* 工单id
|
||||
*/
|
||||
private Long ticketsId;
|
||||
/**
|
||||
* 小车类型
|
||||
*/
|
||||
private Integer carType;
|
||||
|
||||
/**
|
||||
* 小车类型
|
||||
*/
|
||||
private String carName;
|
||||
|
||||
/**
|
||||
* 异常类型
|
||||
*/
|
||||
private String errorType;
|
||||
|
||||
/**
|
||||
* 合同编号
|
||||
*/
|
||||
private String contractNumber;
|
||||
/**
|
||||
* 客户id
|
||||
*/
|
||||
private Long clientId;
|
||||
|
||||
/**
|
||||
* 客户名称
|
||||
*/
|
||||
private String clientName;
|
||||
/**
|
||||
* 故障描述
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 部门对接人
|
||||
*/
|
||||
private String deptPeople;
|
||||
/**
|
||||
* 客户联系电话
|
||||
*/
|
||||
private String deptPhone;
|
||||
/**
|
||||
* 创建者ID
|
||||
*/
|
||||
private Long createUserId;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
* 是否验收
|
||||
*/
|
||||
private Integer isCheck;
|
||||
/**
|
||||
* 工单状态
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 工单关闭时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 审批流id
|
||||
*/
|
||||
private String processInstance;
|
||||
}
|
||||
|
||||
@@ -78,6 +78,8 @@ public class TicketsEntity implements Serializable {
|
||||
*/
|
||||
private String processInstance;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 指派人ID
|
||||
*/
|
||||
private Long assignUserId;
|
||||
}
|
||||
|
||||
@@ -2,12 +2,13 @@ package com.boge.modules.tickets.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.boge.common.utils.PageUtils;
|
||||
import com.boge.modules.tickets.dto.TicketsDTO;
|
||||
import com.boge.modules.tickets.entity.TicketsEntity;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
* @author ls
|
||||
* @email dengpbs@163.com
|
||||
@@ -16,5 +17,7 @@ import java.util.Map;
|
||||
public interface TicketsService extends IService<TicketsEntity> {
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params);
|
||||
|
||||
TicketsDTO getTicketsById(String ticketsId);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,23 @@
|
||||
package com.boge.modules.tickets.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.boge.common.utils.ShiroUtils;
|
||||
import com.boge.modules.car.entity.CarEntity;
|
||||
import com.boge.modules.car.service.CarService;
|
||||
import com.boge.modules.dict.dao.Dict;
|
||||
import com.boge.modules.dict.dao.mapper.SysDictMapper;
|
||||
import com.boge.modules.sys.entity.SysUserEntity;
|
||||
import com.boge.modules.sys.service.SysUserRoleService;
|
||||
import com.boge.modules.sys.service.impl.SysUserServiceImpl;
|
||||
import com.boge.modules.tickets.dto.TicketsDTO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@@ -16,14 +32,43 @@ import com.boge.modules.tickets.service.TicketsService;
|
||||
@Service("ticketsService")
|
||||
public class TicketsServiceImpl extends ServiceImpl<TicketsDao, TicketsEntity> implements TicketsService {
|
||||
|
||||
@Autowired
|
||||
TicketsDao ticketsDao;
|
||||
|
||||
@Autowired
|
||||
private SysDictMapper sysDictMapper;
|
||||
@Autowired
|
||||
private SysUserServiceImpl sysUserService;
|
||||
|
||||
@Autowired
|
||||
private SysUserRoleService sysUserRoleService;
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
IPage<TicketsEntity> page = this.page(
|
||||
new Query<TicketsEntity>().getPage(params),
|
||||
new QueryWrapper<TicketsEntity>()
|
||||
SysUserEntity loginUser = ShiroUtils.getUserEntity();
|
||||
QueryWrapper<TicketsEntity> ticketsEntityQueryWrapper = new QueryWrapper<>();
|
||||
if (ObjectUtil.isNotEmpty(loginUser)){
|
||||
List<Long> longs = sysUserRoleService.queryRoleIdList(loginUser.getUserId());
|
||||
//判断是否是超级管理员
|
||||
if (longs.contains(2L)){
|
||||
ticketsEntityQueryWrapper.orderBy(true, true,"create_time");
|
||||
}else {
|
||||
ticketsEntityQueryWrapper.eq("assign_user_id", loginUser.getUserId())
|
||||
.orderBy(true, true,"create_time");;
|
||||
}
|
||||
}
|
||||
|
||||
IPage<TicketsEntity> page = this.page(new Query<TicketsEntity>().getPage(params),
|
||||
ticketsEntityQueryWrapper
|
||||
);
|
||||
|
||||
return new PageUtils(page);
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
public TicketsDTO getTicketsById(String ticketsId) {
|
||||
TicketsDTO tickets = ticketsDao.getTicketsDTOById(ticketsId);
|
||||
return tickets;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<result property="ticketsId" column="tickets_id"/>
|
||||
<result property="carType" column="car_type"/>
|
||||
<result property="errorType" column="error_type"/>
|
||||
<result property="contractNumber" column="contract_number"/>
|
||||
<result property="contractId" column="contract_number"/>
|
||||
<result property="clientId" column="client_id"/>
|
||||
<result property="description" column="description"/>
|
||||
<result property="deptPeople" column="dept_people"/>
|
||||
@@ -19,6 +19,14 @@
|
||||
<result property="status" column="status"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
<select id="getTicketsDTOById" resultType="com.boge.modules.tickets.dto.TicketsDTO" parameterType="java.lang.String">
|
||||
select * from sys_tickets as a
|
||||
left join sys_client as b on a.client_id = b.client_id
|
||||
left join sys_car as c on a.car_type = c.car_id
|
||||
left join sys_contract as d on a.contract_id = d.contract_id
|
||||
|
||||
where a.tickets_id = #{ticketsId}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user