mirror of
https://gitee.com/elegant_wings/dbd-meeting.git
synced 2025-06-21 22:59:36 +08:00
超时预警\自动好评\防止频繁报修
This commit is contained in:
parent
9972376240
commit
083539e894
@ -50,6 +50,7 @@ public class RepairController extends BaseController {
|
|||||||
@PostMapping("flow/start")
|
@PostMapping("flow/start")
|
||||||
public R startFlow(@RequestBody RepairDTO repairDTO) {
|
public R startFlow(@RequestBody RepairDTO repairDTO) {
|
||||||
Long userId = getLoginStaffId();
|
Long userId = getLoginStaffId();
|
||||||
|
if (!repairService.submitCheck(userId.toString())) return R.error("报修过于频繁,请稍后再试.");
|
||||||
String result = repairService.handleFlow(repairDTO.getRepair(), userId, repairDTO.getFiles(), null, null);
|
String result = repairService.handleFlow(repairDTO.getRepair(), userId, repairDTO.getFiles(), null, null);
|
||||||
return IRepairService.OK.equals(result) ? R.ok() : R.error(result);
|
return IRepairService.OK.equals(result) ? R.ok() : R.error(result);
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package com.ics.admin.mapper;
|
package com.ics.admin.mapper;
|
||||||
|
|
||||||
import com.ics.admin.domain.RepairAttach;
|
import com.ics.admin.domain.RepairAttach;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
@ -14,7 +13,7 @@ import java.util.List;
|
|||||||
* @date 2024-07-31
|
* @date 2024-07-31
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface RepairAttachMapper extends BaseMapper<RepairAttach> {
|
public interface RepairAttachMapper {
|
||||||
/**
|
/**
|
||||||
* 查询附件
|
* 查询附件
|
||||||
*
|
*
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package com.ics.admin.mapper;
|
package com.ics.admin.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.ics.admin.domain.Repair;
|
import com.ics.admin.domain.Repair;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
@ -14,7 +13,7 @@ import java.util.List;
|
|||||||
* @date 2021-03-25
|
* @date 2021-03-25
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface RepairMapper extends BaseMapper<Repair> {
|
public interface RepairMapper {
|
||||||
/**
|
/**
|
||||||
* 查询工单
|
* 查询工单
|
||||||
*
|
*
|
||||||
@ -25,8 +24,11 @@ public interface RepairMapper extends BaseMapper<Repair> {
|
|||||||
|
|
||||||
|
|
||||||
List<Repair> normalRepairList(@Param("userId") String userId, @Param("type") String type);
|
List<Repair> normalRepairList(@Param("userId") String userId, @Param("type") String type);
|
||||||
|
|
||||||
List<Repair> preRepairList(@Param("userId") String userId, @Param("type") String type);
|
List<Repair> preRepairList(@Param("userId") String userId, @Param("type") String type);
|
||||||
|
|
||||||
List<Repair> workRepairList(@Param("userId") String userId, @Param("type") String type);
|
List<Repair> workRepairList(@Param("userId") String userId, @Param("type") String type);
|
||||||
|
|
||||||
List<Repair> adminRepairList(@Param("userId") String userId, @Param("type") String type);
|
List<Repair> adminRepairList(@Param("userId") String userId, @Param("type") String type);
|
||||||
|
|
||||||
|
|
||||||
@ -62,4 +64,35 @@ public interface RepairMapper extends BaseMapper<Repair> {
|
|||||||
*/
|
*/
|
||||||
int deleteRepairByIds(String[] ids);
|
int deleteRepairByIds(String[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 红色预警
|
||||||
|
*
|
||||||
|
* @param day 小于day天红色预警
|
||||||
|
*/
|
||||||
|
int repairTimeOutRed(Integer day);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 橙色预警
|
||||||
|
*
|
||||||
|
* @param day 小于day天橙色预警
|
||||||
|
*/
|
||||||
|
int repairTimeOutOrange(Integer day);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单结束后解除预警
|
||||||
|
*/
|
||||||
|
int removeWarn();
|
||||||
|
/**
|
||||||
|
* 工单结束后7天没有评价的自动好评
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int repairGoodEval();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查3分钟内指定用户提交工单数量
|
||||||
|
* @param userId
|
||||||
|
*/
|
||||||
|
int submitCheck(String userId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package com.ics.admin.service;
|
package com.ics.admin.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.ics.admin.domain.RepairAttach;
|
import com.ics.admin.domain.RepairAttach;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -11,7 +10,7 @@ import java.util.List;
|
|||||||
* @author chen
|
* @author chen
|
||||||
* @date 2024-07-31
|
* @date 2024-07-31
|
||||||
*/
|
*/
|
||||||
public interface IRepairAttachService extends IService<RepairAttach> {
|
public interface IRepairAttachService {
|
||||||
|
|
||||||
String FILE_VOICE = "voice";
|
String FILE_VOICE = "voice";
|
||||||
|
|
||||||
|
@ -3,7 +3,6 @@ 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.admin.utils.FlowOperate;
|
import com.ics.admin.utils.FlowOperate;
|
||||||
import com.ics.common.core.domain.IcsCustomerStaff;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -13,7 +12,7 @@ import java.util.List;
|
|||||||
* @author ics
|
* @author ics
|
||||||
* @date 2021-03-25
|
* @date 2021-03-25
|
||||||
*/
|
*/
|
||||||
public interface IRepairService extends IService<Repair> {
|
public interface IRepairService {
|
||||||
|
|
||||||
String OK = "okay";
|
String OK = "okay";
|
||||||
/**
|
/**
|
||||||
@ -57,15 +56,6 @@ public interface IRepairService extends IService<Repair> {
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
int updateRepair(Repair repair);
|
int updateRepair(Repair repair);
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除工单
|
|
||||||
*
|
|
||||||
* @param ids 需要删除的数据ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
int deleteRepairByIds(String ids);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除工单信息
|
* 删除工单信息
|
||||||
*
|
*
|
||||||
@ -74,4 +64,27 @@ public interface IRepairService extends IService<Repair> {
|
|||||||
*/
|
*/
|
||||||
int deleteRepairById(Long id);
|
int deleteRepairById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单超时预警
|
||||||
|
*/
|
||||||
|
int repairTimeOutWarn();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单结束后解除预警
|
||||||
|
*/
|
||||||
|
int removeWarn();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单自动好评
|
||||||
|
*/
|
||||||
|
int repairGoodEval();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 3分钟内不允许提交多个订单
|
||||||
|
*
|
||||||
|
* @param userId 用户id
|
||||||
|
* @return true 可以报修,false 不能报修
|
||||||
|
*/
|
||||||
|
boolean submitCheck(String userId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package com.ics.admin.service.impl;
|
package com.ics.admin.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.ics.admin.domain.RepairAttach;
|
import com.ics.admin.domain.RepairAttach;
|
||||||
import com.ics.admin.mapper.RepairAttachMapper;
|
import com.ics.admin.mapper.RepairAttachMapper;
|
||||||
import com.ics.admin.service.IRepairAttachService;
|
import com.ics.admin.service.IRepairAttachService;
|
||||||
@ -21,7 +20,7 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
public class RepairAttachServiceImpl extends ServiceImpl<RepairAttachMapper, RepairAttach> implements IRepairAttachService {
|
public class RepairAttachServiceImpl implements IRepairAttachService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private RepairAttachMapper repairAttachMapper;
|
private RepairAttachMapper repairAttachMapper;
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
package com.ics.admin.service.impl;
|
package com.ics.admin.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
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;
|
||||||
@ -16,7 +14,9 @@ import com.ics.admin.service.IRepairService;
|
|||||||
import com.ics.admin.utils.FlowOperate;
|
import com.ics.admin.utils.FlowOperate;
|
||||||
import com.ics.common.core.domain.IcsCustomerStaff;
|
import com.ics.common.core.domain.IcsCustomerStaff;
|
||||||
import com.ics.common.utils.StringUtils;
|
import com.ics.common.utils.StringUtils;
|
||||||
|
import com.ics.system.domain.DictData;
|
||||||
import com.ics.system.domain.Sn;
|
import com.ics.system.domain.Sn;
|
||||||
|
import com.ics.system.service.IDictDataService;
|
||||||
import com.ics.system.service.ISnService;
|
import com.ics.system.service.ISnService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -34,7 +34,8 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
public class RepairServiceImpl extends ServiceImpl<RepairMapper, Repair> implements IRepairService {
|
public class RepairServiceImpl implements IRepairService {
|
||||||
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISnService snService;
|
private ISnService snService;
|
||||||
@ -57,6 +58,9 @@ public class RepairServiceImpl extends ServiceImpl<RepairMapper, Repair> impleme
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IRepairAttachService repairAttachService;
|
private IRepairAttachService repairAttachService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IDictDataService dictDataService;
|
||||||
|
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@Override
|
@Override
|
||||||
@ -237,7 +241,7 @@ public class RepairServiceImpl extends ServiceImpl<RepairMapper, Repair> impleme
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int insertRepair(Repair repair) {
|
public int insertRepair(Repair repair) {
|
||||||
return repairMapper.insert(repair);
|
return repairMapper.insertRepair(repair);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -248,19 +252,7 @@ public class RepairServiceImpl extends ServiceImpl<RepairMapper, Repair> impleme
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int updateRepair(Repair repair) {
|
public int updateRepair(Repair repair) {
|
||||||
return repairMapper.updateById(repair);
|
return repairMapper.updateRepair(repair);
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除工单对象
|
|
||||||
*
|
|
||||||
* @param ids 需要删除的数据ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int deleteRepairByIds(String ids) {
|
|
||||||
String[] idsArray = StrUtil.split(ids, ",");
|
|
||||||
return repairMapper.deleteBatchIds(CollUtil.toList(idsArray));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -279,4 +271,32 @@ public class RepairServiceImpl extends ServiceImpl<RepairMapper, Repair> impleme
|
|||||||
return repairMapper.deleteRepairById(id);
|
return repairMapper.deleteRepairById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int repairTimeOutWarn() {
|
||||||
|
List<DictData> list = dictDataService.selectDictDataByType("repair_timeout");
|
||||||
|
if (list.size() == 2) {
|
||||||
|
Integer orange = Integer.valueOf(list.get(0).getDictValue());
|
||||||
|
Integer red = Integer.valueOf(list.get(1).getDictValue());
|
||||||
|
int r = repairMapper.repairTimeOutRed(red);
|
||||||
|
int o = repairMapper.repairTimeOutOrange(orange);
|
||||||
|
return r + o;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int removeWarn() {
|
||||||
|
return repairMapper.removeWarn();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int repairGoodEval() {
|
||||||
|
return repairMapper.repairGoodEval();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean submitCheck(String userId) {
|
||||||
|
int num = repairMapper.submitCheck(userId);
|
||||||
|
return num == 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -50,12 +50,12 @@
|
|||||||
WHERE id = #{id} and delete_flag = 0
|
WHERE id = #{id} and delete_flag = 0
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectRepairAttachList" resultMap="RepairAttachResult">
|
<select id="selectRepairAttachList" parameterType="Long" resultMap="RepairAttachResult">
|
||||||
<include refid="selectRepairAttachVo"/>
|
<include refid="selectRepairAttachVo"/>
|
||||||
where repair_id= #{repairId} and delete_flag = 0
|
where repair_id= #{repairId} and delete_flag = 0
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertRepairAttach" parameterType="RepairAttach" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertRepairAttach" parameterType="com.ics.admin.domain.RepairAttach">
|
||||||
INSERT INTO ics_repair_attach
|
INSERT INTO ics_repair_attach
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
<if test="repairId != null ">repair_id,</if>
|
<if test="repairId != null ">repair_id,</if>
|
||||||
@ -92,7 +92,7 @@
|
|||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<update id="updateRepairAttachs" parameterType="String">
|
<update id="updateRepairAttachs">
|
||||||
UPDATE ics_repair_attach set repair_id= #{repairId} where id in
|
UPDATE ics_repair_attach set repair_id= #{repairId} where id in
|
||||||
<foreach item="id" collection="ids" open="(" separator="," close=")">
|
<foreach item="id" collection="ids" open="(" separator="," close=")">
|
||||||
#{id}
|
#{id}
|
||||||
@ -106,6 +106,8 @@
|
|||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<delete id="deleteRepairAttachById" parameterType="Long">
|
<delete id="deleteRepairAttachById" parameterType="Long">
|
||||||
DELETE FROM ics_repair_attach WHERE id = #{id}
|
DELETE
|
||||||
|
FROM ics_repair_attach
|
||||||
|
WHERE id = #{id}
|
||||||
</delete>
|
</delete>
|
||||||
</mapper>
|
</mapper>
|
@ -206,7 +206,7 @@
|
|||||||
<include refid="selectRepairVo"/>
|
<include refid="selectRepairVo"/>
|
||||||
where delete_flag = 0 and create_by = #{userId}
|
where delete_flag = 0 and create_by = #{userId}
|
||||||
<if test="type == 'all'"></if>
|
<if test="type == 'all'"></if>
|
||||||
<if test="type == 'process'">and status < 9</if>
|
<if test="type == 'process'">and status <![CDATA[ < ]]> 9 </if>
|
||||||
<if test="type == 'evaling'">and status = 9</if>
|
<if test="type == 'evaling'">and status = 9</if>
|
||||||
<if test="type == 'evaled'">and status = 13</if>
|
<if test="type == 'evaled'">and status = 13</if>
|
||||||
order by create_time desc
|
order by create_time desc
|
||||||
@ -217,7 +217,7 @@
|
|||||||
where delete_flag = 0 and per_userid = #{userId}
|
where delete_flag = 0 and per_userid = #{userId}
|
||||||
<if test="type == 'anew'">and status = 3</if>
|
<if test="type == 'anew'">and status = 3</if>
|
||||||
<if test="type == 'wait'">and status = 1</if>
|
<if test="type == 'wait'">and status = 1</if>
|
||||||
<if test="type == 'already'">and status > 3 and status <> 11</if>
|
<if test="type == 'already'">and status <![CDATA[ > ]]> 3 and status <![CDATA[ <> ]]> 11</if>
|
||||||
<if test="type == 'close'">and status = 11</if>
|
<if test="type == 'close'">and status = 11</if>
|
||||||
order by create_time desc
|
order by create_time desc
|
||||||
</select>
|
</select>
|
||||||
@ -250,4 +250,24 @@
|
|||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<update id="repairTimeOutRed" parameterType="Integer">
|
||||||
|
update ics_repair set warn=5 where delete_flag=0 and status <![CDATA[ < ]]> 9 and timeout is not null and warn <![CDATA[ <> ]]> 5 and TIMESTAMPDIFF(DAY,NOW(),timeout) <![CDATA[ <= ]]> #{day}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="repairTimeOutOrange" parameterType="Integer">
|
||||||
|
update ics_repair set warn=3 where delete_flag=0 and status <![CDATA[ < ]]> 9 and timeout is not null and warn <![CDATA[ <= ]]> 1 and TIMESTAMPDIFF(DAY,NOW(),timeout) <![CDATA[ <= ]]> #{day}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="removeWarn">
|
||||||
|
update ics_repair set warn=0 where delete_flag=0 and status <![CDATA[ >= ]]> 9 and warn <![CDATA[ > ]]> 0
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="repairGoodEval">
|
||||||
|
update ics_repair set eval_service=5,eval_time=NOW(),eval_user_id=-1,status=13
|
||||||
|
where delete_flag=0 and status=9 and end_date is not null and TIMESTAMPDIFF(DAY,end_date,NOW()) <![CDATA[ >= ]]> 7
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<select id="submitCheck" parameterType="String" resultType="Integer">
|
||||||
|
select count(id) from ics_repair where delete_flag=0 and create_by= #{userId} and TIMESTAMPDIFF(MINUTE,create_time,NOW()) <![CDATA[ <= ]]> 3
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
@ -1,9 +1,9 @@
|
|||||||
package com.ics.quartz.task;
|
package com.ics.quartz.task;
|
||||||
|
|
||||||
import com.ics.admin.service.IRepairService;
|
import com.ics.admin.service.IRepairService;
|
||||||
|
import com.ics.common.utils.spring.SpringUtils;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* created at 2024-8-13 14:11
|
* created at 2024-8-13 14:11
|
||||||
@ -13,23 +13,26 @@ import org.springframework.stereotype.Component;
|
|||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Component("repairTask")
|
@Service("repairTask")
|
||||||
public class RepairTask {
|
public class RepairTask {
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IRepairService repairService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工单超时预警
|
* 工单超时预警
|
||||||
*/
|
*/
|
||||||
public void repairTimeOut(){
|
public void repairTimeOut() {
|
||||||
System.out.println("========come on time out=========");
|
IRepairService repairService = SpringUtils.getBean(IRepairService.class);
|
||||||
|
int num = repairService.repairTimeOutWarn();
|
||||||
|
log.info("已对" + num + "个工单超时预警");
|
||||||
|
num = repairService.removeWarn();
|
||||||
|
log.info("已对" + num + "个工单解除预警");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工单完成7天后未评价 则 自动好评
|
* 工单完成7天后未评价 则 自动好评
|
||||||
*/
|
*/
|
||||||
public void repairGoodEval() {
|
public void repairGoodEval() {
|
||||||
System.out.println("========come on give me five=========");
|
IRepairService repairService = SpringUtils.getBean(IRepairService.class);
|
||||||
|
int num = repairService.repairGoodEval();
|
||||||
|
log.info("已对" + num + "个工单自动五星好评");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ public class MyParkLineHandler implements TenantLineHandler {
|
|||||||
"sys_sn", "sys_user_role", "sys_dept", "ics_customer_contract_room", "ics_park", "ics_apply_room", "ics_customer_contract_refund_room", "ics_apply_park_file",
|
"sys_sn", "sys_user_role", "sys_dept", "ics_customer_contract_room", "ics_park", "ics_apply_room", "ics_customer_contract_refund_room", "ics_apply_park_file",
|
||||||
"ics_apply_settle_file", "ics_apply_move_in_file", "ics_activity","ics_customer_staff","tb_customer_ticket","tb_reservation","tb_reservation_person",
|
"ics_apply_settle_file", "ics_apply_move_in_file", "ics_activity","ics_customer_staff","tb_customer_ticket","tb_reservation","tb_reservation_person",
|
||||||
"tb_room_content","tb_room_item","tb_room_item_by_room","tb_room_serve_by_room","tb_room_serve","tb_equipment","tb_staff_customer",
|
"tb_room_content","tb_room_item","tb_room_item_by_room","tb_room_serve_by_room","tb_room_serve","tb_equipment","tb_staff_customer",
|
||||||
"tb_room_equipment","tb_room_record","tb_room_serve","tb_showroom","tb_showroom_record","tb_ticket","tb_user_equipment","tb_visitor_person"
|
"tb_room_equipment","tb_room_record","tb_room_serve","tb_showroom","tb_showroom_record","tb_ticket","tb_user_equipment","tb_visitor_person","ics_repair"
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -24,7 +24,7 @@ public class MyTenantLineHandler implements TenantLineHandler {
|
|||||||
"sys_sn", "sys_user_role", "ics_customer_contract_room", "ics_apply_room", "ics_customer_contract_refund_room", "ics_apply_park_file",
|
"sys_sn", "sys_user_role", "ics_customer_contract_room", "ics_apply_room", "ics_customer_contract_refund_room", "ics_apply_park_file",
|
||||||
"ics_apply_settle_file", "ics_apply_move_in_file", "ics_activity","ics_customer_staff","tb_customer_ticket","tb_reservation","tb_reservation_person",
|
"ics_apply_settle_file", "ics_apply_move_in_file", "ics_activity","ics_customer_staff","tb_customer_ticket","tb_reservation","tb_reservation_person",
|
||||||
"tb_room_content","tb_room_item","tb_room_item_by_room","tb_room_serve_by_room","tb_room_serve","tb_equipment","tb_staff_customer",
|
"tb_room_content","tb_room_item","tb_room_item_by_room","tb_room_serve_by_room","tb_room_serve","tb_equipment","tb_staff_customer",
|
||||||
"tb_room_equipment","tb_room_record","tb_room_serve","tb_showroom","tb_showroom_record","tb_ticket","tb_user_equipment","tb_visitor_person"
|
"tb_room_equipment","tb_room_record","tb_room_serve","tb_showroom","tb_showroom_record","tb_ticket","tb_user_equipment","tb_visitor_person","ics_repair"
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,438 +0,0 @@
|
|||||||
package com.ics.controller.mobile.member;
|
|
||||||
|
|
||||||
import com.google.common.collect.Maps;
|
|
||||||
|
|
||||||
import com.ics.admin.domain.*;
|
|
||||||
import com.ics.admin.service.*;
|
|
||||||
import com.ics.common.core.controller.BaseController;
|
|
||||||
import com.ics.common.core.domain.R;
|
|
||||||
import com.ics.service.IRepairService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
import org.wf.jwtp.annotation.Ignore;
|
|
||||||
import org.wf.jwtp.annotation.RequiresPermissions;
|
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 工单管理
|
|
||||||
*
|
|
||||||
* @author jack
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/repair")
|
|
||||||
public class RepairAPIController extends BaseController {
|
|
||||||
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IRepairService repairService;
|
|
||||||
@Autowired
|
|
||||||
private IIcsCustomerStaffService icsCustomerStaffService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IRepairDeviceService repairDeviceService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IRepairRelationalService staffTypeService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IRepairDeviceTypeService repairTypeService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IRepairAttachService workerTypeService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IRepairAddressService repairAddressService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IRepairAddressFloorService repairRoomService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IIcsCustomerStaffService customerStaffService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IRepairDeviceService deviceService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IRepairFailureTypeService repairFailureTypeService;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询工单管理
|
|
||||||
*/
|
|
||||||
// @RequiresPermissions("member:center:view")
|
|
||||||
// @Ignore
|
|
||||||
// @GetMapping("get/{id}")
|
|
||||||
// public R get(@PathVariable("id") Long id) {
|
|
||||||
// Repair repair = repairService.selectRepairById(id);
|
|
||||||
// if (repair != null) {
|
|
||||||
// repair.setStatusValue(repair.getStatus().getValue());
|
|
||||||
//
|
|
||||||
// //设备名称
|
|
||||||
// RepairDevice repairDevice = repairDeviceService.selectRepairDeviceById(Long.valueOf(repair.getRepairDevice()));
|
|
||||||
// if (repairDevice != null) {
|
|
||||||
// repair.setRepairDeviceName(repairDevice.getName());
|
|
||||||
// }
|
|
||||||
// //维修人
|
|
||||||
// Long workerId = repair.getWorkerId();
|
|
||||||
// IcsCustomerStaff icsCustomerStaff = icsCustomerStaffService.selectIcsCustomerStaffById(workerId);
|
|
||||||
// if (icsCustomerStaff != null) {
|
|
||||||
// repair.setWorkerName(icsCustomerStaff.getName());
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// return R.data(repair);
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询工单管理列表
|
|
||||||
*/
|
|
||||||
// @RequiresPermissions("member:center:view")
|
|
||||||
// @GetMapping("list")
|
|
||||||
// public R list(Repair.Status status, Long parkId) {
|
|
||||||
// long currentUserId = getCurrentUserId();
|
|
||||||
// IcsCustomerStaff staff = icsCustomerStaffService.selectIcsCustomerStaffById(currentUserId);
|
|
||||||
// Repair repair = new Repair();
|
|
||||||
// repair.setStatus(status);
|
|
||||||
// repair.setCreateBy(staff.getUsername());
|
|
||||||
// repair.setParkId(1L);
|
|
||||||
// startPage();
|
|
||||||
// List<Repair> repairList = repairService.selectMyRepairList(repair);
|
|
||||||
// List<Map<String, Object>> repairVOList = Lists.newArrayList();
|
|
||||||
// repairList.stream().forEach(item ->{
|
|
||||||
// Map<String, Object> map = Maps.newHashMap();
|
|
||||||
// map.put("id", item.getId());
|
|
||||||
// map.put("sn", item.getSn());
|
|
||||||
// map.put("repairTime", item.getRepairTime());
|
|
||||||
// map.put("area", item.getArea());
|
|
||||||
// map.put("content", item.getContent());
|
|
||||||
// map.put("status",item.getStatus());
|
|
||||||
// repairVOList.add(map);
|
|
||||||
// });
|
|
||||||
// return result(repairVOList);
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加
|
|
||||||
*/
|
|
||||||
@RequiresPermissions("member:center:view")
|
|
||||||
@GetMapping("/add")
|
|
||||||
public R add() {
|
|
||||||
Map<String, Object> map = Maps.newHashMap();
|
|
||||||
long currentUserId = getCurrentUserId();
|
|
||||||
// IcsCustomerStaff staff = icsCustomerStaffService.selectIcsCustomerStaffById(currentUserId);
|
|
||||||
|
|
||||||
// map.put("userId", staff.getId());
|
|
||||||
// map.put("mobile", staff.getMobile());
|
|
||||||
// map.put("username", staff.getUsername());
|
|
||||||
map.put("area", "");
|
|
||||||
map.put("content", "");
|
|
||||||
return R.data(map);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增保存工单管理
|
|
||||||
*/
|
|
||||||
// @RequiresPermissions("member:center:view")
|
|
||||||
// @Ignore
|
|
||||||
// @PostMapping("save")
|
|
||||||
// public R addSave(@RequestBody Repair repair) {
|
|
||||||
//
|
|
||||||
// //获取用户id
|
|
||||||
// ValidatorUtils.validateEntity(repair);
|
|
||||||
// repair.setStatus(Repair.Status.PENDING_ASSIGN);
|
|
||||||
// return toAjax(repairService.insertRepair(repair));
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取设备分类列表
|
|
||||||
* @param
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
// @Ignore
|
|
||||||
// @GetMapping("deviceTypeList")
|
|
||||||
// public R deviceTypeList(RepairDeviceType repairType) {
|
|
||||||
// return result(repairTypeService.selectRepairTypeList(repairType));
|
|
||||||
// }
|
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@GetMapping("deviceList")
|
|
||||||
public R deviceList(RepairDevice repairDevice) {
|
|
||||||
return result(repairDeviceService.selectRepairDeviceList(repairDevice));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@GetMapping("selectAddressList")
|
|
||||||
public R selectAddressList(RepairAddress repairAddress) {
|
|
||||||
return result(repairAddressService.selectRepairAddressList(repairAddress));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@GetMapping("selectRoomList")
|
|
||||||
public R selectRoomList(RepairAddressFloor repairRoom) {
|
|
||||||
//return result(repairRoomService.selectRepairRoomList(repairRoom));
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户评价工单
|
|
||||||
*/
|
|
||||||
// @RequiresPermissions("member:center:view")
|
|
||||||
// @Ignore
|
|
||||||
// @PostMapping("review")
|
|
||||||
// public R review(@RequestBody RepairEval repairRecord) {
|
|
||||||
// Repair pRepair = repairService.selectRepairById(repairRecord.getId());
|
|
||||||
// if (repairRecord == null || !Repair.Status.COMPLETED.equals(pRepair.getStatus())) {
|
|
||||||
// return R.error("报修为空或状态已完成");
|
|
||||||
// }
|
|
||||||
// pRepair.setStatus(Repair.Status.SCORE);
|
|
||||||
// //修改工单状态
|
|
||||||
// int i = repairService.updateRepair(pRepair);
|
|
||||||
// //新增评价
|
|
||||||
// repairRecord.setCreateTime(DateUtils.getNowDate());
|
|
||||||
// repairRecord.setDeleteFlag(0);
|
|
||||||
// int count = repairRecordService.insertRepairRecord(repairRecord);
|
|
||||||
//
|
|
||||||
// return toAjax(i);
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户取消工单
|
|
||||||
*/
|
|
||||||
// @RequiresPermissions("member:center:view")
|
|
||||||
// @GetMapping("cancel")
|
|
||||||
// public R cancel(Long repairId) {
|
|
||||||
// Repair repair = repairService.selectRepairById(repairId);
|
|
||||||
// if (repair == null || !Repair.Status.PENDING_PROCESS.equals(repair.getStatus())) {
|
|
||||||
// return R.error("报修为空或状态不是待处理");
|
|
||||||
// }
|
|
||||||
// repair.setStatus(Repair.Status.CANCELED);
|
|
||||||
// repair.setUpdateBy(getLoginName());
|
|
||||||
// return toAjax(repairService.updateRepair(repair));
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据用户id或者保修记录
|
|
||||||
*/
|
|
||||||
|
|
||||||
// @Ignore
|
|
||||||
// @GetMapping("/listByUserId")
|
|
||||||
// public R listByUserId(Long userId,Integer status) {
|
|
||||||
// List<Repair> repair = repairService.selectByUserId(userId,status);
|
|
||||||
// for (Repair repair1 : repair) {
|
|
||||||
// RepairDevice repairDevice = repairDeviceService.selectRepairDeviceById(Long.valueOf(repair1.getRepairDevice()));
|
|
||||||
// if (repairDevice != null) {
|
|
||||||
// repair1.setRepairDeviceName(repairDevice.getName());
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// return R.data(repair);
|
|
||||||
// }
|
|
||||||
|
|
||||||
/*-------------------------以下为派单员接口------------------------*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 派单中心列表
|
|
||||||
*/
|
|
||||||
// @Ignore
|
|
||||||
// @PostMapping("/dispatcherList")
|
|
||||||
// public R dispatcherList(@RequestBody Repair repair) {
|
|
||||||
// Integer userId = repair.getUserId();
|
|
||||||
// Integer statusValue = repair.getStatusValue();
|
|
||||||
//
|
|
||||||
// //根据用户id查询绑定的设备分类
|
|
||||||
// Long type = staffTypeService.selectRepairTypeByUserId(userId);
|
|
||||||
// //根据设备分类和状态查询对应的数据
|
|
||||||
// PageDomain pageDomain = TableSupport.buildPageRequest();
|
|
||||||
//
|
|
||||||
// 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) {
|
|
||||||
// RepairDeviceType 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.getAddressId() !=null){
|
|
||||||
// RepairAddress repairAddress = repairAddressService.selectRepairAddressById(repair1.getAddressId());
|
|
||||||
// repair1.setAddressName(repairAddress.getName());
|
|
||||||
// }
|
|
||||||
// //楼层
|
|
||||||
// if (repair1.getRoomId() !=null){
|
|
||||||
// RepairAddressFloor repairRoom = repairRoomService.selectRepairRoomById(repair1.getRoomId());
|
|
||||||
// repair1.setRoomName(repairRoom.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);
|
|
||||||
// }
|
|
||||||
|
|
||||||
//无效申请 取消派单
|
|
||||||
// @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);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// //提交派单人员
|
|
||||||
// @Ignore
|
|
||||||
// @GetMapping("dispatcherPendingProcess")
|
|
||||||
// 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();
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
|||||||
package com.ics.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.ics.admin.domain.RepairLog;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 报修记录Service接口
|
|
||||||
*
|
|
||||||
* @author ics
|
|
||||||
* @date 2021-03-25
|
|
||||||
*/
|
|
||||||
public interface IRepairLogService extends IService<RepairLog> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询报修记录列表
|
|
||||||
*
|
|
||||||
* @param repairLog 报修记录
|
|
||||||
* @return 报修记录集合
|
|
||||||
*/
|
|
||||||
List<RepairLog> selectRepairLogList(RepairLog repairLog);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -1,58 +0,0 @@
|
|||||||
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;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 工单管理Service接口
|
|
||||||
*
|
|
||||||
* @author ics
|
|
||||||
* @date 2021-03-25
|
|
||||||
*/
|
|
||||||
public interface IRepairService extends IService<Repair> {
|
|
||||||
/**
|
|
||||||
* 查询工单管理
|
|
||||||
*
|
|
||||||
* @param id 工单管理ID
|
|
||||||
* @return 工单管理
|
|
||||||
*/
|
|
||||||
Repair selectRepairById(Long id);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增工单管理
|
|
||||||
*
|
|
||||||
* @param repair 工单管理
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
int insertRepair(Repair repair);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改工单管理
|
|
||||||
*
|
|
||||||
* @param repair 工单管理
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
int updateRepair(Repair repair);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询我的工单管理列表
|
|
||||||
*
|
|
||||||
* @param repair 创建用户
|
|
||||||
* @return 工单管理集合
|
|
||||||
*/
|
|
||||||
List<Repair> selectMyRepairList(Repair repair);
|
|
||||||
|
|
||||||
List<Repair> selectByUserId(Long userId,Integer status);
|
|
||||||
|
|
||||||
IPage<Repair> selectRepairListByType(Long type, Integer status, Integer pageNum, Integer pageSize);
|
|
||||||
|
|
||||||
List<Repair> listByWorkerId(Long userId, Integer status);
|
|
||||||
|
|
||||||
Integer listByWorkerIdByCount(Long userId, Integer status);
|
|
||||||
}
|
|
@ -1,38 +0,0 @@
|
|||||||
package com.ics.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.ics.admin.domain.RepairLog;
|
|
||||||
import com.ics.admin.mapper.RepairLogMapper;
|
|
||||||
import com.ics.service.IRepairLogService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 报修记录Service业务层处理
|
|
||||||
*
|
|
||||||
* @author ics
|
|
||||||
* @date 2021-03-25
|
|
||||||
*/
|
|
||||||
@Service("repairLogAppService")
|
|
||||||
public class RepairLogServiceImpl extends ServiceImpl<RepairLogMapper, RepairLog> implements IRepairLogService {
|
|
||||||
@Autowired
|
|
||||||
private RepairLogMapper repairLogMapper;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询报修记录列表
|
|
||||||
*
|
|
||||||
* @param repairLog 报修记录
|
|
||||||
* @return 报修记录
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<RepairLog> selectRepairLogList(RepairLog repairLog) {
|
|
||||||
//return repairLogMapper.selectRepairLogList(repairLog);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -1,185 +0,0 @@
|
|||||||
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;
|
|
||||||
import com.ics.service.IRepairService;
|
|
||||||
import com.ics.common.utils.DateUtils;
|
|
||||||
import com.ics.system.domain.Sn;
|
|
||||||
import com.ics.system.service.ICurrentUserService;
|
|
||||||
import com.ics.system.service.ISnService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 工单管理Service业务层处理
|
|
||||||
*
|
|
||||||
* @author ics
|
|
||||||
* @date 2021-03-25
|
|
||||||
*/
|
|
||||||
@Service("repairAppService")
|
|
||||||
public class RepairServiceImpl extends ServiceImpl<RepairMapper, Repair> implements IRepairService {
|
|
||||||
@Autowired
|
|
||||||
private RepairMapper repairMapper;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ISnService snService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IRepairLogService repairLogService;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询工单管理
|
|
||||||
*
|
|
||||||
* @param id 工单管理ID
|
|
||||||
* @return 工单管理
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public Repair selectRepairById(Long id) {
|
|
||||||
return repairMapper.selectRepairById(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增工单管理
|
|
||||||
*
|
|
||||||
* @param repair 工单管理
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public int insertRepair(Repair repair) {
|
|
||||||
// repair.setSn(snService.generate(Sn.Type.REPAIR));
|
|
||||||
// repair.setCreateTime(DateUtils.getNowDate());
|
|
||||||
// repair.setRepairTime(DateUtils.getNowDate());
|
|
||||||
// int result = repairMapper.insert(repair);
|
|
||||||
// // 增加报修日志
|
|
||||||
// RepairLog repairLog = new RepairLog();
|
|
||||||
// repairLog.setType(repair.getStatus());
|
|
||||||
// repairLog.setDetail(String.format("工单号:%s,已收到报修", repair.getSn()));
|
|
||||||
// repairLog.setRepairId(repair.getId());
|
|
||||||
// repairLog.setCreateBy(repair.getCreateBy());
|
|
||||||
// repairLog.setCreateTime(DateUtils.getNowDate());
|
|
||||||
// repairLog.setUpdateBy(repair.getCreateBy());
|
|
||||||
// repairLog.setUpdateTime(DateUtils.getNowDate());
|
|
||||||
// repairLog.setParkId(repair.getParkId());
|
|
||||||
// repairLog.setTenantId(repair.getTenantId());
|
|
||||||
// repairLogService.insertRepairLog(repairLog);
|
|
||||||
// return result;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改工单管理
|
|
||||||
*
|
|
||||||
* @param repair 工单管理
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int updateRepair(Repair repair) {
|
|
||||||
// 增加报修日志
|
|
||||||
// RepairLog repairLog = new RepairLog();
|
|
||||||
// repairLog.setType(repair.getStatus());
|
|
||||||
// repairLog.setDetail(repair.getStatus().getName());
|
|
||||||
// repairLog.setRepairId(repair.getId());
|
|
||||||
// repairLog.setCreateBy(repair.getUpdateBy());
|
|
||||||
// repairLog.setCreateTime(DateUtils.getNowDate());
|
|
||||||
// repairLog.setUpdateBy(repair.getUpdateBy());
|
|
||||||
// repairLog.setUpdateTime(DateUtils.getNowDate());
|
|
||||||
// repairLogService.insertRepairLog(repairLog);
|
|
||||||
// return repairMapper.updateById(repair);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询工单管理列表
|
|
||||||
*
|
|
||||||
* @param repair 工单管理
|
|
||||||
* @return 工单管理
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<Repair> selectMyRepairList(Repair repair) {
|
|
||||||
//return repairMapper.selectMyRepairList(repair);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Repair> selectByUserId(Long userId,Integer status) {
|
|
||||||
// LambdaQueryWrapper<Repair> wrapper = new LambdaQueryWrapper<>();
|
|
||||||
// wrapper.eq(Repair::getUserId, userId);
|
|
||||||
// wrapper.orderByAsc(Repair::getRepairTime);
|
|
||||||
// if (status != null && status != 0) {
|
|
||||||
// wrapper.eq(Repair::getStatus, status);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// return repairMapper.selectList(wrapper);
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
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, 2);
|
|
||||||
}else if (status == 1){
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
IPage<Repair> pages = new Page<>(pageNum,pageSize);
|
|
||||||
IPage<Repair> userIPage = baseMapper.selectPage(pages,wrapper);
|
|
||||||
return userIPage;
|
|
||||||
}
|
|
||||||
|
|
||||||
@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);
|
|
||||||
return null;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@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);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user