From 38395104a8778ebf9655bc447a191714f56b4b91 Mon Sep 17 00:00:00 2001 From: xiaofajia <1665375861@qq.com> Date: Mon, 4 Nov 2024 17:19:40 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=91=98=E5=B7=A5=E7=A1=AE=E8=AE=A4?= =?UTF-8?q?=E9=A2=86=E6=96=99=E3=80=81=E9=80=80=E6=96=99=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E5=90=8D=E7=A7=B0=E5=92=8C=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/DlRepairSoServiceImpl.java | 28 +++++++++++++++---- .../admin/DlTicketWaresController.java | 4 +-- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/service/impl/DlRepairSoServiceImpl.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/service/impl/DlRepairSoServiceImpl.java index 57df6332..a6f90303 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/service/impl/DlRepairSoServiceImpl.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/service/impl/DlRepairSoServiceImpl.java @@ -323,7 +323,7 @@ public class DlRepairSoServiceImpl extends ServiceImpl().eq(DlRepairSo::getId, id)); + DlRepairSo so = baseMapper.selectById(id); List list = twItemService.list(new LambdaQueryWrapper().eq(DlTwItem::getTwId, so.getTwId())); // 判断是部分完成还是全部完成 DlTicketWares dlTicketWares = new DlTicketWares(); @@ -333,16 +333,22 @@ public class DlRepairSoServiceImpl extends ServiceImpl nameAndCount = list.stream().map(item -> item.getWaresName() + "(" + 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 list = twItemService.list(new LambdaQueryWrapper().eq(DlTwItem::getTwId, newSo.getTwId())); // 查申请表 DlTicketWares byId = ticketWaresService.getById(newSo.getTwId()); + // 取当前操作人的名称 + String remark = SecurityFrameworkUtils.getLoginUserNickname(); + // 构建备注 + /* + 谁,退了什么配件,退了多少个 + */ + List 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); } /** diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/controller/admin/DlTicketWaresController.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/controller/admin/DlTicketWaresController.java index a00c74d7..4d598c98 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/controller/admin/DlTicketWaresController.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/controller/admin/DlTicketWaresController.java @@ -131,7 +131,7 @@ public class DlTicketWaresController { /** * 员工确认领料 - * + * 弃用 * @author 小李 * @date 22:07 2024/10/16 * @param respVO 请求对象 @@ -145,7 +145,7 @@ public class DlTicketWaresController { /** * 仓库确认退料 - * + * 弃用 * @author 小李 * @date 22:03 2024/10/17 * @param respVO 请求对象 From b7163b6aead56db273b36cd0117070a6d8fbd8e7 Mon Sep 17 00:00:00 2001 From: Vinjor Date: Mon, 4 Nov 2024 18:10:46 +0800 Subject: [PATCH 2/3] 1 --- .../iocoder/yudao/common/RecordTypeEnum.java | 4 +++ .../admin/DlRepairTitemController.java | 28 +++++++++++++++++++ .../yudao/module/tickets/vo/AddProjVO.java | 21 ++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/vo/AddProjVO.java diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RecordTypeEnum.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RecordTypeEnum.java index 7e43c8a0..32841686 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RecordTypeEnum.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RecordTypeEnum.java @@ -61,6 +61,10 @@ public enum RecordTypeEnum { TZTL("tztl","通知退料"), /**审批配件申请单*/ SPPJSQD("sppjsqd","审批配件申请单"), + /** + * 添加维修项目 + */ + TJWXXM("tjwxxm", "添加维修项目"), /** * 接单 */ diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/controller/admin/DlRepairTitemController.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/controller/admin/DlRepairTitemController.java index 7dcd45f3..3425bef1 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/controller/admin/DlRepairTitemController.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/controller/admin/DlRepairTitemController.java @@ -1,17 +1,22 @@ 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.module.base.service.RepairRecordsService; import cn.iocoder.yudao.module.tickets.entity.DlRepairTitem; 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.DlRepairTitemRespVO; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import io.swagger.v3.oas.annotations.Operation; +import org.apache.commons.lang3.StringUtils; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; 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.success; @@ -30,6 +35,8 @@ public class DlRepairTitemController { */ @Resource private DlRepairTitemService dlRepairTitemService; + @Resource + private RepairRecordsService repairRecordsService; /** * 维修工单子表 分页 @@ -113,6 +120,26 @@ public class DlRepairTitemController { 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 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); return CommonResult.ok(); } + } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/vo/AddProjVO.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/vo/AddProjVO.java new file mode 100644 index 00000000..8302167c --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/vo/AddProjVO.java @@ -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 itemList; + /** 签字图片相对路径 */ + private String image; + /** 备注内容 */ + private String remark; +} From 2dde810dec7f70857c473062bcbeb473e671415d Mon Sep 17 00:00:00 2001 From: Vinjor Date: Mon, 4 Nov 2024 18:43:25 +0800 Subject: [PATCH 3/3] 1 --- .../service/impl/DlRepairSoServiceImpl.java | 4 ++-- .../service/impl/DlRepairTicketsServiceImpl.java | 9 +++++++-- .../service/impl/DlTicketWaresServiceImpl.java | 11 ++++++++++- .../yudao/module/tickets/vo/DlRepairTicketsReqVO.java | 3 +++ 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/service/impl/DlRepairSoServiceImpl.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/service/impl/DlRepairSoServiceImpl.java index a6f90303..0b82966c 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/service/impl/DlRepairSoServiceImpl.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/service/impl/DlRepairSoServiceImpl.java @@ -345,8 +345,8 @@ public class DlRepairSoServiceImpl extends ServiceImpl nameAndCount = list.stream().map(item -> item.getWaresName() + "(" + item.getWaresCount() + ")").collect(Collectors.toList()); - remark += "确认领料" + String.join(",", nameAndCount); + List 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(), remark, image); } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java index 32f6246c..c7a2d4e3 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java @@ -5,7 +5,6 @@ import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.ObjectUtil; import cn.iocoder.yudao.common.*; 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.module.base.entity.RepairWorker; import cn.iocoder.yudao.module.base.service.RepairRecordsService; @@ -963,7 +962,13 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl wares = repairWaresService.list(new LambdaQueryWrapper().in(RepairWares::getId, respVO.getRepairSois().stream().map(DlRepairSoi::getGoodsId).collect(Collectors.toList()))); + Map 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")) { // 领料 // 构造新数据 List newData = oldData.stream().map(item -> { @@ -512,7 +521,7 @@ public class DlTicketWaresServiceImpl extends ServiceImpl