Merge branch 'repair' of http://122.51.230.86:3000/dianliang/lanan-system into repair
This commit is contained in:
commit
f8544d6569
@ -61,6 +61,10 @@ public enum RecordTypeEnum {
|
|||||||
TZTL("tztl","通知退料"),
|
TZTL("tztl","通知退料"),
|
||||||
/**审批配件申请单*/
|
/**审批配件申请单*/
|
||||||
SPPJSQD("sppjsqd","审批配件申请单"),
|
SPPJSQD("sppjsqd","审批配件申请单"),
|
||||||
|
/**
|
||||||
|
* 添加维修项目
|
||||||
|
*/
|
||||||
|
TJWXXM("tjwxxm", "添加维修项目"),
|
||||||
/**
|
/**
|
||||||
* 接单
|
* 接单
|
||||||
*/
|
*/
|
||||||
|
@ -323,7 +323,7 @@ public class DlRepairSoServiceImpl extends ServiceImpl<DlRepairSoMapper, DlRepai
|
|||||||
baseMapper.updateById(dlRepairSo);
|
baseMapper.updateById(dlRepairSo);
|
||||||
|
|
||||||
// 查最新的子表信息
|
// 查最新的子表信息
|
||||||
DlRepairSo so = baseMapper.selectOne(new LambdaQueryWrapper<DlRepairSo>().eq(DlRepairSo::getId, id));
|
DlRepairSo so = baseMapper.selectById(id);
|
||||||
List<DlTwItem> list = twItemService.list(new LambdaQueryWrapper<DlTwItem>().eq(DlTwItem::getTwId, so.getTwId()));
|
List<DlTwItem> list = twItemService.list(new LambdaQueryWrapper<DlTwItem>().eq(DlTwItem::getTwId, so.getTwId()));
|
||||||
// 判断是部分完成还是全部完成
|
// 判断是部分完成还是全部完成
|
||||||
DlTicketWares dlTicketWares = new DlTicketWares();
|
DlTicketWares dlTicketWares = new DlTicketWares();
|
||||||
@ -333,16 +333,22 @@ public class DlRepairSoServiceImpl extends ServiceImpl<DlRepairSoMapper, DlRepai
|
|||||||
// 更新主表的状态
|
// 更新主表的状态
|
||||||
ticketWaresService.updateById(dlTicketWares);
|
ticketWaresService.updateById(dlTicketWares);
|
||||||
|
|
||||||
// 查主表记录
|
|
||||||
DlRepairSo newSo = baseMapper.selectById(id);
|
|
||||||
// 通知仓库
|
// 通知仓库
|
||||||
repairWorkerService.sentMessage(Long.valueOf(newSo.getCreator()), newSo.getUserName() + "已确认领料单:" + newSo.getSoNo());
|
repairWorkerService.sentMessage(Long.valueOf(so.getCreator()), so.getUserName() + "已确认领料单:" + so.getSoNo());
|
||||||
|
|
||||||
// 记录日志
|
// 记录日志
|
||||||
// 查配件申请表
|
// 查配件申请表
|
||||||
DlTicketWares byId = ticketWaresService.getById(so.getTwId());
|
DlTicketWares byId = ticketWaresService.getById(so.getTwId());
|
||||||
|
// 取当前操作人的名称
|
||||||
|
String remark = SecurityFrameworkUtils.getLoginUserNickname();
|
||||||
|
// 构建备注
|
||||||
|
/*
|
||||||
|
谁,领了什么配件,领了多少个
|
||||||
|
*/
|
||||||
|
List<String> nameAndCount = list.stream().map(item -> item.getWaresName() + "x" + item.getWaresCount()).collect(Collectors.toList());
|
||||||
|
remark += "确认领料" + String.join(";", nameAndCount);
|
||||||
// 记录日志
|
// 记录日志
|
||||||
recordsService.saveRepairRecord(byId.getTicketId(), null, RecordTypeEnum.LL.getCode(), null, image);
|
recordsService.saveRepairRecord(byId.getTicketId(), null, RecordTypeEnum.LL.getCode(), remark, image);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -365,10 +371,20 @@ public class DlRepairSoServiceImpl extends ServiceImpl<DlRepairSoMapper, DlRepai
|
|||||||
// 通知仓库
|
// 通知仓库
|
||||||
repairWorkerService.sentMessage(Long.valueOf(newSo.getCreator()), newSo.getUserName() + "已确认退料单:" + newSo.getSoNo());
|
repairWorkerService.sentMessage(Long.valueOf(newSo.getCreator()), newSo.getUserName() + "已确认退料单:" + newSo.getSoNo());
|
||||||
// 记录日志
|
// 记录日志
|
||||||
|
// 查子表信息
|
||||||
|
List<DlTwItem> list = twItemService.list(new LambdaQueryWrapper<DlTwItem>().eq(DlTwItem::getTwId, newSo.getTwId()));
|
||||||
// 查申请表
|
// 查申请表
|
||||||
DlTicketWares byId = ticketWaresService.getById(newSo.getTwId());
|
DlTicketWares byId = ticketWaresService.getById(newSo.getTwId());
|
||||||
|
// 取当前操作人的名称
|
||||||
|
String remark = SecurityFrameworkUtils.getLoginUserNickname();
|
||||||
|
// 构建备注
|
||||||
|
/*
|
||||||
|
谁,退了什么配件,退了多少个
|
||||||
|
*/
|
||||||
|
List<String> nameAndCount = list.stream().map(item -> item.getWaresName() + "(" + item.getWaresCount() + ")").collect(Collectors.toList());
|
||||||
|
remark += "确认退料" + String.join(",", nameAndCount);
|
||||||
// 记录日志
|
// 记录日志
|
||||||
recordsService.saveRepairRecord(byId.getTicketId(), null, RecordTypeEnum.TL.getCode(), null, image);
|
recordsService.saveRepairRecord(byId.getTicketId(), null, RecordTypeEnum.TL.getCode(), remark, image);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,17 +1,22 @@
|
|||||||
package cn.iocoder.yudao.module.tickets.controller.admin;
|
package cn.iocoder.yudao.module.tickets.controller.admin;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.common.RecordTypeEnum;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.module.base.service.RepairRecordsService;
|
||||||
import cn.iocoder.yudao.module.tickets.entity.DlRepairTitem;
|
import cn.iocoder.yudao.module.tickets.entity.DlRepairTitem;
|
||||||
import cn.iocoder.yudao.module.tickets.service.DlRepairTitemService;
|
import cn.iocoder.yudao.module.tickets.service.DlRepairTitemService;
|
||||||
|
import cn.iocoder.yudao.module.tickets.vo.AddProjVO;
|
||||||
import cn.iocoder.yudao.module.tickets.vo.DlRepairTitemReqVO;
|
import cn.iocoder.yudao.module.tickets.vo.DlRepairTitemReqVO;
|
||||||
import cn.iocoder.yudao.module.tickets.vo.DlRepairTitemRespVO;
|
import cn.iocoder.yudao.module.tickets.vo.DlRepairTitemRespVO;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.ok;
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.ok;
|
||||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
@ -30,6 +35,8 @@ public class DlRepairTitemController {
|
|||||||
*/
|
*/
|
||||||
@Resource
|
@Resource
|
||||||
private DlRepairTitemService dlRepairTitemService;
|
private DlRepairTitemService dlRepairTitemService;
|
||||||
|
@Resource
|
||||||
|
private RepairRecordsService repairRecordsService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 维修工单子表 分页
|
* 维修工单子表 分页
|
||||||
@ -113,6 +120,26 @@ public class DlRepairTitemController {
|
|||||||
return CommonResult.ok();
|
return CommonResult.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加维修项目
|
||||||
|
* @author vinjor-M
|
||||||
|
* @date 14:28 2024/11/4
|
||||||
|
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<?>
|
||||||
|
**/
|
||||||
|
@PostMapping("/addNewProj")
|
||||||
|
@Operation(summary = "添加维修项目")
|
||||||
|
public CommonResult<?> addNewProj(@RequestBody AddProjVO addProjVO){
|
||||||
|
dlRepairTitemService.saveBatch(addProjVO.getItemList());
|
||||||
|
List<String> projNameList = addProjVO.getItemList().stream().map(DlRepairTitem::getItemName).collect(Collectors.toList());
|
||||||
|
//最后记录操作日志--创建工单
|
||||||
|
String remark = "添加维修项目"+String.join(", ",projNameList )+"。";
|
||||||
|
if(StringUtils.isNotEmpty(addProjVO.getRemark())){
|
||||||
|
remark += "备注:"+addProjVO.getRemark();
|
||||||
|
}
|
||||||
|
repairRecordsService.saveRepairRecord(addProjVO.getItemList().get(0).getTicketId(), null, RecordTypeEnum.TJWXXM.getCode(), remark, addProjVO.getImage());
|
||||||
|
return CommonResult.success(addProjVO.getItemList().get(0).getTicketId());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 维修工单单个子项
|
* 维修工单单个子项
|
||||||
*
|
*
|
||||||
@ -126,5 +153,6 @@ public class DlRepairTitemController {
|
|||||||
dlRepairTitemService.removeItemById(id);
|
dlRepairTitemService.removeItemById(id);
|
||||||
return CommonResult.ok();
|
return CommonResult.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ public class DlTicketWaresController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 员工确认领料
|
* 员工确认领料
|
||||||
*
|
* 弃用
|
||||||
* @author 小李
|
* @author 小李
|
||||||
* @date 22:07 2024/10/16
|
* @date 22:07 2024/10/16
|
||||||
* @param respVO 请求对象
|
* @param respVO 请求对象
|
||||||
@ -145,7 +145,7 @@ public class DlTicketWaresController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 仓库确认退料
|
* 仓库确认退料
|
||||||
*
|
* 弃用
|
||||||
* @author 小李
|
* @author 小李
|
||||||
* @date 22:03 2024/10/17
|
* @date 22:03 2024/10/17
|
||||||
* @param respVO 请求对象
|
* @param respVO 请求对象
|
||||||
|
@ -5,7 +5,6 @@ import cn.hutool.core.collection.CollectionUtil;
|
|||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.iocoder.yudao.common.*;
|
import cn.iocoder.yudao.common.*;
|
||||||
import cn.iocoder.yudao.framework.common.util.number.MoneyUtils;
|
import cn.iocoder.yudao.framework.common.util.number.MoneyUtils;
|
||||||
import cn.iocoder.yudao.framework.security.core.LoginUser;
|
|
||||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||||
import cn.iocoder.yudao.module.base.entity.RepairWorker;
|
import cn.iocoder.yudao.module.base.entity.RepairWorker;
|
||||||
import cn.iocoder.yudao.module.base.service.RepairRecordsService;
|
import cn.iocoder.yudao.module.base.service.RepairRecordsService;
|
||||||
@ -963,7 +962,13 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
|
|||||||
}
|
}
|
||||||
repairWorkerService.sentMessage(reqVO.getNowRepairId(), "您有新的工单要处理");
|
repairWorkerService.sentMessage(reqVO.getNowRepairId(), "您有新的工单要处理");
|
||||||
//最后记录操作日志--指派施工
|
//最后记录操作日志--指派施工
|
||||||
repairRecordsService.saveRepairRecord(reqVO.getId(), null, RecordTypeEnum.ZPSG.getCode(), "指派施工", null);
|
String code = RecordTypeEnum.ZPSG.getCode();
|
||||||
|
String remark ="指派施工";
|
||||||
|
if(StringUtils.isNotEmpty(reqVO.getOperateCode())){
|
||||||
|
code = reqVO.getOperateCode();
|
||||||
|
remark = "维修完成移交下一班组维修";
|
||||||
|
}
|
||||||
|
repairRecordsService.saveRepairRecord(reqVO.getId(), null,code, remark, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -421,6 +421,15 @@ public class DlTicketWaresServiceImpl extends ServiceImpl<DlTicketWaresMapper, D
|
|||||||
}));
|
}));
|
||||||
// 要操作的库存数据
|
// 要操作的库存数据
|
||||||
List<RepairWares> wares = repairWaresService.list(new LambdaQueryWrapper<RepairWares>().in(RepairWares::getId, respVO.getRepairSois().stream().map(DlRepairSoi::getGoodsId).collect(Collectors.toList())));
|
List<RepairWares> wares = repairWaresService.list(new LambdaQueryWrapper<RepairWares>().in(RepairWares::getId, respVO.getRepairSois().stream().map(DlRepairSoi::getGoodsId).collect(Collectors.toList())));
|
||||||
|
Map<String,String> waresNameMap = wares.stream().collect(Collectors.toMap(RepairWares::getId,RepairWares::getName));
|
||||||
|
String remarkStr="";
|
||||||
|
for(DlRepairSoi item:respVO.getRepairSois()){
|
||||||
|
//组装通知领取配件的文字
|
||||||
|
if(!"".equals(remarkStr)){
|
||||||
|
remarkStr +=";";
|
||||||
|
}
|
||||||
|
remarkStr += waresNameMap.get(item.getGoodsId())+"x"+item.getGoodsCount();
|
||||||
|
}
|
||||||
if (type.equals("02")) { // 领料
|
if (type.equals("02")) { // 领料
|
||||||
// 构造新数据
|
// 构造新数据
|
||||||
List<DlTwItem> newData = oldData.stream().map(item -> {
|
List<DlTwItem> newData = oldData.stream().map(item -> {
|
||||||
@ -512,7 +521,7 @@ public class DlTicketWaresServiceImpl extends ServiceImpl<DlTicketWaresMapper, D
|
|||||||
//插入记录
|
//插入记录
|
||||||
//最后记录操作日志--创建工单
|
//最后记录操作日志--创建工单
|
||||||
repairRecordsService.saveRepairRecord(respVO.getTicketId(), null, "02".equals(type)?RecordTypeEnum.TZLL.getCode():RecordTypeEnum.TZTL.getCode(),
|
repairRecordsService.saveRepairRecord(respVO.getTicketId(), null, "02".equals(type)?RecordTypeEnum.TZLL.getCode():RecordTypeEnum.TZTL.getCode(),
|
||||||
"02".equals(type)?"通知领料":"通知退料", null);
|
("02".equals(type)?"通知领料":"通知退料")+",配件明细:"+remarkStr, null);
|
||||||
// 通知维修工
|
// 通知维修工
|
||||||
// 查维修工的userId
|
// 查维修工的userId
|
||||||
repairWorkerService.sentMessage(respVO.getRepairId(), type.equals("02") ? "您有新的领料单需要确认" : "您有新的退料单需要确认");
|
repairWorkerService.sentMessage(respVO.getRepairId(), type.equals("02") ? "您有新的领料单需要确认" : "您有新的退料单需要确认");
|
||||||
|
@ -0,0 +1,21 @@
|
|||||||
|
package cn.iocoder.yudao.module.tickets.vo;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.tickets.entity.DlRepairTitem;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 维修过程中添加维修项目vo
|
||||||
|
* @author vinjor-M
|
||||||
|
* @date 14:43 2024/11/4
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
public class AddProjVO {
|
||||||
|
/** 添加的项目信息 */
|
||||||
|
private List<DlRepairTitem> itemList;
|
||||||
|
/** 签字图片相对路径 */
|
||||||
|
private String image;
|
||||||
|
/** 备注内容 */
|
||||||
|
private String remark;
|
||||||
|
}
|
@ -33,4 +33,7 @@ public class DlRepairTicketsReqVO extends DlRepairTickets {
|
|||||||
|
|
||||||
/** 人员角色code */
|
/** 人员角色code */
|
||||||
private String roleCode;
|
private String roleCode;
|
||||||
|
|
||||||
|
/** 操作类型默认是指派施工 --zpsg */
|
||||||
|
private String operateCode;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user