mirror of
https://gitee.com/elegant_wings/dbd-meeting.git
synced 2025-06-22 02:29:36 +08:00
新增了对应的维修员对应的接口
This commit is contained in:
parent
af2a012091
commit
8e695ed358
@ -0,0 +1,76 @@
|
|||||||
|
package com.ics.admin.controller;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import com.ics.common.core.domain.R;
|
||||||
|
import com.ics.common.core.controller.BaseController;
|
||||||
|
import com.ics.admin.domain.RepairWorkerType;
|
||||||
|
import com.ics.admin.service.IRepairWorkerTypeService;
|
||||||
|
import org.wf.jwtp.annotation.RequiresPermissions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 维修人分类关联 提供者
|
||||||
|
*
|
||||||
|
* @author chen
|
||||||
|
* @date 2024-07-31
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("type")
|
||||||
|
public class RepairWorkerTypeController extends BaseController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IRepairWorkerTypeService repairWorkerTypeService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询维修人分类关联
|
||||||
|
*/
|
||||||
|
@GetMapping("get/{id}")
|
||||||
|
public RepairWorkerType get(@PathVariable("id") Long id) {
|
||||||
|
return repairWorkerTypeService.selectRepairWorkerTypeById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询维修人分类关联列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("RepairWorkerType:type:list")
|
||||||
|
@GetMapping("list")
|
||||||
|
public R list(RepairWorkerType repairWorkerType) {
|
||||||
|
startPage();
|
||||||
|
return result(repairWorkerTypeService.selectRepairWorkerTypeList(repairWorkerType));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增保存维修人分类关联
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("RepairWorkerType:type:add")
|
||||||
|
@PostMapping("save")
|
||||||
|
public R addSave(@RequestBody RepairWorkerType repairWorkerType) {
|
||||||
|
return toAjax(repairWorkerTypeService.insertRepairWorkerType(repairWorkerType));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改保存维修人分类关联
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("RepairWorkerType:type:edit")
|
||||||
|
@PostMapping("update")
|
||||||
|
public R editSave(@RequestBody RepairWorkerType repairWorkerType) {
|
||||||
|
return toAjax(repairWorkerTypeService.updateRepairWorkerType(repairWorkerType));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除维修人分类关联
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("RepairWorkerType:type:remove")
|
||||||
|
@PostMapping("remove")
|
||||||
|
public R remove(String ids) {
|
||||||
|
return toAjax(repairWorkerTypeService.deleteRepairWorkerTypeByIds(ids));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -43,8 +43,14 @@ public class Repair extends BaseEntity<Repair> {
|
|||||||
|
|
||||||
private Integer userId;
|
private Integer userId;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String userName;
|
||||||
|
|
||||||
private Integer dispatcherId;
|
private Integer dispatcherId;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String dispatcherName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 报修人
|
* 报修人
|
||||||
*/
|
*/
|
||||||
|
@ -0,0 +1,27 @@
|
|||||||
|
package com.ics.admin.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.ics.common.core.domain.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 维修人分类关联对象 ics_repair_worker_type
|
||||||
|
*
|
||||||
|
* @author chen
|
||||||
|
* @date 2024-07-31
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("ics_repair_worker_type")
|
||||||
|
public class RepairWorkerType extends BaseEntity<RepairWorkerType> {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 维修人id */
|
||||||
|
private Long workerId;
|
||||||
|
|
||||||
|
/** 设备类型id */
|
||||||
|
private Long typeId;
|
||||||
|
|
||||||
|
/** 园区ID */
|
||||||
|
private Long parkId;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,64 @@
|
|||||||
|
package com.ics.admin.mapper;
|
||||||
|
|
||||||
|
import com.ics.admin.domain.RepairWorkerType;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 维修人分类关联Mapper接口
|
||||||
|
*
|
||||||
|
* @author chen
|
||||||
|
* @date 2024-07-31
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface RepairWorkerTypeMapper extends BaseMapper<RepairWorkerType> {
|
||||||
|
/**
|
||||||
|
* 查询维修人分类关联
|
||||||
|
*
|
||||||
|
* @param id 维修人分类关联ID
|
||||||
|
* @return 维修人分类关联
|
||||||
|
*/
|
||||||
|
RepairWorkerType selectRepairWorkerTypeById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询维修人分类关联列表
|
||||||
|
*
|
||||||
|
* @param repairWorkerType 维修人分类关联
|
||||||
|
* @return 维修人分类关联集合
|
||||||
|
*/
|
||||||
|
List<RepairWorkerType> selectRepairWorkerTypeList(RepairWorkerType repairWorkerType);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增维修人分类关联
|
||||||
|
*
|
||||||
|
* @param repairWorkerType 维修人分类关联
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int insertRepairWorkerType(RepairWorkerType repairWorkerType);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改维修人分类关联
|
||||||
|
*
|
||||||
|
* @param repairWorkerType 维修人分类关联
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int updateRepairWorkerType(RepairWorkerType repairWorkerType);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除维修人分类关联
|
||||||
|
*
|
||||||
|
* @param id 维修人分类关联ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteRepairWorkerTypeById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除维修人分类关联
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteRepairWorkerTypeByIds(String[] ids);
|
||||||
|
}
|
@ -58,4 +58,6 @@ public interface IRepairStaffTypeService extends IService<RepairStaffType> {
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
int deleteRepairStaffTypeById(Long id);
|
int deleteRepairStaffTypeById(Long id);
|
||||||
|
|
||||||
|
Long selectRepairTypeByUserId(Integer userId);
|
||||||
}
|
}
|
||||||
|
@ -58,4 +58,6 @@ public interface IRepairTypeService extends IService<RepairType> {
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
int deleteRepairTypeById(Long id);
|
int deleteRepairTypeById(Long id);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,65 @@
|
|||||||
|
package com.ics.admin.service;
|
||||||
|
|
||||||
|
import com.ics.admin.domain.RepairWorkerType;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.ics.common.core.domain.IcsCustomerStaff;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 维修人分类关联Service接口
|
||||||
|
*
|
||||||
|
* @author chen
|
||||||
|
* @date 2024-07-31
|
||||||
|
*/
|
||||||
|
public interface IRepairWorkerTypeService extends IService<RepairWorkerType> {
|
||||||
|
/**
|
||||||
|
* 查询维修人分类关联
|
||||||
|
*
|
||||||
|
* @param id 维修人分类关联ID
|
||||||
|
* @return 维修人分类关联
|
||||||
|
*/
|
||||||
|
RepairWorkerType selectRepairWorkerTypeById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询维修人分类关联列表
|
||||||
|
*
|
||||||
|
* @param repairWorkerType 维修人分类关联
|
||||||
|
* @return 维修人分类关联集合
|
||||||
|
*/
|
||||||
|
List<RepairWorkerType> selectRepairWorkerTypeList(RepairWorkerType repairWorkerType);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增维修人分类关联
|
||||||
|
*
|
||||||
|
* @param repairWorkerType 维修人分类关联
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int insertRepairWorkerType(RepairWorkerType repairWorkerType);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改维修人分类关联
|
||||||
|
*
|
||||||
|
* @param repairWorkerType 维修人分类关联
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int updateRepairWorkerType(RepairWorkerType repairWorkerType);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除维修人分类关联
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteRepairWorkerTypeByIds(String ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除维修人分类关联信息
|
||||||
|
*
|
||||||
|
* @param id 维修人分类关联ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteRepairWorkerTypeById(Long id);
|
||||||
|
|
||||||
|
List<IcsCustomerStaff> selectRepairWorkerTypeListByTypeId(Long type);
|
||||||
|
}
|
@ -89,4 +89,17 @@ public class RepairStaffTypeServiceImpl extends ServiceImpl<RepairStaffTypeMappe
|
|||||||
public int deleteRepairStaffTypeById(Long id) {
|
public int deleteRepairStaffTypeById(Long id) {
|
||||||
return repairStaffTypeMapper.deleteRepairStaffTypeById(id);
|
return repairStaffTypeMapper.deleteRepairStaffTypeById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long selectRepairTypeByUserId(Integer userId) {
|
||||||
|
|
||||||
|
QueryWrapper<RepairStaffType> wrapper = new QueryWrapper<>();
|
||||||
|
wrapper.eq("staffId",userId);
|
||||||
|
RepairStaffType repairStaffType = baseMapper.selectOne(wrapper);
|
||||||
|
if (repairStaffType != null) {
|
||||||
|
return repairStaffType.getTypeId();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -89,4 +89,6 @@ public class RepairTypeServiceImpl extends ServiceImpl<RepairTypeMapper, RepairT
|
|||||||
public int deleteRepairTypeById(Long id) {
|
public int deleteRepairTypeById(Long id) {
|
||||||
return repairTypeMapper.deleteRepairTypeById(id);
|
return repairTypeMapper.deleteRepairTypeById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,113 @@
|
|||||||
|
package com.ics.admin.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.ics.admin.mapper.IcsCustomerStaffMapper;
|
||||||
|
import com.ics.common.core.domain.IcsCustomerStaff;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.ics.admin.mapper.RepairWorkerTypeMapper;
|
||||||
|
import com.ics.admin.domain.RepairWorkerType;
|
||||||
|
import com.ics.admin.service.IRepairWorkerTypeService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 维修人分类关联Service业务层处理
|
||||||
|
*
|
||||||
|
* @author chen
|
||||||
|
* @date 2024-07-31
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class RepairWorkerTypeServiceImpl extends ServiceImpl<RepairWorkerTypeMapper, RepairWorkerType> implements IRepairWorkerTypeService {
|
||||||
|
@Autowired
|
||||||
|
private RepairWorkerTypeMapper repairWorkerTypeMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IcsCustomerStaffMapper icsCustomerStaffMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询维修人分类关联
|
||||||
|
*
|
||||||
|
* @param id 维修人分类关联ID
|
||||||
|
* @return 维修人分类关联
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public RepairWorkerType selectRepairWorkerTypeById(Long id) {
|
||||||
|
return repairWorkerTypeMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询维修人分类关联列表
|
||||||
|
*
|
||||||
|
* @param repairWorkerType 维修人分类关联
|
||||||
|
* @return 维修人分类关联
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<RepairWorkerType> selectRepairWorkerTypeList(RepairWorkerType repairWorkerType) {
|
||||||
|
QueryWrapper queryWrapper = new QueryWrapper();
|
||||||
|
return repairWorkerTypeMapper.selectList(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增维修人分类关联
|
||||||
|
*
|
||||||
|
* @param repairWorkerType 维修人分类关联
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertRepairWorkerType(RepairWorkerType repairWorkerType) {
|
||||||
|
return repairWorkerTypeMapper.insert(repairWorkerType);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改维修人分类关联
|
||||||
|
*
|
||||||
|
* @param repairWorkerType 维修人分类关联
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateRepairWorkerType(RepairWorkerType repairWorkerType) {
|
||||||
|
return repairWorkerTypeMapper.updateById(repairWorkerType);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除维修人分类关联对象
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteRepairWorkerTypeByIds(String ids) {
|
||||||
|
String[] idsArray = StrUtil.split(ids,",");
|
||||||
|
return repairWorkerTypeMapper.deleteBatchIds(CollUtil.toList(idsArray));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除维修人分类关联信息
|
||||||
|
*
|
||||||
|
* @param id 维修人分类关联ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteRepairWorkerTypeById(Long id) {
|
||||||
|
return repairWorkerTypeMapper.deleteRepairWorkerTypeById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<IcsCustomerStaff> selectRepairWorkerTypeListByTypeId(Long type) {
|
||||||
|
|
||||||
|
LambdaQueryWrapper<RepairWorkerType> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.eq(RepairWorkerType::getTypeId,type);
|
||||||
|
List<RepairWorkerType> repairWorkerTypes = repairWorkerTypeMapper.selectList(wrapper);
|
||||||
|
//获取用户ids
|
||||||
|
List<Long> collect = repairWorkerTypes.stream().map(RepairWorkerType::getWorkerId).collect(Collectors.toList());
|
||||||
|
|
||||||
|
LambdaQueryWrapper<IcsCustomerStaff> userWrapper = new LambdaQueryWrapper<>();
|
||||||
|
return icsCustomerStaffMapper.selectList(userWrapper.in(IcsCustomerStaff::getId, collect));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,90 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.ics.chen.mapper.meeting.RepairWorkerTypeMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.ics.admin.domain.RepairWorkerType" id="RepairWorkerTypeResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="workerId" column="worker_id" />
|
||||||
|
<result property="typeId" column="type_id" />
|
||||||
|
<result property="deleteFlag" column="delete_flag" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateBy" column="update_by" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
<result property="tenantId" column="tenant_id" />
|
||||||
|
<result property="parkId" column="park_id" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectRepairWorkerTypeVo">
|
||||||
|
SELECT id, worker_id, type_id, delete_flag, create_by, create_time, update_by, update_time, tenant_id, park_id FROM ics_repair_worker_type
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectRepairWorkerTypeList" parameterType="RepairWorkerType" resultMap="RepairWorkerTypeResult">
|
||||||
|
<include refid="selectRepairWorkerTypeVo"/>
|
||||||
|
<where>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectRepairWorkerTypeById" parameterType="Long" resultMap="RepairWorkerTypeResult">
|
||||||
|
<include refid="selectRepairWorkerTypeVo"/>
|
||||||
|
WHERE id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertRepairWorkerType" parameterType="RepairWorkerType">
|
||||||
|
INSERT INTO ics_repair_worker_type
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null ">id,</if>
|
||||||
|
<if test="workerId != null ">worker_id,</if>
|
||||||
|
<if test="typeId != null ">type_id,</if>
|
||||||
|
<if test="deleteFlag != null and deleteFlag != ''">delete_flag,</if>
|
||||||
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||||
|
<if test="createTime != null ">create_time,</if>
|
||||||
|
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
||||||
|
<if test="updateTime != null ">update_time,</if>
|
||||||
|
<if test="tenantId != null ">tenant_id,</if>
|
||||||
|
<if test="parkId != null ">park_id,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null ">#{id},</if>
|
||||||
|
<if test="workerId != null ">#{workerId},</if>
|
||||||
|
<if test="typeId != null ">#{typeId},</if>
|
||||||
|
<if test="deleteFlag != null and deleteFlag != ''">#{deleteFlag},</if>
|
||||||
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||||
|
<if test="createTime != null ">#{createTime},</if>
|
||||||
|
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
||||||
|
<if test="updateTime != null ">#{updateTime},</if>
|
||||||
|
<if test="tenantId != null ">#{tenantId},</if>
|
||||||
|
<if test="parkId != null ">#{parkId},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateRepairWorkerType" parameterType="RepairWorkerType">
|
||||||
|
UPDATE ics_repair_worker_type
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="workerId != null ">worker_id = #{workerId},</if>
|
||||||
|
<if test="typeId != null ">type_id = #{typeId},</if>
|
||||||
|
<if test="deleteFlag != null and deleteFlag != ''">delete_flag = #{deleteFlag},</if>
|
||||||
|
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
||||||
|
<if test="createTime != null ">create_time = #{createTime},</if>
|
||||||
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||||
|
<if test="updateTime != null ">update_time = #{updateTime},</if>
|
||||||
|
<if test="tenantId != null ">tenant_id = #{tenantId},</if>
|
||||||
|
<if test="parkId != null ">park_id = #{parkId},</if>
|
||||||
|
</trim>
|
||||||
|
WHERE id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteRepairWorkerTypeById" parameterType="Long">
|
||||||
|
DELETE FROM ics_repair_worker_type WHERE id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteRepairWorkerTypeByIds" parameterType="String">
|
||||||
|
DELETE FROM ics_repair_worker_type where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
|
|||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
|
|
||||||
import com.ics.admin.domain.*;
|
import com.ics.admin.domain.*;
|
||||||
|
import com.ics.admin.domain.meeting.StaffCustomer;
|
||||||
import com.ics.admin.service.*;
|
import com.ics.admin.service.*;
|
||||||
import com.ics.admin.vo.ParkVO;
|
import com.ics.admin.vo.ParkVO;
|
||||||
import com.ics.admin.vo.RepairVO;
|
import com.ics.admin.vo.RepairVO;
|
||||||
@ -26,6 +27,7 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
import org.wf.jwtp.annotation.Ignore;
|
import org.wf.jwtp.annotation.Ignore;
|
||||||
import org.wf.jwtp.annotation.RequiresPermissions;
|
import org.wf.jwtp.annotation.RequiresPermissions;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@ -41,11 +43,6 @@ public class RepairAPIController extends BaseController {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IRepairService repairService;
|
private IRepairService repairService;
|
||||||
@Autowired
|
|
||||||
private IRepairLogService repairLogService;
|
|
||||||
@Autowired
|
|
||||||
private IParkService parkService;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IIcsCustomerStaffService icsCustomerStaffService;
|
private IIcsCustomerStaffService icsCustomerStaffService;
|
||||||
|
|
||||||
@ -61,6 +58,9 @@ public class RepairAPIController extends BaseController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IRepairTypeService repairTypeService;
|
private IRepairTypeService repairTypeService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IRepairWorkerTypeService workerTypeService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询工单管理
|
* 查询工单管理
|
||||||
*/
|
*/
|
||||||
@ -209,17 +209,157 @@ public class RepairAPIController extends BaseController {
|
|||||||
* 派单中心列表
|
* 派单中心列表
|
||||||
*/
|
*/
|
||||||
@Ignore
|
@Ignore
|
||||||
@GetMapping("/list")
|
@GetMapping("/dispatcherList")
|
||||||
public R list(@RequestBody Map<String,Object> map) {
|
public R dispatcherList(@RequestBody Map<String,Object> map) {
|
||||||
|
|
||||||
Integer userId = (Integer) map.get("userId");
|
Integer userId = (Integer) map.get("userId");
|
||||||
Integer status = (Integer) map.get("status");
|
Integer status = (Integer) map.get("status");
|
||||||
|
|
||||||
|
//根据用户id查询绑定的设备分类
|
||||||
|
Long type = staffTypeService.selectRepairTypeByUserId(userId);
|
||||||
|
//根据设备分类和状态查询对应的数据
|
||||||
|
List<Repair> repairList = repairService.selectRepairListByType(type,status);
|
||||||
|
|
||||||
|
return R.data(repairList);
|
||||||
|
}
|
||||||
|
|
||||||
|
//无效申请 取消派单
|
||||||
|
@Ignore
|
||||||
|
@PostMapping("dispatcherCancel")
|
||||||
|
public R dispatcherCancel(Long repairId) {
|
||||||
|
Repair repair = repairService.selectRepairById(repairId);
|
||||||
|
if (repair == null || !Repair.Status.PENDING_ASSIGN.equals(repair.getStatus())) {
|
||||||
|
return R.error("报修为空或状态不是待分配");
|
||||||
|
}
|
||||||
|
repair.setStatus(Repair.Status.CANCELED);
|
||||||
|
return toAjax(repairService.updateRepair(repair));
|
||||||
|
}
|
||||||
|
|
||||||
|
//提交反馈
|
||||||
|
@Ignore
|
||||||
|
@PostMapping("dispatcherSubmitFeedback")
|
||||||
|
public R dispatcherSubmitFeedback(Long repairId) {
|
||||||
|
Repair repair = repairService.selectRepairById(repairId);
|
||||||
|
if (repair == null || !Repair.Status.PENDING_ASSIGN.equals(repair.getStatus())) {
|
||||||
|
return R.error("报修为空或状态不是待分配");
|
||||||
|
}
|
||||||
|
repair.setStatus(Repair.Status.SUBMIT_FEEDBACK);
|
||||||
|
return toAjax(repairService.updateRepair(repair));
|
||||||
|
}
|
||||||
|
|
||||||
|
//选择维修人员
|
||||||
|
@Ignore
|
||||||
|
@GetMapping("selectDispatcherChooseWorker")
|
||||||
|
public R dispatcherChooseWorker(@RequestBody Map<String,Object> map) {
|
||||||
|
Integer userId = (Integer) map.get("userId");
|
||||||
|
|
||||||
|
//根据用户id查询绑定的设备分类
|
||||||
|
Long type = staffTypeService.selectRepairTypeByUserId(userId);
|
||||||
|
//根据设备分类查询对应的维修人员列表
|
||||||
|
List<IcsCustomerStaff> customerStaffs = workerTypeService.selectRepairWorkerTypeListByTypeId(type);
|
||||||
|
|
||||||
|
return R.data(customerStaffs);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//根据 当前用户的id 去查询对应的设备分类。根据设备分类查询对应的派单中心
|
//提交派单人员
|
||||||
// List<Repair> repairList = repairService.selectRepairList(repair);
|
@Ignore
|
||||||
// return R.data(repairList);
|
@GetMapping("dispatcherPendingProcess")
|
||||||
return null;
|
public R dispatcherPendingProcess(@RequestBody Repair repair) {
|
||||||
|
Repair repair1 = repairService.selectRepairById(repair.getId());
|
||||||
|
if (repair1 == null || !Repair.Status.PENDING_ASSIGN.equals(repair.getStatus())) {
|
||||||
|
return R.error("报修为空或状态不是待分配");
|
||||||
|
}
|
||||||
|
repair1.setStatus(Repair.Status.PENDING_PROCESS);
|
||||||
|
repair1.setWorkerId(repair.getWorkerId());
|
||||||
|
repair1.setBeginDate(DateUtils.getNowDate());
|
||||||
|
return toAjax(repairService.updateRepair(repair1));
|
||||||
|
}
|
||||||
|
|
||||||
|
/*-------------------------以下为维修人员接口------------------------*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 维修人员工单管理
|
||||||
|
* @param userId
|
||||||
|
* @param status
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Ignore
|
||||||
|
@GetMapping("/listByWorkerId")
|
||||||
|
public R listByWorkerId(Long userId,Integer status) {
|
||||||
|
|
||||||
|
|
||||||
|
//待完成 状态为 1
|
||||||
|
Integer beCompleted = repairService.listByWorkerIdByCount(userId,1);
|
||||||
|
|
||||||
|
//进行中 状态为4
|
||||||
|
Integer ongoing = repairService.listByWorkerIdByCount(userId,4);
|
||||||
|
|
||||||
|
//已完成
|
||||||
|
Integer done2 = repairService.listByWorkerIdByCount(userId,5);
|
||||||
|
Integer done1 = repairService.listByWorkerIdByCount(userId,6);
|
||||||
|
|
||||||
|
Map<String,Object> map = new HashMap<>();
|
||||||
|
map.put("beCompleted",beCompleted);
|
||||||
|
map.put("ongoing",ongoing);
|
||||||
|
map.put("done",done1+done2);
|
||||||
|
|
||||||
|
|
||||||
|
// 待完成 1 进行中 2 已完成 3
|
||||||
|
List<Repair> repair = repairService.listByWorkerId(userId,status);
|
||||||
|
for (Repair repair1 : repair) {
|
||||||
|
RepairDevice repairDevice = repairDeviceService.selectRepairDeviceById(Long.valueOf(repair1.getRepairDevice()));
|
||||||
|
if (repairDevice != null) {
|
||||||
|
repair1.setRepairDeviceName(repairDevice.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
map.put("repair",repair);
|
||||||
|
return R.data(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 维修人员工单详情
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Ignore
|
||||||
|
@GetMapping("/detailByWorkerId")
|
||||||
|
public R detailByWorkerId(Long repairId) {
|
||||||
|
Repair repair = repairService.selectRepairById(repairId);
|
||||||
|
if (repair == null) {
|
||||||
|
return R.error("报修为空");
|
||||||
|
}
|
||||||
|
Integer repairDevice = repair.getRepairDevice();
|
||||||
|
if (repairDevice != null) {
|
||||||
|
RepairDevice repairDevice1 = repairDeviceService.selectRepairDeviceById(Long.valueOf(repairDevice));
|
||||||
|
repair.setRepairDeviceName(repairDevice1.getName());
|
||||||
|
}
|
||||||
|
//派单员id 查找对应名称
|
||||||
|
IcsCustomerStaff icsCustomerStaff = icsCustomerStaffService.selectIcsCustomerStaffById(Long.valueOf(repair.getDispatcherId()));
|
||||||
|
if (icsCustomerStaff != null) {
|
||||||
|
repair.setDispatcherName(icsCustomerStaff.getName());
|
||||||
|
}
|
||||||
|
//报修人id 查找对应名称
|
||||||
|
IcsCustomerStaff staff = icsCustomerStaffService.selectIcsCustomerStaffById(Long.valueOf(repair.getUserId()));
|
||||||
|
if (staff != null) {
|
||||||
|
repair.setUserName(icsCustomerStaff.getName());
|
||||||
|
}
|
||||||
|
return R.data(repair);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 维修人员确认接单
|
||||||
|
*/
|
||||||
|
@Ignore
|
||||||
|
@PostMapping("/confirmOrder")
|
||||||
|
public R confirmOrder(Long repairId) {
|
||||||
|
Repair repair = repairService.selectRepairById(repairId);
|
||||||
|
repair.setStatus(Repair.Status.PROCESSING);
|
||||||
|
repair.setBeginDate(DateUtils.getNowDate());
|
||||||
|
repairService.updateRepair(repair);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@ package com.ics.service;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.ics.admin.domain.Repair;
|
import com.ics.admin.domain.Repair;
|
||||||
|
import com.ics.admin.vo.RepairVO;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -48,4 +49,9 @@ public interface IRepairService extends IService<Repair> {
|
|||||||
|
|
||||||
List<Repair> selectByUserId(Long userId,Integer status);
|
List<Repair> selectByUserId(Long userId,Integer status);
|
||||||
|
|
||||||
|
List<Repair> selectRepairListByType(Long type, Integer status);
|
||||||
|
|
||||||
|
List<Repair> listByWorkerId(Long userId, Integer status);
|
||||||
|
|
||||||
|
Integer listByWorkerIdByCount(Long userId, Integer status);
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@ import com.ics.admin.domain.Repair;
|
|||||||
import com.ics.admin.domain.RepairLog;
|
import com.ics.admin.domain.RepairLog;
|
||||||
import com.ics.admin.mapper.RepairMapper;
|
import com.ics.admin.mapper.RepairMapper;
|
||||||
import com.ics.admin.service.IRepairLogService;
|
import com.ics.admin.service.IRepairLogService;
|
||||||
|
import com.ics.admin.vo.RepairVO;
|
||||||
import com.ics.service.IRepairService;
|
import com.ics.service.IRepairService;
|
||||||
import com.ics.common.utils.DateUtils;
|
import com.ics.common.utils.DateUtils;
|
||||||
import com.ics.system.domain.Sn;
|
import com.ics.system.domain.Sn;
|
||||||
@ -93,8 +94,6 @@ public class RepairServiceImpl extends ServiceImpl<RepairMapper, Repair> impleme
|
|||||||
repairLog.setCreateTime(DateUtils.getNowDate());
|
repairLog.setCreateTime(DateUtils.getNowDate());
|
||||||
repairLog.setUpdateBy(repair.getUpdateBy());
|
repairLog.setUpdateBy(repair.getUpdateBy());
|
||||||
repairLog.setUpdateTime(DateUtils.getNowDate());
|
repairLog.setUpdateTime(DateUtils.getNowDate());
|
||||||
repairLog.setParkId(repair.getParkId());
|
|
||||||
repairLog.setTenantId(repair.getTenantId());
|
|
||||||
repairLogService.insertRepairLog(repairLog);
|
repairLogService.insertRepairLog(repairLog);
|
||||||
return repairMapper.updateById(repair);
|
return repairMapper.updateById(repair);
|
||||||
}
|
}
|
||||||
@ -124,4 +123,49 @@ public class RepairServiceImpl extends ServiceImpl<RepairMapper, Repair> impleme
|
|||||||
return repairMapper.selectList(wrapper);
|
return repairMapper.selectList(wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Repair> selectRepairListByType(Long type, Integer status) {
|
||||||
|
LambdaQueryWrapper<Repair> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.eq(Repair::getTypeId, type);
|
||||||
|
if ( status == 0) {
|
||||||
|
wrapper.eq(Repair::getStatus, status);
|
||||||
|
}else if (status == 1){
|
||||||
|
wrapper.eq(Repair::getStatus, 3).or().eq(Repair::getStatus, 4);
|
||||||
|
}else if (status == 2){
|
||||||
|
wrapper.eq(Repair::getStatus, 5).or().eq(Repair::getStatus, 6).or().eq(Repair::getStatus, 7);
|
||||||
|
}
|
||||||
|
List<Repair> repairs = baseMapper.selectList(wrapper);
|
||||||
|
return repairs;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Repair> listByWorkerId(Long userId, Integer status) {
|
||||||
|
LambdaQueryWrapper<Repair> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.eq(Repair::getWorkerId, userId);
|
||||||
|
wrapper.orderByAsc(Repair::getRepairTime);
|
||||||
|
if ( status == 1) {
|
||||||
|
wrapper.eq(Repair::getStatus, 1);
|
||||||
|
}else if (status == 1){
|
||||||
|
wrapper.eq(Repair::getStatus, 4);
|
||||||
|
}else if (status == 2){
|
||||||
|
wrapper.eq(Repair::getStatus,5 ).or().eq(Repair::getStatus, 6);
|
||||||
|
}
|
||||||
|
|
||||||
|
return repairMapper.selectList(wrapper);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer listByWorkerIdByCount(Long userId, Integer status) {
|
||||||
|
LambdaQueryWrapper<Repair> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.eq(Repair::getWorkerId, userId);
|
||||||
|
wrapper.orderByAsc(Repair::getRepairTime);
|
||||||
|
if (status != null && status != 0) {
|
||||||
|
wrapper.eq(Repair::getStatus, status);
|
||||||
|
}
|
||||||
|
|
||||||
|
return repairMapper.selectCount(wrapper);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user