mirror of
https://gitee.com/elegant_wings/dbd-meeting.git
synced 2025-06-21 21:49:37 +08:00
新增对应的数据结构
This commit is contained in:
parent
5bdf4ce306
commit
78859b4fad
@ -137,7 +137,6 @@ public class CustomerStaffController extends BaseController {
|
||||
if (customerId != null && !"".equals(customerId)) {
|
||||
icsCustomerStaff.setIcsCustomerId(Long.valueOf(customerId));
|
||||
}
|
||||
icsCustomerStaff.setDataType(Constants.CUSTOMER_VISIT);
|
||||
return result(icsCustomerStaffService.selectIcsCustomerStaffList(icsCustomerStaff));
|
||||
}
|
||||
|
||||
|
@ -107,8 +107,6 @@ public class RepairController extends BaseController {
|
||||
RepairType repairType = repairTypeService.selectRepairTypeById(Long.valueOf(repair1.getTypeId()));
|
||||
repair1.setTypeName(repairType.getName());
|
||||
}
|
||||
|
||||
|
||||
//设备名称
|
||||
if (repair1.getRepairDevice() != null){
|
||||
RepairDevice repairDevice = deviceService.selectRepairDeviceById(Long.valueOf(repair1.getRepairDevice()));
|
||||
@ -120,12 +118,12 @@ public class RepairController extends BaseController {
|
||||
RepairFailureType repairFailureType = repairFailureTypeService.selectRepairFailureTypeById(repair1.getFailureTypeId());
|
||||
repair1.setFailureTypeName(repairFailureType.getName());
|
||||
}
|
||||
if (repair.getUserId() != null){
|
||||
if (repair1.getUserId() != null){
|
||||
IcsCustomerStaff staff = customerStaffService.selectIcsCustomerStaffById(Long.valueOf(repair1.getUserId()));
|
||||
repair1.setUserName(staff.getUsername());
|
||||
}
|
||||
|
||||
if (repair.getWorkerId() != null){
|
||||
if (repair1.getWorkerId() != null){
|
||||
IcsCustomerStaff worker = customerStaffService.selectIcsCustomerStaffById(repair1.getWorkerId());
|
||||
repair1.setWorkerName(worker.getUsername());
|
||||
}
|
||||
@ -180,4 +178,12 @@ public class RepairController extends BaseController {
|
||||
return R.data(customerStaffs);
|
||||
}
|
||||
|
||||
//查询派单员列表
|
||||
@Ignore
|
||||
@GetMapping("selectDispatcher")
|
||||
public R selectDispatcher() {
|
||||
List<IcsCustomerStaff> customerStaffs = repairService.selectDispatcher();
|
||||
return R.data(customerStaffs);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,14 @@
|
||||
package com.ics.admin.controller;
|
||||
|
||||
import com.ics.admin.domain.RepairStaffType;
|
||||
import com.ics.admin.domain.RepairWorkerType;
|
||||
import com.ics.admin.domain.meeting.StaffCustomer;
|
||||
import com.ics.admin.service.IIcsCustomerStaffService;
|
||||
import com.ics.admin.service.IRepairStaffTypeService;
|
||||
import com.ics.admin.service.IRepairWorkerTypeService;
|
||||
import com.ics.common.core.domain.IcsCustomerStaff;
|
||||
import com.ics.common.utils.DateUtils;
|
||||
import org.checkerframework.checker.units.qual.A;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
@ -14,6 +23,8 @@ import com.ics.admin.domain.RepairType;
|
||||
import com.ics.admin.service.IRepairTypeService;
|
||||
import org.wf.jwtp.annotation.RequiresPermissions;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备类型 提供者
|
||||
*
|
||||
@ -27,6 +38,16 @@ public class RepairTypeController extends BaseController {
|
||||
@Autowired
|
||||
private IRepairTypeService repairTypeService;
|
||||
|
||||
@Autowired
|
||||
private IRepairStaffTypeService repairStaffTypeService;
|
||||
|
||||
@Autowired
|
||||
private IIcsCustomerStaffService customerStaffService;
|
||||
|
||||
@Autowired
|
||||
private IRepairWorkerTypeService workerTypeService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询设备类型
|
||||
*/
|
||||
@ -38,11 +59,29 @@ public class RepairTypeController extends BaseController {
|
||||
/**
|
||||
* 查询设备类型列表
|
||||
*/
|
||||
@RequiresPermissions("RepairType:repairType:list")
|
||||
@RequiresPermissions("RepairType:repairType:list")
|
||||
@GetMapping("list")
|
||||
public R list(RepairType repairType) {
|
||||
startPage();
|
||||
return result(repairTypeService.selectRepairTypeList(repairType));
|
||||
List<RepairType> repairTypes = repairTypeService.selectRepairTypeList(repairType);
|
||||
for (RepairType type : repairTypes) {
|
||||
//获取派单员名称
|
||||
RepairStaffType repairStaffType = repairStaffTypeService.selectStaffIdByTypeId(type.getId());
|
||||
if (repairStaffType != null) {
|
||||
IcsCustomerStaff staff = customerStaffService.selectIcsCustomerStaffById(repairStaffType.getStaffId());
|
||||
if (staff != null) {
|
||||
type.setStaffName(staff.getName());
|
||||
}
|
||||
}
|
||||
//获取维修工人数据
|
||||
List<IcsCustomerStaff> customerStaffs = workerTypeService.selectRepairWorkerTypeListByTypeId(type.getId());
|
||||
if (customerStaffs != null && customerStaffs.size() > 0) {
|
||||
type.setWorkerNames(customerStaffs.get(0).getUsername()+"等"+customerStaffs.size()+"人");
|
||||
type.setWorkerList(customerStaffs);
|
||||
}
|
||||
|
||||
}
|
||||
return result(repairTypes);
|
||||
}
|
||||
|
||||
|
||||
@ -52,7 +91,25 @@ public class RepairTypeController extends BaseController {
|
||||
@RequiresPermissions("RepairType:repairType:add")
|
||||
@PostMapping("save")
|
||||
public R addSave(@RequestBody RepairType repairType) {
|
||||
return toAjax(repairTypeService.insertRepairType(repairType));
|
||||
int i = repairTypeService.insertRepairType(repairType);
|
||||
if (i <= 0) {
|
||||
return R.error("添加失败");
|
||||
}
|
||||
//添加设备类型和用户关联关系
|
||||
RepairStaffType repairStaffType = new RepairStaffType();
|
||||
repairStaffType.setTypeId(repairType.getId());
|
||||
repairStaffType.setStaffId(repairType.getStaffId());
|
||||
repairStaffType.setCreateTime(DateUtils.getNowDate());
|
||||
|
||||
repairStaffTypeService.insertRepairStaffType(repairStaffType);
|
||||
|
||||
IcsCustomerStaff staff = new IcsCustomerStaff();
|
||||
staff.setStaffId(repairType.getStaffId());
|
||||
staff.setDataType("2");
|
||||
//更新用户数据类型
|
||||
customerStaffService.updateIcsCustomerStaff(staff);
|
||||
|
||||
return toAjax(i);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -74,6 +74,7 @@ public class Repair extends BaseEntity<Repair> {
|
||||
*/
|
||||
private Status status;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer statusValue;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ -210,6 +211,7 @@ public class Repair extends BaseEntity<Repair> {
|
||||
*/
|
||||
private Long workerId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String workerName;
|
||||
|
||||
/**
|
||||
|
@ -1,9 +1,16 @@
|
||||
package com.ics.admin.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.ics.common.core.domain.BaseEntity;
|
||||
import com.ics.common.core.domain.IcsCustomerStaff;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备类型对象 ics_repair_type
|
||||
*
|
||||
@ -15,6 +22,8 @@ import lombok.Data;
|
||||
public class RepairType extends BaseEntity<RepairType> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
|
||||
/** 名称 */
|
||||
private String name;
|
||||
|
||||
@ -24,4 +33,17 @@ public class RepairType extends BaseEntity<RepairType> {
|
||||
/** 园区ID */
|
||||
private Long parkId;
|
||||
|
||||
//派单员id
|
||||
@TableField(exist = false)
|
||||
private Long staffId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String staffName;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String workerNames;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<IcsCustomerStaff> workerList;
|
||||
|
||||
}
|
||||
|
@ -72,4 +72,6 @@ public interface IRepairService extends IService<Repair> {
|
||||
|
||||
List<IcsCustomerStaff> selectWorkerIdByTypeId(String typeId);
|
||||
|
||||
List<IcsCustomerStaff> selectDispatcher();
|
||||
|
||||
}
|
||||
|
@ -60,4 +60,7 @@ public interface IRepairStaffTypeService extends IService<RepairStaffType> {
|
||||
int deleteRepairStaffTypeById(Long id);
|
||||
|
||||
Long selectRepairTypeByUserId(Integer userId);
|
||||
|
||||
RepairStaffType selectStaffIdByTypeId(Long id);
|
||||
|
||||
}
|
||||
|
@ -62,4 +62,5 @@ public interface IRepairWorkerTypeService extends IService<RepairWorkerType> {
|
||||
int deleteRepairWorkerTypeById(Long id);
|
||||
|
||||
List<IcsCustomerStaff> selectRepairWorkerTypeListByTypeId(Long type);
|
||||
|
||||
}
|
||||
|
@ -174,4 +174,13 @@ public class RepairServiceImpl extends ServiceImpl<RepairMapper, Repair> impleme
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IcsCustomerStaff> selectDispatcher() {
|
||||
LambdaQueryWrapper<IcsCustomerStaff> userWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
userWrapper.eq(IcsCustomerStaff::getDataType, "0");
|
||||
return customerStaffMapper.selectList(userWrapper);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ public class RepairStaffTypeServiceImpl extends ServiceImpl<RepairStaffTypeMappe
|
||||
public Long selectRepairTypeByUserId(Integer userId) {
|
||||
|
||||
QueryWrapper<RepairStaffType> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("staffId",userId);
|
||||
wrapper.eq("staff_id",userId);
|
||||
RepairStaffType repairStaffType = baseMapper.selectOne(wrapper);
|
||||
if (repairStaffType != null) {
|
||||
return repairStaffType.getTypeId();
|
||||
@ -102,4 +102,12 @@ public class RepairStaffTypeServiceImpl extends ServiceImpl<RepairStaffTypeMappe
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public RepairStaffType selectStaffIdByTypeId(Long id) {
|
||||
QueryWrapper<RepairStaffType> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("type_id",id);
|
||||
RepairStaffType repairStaffType = baseMapper.selectOne(wrapper);
|
||||
return repairStaffType;
|
||||
}
|
||||
}
|
||||
|
@ -105,9 +105,14 @@ public class RepairWorkerTypeServiceImpl extends ServiceImpl<RepairWorkerTypeMap
|
||||
wrapper.eq(RepairWorkerType::getTypeId,type);
|
||||
List<RepairWorkerType> repairWorkerTypes = repairWorkerTypeMapper.selectList(wrapper);
|
||||
//获取用户ids
|
||||
List<Long> collect = repairWorkerTypes.stream().map(RepairWorkerType::getWorkerId).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(repairWorkerTypes)){
|
||||
List<Long> collect = repairWorkerTypes.stream().map(RepairWorkerType::getWorkerId).collect(Collectors.toList());
|
||||
|
||||
LambdaQueryWrapper<IcsCustomerStaff> userWrapper = new LambdaQueryWrapper<>();
|
||||
return icsCustomerStaffMapper.selectList(userWrapper.in(IcsCustomerStaff::getId, collect));
|
||||
LambdaQueryWrapper<IcsCustomerStaff> userWrapper = new LambdaQueryWrapper<>();
|
||||
return icsCustomerStaffMapper.selectList(userWrapper.in(IcsCustomerStaff::getId, collect));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -50,6 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
left join tb_staff_customer tsc on cs.id = tsc.staff_id
|
||||
left join ics_customer icc on tsc.ics_customer_id = icc.id
|
||||
<where>
|
||||
cs.data_type is not null
|
||||
<if test="username != null and username != ''"> AND cs.username LIKE CONCAT('%', #{username}, '%') </if>
|
||||
<if test="icsCustomerId != null and icsCustomerId != ''"> AND tsc.ics_customer_id = #{icsCustomerId} </if>
|
||||
<if test="mobile != null and mobile != ''"> AND cs.mobile LIKE CONCAT('%', #{mobile}, '%') </if>
|
||||
|
@ -32,7 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
WHERE id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertRepairStaffType" parameterType="RepairStaffType">
|
||||
<insert id="insertRepairStaffType" parameterType="RepairStaffType" keyProperty="id" useGeneratedKeys="true">>
|
||||
INSERT INTO ics_repair_staff_type
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null ">id,</if>
|
||||
|
@ -28,7 +28,7 @@ public class MimeTypeUtils {
|
||||
// word excel powerpoint
|
||||
"doc", "docx", "xls", "xlsx", "ppt", "pptx", "html", "htm", "txt",
|
||||
// 压缩文件
|
||||
"rar", "zip", "gz", "bz2","mp4",
|
||||
"rar", "zip", "gz", "bz2","mp4","mp3",
|
||||
// pdf
|
||||
"pdf"};
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.ics.controller.mobile.member;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
import com.ics.admin.domain.*;
|
||||
@ -12,6 +13,8 @@ import com.ics.common.annotation.LoginUser;
|
||||
import com.ics.common.core.controller.BaseController;
|
||||
import com.ics.common.core.domain.IcsCustomerStaff;
|
||||
import com.ics.common.core.domain.R;
|
||||
import com.ics.common.core.page.PageDomain;
|
||||
import com.ics.common.core.page.TableSupport;
|
||||
import com.ics.common.utils.DateUtils;
|
||||
import com.ics.common.utils.StringUtils;
|
||||
import com.ics.common.utils.ValidatorUtils;
|
||||
@ -67,6 +70,17 @@ public class RepairAPIController extends BaseController {
|
||||
@Autowired
|
||||
private IRepairRoomService repairRoomService;
|
||||
|
||||
@Autowired
|
||||
private IIcsCustomerStaffService customerStaffService;
|
||||
|
||||
@Autowired
|
||||
private IRepairDeviceService deviceService;
|
||||
|
||||
@Autowired
|
||||
private IRepairFailureTypeService repairFailureTypeService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询工单管理
|
||||
*/
|
||||
@ -147,6 +161,8 @@ public class RepairAPIController extends BaseController {
|
||||
@Ignore
|
||||
@PostMapping("save")
|
||||
public R addSave(@RequestBody Repair repair) {
|
||||
|
||||
//获取用户id
|
||||
ValidatorUtils.validateEntity(repair);
|
||||
repair.setStatus(Repair.Status.PENDING_ASSIGN);
|
||||
return toAjax(repairService.insertRepair(repair));
|
||||
@ -246,18 +262,50 @@ public class RepairAPIController extends BaseController {
|
||||
* 派单中心列表
|
||||
*/
|
||||
@Ignore
|
||||
@GetMapping("/dispatcherList")
|
||||
public R dispatcherList(@RequestBody Map<String,Object> map) {
|
||||
|
||||
Integer userId = (Integer) map.get("userId");
|
||||
Integer status = (Integer) map.get("status");
|
||||
@PostMapping("/dispatcherList")
|
||||
public R dispatcherList(@RequestBody Repair repair) {
|
||||
Integer userId = repair.getUserId();
|
||||
Integer statusValue = repair.getStatusValue();
|
||||
|
||||
//根据用户id查询绑定的设备分类
|
||||
Long type = staffTypeService.selectRepairTypeByUserId(userId);
|
||||
//根据设备分类和状态查询对应的数据
|
||||
List<Repair> repairList = repairService.selectRepairListByType(type,status);
|
||||
PageDomain pageDomain = TableSupport.buildPageRequest();
|
||||
|
||||
return R.data(repairList);
|
||||
Integer pageNum = pageDomain.getPageNum();
|
||||
Integer pageSize = pageDomain.getPageSize();
|
||||
IPage<Repair> repairList = repairService.selectRepairListByType(type,statusValue,pageNum,pageSize);
|
||||
for (Repair repair1 : repairList.getRecords()) {
|
||||
repair1.setStatusValue(repair1.getStatus().getValue());
|
||||
repair1.setStatusName(repair1.getStatus().getName());
|
||||
//设备类型
|
||||
if (repair1.getTypeId() != null) {
|
||||
RepairType repairType = repairTypeService.selectRepairTypeById(Long.valueOf(repair1.getTypeId()));
|
||||
repair1.setTypeName(repairType.getName());
|
||||
}
|
||||
//设备名称
|
||||
if (repair1.getRepairDevice() != null){
|
||||
RepairDevice repairDevice = deviceService.selectRepairDeviceById(Long.valueOf(repair1.getRepairDevice()));
|
||||
repair1.setRepairDeviceName(repairDevice.getName());
|
||||
}
|
||||
//故障
|
||||
if (repair1.getFailureTypeId() != null){
|
||||
|
||||
RepairFailureType repairFailureType = repairFailureTypeService.selectRepairFailureTypeById(repair1.getFailureTypeId());
|
||||
repair1.setFailureTypeName(repairFailureType.getName());
|
||||
}
|
||||
if (repair1.getUserId() != null){
|
||||
IcsCustomerStaff staff = customerStaffService.selectIcsCustomerStaffById(Long.valueOf(repair1.getUserId()));
|
||||
repair1.setUserName(staff.getUsername());
|
||||
}
|
||||
|
||||
if (repair1.getWorkerId() != null){
|
||||
IcsCustomerStaff worker = customerStaffService.selectIcsCustomerStaffById(repair1.getWorkerId());
|
||||
repair1.setWorkerName(worker.getUsername());
|
||||
}
|
||||
}
|
||||
|
||||
return R.ok().put("data",repairList);
|
||||
}
|
||||
|
||||
//无效申请 取消派单
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.ics.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ics.admin.domain.Repair;
|
||||
import com.ics.admin.vo.RepairVO;
|
||||
@ -49,7 +50,7 @@ public interface IRepairService extends IService<Repair> {
|
||||
|
||||
List<Repair> selectByUserId(Long userId,Integer status);
|
||||
|
||||
List<Repair> selectRepairListByType(Long type, Integer status);
|
||||
IPage<Repair> selectRepairListByType(Long type, Integer status, Integer pageNum, Integer pageSize);
|
||||
|
||||
List<Repair> listByWorkerId(Long userId, Integer status);
|
||||
|
||||
|
@ -2,9 +2,12 @@ package com.ics.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ics.admin.domain.Repair;
|
||||
import com.ics.admin.domain.RepairLog;
|
||||
import com.ics.admin.domain.meeting.Reservation;
|
||||
import com.ics.admin.mapper.RepairMapper;
|
||||
import com.ics.admin.service.IRepairLogService;
|
||||
import com.ics.admin.vo.RepairVO;
|
||||
@ -124,18 +127,21 @@ public class RepairServiceImpl extends ServiceImpl<RepairMapper, Repair> impleme
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Repair> selectRepairListByType(Long type, Integer status) {
|
||||
public IPage<Repair> selectRepairListByType(Long type, Integer status, Integer pageNum, Integer pageSize) {
|
||||
LambdaQueryWrapper<Repair> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(Repair::getTypeId, type);
|
||||
if ( status == 0) {
|
||||
wrapper.eq(Repair::getStatus, status);
|
||||
wrapper.eq(Repair::getStatus, 2);
|
||||
}else if (status == 1){
|
||||
wrapper.eq(Repair::getStatus, 3).or().eq(Repair::getStatus, 4);
|
||||
wrapper.eq(Repair::getStatus, 1);
|
||||
}else if (status == 2){
|
||||
wrapper.eq(Repair::getStatus, 3).or().eq(Repair::getStatus, 4);
|
||||
}else if (status == 3){
|
||||
wrapper.eq(Repair::getStatus, 5).or().eq(Repair::getStatus, 6).or().eq(Repair::getStatus, 7);
|
||||
}
|
||||
List<Repair> repairs = baseMapper.selectList(wrapper);
|
||||
return repairs;
|
||||
IPage<Repair> pages = new Page<>(pageNum,pageSize);
|
||||
IPage<Repair> userIPage = baseMapper.selectPage(pages,wrapper);
|
||||
return userIPage;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user