Merge branch 'repair' of http://122.51.230.86:3000/dianliang/lanan-system into repair
This commit is contained in:
commit
bb6ee4618f
@ -141,7 +141,7 @@ public class AppSwiperController extends BaseController
|
||||
{
|
||||
LambdaQueryWrapper<ShopMallPartners> queryWrapper =new LambdaQueryWrapper<>();
|
||||
LoginUser user = SecurityFrameworkUtils.getLoginUser();
|
||||
queryWrapper.eq(ShopMallPartners::getUserId,user.getId()).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0");
|
||||
queryWrapper.orderByAsc(ShopMallPartners::getPartnerId).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0").last("limit 1");
|
||||
ShopMallPartners partner = partnersService.getOne(queryWrapper);
|
||||
if (ObjectUtil.isEmpty(partner)){
|
||||
return error("信息有误");
|
||||
|
@ -9,7 +9,11 @@ import javax.websocket.*;
|
||||
import javax.websocket.server.PathParam;
|
||||
import javax.websocket.server.ServerEndpoint;
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.BlockingQueue;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
|
||||
|
||||
/**`1
|
||||
@ -88,12 +92,36 @@ public class InspectionSocket {
|
||||
* 发送给指定的用户
|
||||
* @param message
|
||||
*/
|
||||
public void sendMessage(String message, String userId) throws IOException {
|
||||
if (sessionMap.containsKey(userId)){
|
||||
private final Map<String, BlockingQueue<String>> messageQueueMap = new ConcurrentHashMap<>();
|
||||
|
||||
public void sendMessage(String message, String userId) {
|
||||
if (sessionMap.containsKey(userId)) {
|
||||
Session session = sessionMap.get(userId);
|
||||
session.getAsyncRemote().sendText(message);
|
||||
messageQueueMap.putIfAbsent(userId, new LinkedBlockingQueue<>());
|
||||
|
||||
// 将消息加入用户的队列
|
||||
messageQueueMap.get(userId).offer(message);
|
||||
|
||||
// 异步处理消息队列
|
||||
processQueue(session, userId);
|
||||
}
|
||||
}
|
||||
|
||||
private void processQueue(Session session, String userId) {
|
||||
BlockingQueue<String> queue = messageQueueMap.get(userId);
|
||||
|
||||
CompletableFuture.runAsync(() -> {
|
||||
String nextMessage;
|
||||
while ((nextMessage = queue.poll()) != null) {
|
||||
session.getAsyncRemote().sendText(nextMessage, result -> {
|
||||
if (!result.isOK()) {
|
||||
System.err.println("Message sending failed for user: " + userId);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.inspection.controller;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.inspection.service.AppInspectionPartnerService;
|
||||
import cn.iocoder.yudao.module.shop.entity.ShopMallPartners;
|
||||
@ -43,6 +44,10 @@ public class InspectionEquInfoController extends BaseController
|
||||
public CommonResult list(Integer pageNum,Integer pageSize,InspectionEquInfo inspectionEquInfo) throws Exception {
|
||||
|
||||
Page page =new Page(pageNum,pageSize);
|
||||
if (ObjectUtil.isNull(inspectionEquInfo.getPartnerId())) {
|
||||
ShopMallPartners partners = partnerService.shopInfoByUserId();
|
||||
inspectionEquInfo.setPartnerId(partners.getPartnerId());
|
||||
}
|
||||
IPage<InspectionEquInfo> list = inspectionEquInfoService.selectInspectionEquInfoList(page,inspectionEquInfo);
|
||||
return success(list);
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ public class InspectionInfoController extends BaseController {
|
||||
/**
|
||||
* 获取【请填写功能名称】详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:info:query')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:info:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public CommonResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(inspectionInfoService.selectInspectionInfoById(id));
|
||||
@ -92,6 +92,10 @@ public class InspectionInfoController extends BaseController {
|
||||
public CommonResult edit(@RequestBody InspectionInfo inspectionInfo) throws Exception {
|
||||
return toAjax(inspectionInfoService.updateInspectionInfo(inspectionInfo));
|
||||
}
|
||||
@PostMapping("/updateLeadMan")
|
||||
public CommonResult updateLeadMan(@RequestBody InspectionInfo inspectionInfo){
|
||||
return toAjax(inspectionInfoService.updateLeadMan(inspectionInfo));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/del")
|
||||
@ -137,6 +141,19 @@ public class InspectionInfoController extends BaseController {
|
||||
return success("接单成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 员工取消接单
|
||||
*
|
||||
* @param inspectionId 工单id
|
||||
* @param workNodeId 节点id (geStelectInspection这个方法中返回了)
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("cancelAnOrder")
|
||||
public CommonResult cancelAnOrder(Integer inspectionId, String workNodeId) {
|
||||
inspectionWorkNodeService.cancelAnOrder(inspectionId, workNodeId);
|
||||
return success("接单成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 项目操作(退办理、重审、项目完成)
|
||||
*
|
||||
@ -229,4 +246,24 @@ public class InspectionInfoController extends BaseController {
|
||||
inspectionWorkNode.setDealUserId(loginUser.getId());
|
||||
return success(inspectionWorkNodeService.getRoyaltySum(inspectionWorkNode));
|
||||
}
|
||||
|
||||
/**
|
||||
* 重新审核
|
||||
* @param inspectionWorkNode
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("recheck")
|
||||
public CommonResult recheck(@RequestBody InspectionWorkNode inspectionWorkNode){
|
||||
inspectionWorkNodeService.recheck(inspectionWorkNode);
|
||||
return success("操作成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断当前登陆人是否有重检、重审、退办理的权限(app)
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("isExamine")
|
||||
public CommonResult isExamine(){
|
||||
return success(inspectionInfoService.isExamine());
|
||||
}
|
||||
}
|
||||
|
@ -117,7 +117,7 @@ public class InspectionMallPartnersController extends BaseController {
|
||||
ShopMallPartners partner = new ShopMallPartners();
|
||||
if (roles.contains("jcshop")){
|
||||
LambdaQueryWrapper<ShopMallPartners> queryWrapper =new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ShopMallPartners::getUserId,user.getId()).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0");
|
||||
queryWrapper.orderByAsc(ShopMallPartners::getPartnerId).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0").last("limit 1");
|
||||
partner = shopMallPartnersService.getOne(queryWrapper);
|
||||
if (ObjectUtil.isEmpty(partner)){
|
||||
return error();
|
||||
@ -150,7 +150,7 @@ public class InspectionMallPartnersController extends BaseController {
|
||||
ShopMallPartners partner = new ShopMallPartners();
|
||||
if (roles.contains("jcshop")){
|
||||
LambdaQueryWrapper<ShopMallPartners> queryWrapper =new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ShopMallPartners::getUserId,user.getId()).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0");
|
||||
queryWrapper.orderByAsc(ShopMallPartners::getPartnerId).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0").last("limit 1");
|
||||
partner = shopMallPartnersService.getOne(queryWrapper);
|
||||
if (ObjectUtil.isEmpty(partner)){
|
||||
return error();
|
||||
@ -183,7 +183,7 @@ public class InspectionMallPartnersController extends BaseController {
|
||||
ShopMallPartners partner = new ShopMallPartners();
|
||||
if (roles.contains("jcshop")){
|
||||
LambdaQueryWrapper<ShopMallPartners> queryWrapper =new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ShopMallPartners::getUserId,user.getId()).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0");
|
||||
queryWrapper.orderByAsc(ShopMallPartners::getPartnerId).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0").last("limit 1");
|
||||
partner = shopMallPartnersService.getOne(queryWrapper);
|
||||
if (ObjectUtil.isEmpty(partner)){
|
||||
return;
|
||||
@ -270,7 +270,7 @@ public class InspectionMallPartnersController extends BaseController {
|
||||
ShopMallPartners partner = new ShopMallPartners();
|
||||
if (roles.contains("jcshop")){
|
||||
LambdaQueryWrapper<ShopMallPartners> queryWrapper =new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ShopMallPartners::getUserId,user.getId()).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0");
|
||||
queryWrapper.orderByAsc(ShopMallPartners::getPartnerId).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0").last("limit 1");
|
||||
partner = shopMallPartnersService.getOne(queryWrapper);
|
||||
if (ObjectUtil.isEmpty(partner)){
|
||||
return CommonResult.error(-1,"信息有误");
|
||||
|
@ -159,8 +159,10 @@ public class PartnerOwnController extends BaseController {
|
||||
* 检测线图
|
||||
*/
|
||||
@GetMapping("/chartInfoRatio")
|
||||
public CommonResult chartInfoRatio(Long partnerId,String unit)
|
||||
{
|
||||
public CommonResult chartInfoRatio(Long partnerId,String unit) throws Exception {
|
||||
if (ObjectUtil.isNull(partnerId)) {
|
||||
partnerId = partnerList.shopInfoByUserId().getPartnerId();
|
||||
}
|
||||
return success(partnerList.chartInfoRatio(partnerId, unit));
|
||||
}
|
||||
/**
|
||||
@ -539,8 +541,9 @@ public class PartnerOwnController extends BaseController {
|
||||
@RequestParam(value = "pageNum" ,required = false ,defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(value ="pageSize" ,required = false ,defaultValue = "10") Integer pageSize) {
|
||||
LoginUser user = SecurityFrameworkUtils.getLoginUser();
|
||||
// .eq(PartnerWorker::getUserId,user.getId())
|
||||
LambdaQueryWrapper<PartnerWorker> queryWrapper =new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(PartnerWorker::getUserId,user.getId()).eq(PartnerWorker::getPartnerId,partnerId);
|
||||
queryWrapper.eq(PartnerWorker::getPartnerId,partnerId);
|
||||
PartnerWorker worker = partnerWorkerService.getOne(queryWrapper);
|
||||
if (ObjectUtil.isEmpty(worker)){
|
||||
return null;
|
||||
@ -600,6 +603,12 @@ public class PartnerOwnController extends BaseController {
|
||||
dictDataService.deleteDictData(dictId);
|
||||
return success();
|
||||
}
|
||||
//批量删除客户来源
|
||||
@PostMapping("/delCustomerSourceBatch")
|
||||
public CommonResult delCustomerSourceBatch(@RequestBody List<Long> dictIds){
|
||||
dictDataService.deleteDictDataBatch(dictIds);
|
||||
return success();
|
||||
}
|
||||
|
||||
@PostMapping("/vehicleLicenseOCR")
|
||||
public CommonResult vehicleLicenseOCR(String imagePath) throws Exception
|
||||
|
@ -186,7 +186,7 @@ public class ShopInspectionGoodsController extends BaseController
|
||||
ShopMallPartners partner = new ShopMallPartners();
|
||||
if (roles.contains("jcshop")){
|
||||
LambdaQueryWrapper<ShopMallPartners> queryWrapper =new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ShopMallPartners::getUserId,user.getId()).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0");
|
||||
queryWrapper.orderByAsc(ShopMallPartners::getPartnerId).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0").last("limit 1");
|
||||
partner = appInspectionPartnerService.getOne(queryWrapper);
|
||||
if (ObjectUtil.isEmpty(partner)){
|
||||
return error();
|
||||
|
@ -69,12 +69,12 @@ public class InspectionInfo extends TenantBaseDO
|
||||
private String status;
|
||||
|
||||
/** 开始时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT+8")
|
||||
@Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm")
|
||||
private Date startTime;
|
||||
|
||||
/** 结束时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT+8")
|
||||
@Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm")
|
||||
private Date endTime;
|
||||
//是否制证并完成
|
||||
@ -161,4 +161,8 @@ public class InspectionInfo extends TenantBaseDO
|
||||
private String workNodeStatus;
|
||||
@TableField(exist = false)
|
||||
private String selectType;
|
||||
@TableField(exist = false)
|
||||
private String projectName;
|
||||
@TableField(exist = false)
|
||||
private String leadManName;
|
||||
}
|
||||
|
@ -40,6 +40,8 @@ public class InspectionStepInfo extends Model<InspectionStepInfo> {
|
||||
private Date updateTime;
|
||||
//更新人id
|
||||
private Integer updater;
|
||||
//检测节点id
|
||||
private String workNodeId;
|
||||
@TableField(exist = false)
|
||||
private String nickname;
|
||||
}
|
||||
|
@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
@ -98,4 +100,7 @@ public class InspectionWorkNode extends TenantBaseDO {
|
||||
private String rescueStart;
|
||||
@TableField(exist = false)
|
||||
private String rescueEnd;
|
||||
/*重检或复检时需要传*/
|
||||
@TableField(exist = false)
|
||||
private List<InspectionWorkNode> workNodes;
|
||||
}
|
||||
|
@ -29,4 +29,12 @@ public interface InspectionWorkNodeMapper extends BaseMapper<InspectionWorkNode>
|
||||
|
||||
IPage<Map> getRoyaltyList(@Param("page")IPage page,@Param("inspectionWorkNode") InspectionWorkNode inspectionWorkNode);
|
||||
Map getRoyaltySum(@Param("inspectionWorkNode") InspectionWorkNode inspectionWorkNode);
|
||||
|
||||
void cancelAnOrder(InspectionWorkNode workNode);
|
||||
|
||||
/**
|
||||
* 批量修改检测状态
|
||||
* @param workNodes
|
||||
*/
|
||||
void recheck(@Param("list") List<InspectionWorkNode> workNodes);
|
||||
}
|
||||
|
@ -49,6 +49,13 @@ public interface IInspectionInfoService extends IService<InspectionInfo>
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateInspectionInfo(InspectionInfo inspectionInfo) throws Exception;
|
||||
/**
|
||||
* 修改引车员
|
||||
*
|
||||
* @param inspectionInfo 【请填写功能名称】
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateLeadMan(InspectionInfo inspectionInfo);
|
||||
|
||||
/**
|
||||
* 批量删除【请填写功能名称】
|
||||
@ -96,4 +103,10 @@ public interface IInspectionInfoService extends IService<InspectionInfo>
|
||||
* @return
|
||||
*/
|
||||
List<InspectionWorkNode> getWeorkNodesById(Integer inspectionId);
|
||||
|
||||
/**
|
||||
* 判断app当前检测人是否有审核权限
|
||||
* @return
|
||||
*/
|
||||
Boolean isExamine();
|
||||
}
|
||||
|
@ -23,6 +23,13 @@ public interface IInspectionWorkNodeService extends IService<InspectionWorkNode>
|
||||
*/
|
||||
void updateInspectionWorkNode(Integer inspectionId, String workNodeId);
|
||||
|
||||
/**
|
||||
* 员工取消接单
|
||||
* @param inspectionId
|
||||
* @param workNodeId
|
||||
*/
|
||||
void cancelAnOrder(Integer inspectionId, String workNodeId);
|
||||
|
||||
/**
|
||||
* 更新流程图片 步骤信息
|
||||
* @param inspectionWorkNode
|
||||
@ -47,4 +54,10 @@ public interface IInspectionWorkNodeService extends IService<InspectionWorkNode>
|
||||
IPage<Map> getRoyaltyList(IPage page, InspectionWorkNode inspectionWorkNode);
|
||||
|
||||
Map getRoyaltySum(InspectionWorkNode inspectionWorkNode);
|
||||
|
||||
/**
|
||||
* 重新检测
|
||||
* @param workNodes
|
||||
*/
|
||||
void recheck(InspectionWorkNode workNodes);
|
||||
}
|
||||
|
@ -119,6 +119,8 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
|
||||
private RoleService roleService;
|
||||
@Autowired
|
||||
private AdminUserService adminUserService;
|
||||
@Autowired
|
||||
private IInspectionWorkNodeService inspectionWorkNodeService;
|
||||
|
||||
@Override
|
||||
public IPage<PartnerListVo> partnerList(Page<PartnerListVo> page, PartnerListQuery partnerListQuery) {
|
||||
@ -174,7 +176,7 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
|
||||
ShopMallPartners partner = new ShopMallPartners();
|
||||
if (roles.contains("jcshop")){
|
||||
LambdaQueryWrapper<ShopMallPartners> queryWrapper =new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ShopMallPartners::getUserId,user.getId()).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0");
|
||||
queryWrapper.orderByAsc(ShopMallPartners::getPartnerId).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0").last("limit 1");
|
||||
partner = this.getOne(queryWrapper);
|
||||
if (ObjectUtil.isEmpty(partner)){
|
||||
throw new Exception("信息有误");
|
||||
@ -182,6 +184,8 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
|
||||
}else if (roles.contains("jcworker")){
|
||||
LambdaQueryWrapper<PartnerWorker> queryWrapperWork =new LambdaQueryWrapper<>();
|
||||
queryWrapperWork.eq(PartnerWorker::getUserId,user.getId());
|
||||
queryWrapperWork.orderByAsc(PartnerWorker::getPartnerId);
|
||||
queryWrapperWork.last("limit 1");
|
||||
PartnerWorker worker = partnerWorkerService.getOne(queryWrapperWork);
|
||||
if (ObjectUtil.isEmpty(worker)){
|
||||
throw new Exception("信息有误");
|
||||
@ -1465,6 +1469,7 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
|
||||
if (ObjectUtil.isNotNull(info.getLeadManId())){
|
||||
AdminUserDO leadMan = adminUserService.getById(info.getLeadManId());
|
||||
res.setLeadManName(leadMan.getNickname());
|
||||
res.setLeadManId(info.getLeadManId());
|
||||
}else {
|
||||
res.setLeadManName("");
|
||||
}
|
||||
@ -1495,6 +1500,9 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
|
||||
}
|
||||
ShopInspectionCategory category = categoryService.getById(info.getCategoryId());
|
||||
res.setCarType(category.getCategoryName());
|
||||
// 查询节点表
|
||||
List<InspectionWorkNode> workNodes = inspectionWorkNodeService.getWeorkNodesById(Integer.parseInt(String.valueOf(inspectionInfoId)));
|
||||
res.setWorkNodes(workNodes);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@ -161,6 +161,9 @@ public class InspectionFileServiceImpl extends ServiceImpl<InspectionFileMapper,
|
||||
public IPage<InspectionFile> selectInspectionFileList(Page<InspectionFile> page, InspectionFile inspectionFile) {
|
||||
// 创建一个空的 QueryWrapper
|
||||
QueryWrapper<InspectionFile> queryWrapper = new QueryWrapper<>();
|
||||
if (ObjectUtil.isNotEmpty(inspectionFile.getFatherId())) {
|
||||
queryWrapper.eq("father_id", inspectionFile.getFatherId());
|
||||
}
|
||||
|
||||
// 直接调用 MyBatis-Plus 的 page 方法进行分页查询
|
||||
return this.page(page, queryWrapper); // 返回符合条件的分页查询结果
|
||||
|
@ -14,6 +14,7 @@ import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.framework.security.core.LoginUser;
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
||||
import cn.iocoder.yudao.module.appBase.controller.admin.InspectionSocket;
|
||||
import cn.iocoder.yudao.module.custom.entity.CustomerMain;
|
||||
import cn.iocoder.yudao.module.custom.service.CustomerMainService;
|
||||
@ -54,6 +55,8 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.config.CommonStr.USER_TYPE_CUS;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Service业务层处理
|
||||
*
|
||||
@ -137,13 +140,14 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
|
||||
AdminUserDO workerUser = userService.getUser(loginUser.getId());
|
||||
String buyName = StringUtils.isNotEmpty(inspectionInfo.getBuyName()) ? inspectionInfo.getBuyName() : "未知客户";
|
||||
String buyPhone = StringUtils.isNotEmpty(inspectionInfo.getBuyPhone()) ? inspectionInfo.getBuyPhone() : StringUtils.isNotEmpty(inspectionInfo.getBuyName()) ? inspectionInfo.getBuyName() : "无";
|
||||
AdminUserDO user = userService.getUserByMobile(buyPhone);
|
||||
AdminUserDO user = getAdminUserDO(buyPhone);
|
||||
if (ObjectUtils.isEmpty(user)) {
|
||||
//新增用户
|
||||
UserSaveReqVO userSaveReqVO = new UserSaveReqVO();
|
||||
userSaveReqVO.setNickname(buyName);
|
||||
userSaveReqVO.setUsername(buyPhone);
|
||||
userSaveReqVO.setMobile(buyPhone);
|
||||
userSaveReqVO.setUserType(USER_TYPE_CUS);
|
||||
userSaveReqVO.setPassword("123456");
|
||||
Long uid = userService.createUser(userSaveReqVO);
|
||||
inspectionInfo.setUserId(uid);
|
||||
@ -183,7 +187,9 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
|
||||
inspectionInfo.setPartnerId(partners.getPartnerId());
|
||||
inspectionInfo.setWorkerName(workerUser.getNickname());
|
||||
inspectionInfo.setWorkerPhone(workerUser.getMobile());
|
||||
inspectionInfo.setStartTime(new Date());
|
||||
if (ObjectUtil.isNull(inspectionInfo.getStartTime())) {
|
||||
inspectionInfo.setStartTime(new Date());
|
||||
}
|
||||
inspectionInfo.setCategoryId(goods.getGoodsCategoryId());
|
||||
inspectionInfo.setStatus("0");
|
||||
inspectionInfo.setWorkId(workerUser.getId());
|
||||
@ -248,7 +254,11 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
|
||||
//根据角色id获取所有用户
|
||||
List<UserDTO> listByUserId = roleService.getListByUserId(roleId);
|
||||
List<Long> ids = listByUserId.stream().map(UserDTO::getId).collect(Collectors.toList());
|
||||
ids.add(inspectionInfo.getLeadManId());
|
||||
if (ObjectUtil.isNotNull(inspectionInfo.getLeadManId())) {
|
||||
ids.add(inspectionInfo.getLeadManId());
|
||||
}
|
||||
//给ids去重
|
||||
ids = ids.stream().distinct().collect(Collectors.toList());
|
||||
// 获取当前共单引车员的id
|
||||
if (CollUtil.isNotEmpty(ids)) {
|
||||
for (Long id : ids) {
|
||||
@ -267,6 +277,12 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
|
||||
return save ? 1 : 0;
|
||||
}
|
||||
|
||||
@TenantIgnore
|
||||
private AdminUserDO getAdminUserDO(String buyPhone) {
|
||||
AdminUserDO user = userService.getUserByMobileTenantIgnore(buyPhone);
|
||||
return user;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void settleAccounts(Long InspectionId) {
|
||||
@ -296,7 +312,7 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
|
||||
ShopMallPartners partners = appInspectionPartnerService.shopInfo();
|
||||
LambdaQueryWrapper<PartnerWorker> workerQueryWrapper = new LambdaQueryWrapper<>();
|
||||
workerQueryWrapper.eq(PartnerWorker::getUserId, loginUser.getId()).eq(PartnerWorker::getPartnerId, partners.getPartnerId());
|
||||
PartnerWorker worker = workerService.getOne(workerQueryWrapper);
|
||||
// PartnerWorker worker = workerService.getOne(workerQueryWrapper);
|
||||
AdminUserDO workerUser = userService.getUser(loginUser.getId());
|
||||
// if (ObjectUtils.isNotEmpty(worker)) {
|
||||
inspectionInfo.setWorkId(workerUser.getId());
|
||||
@ -305,7 +321,7 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
|
||||
// }
|
||||
String buyName = StringUtils.isNotEmpty(inspectionInfo.getBuyName()) ? inspectionInfo.getBuyName() : "未知客户";
|
||||
String buyPhone = StringUtils.isNotEmpty(inspectionInfo.getBuyPhone()) ? inspectionInfo.getBuyPhone() : StringUtils.isNotEmpty(inspectionInfo.getBuyName()) ? inspectionInfo.getBuyName() : "无";
|
||||
AdminUserDO user = userService.getUserByMobile(buyPhone);
|
||||
AdminUserDO user = getAdminUserDO(buyPhone);
|
||||
if (ObjectUtils.isEmpty(user)) {
|
||||
//新增用户
|
||||
UserSaveReqVO userSaveReqVO = new UserSaveReqVO();
|
||||
@ -328,6 +344,17 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
|
||||
return baseMapper.updateById(inspectionInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改引车员
|
||||
*
|
||||
* @param inspectionInfo 【请填写功能名称】
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateLeadMan(InspectionInfo inspectionInfo) {
|
||||
return baseMapper.updateById(inspectionInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除【请填写功能名称】
|
||||
*
|
||||
@ -409,6 +436,7 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
|
||||
|
||||
/**
|
||||
* 获取工单详情
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@ -438,4 +466,29 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
|
||||
public List<InspectionWorkNode> getWeorkNodesById(Integer inspectionId) {
|
||||
return workNodeService.getWeorkNodesById(inspectionId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断app当前检测人是否有审核权限
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Boolean isExamine() {
|
||||
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||
//获取当前登陆人的所有角色
|
||||
List<UserRoleDO> userRoles = roleService.getByUserId(loginUser.getId());
|
||||
List<Long> userRoleIds = userRoles.stream().map(UserRoleDO::getRoleId).collect(Collectors.toList());
|
||||
List<RoleDO> roleList = roleService.getRoleList(userRoleIds);
|
||||
|
||||
//判断当前角色集合中的code是否包含jcyszz
|
||||
if (CollectionUtil.isNotEmpty(roleList)) {
|
||||
List<RoleDO> filteredRoleList = roleList.stream()
|
||||
.filter(role -> role.getCode().contains("jcsfdl"))
|
||||
.collect(Collectors.toList());
|
||||
if (CollectionUtil.isNotEmpty(filteredRoleList)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -91,26 +91,57 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod
|
||||
|
||||
//查询用户 信息
|
||||
//修改工单表中当前施工人
|
||||
inspectionInfo.setWorkId(workerUser.getId());
|
||||
inspectionInfo.setWorkerName(workerUser.getNickname());
|
||||
inspectionInfo.setWorkerPhone(workerUser.getMobile());
|
||||
inspectionInfoService.updateById(inspectionInfo);
|
||||
// inspectionInfo.setWorkId(workerUser.getId());
|
||||
// inspectionInfo.setWorkerName(workerUser.getNickname());
|
||||
// inspectionInfo.setWorkerPhone(workerUser.getMobile());
|
||||
// inspectionInfoService.updateById(inspectionInfo);
|
||||
|
||||
//新增步骤
|
||||
//根据projectId查询项目名称
|
||||
DlInspectionProject project = inspectionProjectService.getOne(new LambdaQueryWrapper<DlInspectionProject>()
|
||||
.eq(DlInspectionProject::getId, workNode.getProjectId()));
|
||||
// //新增步骤
|
||||
// //根据projectId查询项目名称
|
||||
// DlInspectionProject project = inspectionProjectService.getOne(new LambdaQueryWrapper<DlInspectionProject>()
|
||||
// .eq(DlInspectionProject::getId, workNode.getProjectId()));
|
||||
//
|
||||
// InspectionStepInfo inspectionStepInfo = new InspectionStepInfo();
|
||||
// inspectionStepInfo.setInspectionInfoId(Integer.parseInt(String.valueOf(inspectionInfo.getId())));
|
||||
// if (ObjectUtil.isNotNull(project)) {
|
||||
// inspectionStepInfo.setTitle(project.getProjectName() + "项目开始检测");
|
||||
// } else {
|
||||
// inspectionStepInfo.setTitle("项目检测开始");
|
||||
// }
|
||||
// inspectionStepInfo.setCreateTime(DateUtil.date());
|
||||
// inspectionStepInfo.setCreator(Integer.parseInt(String.valueOf(workerUser.getId())));
|
||||
// inspectionStepService.save(inspectionStepInfo);
|
||||
}
|
||||
|
||||
InspectionStepInfo inspectionStepInfo = new InspectionStepInfo();
|
||||
inspectionStepInfo.setInspectionInfoId(Integer.parseInt(String.valueOf(inspectionInfo.getId())));
|
||||
if (ObjectUtil.isNotNull(project)) {
|
||||
inspectionStepInfo.setTitle(project.getProjectName() + "项目开始检测");
|
||||
} else {
|
||||
inspectionStepInfo.setTitle("项目检测开始");
|
||||
/**
|
||||
* 员工取消接单
|
||||
*
|
||||
* @param inspectionId
|
||||
* @param workNodeId
|
||||
*/
|
||||
@Override
|
||||
public void cancelAnOrder(Integer inspectionId, String workNodeId) {
|
||||
//获取当前登录人
|
||||
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||
//当前登陆人 就是检测人
|
||||
AdminUserDO workerUser = userService.getUser(loginUser.getId());
|
||||
//根据工单id获取工单
|
||||
InspectionInfo inspectionInfo = inspectionInfoService.getById(inspectionId);
|
||||
if (ObjectUtil.isNull(inspectionInfo)) {
|
||||
throw new RuntimeException("工单不存在");
|
||||
}
|
||||
inspectionStepInfo.setCreateTime(DateUtil.date());
|
||||
inspectionStepInfo.setCreator(Integer.parseInt(String.valueOf(workerUser.getId())));
|
||||
inspectionStepService.save(inspectionStepInfo);
|
||||
//根据流程id获取流程
|
||||
InspectionWorkNode workNode = this.getById(workNodeId);
|
||||
if (ObjectUtil.isNull(workNode)) {
|
||||
throw new RuntimeException("流程不存在");
|
||||
}
|
||||
//判断当前流程节点的接单员是否是当前登陆人
|
||||
if (!workNode.getDealUserId().equals(workerUser.getId())) {
|
||||
throw new RuntimeException("当前流程不是你接单的");
|
||||
}
|
||||
// 更新流程
|
||||
// this.updateById(workNode);
|
||||
baseMapper.cancelAnOrder(workNode);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -142,13 +173,19 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod
|
||||
//根据工单id查询工单
|
||||
InspectionInfo inspectionInfo = inspectionInfoService.selectInspectionInfoById(workNode.getInspectionInfoId());
|
||||
|
||||
//判断是否是最后一个项目 根据工单id查询
|
||||
//判断是否是还有项目完成 根据工单id查询
|
||||
//根据工单id查询流程列表
|
||||
LambdaQueryWrapper<InspectionWorkNode> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(InspectionWorkNode::getInspectionInfoId, workNode.getInspectionInfoId());
|
||||
//是否还有进行中或者待开始的状态
|
||||
queryWrapper.in(InspectionWorkNode::getStatus, "0","1");
|
||||
List<InspectionWorkNode> inspectionWorkNodes = this.list(queryWrapper);
|
||||
//判断当前是否是最后一个项目 根据顺序号判断
|
||||
boolean flag = hasNextNode(inspectionWorkNodes, workNode);
|
||||
boolean flag = true;
|
||||
//判断是否是最后一个流程
|
||||
if (inspectionWorkNodes.size() == 1 && inspectionWorkNodes.get(0).getId().equals(workNode.getId())){
|
||||
flag = false;
|
||||
}
|
||||
|
||||
|
||||
// 插入步骤信息
|
||||
InspectionStepInfo inspectionStepInfo = new InspectionStepInfo();
|
||||
@ -159,7 +196,7 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod
|
||||
.eq(DlInspectionProject::getId, workNode.getProjectId()));
|
||||
String stepTitle = "";
|
||||
if (ObjectUtil.isNotNull(project)) {
|
||||
inspectionStepInfo.setTitle(project.getProjectName() + "项目检测完成");
|
||||
inspectionStepInfo.setTitle(project.getProjectName());
|
||||
} else {
|
||||
inspectionStepInfo.setTitle("项目检测完成");
|
||||
}
|
||||
@ -169,6 +206,7 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod
|
||||
if (ObjectUtil.isNotEmpty(inspectionWorkNode.getDealImages())) {
|
||||
inspectionStepInfo.setImages(inspectionWorkNode.getDealImages());
|
||||
}
|
||||
inspectionStepInfo.setWorkNodeId(workNode.getId());
|
||||
inspectionStepInfo.setCreateTime(DateUtil.date());
|
||||
inspectionStepInfo.setCreator(Integer.parseInt(String.valueOf(loginUser.getId())));
|
||||
inspectionStepService.save(inspectionStepInfo);
|
||||
@ -190,19 +228,20 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod
|
||||
inspectionStepInfo.setCreateTime(DateUtil.date());
|
||||
inspectionStepInfo.setCreator(Integer.parseInt(String.valueOf(loginUser.getId())));
|
||||
inspectionStepService.save(inspectionStepInfo);
|
||||
} else {
|
||||
//修改工单表当前流程
|
||||
inspectionInfo.setNowOrderNum(workNode.getOrderNum() + 1);
|
||||
//获取下一节点
|
||||
InspectionWorkNode nextNode = getNextNode(inspectionWorkNodes, workNode);
|
||||
/*给下一单人员发送信息*/
|
||||
List<UserDTO> listByUserId = roleService.getListByUserId(nextNode.getRoleId());
|
||||
List<Long> ids = listByUserId.stream().map(UserDTO::getId).collect(Collectors.toList());
|
||||
if (ObjectUtil.isNotNull(inspectionInfo.getLeadManId())){
|
||||
ids.add(inspectionInfo.getLeadManId());
|
||||
}
|
||||
sendSocketMessage(ids);
|
||||
}
|
||||
// else {
|
||||
// //修改工单表当前流程
|
||||
// inspectionInfo.setNowOrderNum(workNode.getOrderNum() + 1);
|
||||
// //获取下一节点
|
||||
// InspectionWorkNode nextNode = getNextNode(inspectionWorkNodes, workNode);
|
||||
// /*给下一单人员发送信息*/
|
||||
// List<UserDTO> listByUserId = roleService.getListByUserId(nextNode.getRoleId());
|
||||
// List<Long> ids = listByUserId.stream().map(UserDTO::getId).collect(Collectors.toList());
|
||||
// if (ObjectUtil.isNotNull(inspectionInfo.getLeadManId())){
|
||||
// ids.add(inspectionInfo.getLeadManId());
|
||||
// }
|
||||
// sendSocketMessage(ids);
|
||||
// }
|
||||
|
||||
//将节点状态改为已完成
|
||||
inspectionWorkNode.setStatus("2");
|
||||
@ -264,6 +303,38 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod
|
||||
return baseMapper.getRoyaltySum(inspectionWorkNode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 重新检测
|
||||
*
|
||||
* @param workNodes
|
||||
*/
|
||||
@Override
|
||||
public void recheck(InspectionWorkNode workNodes) {
|
||||
//获取当前登陆人
|
||||
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||
//将传递过来的流程节点全部改为未进行
|
||||
baseMapper.recheck(workNodes.getWorkNodes());
|
||||
//将检测工单设置为重审
|
||||
InspectionInfo info = inspectionInfoService.getById(workNodes.getInspectionInfoId());
|
||||
info.setIsRetrial("1");
|
||||
info.setIsPass("0");
|
||||
//更新工单表
|
||||
inspectionInfoService.updateById(info);
|
||||
// 添加步骤信息表
|
||||
InspectionStepInfo stepInfo = new InspectionStepInfo();
|
||||
stepInfo.setInspectionInfoId(Integer.parseInt(workNodes.getInspectionInfoId().toString()));
|
||||
stepInfo.setTitle("重审");
|
||||
stepInfo.setCreateTime(DateUtil.date());
|
||||
stepInfo.setCreator(Integer.parseInt(loginUser.getId().toString()));
|
||||
if (ObjectUtil.isNotEmpty(workNodes.getRemark())) {
|
||||
stepInfo.setContent(workNodes.getRemark());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(workNodes.getDealImages())) {
|
||||
stepInfo.setImages(workNodes.getDealImages());
|
||||
}
|
||||
inspectionStepService.save(stepInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断传入的 InspectionWorkNode 对象是否在集合中有后续项目
|
||||
*
|
||||
@ -361,6 +432,7 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod
|
||||
// 添加步骤信息表
|
||||
InspectionStepInfo stepInfo = new InspectionStepInfo();
|
||||
stepInfo.setInspectionInfoId(Integer.parseInt(inspectionWorkNode.getInspectionInfoId().toString()));
|
||||
stepInfo.setWorkNodeId(inspectionWorkNode.getId());
|
||||
stepInfo.setTitle("重审");
|
||||
if (ObjectUtil.isNotEmpty(inspectionWorkNode.getRemark())) {
|
||||
stepInfo.setContent(inspectionWorkNode.getRemark());
|
||||
@ -378,7 +450,7 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod
|
||||
for (Long userId : userIds) {
|
||||
try {
|
||||
inspectionSocket.sendMessage("接工单", userId.toString());
|
||||
} catch (IOException e) {
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
@ -246,11 +246,13 @@ public class ShopInspectionGoodsServiceImpl extends ServiceImpl<ShopInspectionGo
|
||||
public List<ShopInspectionCategory> categoryList() throws Exception {
|
||||
ShopMallPartners one = appInspectionPartnerService.shopInfoByUserId();
|
||||
List<ShopInspectionCategory> shopInspectionCategories = appInspectionPartnerService.categoryList(one.getPartnerId());
|
||||
for (ShopInspectionCategory shopInspectionCategory : shopInspectionCategories) {
|
||||
LambdaQueryWrapper<InspectionCategoryTemplate> templateLambdaQueryWrapper =new LambdaQueryWrapper<>();
|
||||
templateLambdaQueryWrapper.eq(InspectionCategoryTemplate::getCategoryId,shopInspectionCategory.getId()).orderByAsc(InspectionCategoryTemplate::getSkuPrice);
|
||||
List<InspectionCategoryTemplate> list = categoryTemplateService.list(templateLambdaQueryWrapper);
|
||||
shopInspectionCategory.setTemplates(list);
|
||||
if (CollectionUtil.isNotEmpty(shopInspectionCategories)) {
|
||||
for (ShopInspectionCategory shopInspectionCategory : shopInspectionCategories) {
|
||||
LambdaQueryWrapper<InspectionCategoryTemplate> templateLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
templateLambdaQueryWrapper.eq(InspectionCategoryTemplate::getCategoryId, shopInspectionCategory.getId()).orderByAsc(InspectionCategoryTemplate::getSkuPrice);
|
||||
List<InspectionCategoryTemplate> list = categoryTemplateService.list(templateLambdaQueryWrapper);
|
||||
shopInspectionCategory.setTemplates(list);
|
||||
}
|
||||
}
|
||||
return shopInspectionCategories;
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.inspection.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.inspection.entity.InspectionWorkNode;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import cn.iocoder.yudao.annotation.Excel;
|
||||
@ -85,4 +86,8 @@ public class InspectionInfoVo {
|
||||
|
||||
/*引车员名字*/
|
||||
private String leadManName;
|
||||
@TableField(exist = false)
|
||||
List<InspectionWorkNode> workNodes;
|
||||
@TableField(exist = false)
|
||||
private Long leadManId;
|
||||
}
|
||||
|
@ -65,12 +65,6 @@ public class PartnerCustomerInfoServiceImpl extends ServiceImpl<PartnerCustomerI
|
||||
private PartnerCustomerInfoMapper customerInfoMapper;
|
||||
@Autowired
|
||||
private PartnerCustomerInfoMapper partnerCustomerInfoMapper;
|
||||
@Resource
|
||||
private CustomerMainService customerMainService;
|
||||
@Autowired
|
||||
private CarMainService carMainService;
|
||||
@Resource
|
||||
private CustomerCarService customerCarService;
|
||||
|
||||
/**
|
||||
* 查询客户信息列表
|
||||
@ -237,26 +231,6 @@ public class PartnerCustomerInfoServiceImpl extends ServiceImpl<PartnerCustomerI
|
||||
throw new Exception("手机号不符合规范");
|
||||
}
|
||||
|
||||
// 创建客户信息
|
||||
CustomerMain customerMain = new CustomerMain();
|
||||
customerMain.setId(UUID.randomUUID().toString().replace("-", ""));
|
||||
customerMain.setUserId(user.getId());
|
||||
customerMain.setCusName(partnerCustomerInfo.getCustomerName());
|
||||
customerMain.setPhoneNumber(partnerCustomerInfo.getCustomerPhone());
|
||||
customerMain.setSex(partnerCustomerInfo.getSex());
|
||||
customerMain.setIsHangAccount("0");
|
||||
customerMain.setTypeCode("01");
|
||||
// 设置客户初始来源
|
||||
//customerMain.setDataFrom("01");
|
||||
// 设置注册方式
|
||||
customerMain.setInviterType("01");
|
||||
|
||||
// 保存客户信息
|
||||
customerMainService.saveOrUpdate(customerMain);
|
||||
|
||||
// 保存车辆信息和客户与车辆关联关系
|
||||
carMainService.saveOrUpdateBatch(saveCarList);
|
||||
customerCarService.saveBatch(saveCustomerCarList);
|
||||
|
||||
// 保存用户车辆信息
|
||||
for (ShopUserCar userCar : saveUserCarList) {
|
||||
|
@ -1,6 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.inspection.mapper.InspectionWorkNodeMapper">
|
||||
<update id="cancelAnOrder">
|
||||
UPDATE inspection_work_node
|
||||
SET status = '0', deal_user_id = null, deal_user_name = null, deal_images = null, remark = null
|
||||
WHERE id = #{id} AND inspection_info_id = #{inspectionInfoId}
|
||||
</update>
|
||||
<update id="recheck">
|
||||
UPDATE inspection_work_node
|
||||
SET status = '0', deal_user_id = null, deal_user_name = null, deal_images = null, remark = null
|
||||
WHERE id in (
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
#{item.id}
|
||||
</foreach>
|
||||
)
|
||||
</update>
|
||||
|
||||
<select id="getWeorkNodesById" resultType="cn.iocoder.yudao.module.inspection.entity.InspectionWorkNode"
|
||||
parameterType="java.lang.Integer">
|
||||
|
@ -24,7 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectInspectionInfoVo">
|
||||
select id, inspection_order_id, work_id, worker_name, worker_phone, is_pass, status, start_time, end_time, year, month, day, create_time, creator, update_time, updater from inspection_info
|
||||
select id,buy_name,buy_phone,user_address, inspection_order_id, work_id, worker_name, worker_phone, is_pass, status, start_time, end_time, year, month, day, create_time, creator, update_time, updater from inspection_info
|
||||
</sql>
|
||||
|
||||
<select id="selectInspectionInfoList" parameterType="cn.iocoder.yudao.module.inspection.entity.InspectionInfo" resultMap="InspectionInfoResult">
|
||||
@ -45,8 +45,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
|
||||
<select id="selectInspectionInfoById" parameterType="Long" resultMap="InspectionInfoResult">
|
||||
<include refid="selectInspectionInfoVo"/>
|
||||
where id = #{id}
|
||||
select info.*,o.sku_name,o.sku_id,o.goods_id
|
||||
from inspection_info info
|
||||
left join order_info o on info.inspection_order_id = o.id
|
||||
where info.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertInspectionInfo" parameterType="cn.iocoder.yudao.module.inspection.entity.InspectionInfo">
|
||||
@ -267,43 +269,56 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
order by ins.start_time desc
|
||||
</select>
|
||||
<select id="selectByUser" resultType="cn.iocoder.yudao.module.inspection.entity.InspectionInfo">
|
||||
SELECT
|
||||
SELECT
|
||||
ii.*,
|
||||
iwn.id AS workNodeId,
|
||||
iwn.status AS workNodeStatus,
|
||||
oi.order_no AS orderNo,
|
||||
oi.phonenumber AS buyPhone
|
||||
FROM
|
||||
oi.phonenumber AS buyPhone,
|
||||
ip.project_name AS projectName,
|
||||
su.nickname AS leadManName
|
||||
FROM
|
||||
inspection_info ii
|
||||
JOIN
|
||||
LEFT JOIN
|
||||
inspection_work_node iwn ON ii.id = iwn.inspection_info_id
|
||||
JOIN order_info oi ON ii.inspection_order_id = oi.id
|
||||
LEFT JOIN
|
||||
order_info oi ON ii.inspection_order_id = oi.id
|
||||
LEFT JOIN
|
||||
inspection_project ip ON iwn.project_id = ip.id
|
||||
LEFT JOIN
|
||||
system_users su ON ii.lead_man_id = su.id
|
||||
<where>
|
||||
-- ii.status = '0' -- 工单正在进行中
|
||||
-- ii.now_order_num = iwn.order_num -- 当前工单步骤与流程节点顺序一致
|
||||
-- AND iwn.status = '0' -- 流程节点状态为待开始
|
||||
<!-- 车牌号模糊查询 -->
|
||||
<if test="inspectionInfo.carNum != null">
|
||||
AND ii.car_num LIKE CONCAT('%', #{inspectionInfo.carNum}, '%')
|
||||
</if>
|
||||
<!-- 待接受 -->
|
||||
<if test="inspectionInfo.status == 1">
|
||||
AND <!-- 工单负责人或角色ID匹配 -->
|
||||
(ii.lead_man_id = #{inspectionInfo.leadManId}
|
||||
OR iwn.role_id IN
|
||||
<foreach collection="roleIds" item="roleId" open="(" separator="," close=")">
|
||||
#{roleId}
|
||||
</foreach>)
|
||||
<if test="inspectionInfo.carNum != null">
|
||||
AND ii.car_num like concat('%',#{inspectionInfo.carNum},'%')
|
||||
</if>
|
||||
-- 待接受
|
||||
<if test="inspectionInfo.status == 1">
|
||||
AND ii.status = '0' AND iwn.status = '0' AND ii.now_order_num = iwn.order_num
|
||||
</if>
|
||||
-- 进行中
|
||||
<if test="inspectionInfo.status == 2">
|
||||
AND ii.status = '0' AND iwn.status = '1' AND iwn.deal_user_id = #{inspectionInfo.dealUserId}
|
||||
</if>
|
||||
-- 已完成
|
||||
<if test="inspectionInfo.status == 3">
|
||||
AND iwn.status = '2' AND iwn.deal_user_id = #{inspectionInfo.dealUserId}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY ii.create_time DESC
|
||||
AND ii.status = '0'
|
||||
AND iwn.status = '0'
|
||||
-- AND ii.now_order_num = iwn.order_num
|
||||
ORDER BY ii.create_time DESC
|
||||
</if>
|
||||
<!-- 进行中 -->
|
||||
<if test="inspectionInfo.status == 2">
|
||||
AND ii.status = '0'
|
||||
AND iwn.status = '1'
|
||||
AND iwn.deal_user_id = #{inspectionInfo.dealUserId}
|
||||
ORDER BY iwn.update_time DESC
|
||||
</if>
|
||||
<!-- 已完成 -->
|
||||
<if test="inspectionInfo.status == 3">
|
||||
AND iwn.status = '2'
|
||||
AND iwn.deal_user_id = #{inspectionInfo.dealUserId}
|
||||
ORDER BY iwn.update_time DESC
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.rescue.service.impl;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.CoordinateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import cn.iocoder.yudao.module.custom.entity.CarMain;
|
||||
import cn.iocoder.yudao.module.custom.entity.CustomerMain;
|
||||
@ -591,27 +592,34 @@ public class RescueDriverInfoServiceImpl extends ServiceImpl<RescueDriverInfoMap
|
||||
detailService.save(rescueInfoDetail);
|
||||
rescueInfo.setRescueStatus("5");
|
||||
rescueInfoService.updateById(rescueInfo);
|
||||
/** 将车辆推送到维修中*/
|
||||
CustomerMainSaveReqVO saveReqVO = new CustomerMainSaveReqVO();
|
||||
// 绑定用户id
|
||||
saveReqVO.setUserId(rescueInfo.getUserId());
|
||||
// 绑定用户手机号
|
||||
saveReqVO.setPhoneNumber(rescueInfo.getConnectionPhone());
|
||||
// 客户名称
|
||||
saveReqVO.setCusName(rescueInfo.getConnectionName());
|
||||
// 车辆信息
|
||||
CarMain carMain = new CarMain();
|
||||
carMain.setCarLicenseImg(rescueInfo.getLicenseNum());
|
||||
|
||||
saveReqVO.setCar(carMain);
|
||||
//推送到维修中
|
||||
customerCarService.saveCustomerAndCar(saveReqVO);
|
||||
//处理司机状态
|
||||
//查询司机是否还存在未结束的救援订单
|
||||
//处理redis
|
||||
DriverInfo driverInfo = driverInfoService.getById(rescueInfo.getDriverId());
|
||||
AdminUserRespDTO user = userService.getUser(driverInfo.getUserId());
|
||||
try {
|
||||
/** 将车辆推送到维修中*/
|
||||
CustomerMainSaveReqVO saveReqVO = new CustomerMainSaveReqVO();
|
||||
// 绑定用户id
|
||||
saveReqVO.setUserId(rescueInfo.getUserId());
|
||||
// 绑定用户手机号
|
||||
saveReqVO.setPhoneNumber(rescueInfo.getConnectionPhone());
|
||||
// 客户名称
|
||||
if(ObjectUtil.isNotEmpty(rescueInfo.getConnectionName())) {
|
||||
saveReqVO.setCusName(rescueInfo.getConnectionName());
|
||||
}else {
|
||||
saveReqVO.setCusName(rescueInfo.getConnectionPhone());
|
||||
}
|
||||
// 车辆信息
|
||||
CarMain carMain = new CarMain();
|
||||
carMain.setLicenseNumber(rescueInfo.getLicenseNum());
|
||||
|
||||
saveReqVO.setCar(carMain);
|
||||
//推送到维修中
|
||||
customerCarService.saveCustomerAndCar(saveReqVO);
|
||||
|
||||
|
||||
// 收集客户信息
|
||||
PartnerCustomerInfo customerInfo = new PartnerCustomerInfo();
|
||||
customerInfo.setCustomerName(rescueInfo.getConnectionName());
|
||||
@ -629,11 +637,6 @@ public class RescueDriverInfoServiceImpl extends ServiceImpl<RescueDriverInfoMap
|
||||
|
||||
customerInfo.setUserCarList(userCarList);
|
||||
|
||||
// 设置客户来源
|
||||
CustomerMain customerMain = new CustomerMain();
|
||||
customerMain.setDataFrom("02");
|
||||
customerMainService.saveOrUpdate(customerMain);
|
||||
|
||||
// 调用插入客户信息的方法
|
||||
customerInfoService.insertPartnerCustomerInfo(customerInfo);
|
||||
} catch (Exception ignored) {
|
||||
|
@ -80,4 +80,6 @@ public interface AdminUserMapper extends BaseMapperX<AdminUserDO> {
|
||||
int updateSetOpenId(@Param("userId")Long userId,@Param("openId")String openId);
|
||||
|
||||
int updateCusInfo(@Param("entity") UserInfoVO userInfoVO);
|
||||
|
||||
AdminUserDO getUserByMobileTenantIgnore(String mobile);
|
||||
}
|
||||
|
@ -123,4 +123,5 @@ public interface DictDataService {
|
||||
**/
|
||||
List<DictDataDO> getDictDataListById(List<Long> dataIds);
|
||||
|
||||
void deleteDictDataBatch(List<Long> dictIds);
|
||||
}
|
||||
|
@ -202,4 +202,10 @@ public class DictDataServiceImpl implements DictDataService {
|
||||
return dictDataMapper.selectList(new LambdaQueryWrapperX<DictDataDO>().in(DictDataDO::getId, dataIds));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteDictDataBatch(List<Long> dictIds) {
|
||||
// 删除字典数据
|
||||
dictDataMapper.deleteByIds(dictIds);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -145,6 +145,13 @@ public interface AdminUserService extends IService<AdminUserDO> {
|
||||
* @return 用户对象信息
|
||||
*/
|
||||
AdminUserDO getUserByMobile(String mobile);
|
||||
/**
|
||||
* 通过手机号获取用户(不带租户id)
|
||||
*
|
||||
* @param mobile 手机号
|
||||
* @return 用户对象信息
|
||||
*/
|
||||
AdminUserDO getUserByMobileTenantIgnore(String mobile);
|
||||
|
||||
/**
|
||||
* 获得用户分页列表
|
||||
|
@ -303,6 +303,11 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
|
||||
|
||||
return userMapper.selectByMobile(mobile);
|
||||
}
|
||||
@Override
|
||||
public AdminUserDO getUserByMobileTenantIgnore(String mobile) {
|
||||
|
||||
return userMapper.getUserByMobileTenantIgnore(mobile);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<AdminUserDO> getUserPage(UserPageReqVO reqVO) {
|
||||
|
@ -75,4 +75,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
AND deleted = 0
|
||||
limit 1
|
||||
</select>
|
||||
<select id="getUserByMobileTenantIgnore"
|
||||
resultType="cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
system_users
|
||||
WHERE
|
||||
mobile = #{phoneNumber}
|
||||
AND deleted = 0
|
||||
limit 1
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -21,9 +21,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
<select id="selectListByRoleId" resultType="cn.iocoder.yudao.module.system.api.user.dto.UserDTO"
|
||||
parameterType="cn.iocoder.yudao.module.system.controller.admin.permission.vo.role.RolePageReqVO">
|
||||
select su.*
|
||||
from system_user_role sr
|
||||
left join system_users su on sr.user_id = su.id
|
||||
select distinct su.*
|
||||
from system_users su
|
||||
left join system_user_role sr on su.id = sr.user_id
|
||||
left join system_role sr2 on sr.role_id = sr2.id
|
||||
<where>
|
||||
su.deleted = 0 and sr2.service_package_id = 'jiance'
|
||||
|
Loading…
Reference in New Issue
Block a user