From 6c86a132bef48c72ddc1accf472e74ba02b1619b Mon Sep 17 00:00:00 2001 From: xiaofajia <1665375861@qq.com> Date: Sat, 23 Nov 2024 14:51:34 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E9=A2=86=E6=96=99=E9=85=8D=E4=BB=B6?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=9B=BE=E7=89=87=E7=94=B1=E5=91=98=E5=B7=A5?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=94=B9=E4=BB=93=E5=BA=93=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/DlTicketWaresServiceImpl.java | 23 +------------------ .../tickets/vo/DlTicketWaresRespVO.java | 3 +++ 2 files changed, 4 insertions(+), 22 deletions(-) diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlTicketWaresServiceImpl.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlTicketWaresServiceImpl.java index d1acbb02..7323477e 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlTicketWaresServiceImpl.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlTicketWaresServiceImpl.java @@ -498,31 +498,10 @@ public class DlTicketWaresServiceImpl extends ServiceImpl oldData = twItemService.list(new LambdaQueryWrapper().in(DlTwItem::getId, respVO.getItems().stream().map(DlTwItem::getId).collect(Collectors.toList()))); -// // 构造新数据 -// List newData = oldData.stream().map(item -> { -// DlTwItem dlTwItem = new DlTwItem(); -// dlTwItem.setId(item.getId()); -// respVO.getRepairSois().stream() -// .filter(i -> i.getGoodsId().equals(item.getWaresId())) -// .findFirst() -// .ifPresent(repairSoi -> { -// dlTwItem.setWaresCouldCount(repairSoi.getGoodsCount()); -// dlTwItem.setWaresStatus(repairSoi.getGoodsCount().equals(item.getWaresCount()) ? "04" : item.getWaresStatus()); -// }); -// return dlTwItem; -// }).collect(Collectors.toList()); -// twItemService.updateBatchById(newData); -// } //插入记录 //最后记录操作日志--创建工单 repairRecordsService.saveRepairRecord(respVO.getTicketId(), null, "02".equals(type) ? RecordTypeEnum.TZLL.getCode() : RecordTypeEnum.TZTL.getCode(), - ("02".equals(type) ? "通知领料" : "通知退料") + ",配件明细:" + remarkStr, null); + ("02".equals(type) ? "通知领料" : "通知退料") + ",配件明细:" + remarkStr, respVO.getImages()); // 通知维修工 // 查维修工的userId repairWorkerService.sentMessage(respVO.getRepairId(), type.equals("02") ? "您有新的领料单需要确认" : "您有新的退料单需要确认"); diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/vo/DlTicketWaresRespVO.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/vo/DlTicketWaresRespVO.java index 111abd9b..1e481867 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/vo/DlTicketWaresRespVO.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/vo/DlTicketWaresRespVO.java @@ -33,4 +33,7 @@ public class DlTicketWaresRespVO extends DlTicketWares { /** 更新配件库子表价格 */ private List repairWaresList; + + /** 通知领料时上传的图片 */ + private String images; } From 15798022e3026f808edc5dfad2136f7b8531b87d Mon Sep 17 00:00:00 2001 From: xiaofajia <1665375861@qq.com> Date: Sat, 23 Nov 2024 17:12:55 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E9=A2=86=E6=96=99=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../stockOperate/entity/DlRepairSo.java | 3 ++ .../service/impl/DlRepairSoServiceImpl.java | 51 +++++++++++++------ .../mapper/stockOperate/DlRepairSoMapper.xml | 6 ++- 3 files changed, 43 insertions(+), 17 deletions(-) diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/entity/DlRepairSo.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/entity/DlRepairSo.java index 7293b598..200b0673 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/entity/DlRepairSo.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/entity/DlRepairSo.java @@ -124,4 +124,7 @@ public class DlRepairSo extends TenantBaseDO { */ @TableField(exist = false) private String licenseNumber; + + /** 用户记录那些人可以看这条记录 */ + private String userIds; } \ No newline at end of file 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 2d3c7f4d..7e98bc3c 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 @@ -50,6 +50,7 @@ import java.util.function.Function; import java.util.stream.Collectors; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception0; /** * 针对表【dl_repair_so(采购单领料单)】的数据库操作Service实现 @@ -128,7 +129,7 @@ public class DlRepairSoServiceImpl extends ServiceImpl() + .set(DlRepairSo::getSoStatus, SoStatusEnum.DEPRECATED.getCode()) + .and(i -> + i.eq(DlRepairSo::getId, repairSoReqVO.getId()) + .ne(DlRepairSo::getSoStatus, SoStatusEnum.DEPRECATED.getCode()) + .ne(DlRepairSo::getSoStatus, SoStatusEnum.PICKED.getCode()) + )); + if (update == 0) { + throw exception0(500, "该单据已有其他人操作"); + } // 下面的代码是因为这个接口还有地方在用 // 查主表 @@ -248,11 +258,11 @@ public class DlRepairSoServiceImpl extends ServiceImpl i.getGoodsId().equals(item.getWaresId())).findFirst().ifPresent(repairSoiByTwItem -> { - if (so.getSoType().equals("02")){ + if (so.getSoType().equals("02")) { dlTwItem.setWaresAlreadyCount(item.getWaresAlreadyCount() - repairSoiByTwItem.getGoodsCount()); // 不操作配件申请表子表的状态 // dlTwItem.setWaresStatus("02"); - }else { + } else { dlTwItem.setWaresAlreadyCount(item.getWaresAlreadyCount() + repairSoiByTwItem.getGoodsCount()); } }); @@ -263,7 +273,7 @@ public class DlRepairSoServiceImpl extends ServiceImpl i.getGoodsId().equals(wares.getId())).findFirst().ifPresent(repairSoiByWares -> { - if (so.getSoType().equals("02")){ + if (so.getSoType().equals("02")) { wares.setStock(item.getStock().add(BigDecimal.valueOf(repairSoiByWares.getGoodsCount()))); } // 采购改了入库逻辑,不能在这里扣库存 @@ -325,11 +335,22 @@ public class DlRepairSoServiceImpl extends ServiceImpl() + .set(DlRepairSo::getSoStatus, SoStatusEnum.PICKED.getCode()) + .and(i -> { + i.eq(DlRepairSo::getId, id) + .ne(DlRepairSo::getSoStatus, SoStatusEnum.PICKED.getCode()) + .ne(DlRepairSo::getSoStatus, SoStatusEnum.DEPRECATED.getCode()); + }) + ); + if (update == 0) { + throw exception0(500, "该领料单已有其他人操作"); + } +// DlRepairSo dlRepairSo = new DlRepairSo(); +// dlRepairSo.setId(id); +// dlRepairSo.setSoStatus(SoStatusEnum.PICKED.getCode()); +// baseMapper.u // 查最新的子表信息 DlRepairSo so = baseMapper.selectById(id); @@ -469,7 +490,7 @@ public class DlRepairSoServiceImpl extends ServiceImpl wareMap = filterWare.stream().collect(Collectors.toMap(DlRepairSoi::getGoodsId, soi -> soi)); //采购配件按照按照原始配件库id分组,目的取出价格---不是用wareId,是用GoodsId,wareId是仓库 - Map itemsMap = pmsWaresList.stream().collect(Collectors.toMap(DlRepairSoi::getGoodsId,soi -> soi)); + Map itemsMap = pmsWaresList.stream().collect(Collectors.toMap(DlRepairSoi::getGoodsId, soi -> soi)); waresList.forEach(item -> { DlRepairSoi filterSoi = wareMap.get(item.getId()); DlRepairSoi itemSoi = itemsMap.get(item.getId()); @@ -526,7 +547,7 @@ public class DlRepairSoServiceImpl extends ServiceImpl waresGroupList = new ArrayList<>(); if (CollectionUtil.isNotEmpty(dlRepairSoiRespVOList)) { //先过滤出itenTypeId为null或空,或者itemTypeName为null或空的,为单独一个组 - List nullList = dlRepairSoiRespVOList.stream().filter(item-> StringUtils.isEmpty(item.getTypeId()) || StringUtils.isEmpty(item.getTypeName())).collect(Collectors.toList()); + List nullList = dlRepairSoiRespVOList.stream().filter(item -> StringUtils.isEmpty(item.getTypeId()) || StringUtils.isEmpty(item.getTypeName())).collect(Collectors.toList()); if (CollectionUtil.isNotEmpty(nullList)) { AppWaresGroupVO waresGroupVO = new AppWaresGroupVO(); waresGroupVO.setSoiRespVOList(nullList); @@ -535,8 +556,8 @@ public class DlRepairSoServiceImpl extends ServiceImpl> groupListMap = dlRepairSoiRespVOList.stream().filter(item->StringUtils.isNotEmpty(item.getTypeId()) && StringUtils.isNotEmpty(item.getTypeName())).collect(Collectors.groupingBy(DlRepairSoiRespVO::getTypeId)); - for (String key:groupListMap.keySet()){ + Map> groupListMap = dlRepairSoiRespVOList.stream().filter(item -> StringUtils.isNotEmpty(item.getTypeId()) && StringUtils.isNotEmpty(item.getTypeName())).collect(Collectors.groupingBy(DlRepairSoiRespVO::getTypeId)); + for (String key : groupListMap.keySet()) { AppWaresGroupVO waresGroupVO = new AppWaresGroupVO(); waresGroupVO.setSoiRespVOList(groupListMap.get(key)); waresGroupVO.setGroupName(groupListMap.get(key).get(0).getTypeName()); diff --git a/dl-module-repair/src/main/resources/mapper/stockOperate/DlRepairSoMapper.xml b/dl-module-repair/src/main/resources/mapper/stockOperate/DlRepairSoMapper.xml index e3efa60c..7b4add8c 100644 --- a/dl-module-repair/src/main/resources/mapper/stockOperate/DlRepairSoMapper.xml +++ b/dl-module-repair/src/main/resources/mapper/stockOperate/DlRepairSoMapper.xml @@ -26,6 +26,7 @@ + @@ -50,7 +51,8 @@ so.update_time, so.updater, so.tw_id, - dtw.license_number + dtw.license_number, + so.user_ids from dl_repair_so so LEFT JOIN dl_ticket_wares dtw ON so.tw_id = dtw.id where so.deleted = '0' @@ -83,7 +85,7 @@ and (so.so_no like concat('%', #{map.soNo}, '%') or so.remark like concat('%', #{map.soNo}, '%')) - and (so.user_id = #{map.userId}) + and (so.user_id = #{map.userId} or find_in_set(#{map.userId}, so.user_ids) > 0) and so.main_id = #{map.mainId} From 21ae569ccd132476262abd8702df23363368bf50 Mon Sep 17 00:00:00 2001 From: xiaofajia <1665375861@qq.com> Date: Mon, 25 Nov 2024 18:08:41 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E9=80=80=E6=96=99=E6=97=B6=E4=BF=9D?= =?UTF-8?q?=E8=AF=81=E6=95=B0=E6=8D=AE=E7=9A=84=E4=B8=80=E8=87=B4=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../stockOperate/service/impl/DlRepairSoServiceImpl.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 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 7e98bc3c..c4bdcc86 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 @@ -392,10 +392,15 @@ public class DlRepairSoServiceImpl extends ServiceImpl() + int update = baseMapper.update(new LambdaUpdateWrapper() .set(DlRepairSo::getSoStatus, SoStatusEnum.RETURNED.getCode()) - .eq(DlRepairSo::getId, id) + .and(i -> i.eq(DlRepairSo::getId, id) + .ne(DlRepairSo::getSoStatus, SoStatusEnum.RETURNED.getCode()) + .ne(DlRepairSo::getSoStatus, SoStatusEnum.DEPRECATED.getCode())) ); + if (update == 0){ + throw exception0(500, "该退料单已有其他人操作"); + } // 查主表 DlRepairSo newSo = baseMapper.selectById(id); // 通知仓库 From 9f281804817b3078177976d2e50aec200c67d424 Mon Sep 17 00:00:00 2001 From: xiaofajia <1665375861@qq.com> Date: Tue, 26 Nov 2024 10:33:53 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E9=85=8D=E4=BB=B6=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E5=8D=95=E5=B7=A6=E4=B8=8B=E8=A7=92=E6=B7=BB=E5=8A=A0=E3=80=90?= =?UTF-8?q?=E5=85=A5=E5=BA=93=E5=8D=95=E3=80=91=E6=8C=89=E9=92=AE=EF=BC=8C?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E5=90=8E=EF=BC=8C=E8=B7=B3=E8=BD=AC=E5=88=B0?= =?UTF-8?q?=E9=87=87=E8=B4=AD=E5=8D=95=E5=88=97=E8=A1=A8=EF=BC=8C=E5=88=97?= =?UTF-8?q?=E5=87=BA=E9=85=8D=E4=BB=B6=E7=94=B3=E8=AF=B7=E5=8D=95=E5=85=B3?= =?UTF-8?q?=E8=81=94=E7=9A=84=E6=89=80=E6=9C=89=E9=87=87=E8=B4=AD=E5=8D=95?= =?UTF-8?q?=EF=BC=8C=E8=83=BD=E7=82=B9=E5=87=BB=E5=85=A5=E5=BA=93=EF=BC=8C?= =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E5=85=A5=E5=BA=93=E5=8D=95=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/mapper/stockOperate/DlRepairSoMapper.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dl-module-repair/src/main/resources/mapper/stockOperate/DlRepairSoMapper.xml b/dl-module-repair/src/main/resources/mapper/stockOperate/DlRepairSoMapper.xml index 7b4add8c..93546bc3 100644 --- a/dl-module-repair/src/main/resources/mapper/stockOperate/DlRepairSoMapper.xml +++ b/dl-module-repair/src/main/resources/mapper/stockOperate/DlRepairSoMapper.xml @@ -90,6 +90,9 @@ and so.main_id = #{map.mainId} + + and so.tw_id = #{map.twId} + order by so.create_time desc \ No newline at end of file From e21ee7197e03fb000044aa8f77bfca225a10ede8 Mon Sep 17 00:00:00 2001 From: xiaofajia <1665375861@qq.com> Date: Wed, 27 Nov 2024 15:35:02 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E4=B8=80=E4=B8=AA=E5=B0=8Fbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/stockOperate/service/impl/DlRepairSoServiceImpl.java | 1 + 1 file changed, 1 insertion(+) 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 811a1336..f4bc2d67 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 @@ -225,6 +225,7 @@ public class DlRepairSoServiceImpl extends ServiceImpl