Compare commits
3 Commits
33c7513050
...
0797e13704
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0797e13704 | ||
|
|
fd93a730be | ||
|
|
b66eed3a37 |
@ -5,6 +5,7 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|||||||
import cn.iocoder.yudao.module.stockOperate.entity.DlRepairSoi;
|
import cn.iocoder.yudao.module.stockOperate.entity.DlRepairSoi;
|
||||||
import cn.iocoder.yudao.module.stockOperate.service.DlRepairSoiService;
|
import cn.iocoder.yudao.module.stockOperate.service.DlRepairSoiService;
|
||||||
import cn.iocoder.yudao.module.stockOperate.vo.DlRepairSoiReqVO;
|
import cn.iocoder.yudao.module.stockOperate.vo.DlRepairSoiReqVO;
|
||||||
|
import cn.iocoder.yudao.module.stockOperate.vo.DlRepairSoiRespVO;
|
||||||
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.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
@ -88,5 +89,23 @@ public class DlRepairSoiController{
|
|||||||
public CommonResult<?> getMapBySoIdAndQuery(@RequestParam("id") String id, @RequestParam("query") String query) {
|
public CommonResult<?> getMapBySoIdAndQuery(@RequestParam("id") String id, @RequestParam("query") String query) {
|
||||||
return success(dlRepairSoiService.getMapBySoIdAndQuery(id, query));
|
return success(dlRepairSoiService.getMapBySoIdAndQuery(id, query));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据供应商查询该供应商采购过的配件 分页
|
||||||
|
*
|
||||||
|
* @author 小李
|
||||||
|
* @date 11:49 2024/11/28
|
||||||
|
* @param reqVO 查询对象
|
||||||
|
* @param pageNo 页码
|
||||||
|
* @param pageSize 条数
|
||||||
|
**/
|
||||||
|
@GetMapping("/getSoBySupplier")
|
||||||
|
@Operation(summary = "根据供应商查询该供应商采购过的配件 分页")
|
||||||
|
public CommonResult<?> getSoBySupplier(DlRepairSoiReqVO reqVO,
|
||||||
|
@RequestParam(value = "pageNo", defaultValue = "1")Integer pageNo,
|
||||||
|
@RequestParam(value = "pageSize", defaultValue = "10")Integer pageSize){
|
||||||
|
Page<DlRepairSoiRespVO> page = new Page<>(pageNo, pageSize);
|
||||||
|
return success(dlRepairSoiService.getSoBySupplier(reqVO, page));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -36,6 +36,15 @@ public interface DlRepairSoiMapper extends BaseMapper<DlRepairSoi> {
|
|||||||
* @param id id
|
* @param id id
|
||||||
**/
|
**/
|
||||||
List<DlRepairSoiRespVO> getMapBySoIdAndQuery(@Param("id") String id, @Param("query") String query);
|
List<DlRepairSoiRespVO> getMapBySoIdAndQuery(@Param("id") String id, @Param("query") String query);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据供应商查询该供应商采购过的配件
|
||||||
|
*
|
||||||
|
* @author 小李
|
||||||
|
* @date 11:49 2024/11/28
|
||||||
|
* @param reqVO 查询对象
|
||||||
|
**/
|
||||||
|
IPage<DlRepairSoiRespVO> getSoBySupplier(@Param("map") DlRepairSoiReqVO reqVO, Page<DlRepairSoiRespVO> page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -64,4 +64,13 @@ public interface DlRepairSoiService extends IService<DlRepairSoi> {
|
|||||||
* @param id id
|
* @param id id
|
||||||
**/
|
**/
|
||||||
Map<String, List<DlRepairSoiRespVO>> getMapBySoIdAndQuery(String id, String query);
|
Map<String, List<DlRepairSoiRespVO>> getMapBySoIdAndQuery(String id, String query);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据供应商查询该供应商采购过的配件
|
||||||
|
*
|
||||||
|
* @author 小李
|
||||||
|
* @date 11:49 2024/11/28
|
||||||
|
* @param reqVO 查询对象
|
||||||
|
**/
|
||||||
|
IPage<DlRepairSoiRespVO> getSoBySupplier(DlRepairSoiReqVO reqVO, Page<DlRepairSoiRespVO> page);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,6 +20,7 @@ import cn.iocoder.yudao.module.stockOperate.service.DlRepairSoService;
|
|||||||
import cn.iocoder.yudao.module.stockOperate.service.DlRepairSoiService;
|
import cn.iocoder.yudao.module.stockOperate.service.DlRepairSoiService;
|
||||||
import cn.iocoder.yudao.module.stockOperate.vo.DlRepairSoReqVO;
|
import cn.iocoder.yudao.module.stockOperate.vo.DlRepairSoReqVO;
|
||||||
import cn.iocoder.yudao.module.stockOperate.vo.DlRepairSoRespVO;
|
import cn.iocoder.yudao.module.stockOperate.vo.DlRepairSoRespVO;
|
||||||
|
import cn.iocoder.yudao.module.stockOperate.vo.DlRepairSoiReqVO;
|
||||||
import cn.iocoder.yudao.module.stockOperate.vo.DlRepairSoiRespVO;
|
import cn.iocoder.yudao.module.stockOperate.vo.DlRepairSoiRespVO;
|
||||||
import cn.iocoder.yudao.module.supplier.service.BaseSupplierService;
|
import cn.iocoder.yudao.module.supplier.service.BaseSupplierService;
|
||||||
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
|
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
|
||||||
@ -120,14 +121,6 @@ public class DlRepairSoServiceImpl extends ServiceImpl<DlRepairSoMapper, DlRepai
|
|||||||
@Override
|
@Override
|
||||||
public void createRepairSo(DlRepairSoRespVO repairSoRespVO) {
|
public void createRepairSo(DlRepairSoRespVO repairSoRespVO) {
|
||||||
repairSoRespVO.setSoTime(new Date());
|
repairSoRespVO.setSoTime(new Date());
|
||||||
// 加个判断,可能出现没有设置价格的情况----需求说了非必填,注掉
|
|
||||||
// if (repairSoRespVO.getGoodsList() != null){
|
|
||||||
// repairSoRespVO.getGoodsList().forEach(item -> {
|
|
||||||
// if (item.getGoodsPrice() == null){
|
|
||||||
// throw exception0(500, "有配件未设置进价");
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
//保存供应商
|
//保存供应商
|
||||||
if (StringUtils.isEmpty(repairSoRespVO.getSupplierId())) {
|
if (StringUtils.isEmpty(repairSoRespVO.getSupplierId())) {
|
||||||
//采购单中录入供应商或无供应商情况
|
//采购单中录入供应商或无供应商情况
|
||||||
@ -163,7 +156,6 @@ public class DlRepairSoServiceImpl extends ServiceImpl<DlRepairSoMapper, DlRepai
|
|||||||
}
|
}
|
||||||
repairSoRespVO.getGoodsList().forEach(item -> {
|
repairSoRespVO.getGoodsList().forEach(item -> {
|
||||||
item.setSoId(repairSoRespVO.getId());
|
item.setSoId(repairSoRespVO.getId());
|
||||||
// item.setSoiType(repairSoRespVO.getSoType());
|
|
||||||
});
|
});
|
||||||
repairSoiService.saveBatch(repairSoRespVO.getGoodsList());
|
repairSoiService.saveBatch(repairSoRespVO.getGoodsList());
|
||||||
|
|
||||||
@ -171,30 +163,6 @@ public class DlRepairSoServiceImpl extends ServiceImpl<DlRepairSoMapper, DlRepai
|
|||||||
// 前端选择了配件生成采购单的时候,可能会改配件的一些信息,但不知道会改什么,直接拿到全部,重新更新
|
// 前端选择了配件生成采购单的时候,可能会改配件的一些信息,但不知道会改什么,直接拿到全部,重新更新
|
||||||
List<RepairWares> waresList = repairSoRespVO.getWaresList();
|
List<RepairWares> waresList = repairSoRespVO.getWaresList();
|
||||||
waresService.updateBatchById(waresList);
|
waresService.updateBatchById(waresList);
|
||||||
|
|
||||||
// 操作配件库存表---应该是弃用了
|
|
||||||
// 获取所有需要操作的数据----生成采购单的时候,不直接操作库存,放到下面的inWares方法去操作
|
|
||||||
// if (repairSoRespVO.getSoType() != null && !repairSoRespVO.getSoType().equals("01")){
|
|
||||||
// List<DlRepairSoi> goodsList = repairSoRespVO.getGoodsList();
|
|
||||||
// List<String> ids = goodsList.stream().map(DlRepairSoi::getGoodsId).collect(Collectors.toList());
|
|
||||||
// List<RepairWares> repairWares = waresService.listByIds(ids);
|
|
||||||
// // 更新库存和进价
|
|
||||||
// List<RepairWares> newWares = repairWares.stream().map(item -> {
|
|
||||||
// // 取数据
|
|
||||||
// DlRepairSoi repairSoi = goodsList.stream().filter(i -> i.getGoodsId().equals(item.getId())).collect(Collectors.toList()).get(0);
|
|
||||||
// // 设置新值
|
|
||||||
// // 如果是采购入库,数量+,如果是领料出库,数量-
|
|
||||||
// // 01, 03 是采购 02 是领料
|
|
||||||
// BigDecimal count = new BigDecimal(repairSoi.getGoodsCount());
|
|
||||||
// RepairWares wares = new RepairWares();
|
|
||||||
// wares.setId(item.getId());
|
|
||||||
// wares.setStock("02".equals(repairSoRespVO.getSoType()) ? item.getStock().subtract(count) : item.getStock().add(count));
|
|
||||||
// // 更新进价
|
|
||||||
// wares.setPurPrice(repairSoi.getGoodsPrice());
|
|
||||||
// return wares;
|
|
||||||
// }).collect(Collectors.toList());
|
|
||||||
// waresService.updateBatchById(newWares);
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -348,21 +316,17 @@ public class DlRepairSoServiceImpl extends ServiceImpl<DlRepairSoMapper, DlRepai
|
|||||||
if (update == 0) {
|
if (update == 0) {
|
||||||
throw exception0(500, "该领料单已有其他人操作");
|
throw exception0(500, "该领料单已有其他人操作");
|
||||||
}
|
}
|
||||||
// DlRepairSo dlRepairSo = new DlRepairSo();
|
|
||||||
// dlRepairSo.setId(id);
|
|
||||||
// dlRepairSo.setSoStatus(SoStatusEnum.PICKED.getCode());
|
|
||||||
// baseMapper.u
|
|
||||||
|
|
||||||
// 查最新的子表信息
|
// 查最新的子表信息
|
||||||
DlRepairSo so = baseMapper.selectById(id);
|
DlRepairSo so = baseMapper.selectById(id);
|
||||||
List<DlTwItem> list = twItemService.list(new LambdaQueryWrapper<DlTwItem>().eq(DlTwItem::getTwId, so.getTwId()));
|
List<DlRepairSoi> sois = repairSoiService.list(new LambdaQueryWrapper<DlRepairSoi>().eq(DlRepairSoi::getSoId, id));
|
||||||
// 判断是部分完成还是全部完成----不需要判断了
|
Set<String> waresIds = sois.stream().map(DlRepairSoi::getGoodsId).collect(Collectors.toSet());
|
||||||
// DlTicketWares dlTicketWares = new DlTicketWares();
|
List<RepairWares> repairWares = repairWaresService.listByIds(waresIds);
|
||||||
// dlTicketWares.setId(so.getTwId());
|
List<DlRepairSoiRespVO> list = sois.stream().map(item -> {
|
||||||
// List<DlTwItem> flag = list.stream().filter(item -> !item.getWaresStatus().equals("01")).collect(Collectors.toList());
|
DlRepairSoiRespVO bean = BeanUtil.toBean(item, DlRepairSoiRespVO.class);
|
||||||
// dlTicketWares.setStatus(CollectionUtil.isEmpty(flag) ? "03" : "04");
|
repairWares.stream().filter(i -> i.getId().equals(item.getGoodsId())).findFirst().ifPresent(bean::setWares);
|
||||||
// 更新主表的状态
|
return bean;
|
||||||
// ticketWaresService.updateById(dlTicketWares);
|
}).collect(Collectors.toList());
|
||||||
|
|
||||||
// 通知仓库
|
// 通知仓库
|
||||||
repairWorkerService.sentMessage(Long.valueOf(so.getCreator()), so.getUserName() + "已确认领料单:" + so.getSoNo());
|
repairWorkerService.sentMessage(Long.valueOf(so.getCreator()), so.getUserName() + "已确认领料单:" + so.getSoNo());
|
||||||
@ -371,20 +335,24 @@ public class DlRepairSoServiceImpl extends ServiceImpl<DlRepairSoMapper, DlRepai
|
|||||||
// 查配件申请表
|
// 查配件申请表
|
||||||
DlTicketWares byId = ticketWaresService.getById(so.getTwId());
|
DlTicketWares byId = ticketWaresService.getById(so.getTwId());
|
||||||
// 取当前操作人的名称
|
// 取当前操作人的名称
|
||||||
String remark = SecurityFrameworkUtils.getLoginUserNickname();
|
StringBuilder remark = new StringBuilder("确认领料: ");
|
||||||
// 构建备注
|
// 构建备注
|
||||||
/*
|
/*
|
||||||
谁,领了什么配件,领了多少个
|
谁,领了什么配件,领了多少个
|
||||||
*/
|
*/
|
||||||
List<String> nameAndCount = list.stream().map(item -> item.getWaresName() + "x" + item.getWaresCount()).collect(Collectors.toList());
|
for (int i = 0; i < list.size(); i++) {
|
||||||
remark += "确认领料" + String.join(";", nameAndCount);
|
DlRepairSoiRespVO item = list.get(i);
|
||||||
|
if (ObjectUtil.isNotEmpty(item.getWares())) {
|
||||||
|
remark.append(i + 1).append(".").append(item.getWares().getName()).append("x").append(item.getGoodsCount()).append("; ");
|
||||||
|
}
|
||||||
|
}
|
||||||
// 记录日志
|
// 记录日志
|
||||||
recordsService.saveRepairRecord(byId.getTicketId(), null, RecordTypeEnum.LL.getCode(), remark, image);
|
recordsService.saveRepairRecord(byId.getTicketId(), null, RecordTypeEnum.LL.getCode(), remark.toString(), image);
|
||||||
|
|
||||||
// 更新工单主表时间
|
// 更新工单主表时间
|
||||||
if (ObjectUtil.isNotEmpty(so) && ObjectUtil.isNotEmpty(so.getTwId())){
|
if (ObjectUtil.isNotEmpty(so) && ObjectUtil.isNotEmpty(so.getTwId())) {
|
||||||
DlTicketWares ticketWares = ticketWaresService.getById(so.getTwId());
|
DlTicketWares ticketWares = ticketWaresService.getById(so.getTwId());
|
||||||
if (ObjectUtil.isNotEmpty(ticketWares) && ObjectUtil.isNotEmpty(ticketWares.getTicketId())){
|
if (ObjectUtil.isNotEmpty(ticketWares) && ObjectUtil.isNotEmpty(ticketWares.getTicketId())) {
|
||||||
ticketsService.refreshUpdateTime(ticketWares.getTicketId());
|
ticketsService.refreshUpdateTime(ticketWares.getTicketId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -407,7 +375,7 @@ public class DlRepairSoServiceImpl extends ServiceImpl<DlRepairSoMapper, DlRepai
|
|||||||
.ne(DlRepairSo::getSoStatus, SoStatusEnum.RETURNED.getCode())
|
.ne(DlRepairSo::getSoStatus, SoStatusEnum.RETURNED.getCode())
|
||||||
.ne(DlRepairSo::getSoStatus, SoStatusEnum.DEPRECATED.getCode()))
|
.ne(DlRepairSo::getSoStatus, SoStatusEnum.DEPRECATED.getCode()))
|
||||||
);
|
);
|
||||||
if (update == 0){
|
if (update == 0) {
|
||||||
throw exception0(500, "该退料单已有其他人操作");
|
throw exception0(500, "该退料单已有其他人操作");
|
||||||
}
|
}
|
||||||
// 查主表
|
// 查主表
|
||||||
@ -416,24 +384,35 @@ 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()));
|
List<DlRepairSoi> sois = repairSoiService.list(new LambdaQueryWrapper<DlRepairSoi>().eq(DlRepairSoi::getSoId, id));
|
||||||
|
Set<String> waresIds = sois.stream().map(DlRepairSoi::getGoodsId).collect(Collectors.toSet());
|
||||||
|
List<RepairWares> repairWares = repairWaresService.listByIds(waresIds);
|
||||||
|
List<DlRepairSoiRespVO> list = sois.stream().map(item -> {
|
||||||
|
DlRepairSoiRespVO bean = BeanUtil.toBean(item, DlRepairSoiRespVO.class);
|
||||||
|
repairWares.stream().filter(i -> i.getId().equals(item.getGoodsId())).findFirst().ifPresent(bean::setWares);
|
||||||
|
return bean;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
// 查申请表
|
// 查申请表
|
||||||
DlTicketWares byId = ticketWaresService.getById(newSo.getTwId());
|
DlTicketWares byId = ticketWaresService.getById(newSo.getTwId());
|
||||||
// 取当前操作人的名称
|
// 取当前操作人的名称
|
||||||
String remark = SecurityFrameworkUtils.getLoginUserNickname();
|
StringBuilder remark = new StringBuilder("确认退料: ");
|
||||||
// 构建备注
|
// 构建备注
|
||||||
/*
|
/*
|
||||||
谁,退了什么配件,退了多少个
|
谁,退了什么配件,退了多少个
|
||||||
*/
|
*/
|
||||||
List<String> nameAndCount = list.stream().map(item -> item.getWaresName() + "(" + item.getWaresCount() + ")").collect(Collectors.toList());
|
for (int i = 0; i < list.size(); i++) {
|
||||||
remark += "确认退料" + String.join(",", nameAndCount);
|
DlRepairSoiRespVO item = list.get(i);
|
||||||
|
if (ObjectUtil.isNotEmpty(item.getWares())) {
|
||||||
|
remark.append(i + 1).append(".").append(item.getWares().getName()).append("x").append(item.getGoodsCount()).append("; ");
|
||||||
|
}
|
||||||
|
}
|
||||||
// 记录日志
|
// 记录日志
|
||||||
recordsService.saveRepairRecord(byId.getTicketId(), null, RecordTypeEnum.TL.getCode(), remark, image);
|
recordsService.saveRepairRecord(byId.getTicketId(), null, RecordTypeEnum.TL.getCode(), remark.toString(), image);
|
||||||
|
|
||||||
// 更新工单主表时间
|
// 更新工单主表时间
|
||||||
if (ObjectUtil.isNotEmpty(newSo) && ObjectUtil.isNotEmpty(newSo.getTwId())){
|
if (ObjectUtil.isNotEmpty(newSo) && ObjectUtil.isNotEmpty(newSo.getTwId())) {
|
||||||
DlTicketWares ticketWares = ticketWaresService.getById(newSo.getTwId());
|
DlTicketWares ticketWares = ticketWaresService.getById(newSo.getTwId());
|
||||||
if (ObjectUtil.isNotEmpty(ticketWares) && ObjectUtil.isNotEmpty(ticketWares.getTicketId())){
|
if (ObjectUtil.isNotEmpty(ticketWares) && ObjectUtil.isNotEmpty(ticketWares.getTicketId())) {
|
||||||
ticketsService.refreshUpdateTime(ticketWares.getTicketId());
|
ticketsService.refreshUpdateTime(ticketWares.getTicketId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,6 +18,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.sun.xml.bind.v2.TODO;
|
||||||
import org.springframework.context.annotation.Lazy;
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@ -166,6 +167,18 @@ public class DlRepairSoiServiceImpl extends ServiceImpl<DlRepairSoiMapper, DlRep
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据供应商查询该供应商采购过的配件
|
||||||
|
*
|
||||||
|
* @author 小李
|
||||||
|
* @date 11:49 2024/11/28
|
||||||
|
* @param reqVO 查询对象
|
||||||
|
**/
|
||||||
|
@Override
|
||||||
|
public IPage<DlRepairSoiRespVO> getSoBySupplier(DlRepairSoiReqVO reqVO, Page<DlRepairSoiRespVO> page){
|
||||||
|
return baseMapper.getSoBySupplier(reqVO, page);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -29,4 +29,7 @@ public class DlRepairSoiReqVO extends DlRepairSoi {
|
|||||||
|
|
||||||
@Schema(pattern = "查询关键字")
|
@Schema(pattern = "查询关键字")
|
||||||
private String query;
|
private String query;
|
||||||
|
|
||||||
|
/** 供应商ID */
|
||||||
|
private String supplierId;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -440,13 +440,10 @@ 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));
|
Map<String, String> waresNameMap = wares.stream().collect(Collectors.toMap(RepairWares::getId, RepairWares::getName));
|
||||||
String remarkStr = "";
|
StringBuilder remarkStr = new StringBuilder();
|
||||||
for (DlRepairSoi item : respVO.getRepairSois()) {
|
for (int i = 0; i < respVO.getRepairSois().size(); i++) {
|
||||||
//组装通知领取配件的文字
|
DlRepairSoi repairSoi = respVO.getRepairSois().get(i);
|
||||||
if (!"".equals(remarkStr)) {
|
remarkStr.append(i + 1).append(".").append(waresNameMap.get(repairSoi.getGoodsId())).append("x").append(repairSoi.getGoodsCount()).append("; ");
|
||||||
remarkStr += ";";
|
|
||||||
}
|
|
||||||
remarkStr += waresNameMap.get(item.getGoodsId()) + "x" + item.getGoodsCount();
|
|
||||||
}
|
}
|
||||||
if (type.equals("02")) { // 领料
|
if (type.equals("02")) { // 领料
|
||||||
// 构造新数据
|
// 构造新数据
|
||||||
@ -511,7 +508,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) ? "通知领料" : "通知退料") + ",配件明细:" + remarkStr, respVO.getImages());
|
("02".equals(type) ? "通知领料" : "通知退料") + ": " + remarkStr.toString(), respVO.getImages());
|
||||||
// 通知维修工
|
// 通知维修工
|
||||||
// 查维修工的userId
|
// 查维修工的userId
|
||||||
repairWorkerService.sentMessage(respVO.getRepairId(), type.equals("02") ? "您有新的领料单需要确认" : "您有新的退料单需要确认");
|
repairWorkerService.sentMessage(respVO.getRepairId(), type.equals("02") ? "您有新的领料单需要确认" : "您有新的退料单需要确认");
|
||||||
|
|||||||
@ -148,4 +148,45 @@
|
|||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getSoBySupplier" resultMap="SoiAndWares">
|
||||||
|
select drsi.*,
|
||||||
|
drw.id AS wares_id,
|
||||||
|
drw.bar_code,
|
||||||
|
drw.code,
|
||||||
|
drw.name,
|
||||||
|
drw.model,
|
||||||
|
drw.price,
|
||||||
|
drw.pur_price,
|
||||||
|
drw.type,
|
||||||
|
drw.unit,
|
||||||
|
drw.warehouse,
|
||||||
|
drw.mini_stock,
|
||||||
|
drw.max_stock,
|
||||||
|
drw.stock,
|
||||||
|
drw.img,
|
||||||
|
drw.attribute,
|
||||||
|
drw.corp_id,
|
||||||
|
drw.cover_img,
|
||||||
|
drw.car_model,
|
||||||
|
drw.remark AS wares_remark,
|
||||||
|
drw.status,
|
||||||
|
drw.data_form
|
||||||
|
from dl_repair_soi drsi
|
||||||
|
join dl_repair_so drs on drsi.so_id = drs.id
|
||||||
|
join dl_repair_wares drw on drsi.goods_id = drw.id
|
||||||
|
where drs.so_type = '02'
|
||||||
|
<if test="map.supplierId != null and map.supplierId != ''">
|
||||||
|
and drs.supplier_id = #{map.supplierId}
|
||||||
|
</if>
|
||||||
|
<if test="map.query != null and map.query != ''">
|
||||||
|
and (
|
||||||
|
drw.name like concat('%', #{map.query}, '%')
|
||||||
|
or
|
||||||
|
drw.code like concat('%', #{map.query}, '%')
|
||||||
|
or
|
||||||
|
drw.model like concat('%', #{map.query}, '%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user