Merge branch 'repair' of http://122.51.230.86:3000/dianliang/lanan-system into repair
This commit is contained in:
commit
287c4feab4
@ -85,12 +85,10 @@
|
||||
SELECT
|
||||
<include refid="baseCarMainColumn"></include>,
|
||||
bcb.brand_name AS brandStr,
|
||||
bcb.logo_img AS logoImg,
|
||||
bcm.model_name AS modelStr
|
||||
bcb.logo_img AS logoImg
|
||||
FROM
|
||||
`base_car_main` tbcm
|
||||
LEFT JOIN base_car_brand bcb ON bcb.deleted = 0 AND tbcm.car_brand = bcb.id
|
||||
LEFT JOIN base_car_model bcm ON bcm.deleted = 0 AND tbcm.car_model = bcm.id
|
||||
WHERE
|
||||
tbcm.deleted = 0
|
||||
AND
|
||||
|
@ -26,8 +26,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static cn.iocoder.yudao.common.BaseConstants.REPAIR_RECORD_TYPE_RECORD;
|
||||
|
||||
/**
|
||||
* 维修记录 Service 实现类
|
||||
*
|
||||
@ -106,10 +104,8 @@ public class RepairRecordsServiceImpl extends ServiceImpl<RepairRecordsMapper, R
|
||||
} else {
|
||||
item.setRoleName(getRoleName(userRoleMap.get(item.getDealUserId())));
|
||||
}
|
||||
List<RepairRecordsItem> itemList = itemService.getByMainId(REPAIR_RECORD_TYPE_RECORD, item.getId(), pageReqVO.getIsOpen());
|
||||
item.setItemList(itemList);
|
||||
//相对路径按照“,”分隔
|
||||
item.setImages(itemList.stream().map(RepairRecordsItem::getImage).collect(Collectors.joining(",")));
|
||||
item.setImages(item.getItemList().stream().map(RepairRecordsItem::getImage).collect(Collectors.joining(",")));
|
||||
});
|
||||
return list;
|
||||
}
|
||||
|
@ -163,7 +163,7 @@ public class DlRepairTitemController {
|
||||
@GetMapping("/getProjList")
|
||||
@Operation(summary = "查某工单维修项目进度")
|
||||
public CommonResult<?> getProjList(@RequestParam("ticketId") String ticketId){
|
||||
return success(dlRepairTitemService.getProjList(ticketId));
|
||||
return success(dlRepairTitemService.getProjList(ticketId,null));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@ public class ApiRepairTitemController {
|
||||
@Operation(summary = "查某工单维修项目进度")
|
||||
@TenantIgnore
|
||||
public CommonResult<?> getProjList(@RequestParam("ticketId") String ticketId){
|
||||
return success(dlRepairTitemService.getProjList(ticketId));
|
||||
return success(dlRepairTitemService.getProjList(ticketId,"1"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 针对表【dl_repair_titem(维修工单子表)】的数据库操作Mapper
|
||||
*
|
||||
@ -31,6 +33,15 @@ public interface DlRepairTitemMapper extends BaseMapper<DlRepairTitem> {
|
||||
* @param dlRepairTitem
|
||||
*/
|
||||
void updateRepairAndSale(DlRepairTitem dlRepairTitem);
|
||||
|
||||
/**
|
||||
* 查某工单维修项目进度
|
||||
* @author vinjor-M
|
||||
* @date 15:33 2024/11/12
|
||||
* @param ticketId 工单id
|
||||
* @return java.util.List<cn.iocoder.yudao.module.tickets.vo.DlRepairTitemRespVO>
|
||||
**/
|
||||
List<DlRepairTitemRespVO> selectProjList(@Param("ticketId")String ticketId,@Param("isOpen")String isOpen);
|
||||
}
|
||||
|
||||
|
||||
|
@ -82,5 +82,5 @@ public interface DlRepairTitemService extends IService<DlRepairTitem> {
|
||||
* @param ticketId 工单ID
|
||||
* @return java.util.List<cn.iocoder.yudao.module.tickets.entity.DlRepairTitem>
|
||||
**/
|
||||
List<DlRepairTitem> getProjList(String ticketId);
|
||||
List<DlRepairTitemRespVO> getProjList(String ticketId,String isOpen);
|
||||
}
|
||||
|
@ -342,7 +342,7 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
|
||||
}
|
||||
|
||||
//查用户信息
|
||||
CustomerMain customerInfo = customerService.getCustomerById(dlRepairTickets.getUserId());
|
||||
CustomerMain customerInfo = customerService.getById(dlRepairTickets.getUserId());
|
||||
result.setCustomerInfo(customerInfo);
|
||||
// 查工单子表
|
||||
List<DlRepairTitem> itemList = titemService.list(new LambdaQueryWrapper<DlRepairTitem>().eq(DlRepairTitem::getTicketId, id));
|
||||
|
@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@ -31,6 +32,8 @@ public class DlRepairTitemServiceImpl extends ServiceImpl<DlRepairTitemMapper, D
|
||||
|
||||
@Resource
|
||||
private DlRepairTicketsService repairTicketsService;
|
||||
@Autowired
|
||||
private DlRepairTitemMapper dlRepairTitemMapper;
|
||||
|
||||
/**
|
||||
* 维修工单子表 分页
|
||||
@ -152,12 +155,8 @@ public class DlRepairTitemServiceImpl extends ServiceImpl<DlRepairTitemMapper, D
|
||||
* @date 10:58 2024/11/5
|
||||
**/
|
||||
@Override
|
||||
public List<DlRepairTitem> getProjList(String ticketId) {
|
||||
LambdaQueryWrapper<DlRepairTitem> queryWrapper = new LambdaQueryWrapper<DlRepairTitem>()
|
||||
.eq(DlRepairTitem::getTicketId,ticketId)
|
||||
.eq(DlRepairTitem::getItemType,"01")
|
||||
.orderByDesc(DlRepairTitem::getItemStatus);
|
||||
return this.list(queryWrapper);
|
||||
public List<DlRepairTitemRespVO> getProjList(String ticketId,String isOpen) {
|
||||
return dlRepairTitemMapper.selectProjList(ticketId,isOpen);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,9 +1,11 @@
|
||||
package cn.iocoder.yudao.module.tickets.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.base.entity.RepairRecordsItem;
|
||||
import cn.iocoder.yudao.module.tickets.entity.DlRepairTitem;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 维修工单子表 响应VO
|
||||
@ -24,4 +26,9 @@ public class DlRepairTitemRespVO extends DlRepairTitem {
|
||||
private String corpId;
|
||||
|
||||
private String ticketNo;
|
||||
|
||||
/**
|
||||
* 维修项目的维修过程图片
|
||||
**/
|
||||
private List<RepairRecordsItem> recordsItemList;
|
||||
}
|
||||
|
@ -8,14 +8,43 @@
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
<select id="queryRepairRecords" resultType="cn.iocoder.yudao.module.base.vo.RepairRecordsRespVO">
|
||||
<resultMap id="baseResultMap" type="cn.iocoder.yudao.module.base.vo.RepairRecordsRespVO">
|
||||
<id column="id" property="id"/>
|
||||
<result column="ticket_id" property="ticketId"/>
|
||||
<result column="repair_item_id" property="repairItemId"/>
|
||||
<result column="type" property="type"/>
|
||||
<result column="remark" property="remark"/>
|
||||
<result column="deal_user_name" property="dealUserName"/>
|
||||
<result column="deal_user_id" property="dealUserId"/>
|
||||
<result column="creator" property="creator"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<collection property="itemList" ofType="cn.iocoder.yudao.module.base.entity.RepairRecordsItem" columnPrefix="item_">
|
||||
<id column="id" property="id"/>
|
||||
<result column="record_id" property="recordId"/>
|
||||
<result column="ticket_id" property="ticketId"/>
|
||||
<result column="repair_item_id" property="repairItemId"/>
|
||||
<result column="remark" property="remark"/>
|
||||
<result column="image" property="image"/>
|
||||
<result column="is_open" property="isOpen"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
</collection>
|
||||
</resultMap>
|
||||
<select id="queryRepairRecords" resultMap="baseResultMap">
|
||||
SELECT main.*,
|
||||
drt.item_name AS projectName
|
||||
drt.item_name AS projectName,
|
||||
drri.id AS item_id,
|
||||
drri.record_id AS item_record_id,
|
||||
drri.ticket_id AS item_ticket_id,
|
||||
drri.repair_item_id AS item_repair_item_id,
|
||||
drri.remark AS item_remark,
|
||||
drri.image AS item_image,
|
||||
drri.is_open AS item_is_open,
|
||||
drri.create_time AS item_create_time
|
||||
FROM dl_repair_records main
|
||||
LEFT JOIN dl_repair_titem drt ON main.repair_item_id = drt.id AND drt.deleted = 0
|
||||
LEFT JOIN dl_repair_records_item drri ON main.id = drri.record_id
|
||||
<where>
|
||||
main.deleted = '0'
|
||||
main.deleted = '0' AND drri.deleted = '0'
|
||||
<if test="entity.ticketId != null and entity.ticketId != ''">
|
||||
AND main.ticket_id = #{entity.ticketId}
|
||||
</if>
|
||||
@ -28,8 +57,11 @@
|
||||
<if test="entity.type != null and entity.type != ''">
|
||||
AND main.type = #{entity.type}
|
||||
</if>
|
||||
<if test="entity.isOpen != null and entity.isOpen != ''">
|
||||
AND drri.is_open = #{entity.type}
|
||||
</if>
|
||||
</where>
|
||||
order by main.create_time desc
|
||||
order by main.create_time desc,drri.create_time
|
||||
</select>
|
||||
<select id="selectNowRepairByTicketId" resultType="java.util.Map">
|
||||
SELECT
|
||||
|
@ -3,6 +3,32 @@
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.tickets.mapper.DlRepairTitemMapper">
|
||||
<resultMap id="BaseResultMap" type="cn.iocoder.yudao.module.tickets.vo.DlRepairTitemRespVO">
|
||||
<id property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result column="ticket_id" property="ticketId"/>
|
||||
<result column="item_name" property="itemName"/>
|
||||
<result column="item_count" property="itemCount"/>
|
||||
<result column="item_unit" property="itemUnit"/>
|
||||
<result column="item_price" property="itemPrice"/>
|
||||
<result column="item_discount" property="itemDiscount"/>
|
||||
<result column="item_money" property="itemMoney"/>
|
||||
<result column="project_id" property="projectId"/>
|
||||
<result column="item_status" property="itemStatus"/>
|
||||
<result column="remark" property="remark"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<collection property="recordsItemList" ofType="cn.iocoder.yudao.module.base.entity.RepairRecordsItem"
|
||||
columnPrefix="item_">
|
||||
<id column="id" property="id"/>
|
||||
<result column="record_id" property="recordId"/>
|
||||
<result column="ticket_id" property="ticketId"/>
|
||||
<result column="repair_item_id" property="repairItemId"/>
|
||||
<result column="remark" property="remark"/>
|
||||
<result column="image" property="image"/>
|
||||
<result column="is_open" property="isOpen"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
</collection>
|
||||
</resultMap>
|
||||
<update id="updateRepairAndSale" parameterType="cn.iocoder.yudao.module.tickets.entity.DlRepairTitem">
|
||||
UPDATE dl_repair_titem
|
||||
<set>
|
||||
@ -56,4 +82,31 @@
|
||||
FROM dl_repair_titem drti
|
||||
LEFT JOIN dl_repair_tickets drt ON drti.ticket_id = drt.id
|
||||
</select>
|
||||
<select id="selectProjList" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
drt.* ,
|
||||
drri.id AS item_id,
|
||||
drri.record_id AS item_record_id,
|
||||
drri.ticket_id AS item_ticket_id,
|
||||
drri.repair_item_id AS item_repair_item_id,
|
||||
drri.remark AS item_remark,
|
||||
drri.image AS item_image,
|
||||
drri.is_open AS item_is_open,
|
||||
drri.create_time AS item_create_time
|
||||
FROM
|
||||
dl_repair_titem drt
|
||||
LEFT JOIN dl_repair_records_item drri ON drt.id = drri.repair_item_id
|
||||
AND drri.deleted = '0'
|
||||
WHERE
|
||||
drt.deleted = 0
|
||||
AND drt.item_type = '01'
|
||||
AND drt.ticket_id = #{ticketId}
|
||||
<if test="isOpen!=null and isOpen!=''">
|
||||
AND drri.is_open = #{isOpen}
|
||||
</if>
|
||||
ORDER BY
|
||||
drt.item_status DESC,
|
||||
drt.update_time,
|
||||
drri.create_time
|
||||
</select>
|
||||
</mapper>
|
||||
|
Loading…
Reference in New Issue
Block a user