mirror of
https://gitee.com/elegant_wings/dbd-meeting.git
synced 2025-06-21 17:09:36 +08:00
附件 扩展类型字段
This commit is contained in:
parent
20ef56dd8a
commit
60722ba5e7
@ -36,7 +36,7 @@ public class RepairAttachController extends BaseController {
|
|||||||
private DfsConfig dfsConfig;
|
private DfsConfig dfsConfig;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保修上传语音
|
* 报修上传语音
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions(value = {"repair:attach:operator", "member:center:view"}, logical = Logical.OR)
|
@RequiresPermissions(value = {"repair:attach:operator", "member:center:view"}, logical = Logical.OR)
|
||||||
@PostMapping("upload/voice")
|
@PostMapping("upload/voice")
|
||||||
@ -45,7 +45,7 @@ public class RepairAttachController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保修上传图片视频
|
* 报修上传图片视频
|
||||||
*
|
*
|
||||||
* @param file
|
* @param file
|
||||||
* @param repairId 工单id
|
* @param repairId 工单id
|
||||||
@ -81,6 +81,7 @@ public class RepairAttachController extends BaseController {
|
|||||||
// 上传并返回新文件名称
|
// 上传并返回新文件名称
|
||||||
String url = FileUploadUtils.upload(filePath, file);
|
String url = FileUploadUtils.upload(filePath, file);
|
||||||
RepairAttach repairAttach = new RepairAttach();
|
RepairAttach repairAttach = new RepairAttach();
|
||||||
|
repairAttach.setTypeId(0);
|
||||||
repairAttach.setRepairId(repairId);
|
repairAttach.setRepairId(repairId);
|
||||||
repairAttach.setNodeId(nodeId);
|
repairAttach.setNodeId(nodeId);
|
||||||
repairAttach.setOriginalFilename(originalFilename);
|
repairAttach.setOriginalFilename(originalFilename);
|
||||||
|
@ -201,7 +201,7 @@ public class RepairController extends BaseController {
|
|||||||
public R get(@RequestBody Map<String, Long> map) {
|
public R get(@RequestBody Map<String, Long> map) {
|
||||||
Long id = map.get("id");
|
Long id = map.get("id");
|
||||||
Repair repair = repairService.selectRepairById(id);
|
Repair repair = repairService.selectRepairById(id);
|
||||||
Map<String, Object> files=repairAttachService.getAttachMapbyRepairId(id);
|
Map<String, Object> files=repairAttachService.getAttachMapbyRepairId(id,0);
|
||||||
List<RepairLog> logList = repairLogService.selectRepairLogListByRepairId(id);
|
List<RepairLog> logList = repairLogService.selectRepairLogListByRepairId(id);
|
||||||
return R.ok().put("repair", repair)
|
return R.ok().put("repair", repair)
|
||||||
.put("files", files)
|
.put("files", files)
|
||||||
|
@ -14,6 +14,12 @@ import lombok.Data;
|
|||||||
@TableName("ics_repair_attach")
|
@TableName("ics_repair_attach")
|
||||||
public class RepairAttach extends BaseEntity<RepairAttach> {
|
public class RepairAttach extends BaseEntity<RepairAttach> {
|
||||||
private static final long serialVersionUID = -202408082136L;
|
private static final long serialVersionUID = -202408082136L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 附件类型 0,工单附件,1,会议预约附件
|
||||||
|
*/
|
||||||
|
private Integer typeId = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工单id
|
* 工单id
|
||||||
*/
|
*/
|
||||||
|
@ -18,7 +18,7 @@ public class RepairRemind extends BaseEntity<RepairRemind> {
|
|||||||
private static final long serialVersionUID = -202408172114L;
|
private static final long serialVersionUID = -202408172114L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提醒类型
|
* 提醒类型 0,工单提醒,1,会议预约提醒
|
||||||
*/
|
*/
|
||||||
private Integer typeId;
|
private Integer typeId;
|
||||||
|
|
||||||
|
@ -30,14 +30,14 @@ public interface RepairAttachMapper {
|
|||||||
* @param repairId 工单id
|
* @param repairId 工单id
|
||||||
* @return 附件集合
|
* @return 附件集合
|
||||||
*/
|
*/
|
||||||
List<RepairAttach> selectRepairAttachList(@Param("repairId") Long repairId);
|
List<RepairAttach> selectRepairAttachList(@Param("repairId") Long repairId, @Param("typeId") Integer typeId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取工单报修的第一张图片url
|
* 获取工单报修的第一张图片url
|
||||||
* @param repairId 工单id
|
* @param repairId 工单id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
String getRepairFirstImg(@Param("repairId") Long repairId);
|
String getRepairFirstImg(@Param("repairId") Long repairId, @Param("typeId") Integer typeId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增附件
|
* 新增附件
|
||||||
@ -54,7 +54,7 @@ public interface RepairAttachMapper {
|
|||||||
* @param ids 附件id数组
|
* @param ids 附件id数组
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
int updateRepairAttachs(@Param("repairId") Long repairId, @Param("ids") String[] ids);
|
int updateRepairAttachs(@Param("repairId") Long repairId, @Param("typeId") Integer typeId, @Param("ids") String[] ids);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除工单附件
|
* 删除工单附件
|
||||||
@ -62,7 +62,7 @@ public interface RepairAttachMapper {
|
|||||||
* @param repairId 工单ID
|
* @param repairId 工单ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
int deleteByRepairId(Long repairId);
|
int deleteByRepairId(@Param("repairId") Long repairId, @Param("typeId") Integer typeId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除附件
|
* 删除附件
|
||||||
|
@ -34,7 +34,7 @@ public interface IRepairAttachService {
|
|||||||
* @param repairId 工单id
|
* @param repairId 工单id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int updateRepairAttach(long repairId, String[] ids);
|
int updateRepairAttach(long repairId, Integer typeId, String[] ids);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询工单所有附件
|
* 查询工单所有附件
|
||||||
@ -42,7 +42,7 @@ public interface IRepairAttachService {
|
|||||||
* @param repairId 工单id
|
* @param repairId 工单id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<RepairAttach> getListByRepair(Long repairId);
|
List<RepairAttach> getListByRepair(Long repairId, Integer typeId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询工单所有附件,并分类组合成map
|
* 查询工单所有附件,并分类组合成map
|
||||||
@ -50,7 +50,7 @@ public interface IRepairAttachService {
|
|||||||
* @param repairId 工单id
|
* @param repairId 工单id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Map<String, Object> getAttachMapbyRepairId(Long repairId);
|
Map<String, Object> getAttachMapbyRepairId(Long repairId, Integer typeId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除工单附件
|
* 删除工单附件
|
||||||
@ -58,7 +58,7 @@ public interface IRepairAttachService {
|
|||||||
* @param repairId
|
* @param repairId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int deleteByRepairId(long repairId);
|
int deleteByRepairId(long repairId, Integer typeId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除附件信息
|
* 删除附件信息
|
||||||
|
@ -38,19 +38,19 @@ public class RepairAttachServiceImpl implements IRepairAttachService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int updateRepairAttach(long repairId, String[] ids) {
|
public int updateRepairAttach(long repairId, Integer typeId, String[] ids) {
|
||||||
return repairAttachMapper.updateRepairAttachs(repairId, ids);
|
return repairAttachMapper.updateRepairAttachs(repairId, typeId, ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<RepairAttach> getListByRepair(Long repairId) {
|
public List<RepairAttach> getListByRepair(Long repairId, Integer typeId) {
|
||||||
return repairAttachMapper.selectRepairAttachList(repairId);
|
return repairAttachMapper.selectRepairAttachList(repairId, typeId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> getAttachMapbyRepairId(Long repairId) {
|
public Map<String, Object> getAttachMapbyRepairId(Long repairId, Integer typeId) {
|
||||||
List<RepairAttach> list =repairAttachMapper.selectRepairAttachList(repairId);
|
List<RepairAttach> list = repairAttachMapper.selectRepairAttachList(repairId, typeId);
|
||||||
List<RepairAttachVO> voices = new ArrayList<>();
|
List<RepairAttachVO> voices = new ArrayList<>();
|
||||||
List<RepairAttachVO> repairs = new ArrayList<>();
|
List<RepairAttachVO> repairs = new ArrayList<>();
|
||||||
List<RepairAttachVO> feedbacks = new ArrayList<>();
|
List<RepairAttachVO> feedbacks = new ArrayList<>();
|
||||||
@ -73,12 +73,12 @@ public class RepairAttachServiceImpl implements IRepairAttachService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int deleteByRepairId(long repairId) {
|
public int deleteByRepairId(long repairId, Integer typeId) {
|
||||||
List<RepairAttach> list = repairAttachMapper.selectRepairAttachList(repairId);
|
List<RepairAttach> list = repairAttachMapper.selectRepairAttachList(repairId, typeId);
|
||||||
for (RepairAttach repairAttach : list) {
|
for (RepairAttach repairAttach : list) {
|
||||||
deleteFile(repairAttach.getUrl());
|
deleteFile(repairAttach.getUrl());
|
||||||
}
|
}
|
||||||
return repairAttachMapper.deleteByRepairId(repairId);
|
return repairAttachMapper.deleteByRepairId(repairId, typeId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -295,7 +295,7 @@ public class RepairServiceImpl implements IRepairService {
|
|||||||
RepairLog oldLog = null;
|
RepairLog oldLog = null;
|
||||||
if (from == 0) {
|
if (from == 0) {
|
||||||
repairMapper.insertRepair(repair);
|
repairMapper.insertRepair(repair);
|
||||||
if (files != null && files.length > 0) repairAttachMapper.updateRepairAttachs(repair.getId(), files);//处理附件
|
if (files != null && files.length > 0) repairAttachMapper.updateRepairAttachs(repair.getId(),0,files);//处理附件
|
||||||
//处理工单提醒--start
|
//处理工单提醒--start
|
||||||
for (RepairRemind repairRemind : rList) {
|
for (RepairRemind repairRemind : rList) {
|
||||||
repairRemind.setRepairId(repair.getId());
|
repairRemind.setRepairId(repair.getId());
|
||||||
@ -391,7 +391,7 @@ public class RepairServiceImpl implements IRepairService {
|
|||||||
IcsCustomerStaff evalUser = customerStaffMapper.selectIcsCustomerStaffById(repair.getEvalUserId());
|
IcsCustomerStaff evalUser = customerStaffMapper.selectIcsCustomerStaffById(repair.getEvalUserId());
|
||||||
repair.setEvalUserName(evalUser.getUsername());
|
repair.setEvalUserName(evalUser.getUsername());
|
||||||
}
|
}
|
||||||
String url = repairAttachMapper.getRepairFirstImg(repair.getId());
|
String url = repairAttachMapper.getRepairFirstImg(repair.getId(),0);
|
||||||
repair.setExt1(url);
|
repair.setExt1(url);
|
||||||
IcsCustomerStaff createUser = customerStaffMapper.selectIcsCustomerStaffById(Long.valueOf(repair.getCreateBy()));
|
IcsCustomerStaff createUser = customerStaffMapper.selectIcsCustomerStaffById(Long.valueOf(repair.getCreateBy()));
|
||||||
repair.setExt2(createUser.getUsername());
|
repair.setExt2(createUser.getUsername());
|
||||||
@ -444,7 +444,7 @@ public class RepairServiceImpl implements IRepairService {
|
|||||||
@Override
|
@Override
|
||||||
public int deleteRepairById(Long id) {
|
public int deleteRepairById(Long id) {
|
||||||
//删除附件
|
//删除附件
|
||||||
repairAttachService.deleteByRepairId(id);
|
repairAttachService.deleteByRepairId(id,0);
|
||||||
//删除日志
|
//删除日志
|
||||||
repairLogMapper.deleteRepairLogByRId(id);
|
repairLogMapper.deleteRepairLogByRId(id);
|
||||||
return repairMapper.deleteRepairById(id);
|
return repairMapper.deleteRepairById(id);
|
||||||
@ -456,7 +456,7 @@ public class RepairServiceImpl implements IRepairService {
|
|||||||
String[] idsArray = StrUtil.split(ids, ",");
|
String[] idsArray = StrUtil.split(ids, ",");
|
||||||
for (int i = 0; i < idsArray.length; i++) {
|
for (int i = 0; i < idsArray.length; i++) {
|
||||||
Long id = Long.valueOf(idsArray[0]);
|
Long id = Long.valueOf(idsArray[0]);
|
||||||
repairAttachService.deleteByRepairId(id);
|
repairAttachService.deleteByRepairId(id,0);
|
||||||
//删除日志
|
//删除日志
|
||||||
repairLogMapper.deleteRepairLogByRId(id);
|
repairLogMapper.deleteRepairLogByRId(id);
|
||||||
repairMapper.deleteRepairById(id);
|
repairMapper.deleteRepairById(id);
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
<resultMap type="com.ics.admin.domain.RepairAttach" id="RepairAttachResult">
|
<resultMap type="com.ics.admin.domain.RepairAttach" id="RepairAttachResult">
|
||||||
<result property="id" column="id"/>
|
<result property="id" column="id"/>
|
||||||
|
<result property="typeId" column="type_id" />
|
||||||
<result property="repairId" column="repair_id"/>
|
<result property="repairId" column="repair_id"/>
|
||||||
<result property="nodeId" column="node_id"/>
|
<result property="nodeId" column="node_id"/>
|
||||||
<result property="originalFilename" column="original_filename"/>
|
<result property="originalFilename" column="original_filename"/>
|
||||||
@ -26,6 +27,7 @@
|
|||||||
|
|
||||||
<sql id="selectRepairAttachVo">
|
<sql id="selectRepairAttachVo">
|
||||||
SELECT id,
|
SELECT id,
|
||||||
|
type_id,
|
||||||
repair_id,
|
repair_id,
|
||||||
node_id,
|
node_id,
|
||||||
original_filename,
|
original_filename,
|
||||||
@ -50,18 +52,19 @@
|
|||||||
WHERE id = #{id} and delete_flag = 0
|
WHERE id = #{id} and delete_flag = 0
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectRepairAttachList" parameterType="Long" resultMap="RepairAttachResult">
|
<select id="selectRepairAttachList" resultMap="RepairAttachResult">
|
||||||
<include refid="selectRepairAttachVo"/>
|
<include refid="selectRepairAttachVo"/>
|
||||||
where repair_id= #{repairId} and delete_flag = 0
|
where repair_id= #{repairId} and type_id = #{typeId} and delete_flag = 0
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getRepairFirstImg" parameterType="Long" resultType="String">
|
<select id="getRepairFirstImg" resultType="String">
|
||||||
select url from ics_repair_attach where repair_id=#{repairId} and node_id=1 and delete_flag=0 and ext1='img' order by id limit 1
|
select url from ics_repair_attach where repair_id=#{repairId} and node_id=1 and type_id = #{typeId} and delete_flag=0 and ext1='img' order by id limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertRepairAttach" parameterType="com.ics.admin.domain.RepairAttach" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertRepairAttach" parameterType="com.ics.admin.domain.RepairAttach" useGeneratedKeys="true" keyProperty="id">
|
||||||
INSERT INTO ics_repair_attach
|
INSERT INTO ics_repair_attach
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="typeId != null ">type_id,</if>
|
||||||
<if test="repairId != null ">repair_id,</if>
|
<if test="repairId != null ">repair_id,</if>
|
||||||
<if test="nodeId != null ">node_id,</if>
|
<if test="nodeId != null ">node_id,</if>
|
||||||
<if test="originalFilename != null and originalFilename != ''">original_filename,</if>
|
<if test="originalFilename != null and originalFilename != ''">original_filename,</if>
|
||||||
@ -79,6 +82,7 @@
|
|||||||
</trim>
|
</trim>
|
||||||
|
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="typeId != null ">#{typeId},</if>
|
||||||
<if test="repairId != null ">#{repairId},</if>
|
<if test="repairId != null ">#{repairId},</if>
|
||||||
<if test="nodeId != null ">#{nodeId},</if>
|
<if test="nodeId != null ">#{nodeId},</if>
|
||||||
<if test="originalFilename != null and originalFilename != ''">#{originalFilename},</if>
|
<if test="originalFilename != null and originalFilename != ''">#{originalFilename},</if>
|
||||||
@ -97,16 +101,16 @@
|
|||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<update id="updateRepairAttachs">
|
<update id="updateRepairAttachs">
|
||||||
UPDATE ics_repair_attach set repair_id= #{repairId} where id in
|
UPDATE ics_repair_attach set repair_id= #{repairId} where type_id = #{typeId} and id in
|
||||||
<foreach item="id" collection="ids" open="(" separator="," close=")">
|
<foreach item="id" collection="ids" open="(" separator="," close=")">
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<delete id="deleteByRepairId" parameterType="Long">
|
<delete id="deleteByRepairId">
|
||||||
DELETE
|
DELETE
|
||||||
FROM ics_repair_attach
|
FROM ics_repair_attach
|
||||||
WHERE repair_id = #{repairId}
|
WHERE repair_id = #{repairId} and type_id = #{typeId}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<delete id="deleteRepairAttachById" parameterType="Long">
|
<delete id="deleteRepairAttachById" parameterType="Long">
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<resultMap type="com.ics.admin.domain.RepairRemind" id="RepairRemindResult">
|
<resultMap type="com.ics.admin.domain.RepairRemind" id="RepairRemindResult">
|
||||||
<result property="id" column="id" />
|
<result property="id" column="id" />
|
||||||
<result property="typeId" column="type_id" />
|
<result property="typeId" column="type_id"/>
|
||||||
<result property="repairId" column="repair_id" />
|
<result property="repairId" column="repair_id" />
|
||||||
<result property="userId" column="user_id" />
|
<result property="userId" column="user_id" />
|
||||||
<result property="content" column="content" />
|
<result property="content" column="content" />
|
||||||
|
@ -22,6 +22,6 @@ public class RepairRemindPushTask {
|
|||||||
public void remindPush() {
|
public void remindPush() {
|
||||||
RepairRemindPushService repairRemindPushService = SpringUtils.getBean(RepairRemindPushService.class);
|
RepairRemindPushService repairRemindPushService = SpringUtils.getBean(RepairRemindPushService.class);
|
||||||
int num = repairRemindPushService.pushWxTemplateMsg();
|
int num = repairRemindPushService.pushWxTemplateMsg();
|
||||||
log.info("推送公众号" + num + "个工单提醒");
|
log.info("推送公众号" + num + "个提醒");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user