mirror of
https://gitee.com/elegant_wings/dbd-meeting.git
synced 2025-06-21 21:49:37 +08:00
修改了PC 页面 报修新增和详细页面接口
This commit is contained in:
parent
3a44a2b2da
commit
cfbdd34435
@ -1,19 +1,20 @@
|
|||||||
package com.ics.admin.controller;
|
package com.ics.admin.controller;
|
||||||
|
|
||||||
import com.ics.admin.domain.Repair;
|
import com.ics.admin.domain.*;
|
||||||
import com.ics.admin.domain.RepairLog;
|
import com.ics.admin.service.*;
|
||||||
import com.ics.admin.service.IRepairLogService;
|
|
||||||
import com.ics.admin.service.IRepairService;
|
|
||||||
import com.ics.admin.vo.ParkVO;
|
import com.ics.admin.vo.ParkVO;
|
||||||
import com.ics.admin.vo.RepairVO;
|
import com.ics.admin.vo.RepairVO;
|
||||||
import com.ics.common.annotation.LoginUser;
|
import com.ics.common.annotation.LoginUser;
|
||||||
import com.ics.common.core.controller.BaseController;
|
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.domain.R;
|
||||||
import com.ics.common.utils.bean.BeanUtils;
|
import com.ics.common.utils.bean.BeanUtils;
|
||||||
import com.ics.system.domain.User;
|
import com.ics.system.domain.User;
|
||||||
import com.ics.system.domain.vo.UserVO;
|
import com.ics.system.domain.vo.UserVO;
|
||||||
|
import org.checkerframework.checker.units.qual.A;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.wf.jwtp.annotation.Ignore;
|
||||||
import org.wf.jwtp.annotation.RequiresPermissions;
|
import org.wf.jwtp.annotation.RequiresPermissions;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -34,6 +35,21 @@ public class RepairController extends BaseController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IRepairLogService repairLogService;
|
private IRepairLogService repairLogService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IIcsCustomerStaffService customerStaffService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IRepairTypeService repairTypeService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IRepairDeviceService deviceService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IRepairFailureTypeService repairFailureTypeService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IRepairRecordService repairRecordService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询工单管理
|
* 查询工单管理
|
||||||
*/
|
*/
|
||||||
@ -46,14 +62,39 @@ public class RepairController extends BaseController {
|
|||||||
BeanUtils.copyBeanProp(repairVO, repair);
|
BeanUtils.copyBeanProp(repairVO, repair);
|
||||||
repairVO.setStatus(repair.getStatus().getValue());
|
repairVO.setStatus(repair.getStatus().getValue());
|
||||||
repairVO.setStatusName(repair.getStatus().getName());
|
repairVO.setStatusName(repair.getStatus().getName());
|
||||||
|
//设备类型
|
||||||
|
RepairType repairType = repairTypeService.selectRepairTypeById(Long.valueOf(repair.getTypeId()));
|
||||||
|
repairVO.setTypeName(repairType.getName());
|
||||||
|
//设备名称
|
||||||
|
RepairDevice repairDevice = deviceService.selectRepairDeviceById(Long.valueOf(repair.getRepairDevice()));
|
||||||
|
repairVO.setRepairDeviceName(repairDevice.getName());
|
||||||
|
//故障
|
||||||
|
RepairFailureType repairFailureType = repairFailureTypeService.selectRepairFailureTypeById(repair.getFailureTypeId());
|
||||||
|
repairVO.setFailureTypeName(repairFailureType.getName());
|
||||||
|
IcsCustomerStaff staff = customerStaffService.selectIcsCustomerStaffById(Long.valueOf(repair.getUserId()));
|
||||||
|
repairVO.setUserName(staff.getUsername());
|
||||||
|
|
||||||
ParkVO parkVO = new ParkVO();
|
IcsCustomerStaff worker = customerStaffService.selectIcsCustomerStaffById(repair.getWorkerId());
|
||||||
BeanUtils.copyBeanProp(parkVO, repair.getPark());
|
repairVO.setWorkerName(worker.getUsername());
|
||||||
repairVO.setParkVO(parkVO);
|
|
||||||
|
|
||||||
UserVO userVO = new UserVO();
|
RepairRecord repairRecord = repairRecordService.selectByRepairId(id);
|
||||||
BeanUtils.copyBeanProp(userVO, repair.getUser());
|
if (null != repairRecord){
|
||||||
repairVO.setUserVO(userVO);
|
repairVO.setSpeed(repairRecord.getSpeed());
|
||||||
|
repairVO.setServe(repairRecord.getServe());
|
||||||
|
repairVO.setEffect(repairRecord.getEffect());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// repairVO.setStatus(repair.getStatus().getValue());
|
||||||
|
// repairVO.setStatusName(repair.getStatus().getName());
|
||||||
|
//
|
||||||
|
// ParkVO parkVO = new ParkVO();
|
||||||
|
// BeanUtils.copyBeanProp(parkVO, repair.getPark());
|
||||||
|
// repairVO.setParkVO(parkVO);
|
||||||
|
//
|
||||||
|
// UserVO userVO = new UserVO();
|
||||||
|
// BeanUtils.copyBeanProp(userVO, repair.getUser());
|
||||||
|
// repairVO.setUserVO(userVO);
|
||||||
|
|
||||||
RepairLog repairLog = new RepairLog();
|
RepairLog repairLog = new RepairLog();
|
||||||
repairLog.setRepairId(id);
|
repairLog.setRepairId(id);
|
||||||
@ -80,11 +121,12 @@ public class RepairController extends BaseController {
|
|||||||
@PostMapping("/review")
|
@PostMapping("/review")
|
||||||
public R review(@RequestBody Repair repair) {
|
public R review(@RequestBody Repair repair) {
|
||||||
Repair pRepair = repairService.selectRepairById(repair.getId());
|
Repair pRepair = repairService.selectRepairById(repair.getId());
|
||||||
if (repair == null || !Repair.Status.PENDING_ASSIGN.equals(pRepair.getStatus())) {
|
// if (repair == null || !Repair.Status.PENDING_ASSIGN.equals(pRepair.getStatus())) {
|
||||||
return R.error("报修为空或状态不是待分配");
|
// return R.error("报修为空或状态不是待分配");
|
||||||
}
|
// }
|
||||||
repair.setStatus(Repair.Status.PENDING_PROCESS);
|
// repair.setStatus(Repair.Status.PENDING_PROCESS);
|
||||||
return toAjax(repairService.updateRepair(repair));
|
repair.setStatus(Repair.Status.PENDING_ASSIGN);
|
||||||
|
return toAjax(repairService.insertRepair(repair));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -110,4 +152,13 @@ public class RepairController extends BaseController {
|
|||||||
return toAjax(repairService.deleteRepairByIds(ids));
|
return toAjax(repairService.deleteRepairByIds(ids));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Ignore
|
||||||
|
@GetMapping("selectWorkerIdByTypeId")
|
||||||
|
public R selectWorkerIdByTypeId(String typeId) {
|
||||||
|
List<IcsCustomerStaff> customerStaffs = repairService.selectWorkerIdByTypeId(typeId);
|
||||||
|
return R.data(customerStaffs);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,9 @@ public class Repair extends BaseEntity<Repair> {
|
|||||||
|
|
||||||
private Integer typeId;
|
private Integer typeId;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String typeName;
|
||||||
|
|
||||||
private Integer repairDevice;
|
private Integer repairDevice;
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String repairDeviceName;
|
private String repairDeviceName;
|
||||||
@ -145,6 +148,12 @@ public class Repair extends BaseEntity<Repair> {
|
|||||||
*/
|
*/
|
||||||
private String content;
|
private String content;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* failure_date 故障时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date failureDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 报修时间
|
* 报修时间
|
||||||
*/
|
*/
|
||||||
@ -154,8 +163,7 @@ public class Repair extends BaseEntity<Repair> {
|
|||||||
/**
|
/**
|
||||||
* 报修图片
|
* 报修图片
|
||||||
*/
|
*/
|
||||||
@TableField(typeHandler = BannerImageHandler.class)
|
private String repairImages;
|
||||||
private List<BannerImage> repairImages = new ArrayList<>();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 维修费
|
* 维修费
|
||||||
|
@ -90,5 +90,6 @@ public interface IIcsCustomerStaffService extends IService<IcsCustomerStaff> {
|
|||||||
|
|
||||||
IcsCustomerStaff selectUserByMobile(String phone);
|
IcsCustomerStaff selectUserByMobile(String phone);
|
||||||
|
|
||||||
|
|
||||||
// IcsCustomerStaff selectUserByMobileAndParkId(String phoneNumber, String parkId);
|
// IcsCustomerStaff selectUserByMobileAndParkId(String phoneNumber, String parkId);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.ics.admin.service;
|
package com.ics.admin.service;
|
||||||
|
|
||||||
|
import com.ics.admin.domain.Repair;
|
||||||
import com.ics.admin.domain.RepairRecord;
|
import com.ics.admin.domain.RepairRecord;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -58,4 +59,6 @@ public interface IRepairRecordService extends IService<RepairRecord> {
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
int deleteRepairRecordById(Long id);
|
int deleteRepairRecordById(Long id);
|
||||||
|
|
||||||
|
RepairRecord selectByRepairId(Long id);
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ package com.ics.admin.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.common.core.domain.IcsCustomerStaff;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -68,4 +69,7 @@ public interface IRepairService extends IService<Repair> {
|
|||||||
* @return 工单管理集合
|
* @return 工单管理集合
|
||||||
*/
|
*/
|
||||||
List<Repair> selectMyRepairList(Repair repair);
|
List<Repair> selectMyRepairList(Repair repair);
|
||||||
|
|
||||||
|
List<IcsCustomerStaff> selectWorkerIdByTypeId(String typeId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -301,6 +301,7 @@ public class IcsCustomerStaffServiceImpl extends ServiceImpl<IcsCustomerStaffMap
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//根据企业查询对应的设备
|
//根据企业查询对应的设备
|
||||||
public void queryDeviceByCustomerId(Long customerId,Long userId){
|
public void queryDeviceByCustomerId(Long customerId,Long userId){
|
||||||
ArrayList<Long> ids = new ArrayList<>();
|
ArrayList<Long> ids = new ArrayList<>();
|
||||||
|
@ -3,8 +3,10 @@ package com.ics.admin.service.impl;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
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.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.ics.admin.domain.Repair;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.ics.admin.mapper.RepairRecordMapper;
|
import com.ics.admin.mapper.RepairRecordMapper;
|
||||||
@ -89,4 +91,12 @@ public class RepairRecordServiceImpl extends ServiceImpl<RepairRecordMapper, Rep
|
|||||||
public int deleteRepairRecordById(Long id) {
|
public int deleteRepairRecordById(Long id) {
|
||||||
return repairRecordMapper.deleteRepairRecordById(id);
|
return repairRecordMapper.deleteRepairRecordById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RepairRecord selectByRepairId(Long id) {
|
||||||
|
LambdaQueryWrapper<RepairRecord> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
|
wrapper.eq(RepairRecord::getRepairId,id);
|
||||||
|
return repairRecordMapper.selectOne(wrapper);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,12 +2,18 @@ package com.ics.admin.service.impl;
|
|||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.ics.admin.domain.Repair;
|
import com.ics.admin.domain.Repair;
|
||||||
import com.ics.admin.domain.RepairLog;
|
import com.ics.admin.domain.RepairLog;
|
||||||
|
import com.ics.admin.domain.RepairWorkerType;
|
||||||
|
import com.ics.admin.mapper.IcsCustomerStaffMapper;
|
||||||
import com.ics.admin.mapper.RepairMapper;
|
import com.ics.admin.mapper.RepairMapper;
|
||||||
|
import com.ics.admin.mapper.RepairWorkerTypeMapper;
|
||||||
import com.ics.admin.service.IRepairLogService;
|
import com.ics.admin.service.IRepairLogService;
|
||||||
import com.ics.admin.service.IRepairService;
|
import com.ics.admin.service.IRepairService;
|
||||||
|
import com.ics.admin.service.IRepairWorkerTypeService;
|
||||||
|
import com.ics.common.core.domain.IcsCustomerStaff;
|
||||||
import com.ics.common.utils.DateUtils;
|
import com.ics.common.utils.DateUtils;
|
||||||
import com.ics.system.domain.Sn;
|
import com.ics.system.domain.Sn;
|
||||||
import com.ics.system.service.ICurrentUserService;
|
import com.ics.system.service.ICurrentUserService;
|
||||||
@ -17,6 +23,7 @@ import org.springframework.stereotype.Service;
|
|||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工单管理Service业务层处理
|
* 工单管理Service业务层处理
|
||||||
@ -38,6 +45,15 @@ public class RepairServiceImpl extends ServiceImpl<RepairMapper, Repair> impleme
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ICurrentUserService currentUserService;
|
private ICurrentUserService currentUserService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IRepairWorkerTypeService repairWorkerTypeService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RepairWorkerTypeMapper repairWorkerTypeMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IcsCustomerStaffMapper customerStaffMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询工单管理
|
* 查询工单管理
|
||||||
*
|
*
|
||||||
@ -143,4 +159,18 @@ public class RepairServiceImpl extends ServiceImpl<RepairMapper, Repair> impleme
|
|||||||
return repairMapper.selectMyRepairList(repair);
|
return repairMapper.selectMyRepairList(repair);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<IcsCustomerStaff> selectWorkerIdByTypeId(String typeId) {
|
||||||
|
LambdaQueryWrapper<RepairWorkerType> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.eq(RepairWorkerType::getTypeId, typeId);
|
||||||
|
//获取用户ids
|
||||||
|
List<Long> collect = repairWorkerTypeMapper.selectList(wrapper).stream().map(RepairWorkerType::getWorkerId).collect(Collectors.toList());
|
||||||
|
LambdaQueryWrapper<IcsCustomerStaff> userWrapper = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
|
userWrapper.in(IcsCustomerStaff::getId, collect);
|
||||||
|
return customerStaffMapper.selectList(userWrapper);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -40,6 +40,10 @@ public class RepairVO {
|
|||||||
*/
|
*/
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
private String repairName;
|
||||||
|
|
||||||
|
private String repairLevel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 联系电话
|
* 联系电话
|
||||||
*/
|
*/
|
||||||
@ -167,7 +171,24 @@ public class RepairVO {
|
|||||||
/**
|
/**
|
||||||
* 报修图片
|
* 报修图片
|
||||||
*/
|
*/
|
||||||
@TableField(typeHandler = BannerImageHandler.class)
|
private String repairImages;
|
||||||
private List<BannerImage> repairImages = new ArrayList<>();
|
|
||||||
|
|
||||||
|
private String typeName;
|
||||||
|
|
||||||
|
private String repairDeviceName;
|
||||||
|
|
||||||
|
private String failureTypeName;
|
||||||
|
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
private String workerName;
|
||||||
|
|
||||||
|
//评分
|
||||||
|
private Integer speed;
|
||||||
|
|
||||||
|
private Integer serve;
|
||||||
|
|
||||||
|
private Integer effect;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
<result property="repairVoice" column="repair_voice"/>
|
<result property="repairVoice" column="repair_voice"/>
|
||||||
<result property="dispatcherId" column="dispatcher_id"/>
|
<result property="dispatcherId" column="dispatcher_id"/>
|
||||||
<result property="failureTypeId" column="failure_type_id"/>
|
<result property="failureTypeId" column="failure_type_id"/>
|
||||||
|
<result property="failureDate" column="failure_date"/>
|
||||||
<result property="name" column="name"/>
|
<result property="name" column="name"/>
|
||||||
<result property="userId" column="user_id"/>
|
<result property="userId" column="user_id"/>
|
||||||
<result property="phone" column="phone"/>
|
<result property="phone" column="phone"/>
|
||||||
@ -21,8 +22,7 @@
|
|||||||
<result property="status" column="status" />
|
<result property="status" column="status" />
|
||||||
<result property="content" column="content"/>
|
<result property="content" column="content"/>
|
||||||
<result property="repairTime" column="repair_time"/>
|
<result property="repairTime" column="repair_time"/>
|
||||||
<result property="repairImages" column="repair_images" jdbcType="LONGVARCHAR"
|
<result property="repairImages" column="repair_images" />
|
||||||
javaType="java.util.ArrayList" typeHandler="com.ics.admin.handler.BannerImageHandler"/>
|
|
||||||
<result property="repairFee" column="repair_fee"/>
|
<result property="repairFee" column="repair_fee"/>
|
||||||
<result property="repairScore" column="repair_score"/>
|
<result property="repairScore" column="repair_score"/>
|
||||||
<result property="repairMateriel" column="repair_materiel"/>
|
<result property="repairMateriel" column="repair_materiel"/>
|
||||||
@ -71,6 +71,7 @@
|
|||||||
r.area,
|
r.area,
|
||||||
r.status,
|
r.status,
|
||||||
r.content,
|
r.content,
|
||||||
|
r.failure_date,
|
||||||
r.repair_name,
|
r.repair_name,
|
||||||
r.user_id,
|
r.user_id,
|
||||||
r.repair_level,
|
r.repair_level,
|
||||||
|
@ -28,7 +28,7 @@ public class MimeTypeUtils {
|
|||||||
// word excel powerpoint
|
// word excel powerpoint
|
||||||
"doc", "docx", "xls", "xlsx", "ppt", "pptx", "html", "htm", "txt",
|
"doc", "docx", "xls", "xlsx", "ppt", "pptx", "html", "htm", "txt",
|
||||||
// 压缩文件
|
// 压缩文件
|
||||||
"rar", "zip", "gz", "bz2",
|
"rar", "zip", "gz", "bz2","mp4",
|
||||||
// pdf
|
// pdf
|
||||||
"pdf"};
|
"pdf"};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user