管理员统计功能
This commit is contained in:
parent
7dc148e5b2
commit
17cd3db1ea
@ -0,0 +1,53 @@
|
||||
package cn.iocoder.yudao.module.tickets.entity;
|
||||
|
||||
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
/**
|
||||
* 维修记录 DO
|
||||
*
|
||||
* @author lzt
|
||||
*/
|
||||
@TableName("dl_repair_records")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BaseRepairRecords extends TenantBaseDO {
|
||||
|
||||
/**
|
||||
* 主键标识
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_UUID)
|
||||
private String id;
|
||||
/**
|
||||
* 工单id
|
||||
*/
|
||||
private String ticketId;
|
||||
/**
|
||||
* 工单子表id
|
||||
*/
|
||||
private String repairItemId;
|
||||
/**
|
||||
* 记录类型(repair_records_type)
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 记录描述
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 处理人
|
||||
*/
|
||||
private String dealUserName;
|
||||
/**
|
||||
* 处理人员工表id
|
||||
*/
|
||||
private Long dealUserId;
|
||||
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package cn.iocoder.yudao.module.tickets.mapper;
|
||||
|
||||
import cn.iocoder.yudao.module.tickets.entity.BaseRepairRecords;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 维修记录 Mapper
|
||||
*
|
||||
* @author lzt
|
||||
*/
|
||||
@Mapper
|
||||
public interface BaseRepairRecordsMapper extends BaseMapper<BaseRepairRecords> {
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package cn.iocoder.yudao.module.tickets.service;
|
||||
|
||||
import cn.iocoder.yudao.module.tickets.entity.BaseRepairRecords;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* 维修记录 Service 接口
|
||||
*
|
||||
* @author lzt
|
||||
*/
|
||||
public interface BaseRepairRecordsService extends IService<BaseRepairRecords> {
|
||||
|
||||
/**
|
||||
* 保存维修记录
|
||||
*
|
||||
* @param ticketId 工单id
|
||||
// * @param repairItemId 工单子表id
|
||||
* @param type 工作类型(数据字典:repair_records_type;后端对应 RecordTypeEnum 枚举)
|
||||
* @param remark 备注
|
||||
* @param images 图片(相对路径按照“,”分隔)
|
||||
* @author PQZ
|
||||
* @date 14:51 2024/10/11
|
||||
**/
|
||||
void saveRepairRecord(String ticketId, String repairItemId, String type, String remark, String images);
|
||||
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.tickets.service.impl;
|
||||
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
||||
import cn.iocoder.yudao.module.tickets.entity.BaseRepairRecords;
|
||||
import cn.iocoder.yudao.module.tickets.mapper.BaseRepairRecordsMapper;
|
||||
import cn.iocoder.yudao.module.tickets.service.BaseRepairRecordsService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 维修记录 Service 实现类
|
||||
*
|
||||
* @author lzt
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class BaseRepairRecordsServiceImpl extends ServiceImpl<BaseRepairRecordsMapper, BaseRepairRecords> implements BaseRepairRecordsService {
|
||||
|
||||
@Resource
|
||||
private AdminUserApi userApi;
|
||||
|
||||
/**
|
||||
* 保存维修记录
|
||||
*
|
||||
* @param ticketId 工单id
|
||||
* @param repairItemId 工单子表id
|
||||
* @param type 工作类型(数据字典:repair_records_type;后端对应 RecordTypeEnum 枚举)
|
||||
* @param remark 备注
|
||||
* @param images 图片(相对路径按照“,”分隔)
|
||||
* @author PQZ
|
||||
* @date 14:51 2024/10/11
|
||||
**/
|
||||
@Override
|
||||
public void saveRepairRecord(String ticketId, String repairItemId, String type, String remark, String images) {
|
||||
//获取当前登录用户
|
||||
Long userId = SecurityFrameworkUtils.getLoginUserId();
|
||||
AdminUserRespDTO loginUser = userApi.getUser(userId);
|
||||
//初始化维修记录
|
||||
BaseRepairRecords repairRecords = new BaseRepairRecords();
|
||||
repairRecords.setTicketId(ticketId);
|
||||
repairRecords.setRepairItemId(repairItemId);
|
||||
repairRecords.setType(type);
|
||||
repairRecords.setRemark(remark);
|
||||
repairRecords.setDealUserId(loginUser.getId());
|
||||
repairRecords.setDealUserName(loginUser.getNickname());
|
||||
//保存维修记录
|
||||
save(repairRecords);
|
||||
}
|
||||
|
||||
}
|
@ -2,9 +2,11 @@ package cn.iocoder.yudao.module.tickets.service.impl;
|
||||
|
||||
import cn.iocoder.yudao.module.tickets.entity.Tickets;
|
||||
import cn.iocoder.yudao.module.tickets.mapper.TicketsMapper;
|
||||
import cn.iocoder.yudao.module.tickets.service.BaseRepairRecordsService;
|
||||
import cn.iocoder.yudao.module.tickets.service.TicketsService;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
@ -15,6 +17,8 @@ import java.util.List;
|
||||
**/
|
||||
@Service
|
||||
public class TicketsServiceImpl extends ServiceImpl<TicketsMapper, Tickets> implements TicketsService {
|
||||
@Autowired
|
||||
private BaseRepairRecordsService baseRepairRecordsService;
|
||||
|
||||
/**
|
||||
* 更新工单状态为已结账
|
||||
@ -32,5 +36,9 @@ public class TicketsServiceImpl extends ServiceImpl<TicketsMapper, Tickets> impl
|
||||
// 不在这儿结束
|
||||
// .set(Tickets::getIsFinish, "1")
|
||||
);
|
||||
// 记录日志
|
||||
if(!ticketIds.isEmpty()){
|
||||
baseRepairRecordsService.saveRepairRecord(ticketIds.get(0), null, "js", "线上支付结算", null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -459,6 +459,8 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
|
||||
repairOrderInfo.setOrderStatus("1");
|
||||
}
|
||||
repairOrderInfoService.updateById(repairOrderInfo);
|
||||
// 记录日志
|
||||
repairRecordsService.saveRepairRecord(one.getGoodsId(), null, RecordTypeEnum.JS.getCode(), "线下支付结算", null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user