This commit is contained in:
Vinjor 2024-10-22 18:29:46 +08:00
parent e6cb2ba276
commit bc3c0497f4
6 changed files with 20 additions and 7 deletions

View File

@ -130,7 +130,7 @@ public class RepairWaresController {
* @date 10:51 2024/10/22
**/
@GetMapping("/getAllTypeList")
@Operation(summary = "查询所有有配件的分")
@Operation(summary = "查询所有有配件的分")
public CommonResult<?> getAllTypeList() {
return success(waresService.getAllTypeList());
}

View File

@ -436,7 +436,8 @@ public class DlTicketWaresServiceImpl extends ServiceImpl<DlTicketWaresMapper, D
public Map<String, Integer> getWorkerTodo() {
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
LambdaQueryWrapper<DlTicketWares> queryWrapper = new LambdaQueryWrapper<DlTicketWares>()
.eq(DlTicketWares::getRepairId,loginUser.getId());
.eq(DlTicketWares::getRepairId,loginUser.getId())
.eq(DlTicketWares::getType,"01");
List<DlTicketWares> list = this.list(queryWrapper);
Map<String, Integer> rtnMap = new HashMap<>();
//所有提交的

View File

@ -10,13 +10,14 @@ import cn.iocoder.yudao.module.tickets.service.DlTicketWaresService;
import cn.iocoder.yudao.module.tickets.service.DlTwItemService;
import cn.iocoder.yudao.module.tickets.vo.DlTwItemReqVO;
import cn.iocoder.yudao.module.tickets.vo.DlTwItemRespVO;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
@ -35,6 +36,9 @@ public class DlTwItemServiceImpl extends ServiceImpl<DlTwItemMapper, DlTwItem>
@Resource
@Lazy
private DlTicketWaresService ticketWaresService;
@Resource
@Lazy
private RepairWaresService waresService;
/**
* 根据主表查看全部
@ -47,6 +51,12 @@ public class DlTwItemServiceImpl extends ServiceImpl<DlTwItemMapper, DlTwItem>
public List<DlTwItemRespVO> listTwItem(DlTwItemReqVO reqVO){
// 查记录
List<DlTwItem> dlTwItems = baseMapper.listTwItem(reqVO);
//所有有配件的分类
List<Map<String,String>> typeMapList = waresService.getAllTypeList();
Map<String,String> typeMap = new HashMap<>();
for(Map<String,String> map:typeMapList){
typeMap.put(map.get("id"),map.get("name"));
}
// 查配件详情
List<String> ids = dlTwItems.stream().map(DlTwItem::getWaresId).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(ids)){
@ -57,6 +67,7 @@ public class DlTwItemServiceImpl extends ServiceImpl<DlTwItemMapper, DlTwItem>
.filter(i -> i.getId().equals(bean.getWaresId()))
.findFirst()
.ifPresent(bean::setWares);
bean.setTypeName(typeMap.get(bean.getWares().getType()));
return bean;
}).collect(Collectors.toList());
}

View File

@ -15,4 +15,6 @@ public class DlTwItemRespVO extends DlTwItem {
/** 配件详情 */
private RepairWares wares;
/** 配件分类名称 */
private String typeName;
}

View File

@ -72,9 +72,6 @@
<if test="map.supplierId != null and map.supplierId != ''">
and so.supplier_id = #{map.supplierId}
</if>
<if test="map.soStatus != null and map.soStatus != ''">
and so.so_status = #{map.soStatus}
</if>
<if test="map.corpId != null and map.corpId != ''">
and so.corp_id = #{map.corpId}
</if>

View File

@ -16,6 +16,7 @@
<result property="adviserId" column="adviser_id" />
<result property="adviserName" column="adviser_name" />
<result property="licenseNumber" column="license_number" />
<result property="createTime" column="create_time" />
</resultMap>
<sql id="Base_SQL">
@ -26,7 +27,8 @@
dtw.repair_name as repair_name,
dtw.adviser_id as adviser_id,
dtw.adviser_name as adviser_name,
dtw.license_number
dtw.license_number as license_number,
dtw.create_time as create_time
from dl_ticket_wares dtw
left join dl_repair_tickets drt
on dtw.ticket_id = drt.id