Merge branch 'repair'
This commit is contained in:
commit
5924aea9da
@ -2,38 +2,32 @@ package cn.iocoder.yudao.module.company.controller.admin;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.iocoder.yudao.common.CommonErrorCodeConstants;
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
|
||||
import cn.iocoder.yudao.module.company.entity.Company;
|
||||
import cn.iocoder.yudao.module.company.service.CompanyService;
|
||||
import cn.iocoder.yudao.module.company.vo.CompanyReqVO;
|
||||
import cn.iocoder.yudao.module.company.vo.CompanyRespVO;
|
||||
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
|
||||
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
|
||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import cn.iocoder.yudao.module.company.vo.CompanyReqVO;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception0;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import cn.iocoder.yudao.module.company.service.CompanyService;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@ -43,6 +37,10 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception0;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* 企业信息表(每个租户的下属企业信息);(dl_company)表控制层
|
||||
*
|
||||
@ -198,4 +196,23 @@ public class CompanyController {
|
||||
}
|
||||
return success(companyService.getById(dept.getCorpId()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查某租户下某个业务系统的企业信息
|
||||
* @author vinjor-M
|
||||
* @date 15:08 2024/11/15
|
||||
* @param tenantId 租户ID
|
||||
* @param systemCode 系统标识
|
||||
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<?>
|
||||
**/
|
||||
@GetMapping("/getCompanyByTenantId")
|
||||
@Operation(summary = "查某租户下某个业务系统的企业信息")
|
||||
public CommonResult<?> getCompanyByTenantId(String tenantId,String systemCode){
|
||||
LambdaQueryWrapper<Company> queryWrapper = new LambdaQueryWrapper<Company>()
|
||||
.eq(TenantBaseDO::getTenantId,tenantId)
|
||||
.like(Company::getServiceCodes,systemCode)
|
||||
.orderByDesc(BaseDO::getCreateTime);
|
||||
List<Company> list = this.companyService.list(queryWrapper);
|
||||
return success(list.isEmpty()?null:list.get(0));
|
||||
}
|
||||
}
|
@ -30,6 +30,9 @@ public class Company extends TenantBaseDO {
|
||||
/** 企业名称 */
|
||||
@ExcelProperty("企业名称")
|
||||
private String corpName ;
|
||||
/** 企业简称 */
|
||||
@ExcelProperty("企业简称")
|
||||
private String simpleName ;
|
||||
/** 统一社会信用代码 */
|
||||
@ExcelProperty("统一社会信用代码")
|
||||
private String orgCard ;
|
||||
|
@ -101,6 +101,4 @@ public class BaseTypeController {
|
||||
public CommonResult<List<BaseTypeRespVO>> getBaseTypeList(@Valid BaseTypeListReqVO listReqVO) {
|
||||
return success(baseTypeService.getBaseTypeList(listReqVO));
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -77,7 +77,8 @@ public class CarBrandController {
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得车辆品牌")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('base:car-brand:query')")
|
||||
// 有些地方要用,但是又没有权限,故把查看单个的权限公开---小李
|
||||
// @PreAuthorize("@ss.hasPermission('base:car-brand:query')")
|
||||
public CommonResult<CarBrandRespVO> getCarBrand(@RequestParam("id") String id) {
|
||||
CarBrand carBrand = carBrandService.getCarBrand(id);
|
||||
return success(BeanUtils.toBean(carBrand, CarBrandRespVO.class));
|
||||
|
@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.custom.controller.admin;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.iocoder.yudao.module.custom.entity.CarMain;
|
||||
import cn.iocoder.yudao.module.custom.service.CarMainService;
|
||||
import cn.iocoder.yudao.module.custom.service.UserCarService;
|
||||
@ -215,8 +216,10 @@ public class CarMainController {
|
||||
@PostMapping("/getByLicenseNumber")
|
||||
@Operation(summary = "根据车牌查单条记录")
|
||||
public CommonResult<?> getByLicenseNumber(@RequestBody CarMain carMain) {
|
||||
CarMain one = carMainService.getOne(new LambdaQueryWrapper<CarMain>().eq(CarMain::getLicenseNumber, carMain.getLicenseNumber()));
|
||||
return success(one);
|
||||
// 可能查到多条,只用一条就是,理论上讲是不会有多条的
|
||||
// CarMain one = carMainService.list(new LambdaQueryWrapper<CarMain>().eq(CarMain::getLicenseNumber, carMain.getLicenseNumber()));
|
||||
List<CarMain> list = carMainService.list(new LambdaQueryWrapper<CarMain>().eq(CarMain::getLicenseNumber, carMain.getLicenseNumber()).last("limit 1"));
|
||||
return success(CollectionUtil.isNotEmpty(list) ? list.get(0) : null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -0,0 +1,53 @@
|
||||
package cn.iocoder.yudao.module.tickets.entity;
|
||||
|
||||
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
/**
|
||||
* 维修记录 DO
|
||||
*
|
||||
* @author lzt
|
||||
*/
|
||||
@TableName("dl_repair_records")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BaseRepairRecords extends TenantBaseDO {
|
||||
|
||||
/**
|
||||
* 主键标识
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_UUID)
|
||||
private String id;
|
||||
/**
|
||||
* 工单id
|
||||
*/
|
||||
private String ticketId;
|
||||
/**
|
||||
* 工单子表id
|
||||
*/
|
||||
private String repairItemId;
|
||||
/**
|
||||
* 记录类型(repair_records_type)
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 记录描述
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 处理人
|
||||
*/
|
||||
private String dealUserName;
|
||||
/**
|
||||
* 处理人员工表id
|
||||
*/
|
||||
private Long dealUserId;
|
||||
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package cn.iocoder.yudao.module.tickets.mapper;
|
||||
|
||||
import cn.iocoder.yudao.module.tickets.entity.BaseRepairRecords;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 维修记录 Mapper
|
||||
*
|
||||
* @author lzt
|
||||
*/
|
||||
@Mapper
|
||||
public interface BaseRepairRecordsMapper extends BaseMapper<BaseRepairRecords> {
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package cn.iocoder.yudao.module.tickets.service;
|
||||
|
||||
import cn.iocoder.yudao.module.tickets.entity.BaseRepairRecords;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* 维修记录 Service 接口
|
||||
*
|
||||
* @author lzt
|
||||
*/
|
||||
public interface BaseRepairRecordsService extends IService<BaseRepairRecords> {
|
||||
|
||||
/**
|
||||
* 保存维修记录
|
||||
*
|
||||
* @param ticketId 工单id
|
||||
// * @param repairItemId 工单子表id
|
||||
* @param type 工作类型(数据字典:repair_records_type;后端对应 RecordTypeEnum 枚举)
|
||||
* @param remark 备注
|
||||
* @param images 图片(相对路径按照“,”分隔)
|
||||
* @author PQZ
|
||||
* @date 14:51 2024/10/11
|
||||
**/
|
||||
void saveRepairRecord(String ticketId, String repairItemId, String type, String remark, String images);
|
||||
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.tickets.service.impl;
|
||||
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
||||
import cn.iocoder.yudao.module.tickets.entity.BaseRepairRecords;
|
||||
import cn.iocoder.yudao.module.tickets.mapper.BaseRepairRecordsMapper;
|
||||
import cn.iocoder.yudao.module.tickets.service.BaseRepairRecordsService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 维修记录 Service 实现类
|
||||
*
|
||||
* @author lzt
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class BaseRepairRecordsServiceImpl extends ServiceImpl<BaseRepairRecordsMapper, BaseRepairRecords> implements BaseRepairRecordsService {
|
||||
|
||||
@Resource
|
||||
private AdminUserApi userApi;
|
||||
|
||||
/**
|
||||
* 保存维修记录
|
||||
*
|
||||
* @param ticketId 工单id
|
||||
* @param repairItemId 工单子表id
|
||||
* @param type 工作类型(数据字典:repair_records_type;后端对应 RecordTypeEnum 枚举)
|
||||
* @param remark 备注
|
||||
* @param images 图片(相对路径按照“,”分隔)
|
||||
* @author PQZ
|
||||
* @date 14:51 2024/10/11
|
||||
**/
|
||||
@Override
|
||||
public void saveRepairRecord(String ticketId, String repairItemId, String type, String remark, String images) {
|
||||
//获取当前登录用户
|
||||
Long userId = SecurityFrameworkUtils.getLoginUserId();
|
||||
AdminUserRespDTO loginUser = userApi.getUser(userId);
|
||||
//初始化维修记录
|
||||
BaseRepairRecords repairRecords = new BaseRepairRecords();
|
||||
repairRecords.setTicketId(ticketId);
|
||||
repairRecords.setRepairItemId(repairItemId);
|
||||
repairRecords.setType(type);
|
||||
repairRecords.setRemark(remark);
|
||||
repairRecords.setDealUserId(loginUser.getId());
|
||||
repairRecords.setDealUserName(loginUser.getNickname());
|
||||
//保存维修记录
|
||||
save(repairRecords);
|
||||
}
|
||||
|
||||
}
|
@ -2,9 +2,11 @@ package cn.iocoder.yudao.module.tickets.service.impl;
|
||||
|
||||
import cn.iocoder.yudao.module.tickets.entity.Tickets;
|
||||
import cn.iocoder.yudao.module.tickets.mapper.TicketsMapper;
|
||||
import cn.iocoder.yudao.module.tickets.service.BaseRepairRecordsService;
|
||||
import cn.iocoder.yudao.module.tickets.service.TicketsService;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
@ -15,6 +17,8 @@ import java.util.List;
|
||||
**/
|
||||
@Service
|
||||
public class TicketsServiceImpl extends ServiceImpl<TicketsMapper, Tickets> implements TicketsService {
|
||||
@Autowired
|
||||
private BaseRepairRecordsService baseRepairRecordsService;
|
||||
|
||||
/**
|
||||
* 更新工单状态为已结账
|
||||
@ -29,7 +33,12 @@ public class TicketsServiceImpl extends ServiceImpl<TicketsMapper, Tickets> impl
|
||||
baseMapper.update(new LambdaUpdateWrapper<Tickets>()
|
||||
.in(Tickets::getId, ticketIds)
|
||||
.set(Tickets::getTicketsStatus, "02")
|
||||
.set(Tickets::getIsFinish, "1")
|
||||
// 不在这儿结束
|
||||
// .set(Tickets::getIsFinish, "1")
|
||||
);
|
||||
// 记录日志
|
||||
if(!ticketIds.isEmpty()){
|
||||
baseRepairRecordsService.saveRepairRecord(ticketIds.get(0), null, "js", "线上支付结算", null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -35,6 +35,10 @@ public enum RecordTypeEnum {
|
||||
* 总检
|
||||
*/
|
||||
ZJ("zj","总检"),
|
||||
/**
|
||||
* 结算
|
||||
*/
|
||||
JS("js","结算"),
|
||||
/**
|
||||
* 结束工单
|
||||
*/
|
||||
@ -76,6 +80,9 @@ public enum RecordTypeEnum {
|
||||
/** 删除工单 */
|
||||
SCGG("scgg", "删除工单"),
|
||||
|
||||
/** 删除工单 */
|
||||
JC("jc", "交车"),
|
||||
|
||||
/** 内返派工 */
|
||||
NFPG("nfpg", "内返派工");
|
||||
|
||||
|
@ -27,6 +27,10 @@ public enum TicketsStatusEnum {
|
||||
* 待通知客户取车
|
||||
*/
|
||||
WAITING_NOTICE("07","待通知客户取车"),
|
||||
/**
|
||||
* 已交车
|
||||
*/
|
||||
OVER("08","已交车"),
|
||||
/**
|
||||
* 挂单/记账
|
||||
*/
|
||||
|
@ -39,6 +39,6 @@ public class TicketsAPI {
|
||||
@Operation(summary = "维修工单表 查看一个工单的详细信息")
|
||||
@TenantIgnore
|
||||
public CommonResult<?> getTicketsById(@RequestParam(value = "id") String id){
|
||||
return success(dlRepairTicketsService.getTicketsById(id));
|
||||
return success(dlRepairTicketsService.getTicketsById(id,null));
|
||||
}
|
||||
}
|
||||
|
@ -123,6 +123,12 @@ public class RepairWorkerController {
|
||||
return success(workerService.listByLeads());
|
||||
}
|
||||
|
||||
@GetMapping("/listLeadsAll")
|
||||
@Operation(summary = "通过班组长的id查该班组的员工(不去掉班组长)")
|
||||
public CommonResult<?> listLeadsAll() {
|
||||
return success(workerService.listLeadsAll());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查当前登录用户是否维修班组长
|
||||
* @author vinjor-M
|
||||
|
@ -106,6 +106,14 @@ public interface RepairWorkerService extends IService<RepairWorker> {
|
||||
**/
|
||||
List<RepairWorker> listByLeads();
|
||||
|
||||
/**
|
||||
* 通过班组长的id查该班组的员工(不去掉班组长)
|
||||
* @author PQZ
|
||||
* @date 15:20 2024/11/13
|
||||
* @return java.util.List<cn.iocoder.yudao.module.base.entity.RepairWorker>
|
||||
**/
|
||||
List<RepairWorker> listLeadsAll();
|
||||
|
||||
/**
|
||||
* 查当前登录用户是否维修班组长
|
||||
* @author vinjor-M
|
||||
|
@ -272,6 +272,21 @@ public class RepairWorkerServiceImpl extends ServiceImpl<RepairWorkerMapper, Rep
|
||||
return workerList.stream().filter(item -> !Objects.equals(item.getUserId(), worker.getUserId())).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过班组长的id查该班组的员工()不去掉班组长
|
||||
*
|
||||
* @return java.util.List<cn.iocoder.yudao.module.base.entity.RepairWorker>
|
||||
* @author PQZ
|
||||
* @date 15:20 2024/11/13
|
||||
**/
|
||||
@Override
|
||||
public List<RepairWorker> listLeadsAll() {
|
||||
// 取班组长的记录
|
||||
RepairWorker worker = baseMapper.selectOne(new LambdaQueryWrapper<RepairWorker>().eq(RepairWorker::getUserId, SecurityFrameworkUtils.getLoginUserId()));
|
||||
// 根据班组长的工种查所有该工程的工人
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<RepairWorker>().eq(RepairWorker::getWorkType, worker.getWorkType()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查当前登录用户是否维修班组长
|
||||
*
|
||||
|
@ -88,6 +88,19 @@ public class DlRepairSoController {
|
||||
return success(dlRepairSoService.getRepairSoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 领料单、退料单APP查看
|
||||
* @author vinjor-M
|
||||
* @date 11:10 2024/11/21
|
||||
* @param id 单据id
|
||||
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<?>
|
||||
**/
|
||||
@GetMapping("/getApp")
|
||||
@Operation(summary = "采购单/领料单 查看")
|
||||
public CommonResult<?> getApp(@RequestParam("id") String id) {
|
||||
return success(dlRepairSoService.getApp(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 员工确认领料
|
||||
*
|
||||
@ -120,15 +133,15 @@ public class DlRepairSoController {
|
||||
/**
|
||||
* 采购入库
|
||||
*
|
||||
* @param repairSoReqVO DlRepairSoReqVO实体
|
||||
* @param repairSoRespVO DlRepairSoReqVO实体
|
||||
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<?>
|
||||
* @author PQZ
|
||||
* @date 10:43 2024/10/25
|
||||
**/
|
||||
@PostMapping("/inWare")
|
||||
@Operation(summary = "采购入库")
|
||||
public CommonResult<?> inWare(@RequestBody DlRepairSoReqVO repairSoReqVO) {
|
||||
dlRepairSoService.inWare(repairSoReqVO);
|
||||
public CommonResult<?> inWare(@RequestBody DlRepairSoRespVO repairSoRespVO) {
|
||||
dlRepairSoService.inWare(repairSoRespVO);
|
||||
return CommonResult.ok();
|
||||
}
|
||||
}
|
||||
|
@ -75,5 +75,18 @@ public class DlRepairSoiController{
|
||||
public CommonResult<?> getRepairSoiBySoId(@RequestParam(value = "soId") String soId){
|
||||
return success(dlRepairSoiService.getRepairSoiBySoId(soId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据主表的ID得到子表的所有数据,按类型区分的map,支持条件查询
|
||||
*
|
||||
* @author 小李
|
||||
* @date 15:51 2024/11/19
|
||||
* @param id id
|
||||
**/
|
||||
@GetMapping("/getMapBySoIdAndQuery")
|
||||
@Operation(summary = "根据主表的ID得到子表的所有数据,按类型区分的map,支持条件查询")
|
||||
public CommonResult<?> getMapBySoIdAndQuery(@RequestParam("id") String id, @RequestParam("query") String query) {
|
||||
return success(dlRepairSoiService.getMapBySoIdAndQuery(id, query));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -11,10 +11,6 @@ import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 采购单领料单子表
|
||||
* @TableName dl_repair_soi
|
||||
*/
|
||||
/**
|
||||
* 采购单/领料单子表
|
||||
* @author 小李
|
||||
|
@ -2,12 +2,15 @@ package cn.iocoder.yudao.module.stockOperate.mapper;
|
||||
|
||||
import cn.iocoder.yudao.module.stockOperate.entity.DlRepairSo;
|
||||
import cn.iocoder.yudao.module.stockOperate.vo.DlRepairSoReqVO;
|
||||
import cn.iocoder.yudao.module.stockOperate.vo.DlRepairSoiRespVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
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_so(采购单领料单)】的数据库操作Mapper
|
||||
* @author 小李
|
||||
@ -28,6 +31,15 @@ public interface DlRepairSoMapper extends BaseMapper<DlRepairSo> {
|
||||
* @return java.lang.Integer
|
||||
**/
|
||||
Integer selectCountNum(@Param("type") String type,@Param("userId") Long userId,@Param("status") String status);
|
||||
|
||||
/**
|
||||
* 查单据配件明细
|
||||
* @author vinjor-M
|
||||
* @date 11:13 2024/11/21
|
||||
* @param id 单据id
|
||||
* @return java.util.List<cn.iocoder.yudao.module.tickets.vo.AppWaresGroupVO>
|
||||
**/
|
||||
List<DlRepairSoiRespVO> selectByIdGroup(@Param("id")String id);
|
||||
}
|
||||
|
||||
|
||||
|
@ -2,12 +2,15 @@ package cn.iocoder.yudao.module.stockOperate.mapper;
|
||||
|
||||
import cn.iocoder.yudao.module.stockOperate.entity.DlRepairSoi;
|
||||
import cn.iocoder.yudao.module.stockOperate.vo.DlRepairSoiReqVO;
|
||||
import cn.iocoder.yudao.module.stockOperate.vo.DlRepairSoiRespVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
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_soi(采购单领料单子表)】的数据库操作Mapper
|
||||
* @author 小李
|
||||
@ -24,6 +27,15 @@ public interface DlRepairSoiMapper extends BaseMapper<DlRepairSoi> {
|
||||
* @param repairSoiReqVO 查询对象
|
||||
**/
|
||||
IPage<DlRepairSoi> getRepairSoiPage(@Param("map") DlRepairSoiReqVO repairSoiReqVO, Page<DlRepairSoi> page);
|
||||
|
||||
/**
|
||||
* 根据主表的ID得到子表的所有数据,按类型区分的map,支持条件查询
|
||||
*
|
||||
* @author 小李
|
||||
* @date 15:51 2024/11/19
|
||||
* @param id id
|
||||
**/
|
||||
List<DlRepairSoiRespVO> getMapBySoIdAndQuery(@Param("id") String id, @Param("query") String query);
|
||||
}
|
||||
|
||||
|
||||
|
@ -72,9 +72,17 @@ public interface DlRepairSoService extends IService<DlRepairSo> {
|
||||
/**
|
||||
* 采购入库
|
||||
*
|
||||
* @param reqVO (接参实体中需传入:采购单id,子表中商品id,子表中入库数量inCount)
|
||||
* @param repairSoRespVO (接参实体中需传入:采购单id,子表中商品id,子表中入库数量inCount)
|
||||
* @author PQZ
|
||||
* @date 14:32 2024/10/24
|
||||
**/
|
||||
void inWare(DlRepairSoReqVO reqVO);
|
||||
void inWare(DlRepairSoRespVO repairSoRespVO);
|
||||
/**
|
||||
* 领料单、退料单APP查看
|
||||
* @author vinjor-M
|
||||
* @date 11:10 2024/11/21
|
||||
* @param id 单据id
|
||||
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<?>
|
||||
**/
|
||||
Object getApp(String id);
|
||||
}
|
||||
|
@ -3,11 +3,13 @@ package cn.iocoder.yudao.module.stockOperate.service;
|
||||
import cn.iocoder.yudao.module.stockOperate.entity.DlRepairSoi;
|
||||
import cn.iocoder.yudao.module.stockOperate.vo.DlRepairSoiQueryRespVO;
|
||||
import cn.iocoder.yudao.module.stockOperate.vo.DlRepairSoiReqVO;
|
||||
import cn.iocoder.yudao.module.stockOperate.vo.DlRepairSoiRespVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 针对表【dl_repair_soi(采购单领料单子表)】的数据库操作Service
|
||||
@ -53,4 +55,13 @@ public interface DlRepairSoiService extends IService<DlRepairSoi> {
|
||||
* @date 14:39 2024/10/24
|
||||
**/
|
||||
List<DlRepairSoi> listByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 根据主表的ID得到子表的所有数据,按类型区分的map,支持条件查询
|
||||
*
|
||||
* @author 小李
|
||||
* @date 15:51 2024/11/19
|
||||
* @param id id
|
||||
**/
|
||||
Map<String, List<DlRepairSoiRespVO>> getMapBySoIdAndQuery(String id, String query);
|
||||
}
|
||||
|
@ -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.vo.DlRepairSoReqVO;
|
||||
import cn.iocoder.yudao.module.stockOperate.vo.DlRepairSoRespVO;
|
||||
import cn.iocoder.yudao.module.stockOperate.vo.DlRepairSoiRespVO;
|
||||
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.dto.DeptRespDTO;
|
||||
@ -31,6 +32,7 @@ import cn.iocoder.yudao.module.tickets.service.DlRepairTicketsService;
|
||||
import cn.iocoder.yudao.module.tickets.service.DlRepairTitemService;
|
||||
import cn.iocoder.yudao.module.tickets.service.DlTicketWaresService;
|
||||
import cn.iocoder.yudao.module.tickets.service.DlTwItemService;
|
||||
import cn.iocoder.yudao.module.tickets.vo.AppWaresGroupVO;
|
||||
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
@ -48,7 +50,6 @@ 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实现
|
||||
@ -60,6 +61,8 @@ import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionU
|
||||
public class DlRepairSoServiceImpl extends ServiceImpl<DlRepairSoMapper, DlRepairSo>
|
||||
implements DlRepairSoService {
|
||||
|
||||
@Resource
|
||||
private DlRepairSoMapper dlRepairSoMapper;
|
||||
@Resource
|
||||
private DlRepairSoiService repairSoiService;
|
||||
|
||||
@ -116,14 +119,14 @@ public class DlRepairSoServiceImpl extends ServiceImpl<DlRepairSoMapper, DlRepai
|
||||
@Override
|
||||
public void createRepairSo(DlRepairSoRespVO repairSoRespVO) {
|
||||
repairSoRespVO.setSoTime(new Date());
|
||||
// 加个判断,可能出现没有设置价格的情况
|
||||
if (repairSoRespVO.getGoodsList() != null){
|
||||
repairSoRespVO.getGoodsList().forEach(item -> {
|
||||
if (item.getGoodsPrice() == null){
|
||||
throw exception0(500, "有配件未设置进价");
|
||||
}
|
||||
});
|
||||
}
|
||||
// 加个判断,可能出现没有设置价格的情况----需求说了非必填,注掉
|
||||
// if (repairSoRespVO.getGoodsList() != null){
|
||||
// repairSoRespVO.getGoodsList().forEach(item -> {
|
||||
// if (item.getGoodsPrice() == null){
|
||||
// throw exception0(500, "有配件未设置进价");
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
//保存供应商
|
||||
if (StringUtils.isEmpty(repairSoRespVO.getSupplierId())){
|
||||
//采购单中录入供应商或无供应商情况
|
||||
@ -163,29 +166,34 @@ public class DlRepairSoServiceImpl extends ServiceImpl<DlRepairSoMapper, DlRepai
|
||||
});
|
||||
repairSoiService.saveBatch(repairSoRespVO.getGoodsList());
|
||||
|
||||
// 操作配件库存表
|
||||
// 操作配件表
|
||||
// 前端选择了配件生成采购单的时候,可能会改配件的一些信息,但不知道会改什么,直接拿到全部,重新更新
|
||||
List<RepairWares> waresList = repairSoRespVO.getWaresList();
|
||||
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);
|
||||
}
|
||||
// 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);
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
@ -242,7 +250,8 @@ public class DlRepairSoServiceImpl extends ServiceImpl<DlRepairSoMapper, DlRepai
|
||||
sois.stream().filter(i -> i.getGoodsId().equals(item.getWaresId())).findFirst().ifPresent(repairSoiByTwItem -> {
|
||||
if (so.getSoType().equals("02")){
|
||||
dlTwItem.setWaresAlreadyCount(item.getWaresAlreadyCount() - repairSoiByTwItem.getGoodsCount());
|
||||
dlTwItem.setWaresStatus("02");
|
||||
// 不操作配件申请表子表的状态
|
||||
// dlTwItem.setWaresStatus("02");
|
||||
}else {
|
||||
dlTwItem.setWaresAlreadyCount(item.getWaresAlreadyCount() + repairSoiByTwItem.getGoodsCount());
|
||||
}
|
||||
@ -325,13 +334,13 @@ public class DlRepairSoServiceImpl extends ServiceImpl<DlRepairSoMapper, DlRepai
|
||||
// 查最新的子表信息
|
||||
DlRepairSo so = baseMapper.selectById(id);
|
||||
List<DlTwItem> list = twItemService.list(new LambdaQueryWrapper<DlTwItem>().eq(DlTwItem::getTwId, so.getTwId()));
|
||||
// 判断是部分完成还是全部完成
|
||||
DlTicketWares dlTicketWares = new DlTicketWares();
|
||||
dlTicketWares.setId(so.getTwId());
|
||||
List<DlTwItem> flag = list.stream().filter(item -> !item.getWaresStatus().equals("01")).collect(Collectors.toList());
|
||||
dlTicketWares.setStatus(CollectionUtil.isEmpty(flag) ? "03" : "04");
|
||||
// 判断是部分完成还是全部完成----不需要判断了
|
||||
// DlTicketWares dlTicketWares = new DlTicketWares();
|
||||
// dlTicketWares.setId(so.getTwId());
|
||||
// List<DlTwItem> flag = list.stream().filter(item -> !item.getWaresStatus().equals("01")).collect(Collectors.toList());
|
||||
// dlTicketWares.setStatus(CollectionUtil.isEmpty(flag) ? "03" : "04");
|
||||
// 更新主表的状态
|
||||
ticketWaresService.updateById(dlTicketWares);
|
||||
// ticketWaresService.updateById(dlTicketWares);
|
||||
|
||||
// 通知仓库
|
||||
repairWorkerService.sentMessage(Long.valueOf(so.getCreator()), so.getUserName() + "已确认领料单:" + so.getSoNo());
|
||||
@ -396,7 +405,7 @@ public class DlRepairSoServiceImpl extends ServiceImpl<DlRepairSoMapper, DlRepai
|
||||
**/
|
||||
@Override
|
||||
@DSTransactional
|
||||
public void inWare(DlRepairSoReqVO reqVO) {
|
||||
public void inWare(DlRepairSoRespVO reqVO) {
|
||||
/*1、基础数据准备*/
|
||||
//获取当前登录用户
|
||||
Long userId = SecurityFrameworkUtils.getLoginUserId();
|
||||
@ -447,8 +456,8 @@ public class DlRepairSoServiceImpl extends ServiceImpl<DlRepairSoMapper, DlRepai
|
||||
//入库数量
|
||||
inWares.setInCount(filterSoi.getInCount());
|
||||
inWares.setId(null);
|
||||
//采购品中入库数量字段累加
|
||||
item.setInCount(item.getInCount() == null ? 0 : item.getInCount() + filterSoi.getInCount());
|
||||
//采购品中入库数量字段累加---这里item.getInCount 是null的时候,应该是filterSoi的inCount而不是0
|
||||
item.setInCount(item.getInCount() == null ? filterSoi.getInCount() : item.getInCount() + filterSoi.getInCount());
|
||||
inWaresList.add(inWares);
|
||||
});
|
||||
//更新采购品
|
||||
@ -474,7 +483,9 @@ public class DlRepairSoServiceImpl extends ServiceImpl<DlRepairSoMapper, DlRepai
|
||||
// 查该采购单的所有采购配件
|
||||
List<DlRepairSoi> sois = repairSoiService.list(new LambdaQueryWrapper<DlRepairSoi>().eq(DlRepairSoi::getSoId, reqVO.getId()));
|
||||
// 过滤出入库数量大于等于采购数量的数据 (入库数量可以大于采购的数量)
|
||||
List<DlRepairSoi> allInSois = sois.stream().filter(item -> item.getInCount() >= item.getGoodsCount()).collect(Collectors.toList());
|
||||
List<DlRepairSoi> allInSois = sois.stream()
|
||||
.filter(item -> (ObjectUtil.isNotEmpty(item.getInCount()) && item.getInCount() >= item.getGoodsCount()))
|
||||
.collect(Collectors.toList());
|
||||
// 如果allInSois的size就是sois的size,那就是全部都入库了
|
||||
if (CollectionUtil.isNotEmpty(allInSois) && allInSois.size() == sois.size()) {
|
||||
// 更新采购单的状态为已入库
|
||||
@ -483,6 +494,58 @@ public class DlRepairSoServiceImpl extends ServiceImpl<DlRepairSoMapper, DlRepai
|
||||
.eq(DlRepairSo::getId, reqVO.getId())
|
||||
);
|
||||
}
|
||||
|
||||
// 不敢动上面的代码,在新加一个逻辑,重复了也没事儿
|
||||
// 更新配件信息---因为入库的时候,配件的信息还能改
|
||||
List<RepairWares> reqVOWaresList = reqVO.getWaresList();
|
||||
List<String> ids = reqVOWaresList.stream().map(item -> item.getId()).collect(Collectors.toList());
|
||||
List<RepairWares> oldWares = waresService.listByIds(ids);
|
||||
// 这里是因为传过来的库存不是最新的,但其他字段可能变了,所以用最新的库存替换传回来的,在用传回来的+最新库存构成最新数据
|
||||
List<RepairWares> newWares = reqVOWaresList.stream().map(item -> {
|
||||
RepairWares wares = BeanUtil.toBean(item, RepairWares.class);
|
||||
RepairWares findWares = oldWares.stream().filter(i -> i.getId().equals(wares.getId())).findFirst().orElse(null);
|
||||
if (findWares != null) {
|
||||
wares.setStock(findWares.getStock());
|
||||
}
|
||||
return wares;
|
||||
}).collect(Collectors.toList());
|
||||
waresService.updateBatchById(newWares);
|
||||
}
|
||||
|
||||
/**
|
||||
* 领料单、退料单APP查看
|
||||
*
|
||||
* @param id 单据id
|
||||
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<?>
|
||||
* @author vinjor-M
|
||||
* @date 11:10 2024/11/21
|
||||
**/
|
||||
@Override
|
||||
public Object getApp(String id) {
|
||||
List<DlRepairSoiRespVO> dlRepairSoiRespVOList = dlRepairSoMapper.selectByIdGroup(id);
|
||||
List<AppWaresGroupVO> waresGroupList = new ArrayList<>();
|
||||
if (CollectionUtil.isNotEmpty(dlRepairSoiRespVOList)) {
|
||||
//先过滤出itenTypeId为null或空,或者itemTypeName为null或空的,为单独一个组
|
||||
List<DlRepairSoiRespVO> 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);
|
||||
waresGroupVO.setGroupName("未知分组");
|
||||
waresGroupVO.setNums(nullList.size());
|
||||
waresGroupList.add(waresGroupVO);
|
||||
}
|
||||
//过滤出有分类的进行分组
|
||||
Map<String,List<DlRepairSoiRespVO>> 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());
|
||||
waresGroupVO.setGroupId(key);
|
||||
waresGroupVO.setNums(groupListMap.get(key).size());
|
||||
waresGroupList.add(waresGroupVO);
|
||||
}
|
||||
}
|
||||
return waresGroupList;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,8 @@ package cn.iocoder.yudao.module.stockOperate.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.iocoder.yudao.module.conf.entity.BaseType;
|
||||
import cn.iocoder.yudao.module.conf.service.BaseTypeService;
|
||||
import cn.iocoder.yudao.module.project.entity.RepairWares;
|
||||
import cn.iocoder.yudao.module.project.service.RepairWaresService;
|
||||
import cn.iocoder.yudao.module.stockOperate.entity.DlRepairSo;
|
||||
@ -11,6 +13,7 @@ import cn.iocoder.yudao.module.stockOperate.service.DlRepairSoService;
|
||||
import cn.iocoder.yudao.module.stockOperate.service.DlRepairSoiService;
|
||||
import cn.iocoder.yudao.module.stockOperate.vo.DlRepairSoiQueryRespVO;
|
||||
import cn.iocoder.yudao.module.stockOperate.vo.DlRepairSoiReqVO;
|
||||
import cn.iocoder.yudao.module.stockOperate.vo.DlRepairSoiRespVO;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@ -19,7 +22,9 @@ 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.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@ -40,6 +45,9 @@ public class DlRepairSoiServiceImpl extends ServiceImpl<DlRepairSoiMapper, DlRep
|
||||
@Lazy
|
||||
private DlRepairSoService soService;
|
||||
|
||||
@Resource
|
||||
private BaseTypeService typeService;
|
||||
|
||||
/**
|
||||
* 采购单领料单子表 分页
|
||||
*
|
||||
@ -120,6 +128,44 @@ public class DlRepairSoiServiceImpl extends ServiceImpl<DlRepairSoiMapper, DlRep
|
||||
public List<DlRepairSoi> listByIds(List<String> ids) {
|
||||
return baseMapper.selectBatchIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据主表的ID得到子表的所有数据,按类型区分的map,支持条件查询
|
||||
*
|
||||
* @author 小李
|
||||
* @date 15:51 2024/11/19
|
||||
* @param id id
|
||||
**/
|
||||
@Override
|
||||
public Map<String, List<DlRepairSoiRespVO>> getMapBySoIdAndQuery(String id, String query){
|
||||
// 查出该单据的子项和其对应的配件信息
|
||||
List<DlRepairSoiRespVO> respVOList = baseMapper.getMapBySoIdAndQuery(id, query);
|
||||
if (CollectionUtil.isEmpty(respVOList)){
|
||||
return null;
|
||||
}
|
||||
// 按配件信息的type进行分组
|
||||
Map<String, List<DlRepairSoiRespVO>> map = respVOList.stream().collect(Collectors.groupingBy(item -> {
|
||||
String key = item.getWares().getType();
|
||||
if (key == null || key.isEmpty()) {
|
||||
key = "default";
|
||||
}
|
||||
return key;
|
||||
}));
|
||||
// 查分类的信息
|
||||
List<BaseType> baseTypes = typeService.listByIds(map.keySet());
|
||||
Map<String, String> typeMap = baseTypes.stream().collect(Collectors.toMap(BaseType::getId, BaseType::getName));
|
||||
// 映射
|
||||
Map<String, List<DlRepairSoiRespVO>> result = new HashMap<>();
|
||||
for (Map.Entry<String, List<DlRepairSoiRespVO>> entry : map.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
String newKey = typeMap.get(key);
|
||||
if (newKey == null || newKey.isEmpty()) {
|
||||
newKey = "未分类";
|
||||
}
|
||||
result.put(newKey, entry.getValue());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -18,4 +18,10 @@ public class DlRepairSoRespVO extends DlRepairSo {
|
||||
|
||||
// 商品List
|
||||
private List<DlRepairSoi> goodsList;
|
||||
|
||||
// 配件List
|
||||
private List<RepairWares> waresList;
|
||||
|
||||
/**关联商品*/
|
||||
List<DlRepairSoi> soiList;
|
||||
}
|
||||
|
@ -1,8 +1,11 @@
|
||||
package cn.iocoder.yudao.module.stockOperate.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.project.entity.RepairWares;
|
||||
import cn.iocoder.yudao.module.stockOperate.entity.DlRepairSoi;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 采购单/领料单子表 响应VO
|
||||
* @author 小李
|
||||
@ -10,4 +13,19 @@ import lombok.Data;
|
||||
**/
|
||||
@Data
|
||||
public class DlRepairSoiRespVO extends DlRepairSoi {
|
||||
|
||||
/** 对应的配件信息 */
|
||||
private RepairWares wares;
|
||||
/** 配件分类id */
|
||||
private String typeId;
|
||||
/** 配件分类名称 */
|
||||
private String typeName;
|
||||
/** 配件名称 */
|
||||
private String goodsName;
|
||||
/** 配件计量单位名称 */
|
||||
private String unitText;
|
||||
/** 售价 */
|
||||
private BigDecimal salePrice;
|
||||
/** 库存 */
|
||||
private Integer stock;
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package cn.iocoder.yudao.module.tickets.controller.admin;
|
||||
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.iocoder.yudao.common.RepairCons;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.tickets.entity.DlRepairTickets;
|
||||
@ -16,6 +17,9 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@ -70,13 +74,14 @@ public class DlRepairTicketsController {
|
||||
* 获得一个工单的详细信息
|
||||
*
|
||||
* @param id 工单ID
|
||||
* @param ifApp 是否是APP发起的查询
|
||||
* @author 小李
|
||||
* @date 16:05 2024/9/21
|
||||
**/
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "查看一个工单的详细信息")
|
||||
public CommonResult<?> getTicketsById(@RequestParam("id") String id) {
|
||||
return success(dlRepairTicketsService.getTicketsById(id));
|
||||
public CommonResult<?> getTicketsById(@RequestParam("id") String id,@RequestParam(required = false, value = "ifApp", defaultValue = "false")Boolean ifApp) {
|
||||
return success(dlRepairTicketsService.getTicketsById(id,ifApp));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -298,15 +303,58 @@ public class DlRepairTicketsController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 从总检的角度差维修中、已完成的工单数量
|
||||
* 服务顾问交车
|
||||
* @author vinjor-M
|
||||
* @date 16:51 2024/11/13
|
||||
* @param respVO
|
||||
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<?>
|
||||
**/
|
||||
@PostMapping("/overOrder")
|
||||
@Operation(summary = "服务顾问交车")
|
||||
public CommonResult<?> overOrder(@RequestBody DlRepairTicketsRespVO respVO) {
|
||||
dlRepairTicketsService.overOrder(respVO);
|
||||
return CommonResult.ok();
|
||||
}
|
||||
/**
|
||||
* 从总检的角度查进场数、维修中、已完成、已交车、在厂的工单数量
|
||||
* @author vinjor-M
|
||||
* @date 11:29 2024/10/24
|
||||
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<?>
|
||||
**/
|
||||
@GetMapping("/getBossNum")
|
||||
@Operation(summary = "从总检的角度差维修中、已完成的工单数量")
|
||||
public CommonResult<?> getBossNum() {
|
||||
return success(dlRepairTicketsService.getBossNum());
|
||||
@Operation(summary = "从总检的角度查进场数、维修中、已完成、已交车、在厂的工单数量")
|
||||
public CommonResult<?> getBossNum(String selectType,String startDate,String endDate) {
|
||||
return success(dlRepairTicketsService.getBossNum(selectType, startDate, endDate));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取日期范围
|
||||
* @author vinjor-M
|
||||
* @date 11:29 2024/10/24
|
||||
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<?>
|
||||
**/
|
||||
@GetMapping("/getDateRange")
|
||||
@Operation(summary = "获取日期范围")
|
||||
public CommonResult<?> getDateRange(String selectType) {
|
||||
Map<String,String> rtnMap = new HashMap<>();
|
||||
// 获取当前日期
|
||||
Date currentDate = new Date();
|
||||
String nowDay = DateUtil.formatDate(new Date());
|
||||
rtnMap.put("endDate",nowDay);
|
||||
if("threeMonth".equals(selectType)){
|
||||
//近3个月
|
||||
// 使用Hutool的DateUtil推移3个月
|
||||
Date threeMonthsAgo = DateUtil.offsetMonth(currentDate, -3);
|
||||
String startDay = DateUtil.formatDate(threeMonthsAgo);
|
||||
rtnMap.put("startDate",startDay);
|
||||
}else {
|
||||
//近6个月
|
||||
// 使用Hutool的DateUtil推移6个月
|
||||
Date threeMonthsAgo = DateUtil.offsetMonth(currentDate, -6);
|
||||
String startDay = DateUtil.formatDate(threeMonthsAgo);
|
||||
rtnMap.put("startDate",startDay);
|
||||
}
|
||||
return success(rtnMap);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -323,6 +371,19 @@ public class DlRepairTicketsController {
|
||||
return CommonResult.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否工单子表的任何一个类目没有价格或价格为0
|
||||
*
|
||||
* @param id 工单ID
|
||||
* @author 小李
|
||||
* @date 15:00 2024/11/16
|
||||
**/
|
||||
@GetMapping("/hasPrice")
|
||||
@Operation(summary = "判断是否工单子表的任何一个类目没有价格或价格为0")
|
||||
public CommonResult<?> hasPrice(@RequestParam("id")String id){
|
||||
return success(dlRepairTicketsService.hasPrice(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增工单子项
|
||||
*
|
||||
@ -364,5 +425,18 @@ public class DlRepairTicketsController {
|
||||
dlRepairTicketsService.removeTicketById(id);
|
||||
return CommonResult.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据工单ID查客户和车辆信息
|
||||
*
|
||||
* @author 小李
|
||||
* @date 19:07 2024/11/18
|
||||
* @param id id
|
||||
**/
|
||||
@GetMapping("/getCusAndCarById")
|
||||
@Operation(summary = "根据工单ID查客户和车辆信息")
|
||||
public CommonResult<?> getCusAndCarById(@RequestParam("id") String id) {
|
||||
return success(dlRepairTicketsService.getCusAndCarById(id));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -11,6 +11,8 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
/**
|
||||
@ -168,5 +170,45 @@ public class DlTicketWaresController {
|
||||
public CommonResult<?> getWorkerTodo(){
|
||||
return success(dlTicketWaresService.getWorkerTodo());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查单个配件申请单的信息
|
||||
*
|
||||
* @author 小李
|
||||
* @date 15:55 2024/11/14
|
||||
* @param id id
|
||||
**/
|
||||
@GetMapping("/getById")
|
||||
@Operation(summary = "查单个配件申请单的信息")
|
||||
public CommonResult<?> getById(@RequestParam("id") String id){
|
||||
return success(dlTicketWaresService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改是否传给保险公司
|
||||
*
|
||||
* @author 小李
|
||||
* @date 15:48 2024/11/18
|
||||
* @param respVO 对象
|
||||
**/
|
||||
@PostMapping("/updateSafe")
|
||||
@Operation(summary = "修改是否传给保险公司")
|
||||
public CommonResult<?> updateSafe(@RequestBody DlTicketWaresRespVO respVO){
|
||||
dlTicketWaresService.updateSafe(respVO);
|
||||
return CommonResult.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据选择的配件生成采购单需要的数据
|
||||
*
|
||||
* @author 小李
|
||||
* @date 18:14 2024/11/18
|
||||
* @param ids ids
|
||||
**/
|
||||
@GetMapping("/getByIds")
|
||||
@Operation(summary = "根据选择的配件生成采购单需要的数据")
|
||||
public CommonResult<?> getByIds(@RequestParam("ids") List<String> ids){
|
||||
return success(dlTicketWaresService.getByIds(ids));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,14 +1,11 @@
|
||||
package cn.iocoder.yudao.module.tickets.controller.admin;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.tickets.entity.DlTwItem;
|
||||
import cn.iocoder.yudao.module.tickets.service.DlTwItemService;
|
||||
import cn.iocoder.yudao.module.tickets.vo.AddTwiVO;
|
||||
import cn.iocoder.yudao.module.tickets.vo.DlTwItemReqVO;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@ -41,5 +38,32 @@ public class DlTwItemController {
|
||||
public CommonResult<?> listTwItem(DlTwItemReqVO reqVO){
|
||||
return success(dlTwItemService.listTwItem(reqVO));
|
||||
}
|
||||
|
||||
/**
|
||||
* APP查询配件申请单列表-按配件分类进行分组
|
||||
* @author vinjor-M
|
||||
* @date 14:01 2024/11/20
|
||||
* @param reqVO TODO
|
||||
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<?>
|
||||
**/
|
||||
@GetMapping("/listApp")
|
||||
@Operation(summary = "APP查询配件申请单列表-按配件分类进行分组")
|
||||
public CommonResult<?> listApp(DlTwItemReqVO reqVO){
|
||||
return success(dlTwItemService.listApp(reqVO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 给配件申请表子表添加数据
|
||||
*
|
||||
* @author 小李
|
||||
* @date 17:47 2024/11/13
|
||||
* @param addTwiVO 对象
|
||||
**/
|
||||
@PostMapping("/addTwi")
|
||||
@Operation(summary = "给配件申请表子表添加数据")
|
||||
public CommonResult<?> addTwi(@RequestBody AddTwiVO addTwiVO){
|
||||
dlTwItemService.addTwi(addTwiVO);
|
||||
return CommonResult.ok();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -65,4 +65,19 @@ public class DlTicketWares extends TenantBaseDO {
|
||||
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
/** 多个图片地址,英文逗号分隔(拍照上传配件申请单时用) */
|
||||
private String images;
|
||||
|
||||
/** 是否传给保险公司(字典yes_no,1:是,0:否,默认0) */
|
||||
private String toSafe;
|
||||
|
||||
/** 保险公司名称 */
|
||||
private String safeName;
|
||||
|
||||
/** 保险公司联系人 */
|
||||
private String safeContact;
|
||||
|
||||
/** 保险公司联系电话 */
|
||||
private String safeMobile;
|
||||
}
|
@ -42,6 +42,16 @@ public interface DlRepairTicketsMapper extends BaseMapper<DlRepairTickets> {
|
||||
* @param repairTicketsReqVO 查询对象
|
||||
**/
|
||||
IPage<DlRepairTickets> getPageTypeAll(@Param("map") DlRepairTicketsReqVO repairTicketsReqVO, Page<DlRepairTickets> page);
|
||||
|
||||
/**
|
||||
* 根据条件查询指定工单数量
|
||||
* @author vinjor-M
|
||||
* @date 15:46 2024/11/18
|
||||
* @param dayDate 某一天日期
|
||||
* @param recordCode 操作记录code
|
||||
* @return java.lang.Long
|
||||
**/
|
||||
Long selectCountByParams(@Param("nowDate")String dayDate, @Param("recordCode")String recordCode, @Param("startTime")String startTime, @Param("endTime")String endTime);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
package cn.iocoder.yudao.module.tickets.mapper;
|
||||
|
||||
import cn.iocoder.yudao.module.tickets.entity.DlRepairTitem;
|
||||
import cn.iocoder.yudao.module.tickets.vo.DlRepairTitemReqVO;
|
||||
import cn.iocoder.yudao.module.tickets.vo.DlRepairTitemRespVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@ -42,6 +43,15 @@ public interface DlRepairTitemMapper extends BaseMapper<DlRepairTitem> {
|
||||
* @return java.util.List<cn.iocoder.yudao.module.tickets.vo.DlRepairTitemRespVO>
|
||||
**/
|
||||
List<DlRepairTitemRespVO> selectProjList(@Param("ticketId")String ticketId,@Param("isOpen")String isOpen);
|
||||
|
||||
/**
|
||||
* 根据工单ID查询所有配件明细--带着分组名称和ID
|
||||
* @author vinjor-M
|
||||
* @date 10:44 2024/11/19
|
||||
* @param ticketId 工单ID
|
||||
* @return java.util.List<cn.iocoder.yudao.module.tickets.vo.DlRepairTitemReqVO>
|
||||
**/
|
||||
List<DlRepairTitemReqVO> selectByTicketId(@Param("ticketId")String ticketId);
|
||||
}
|
||||
|
||||
|
||||
|
@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.tickets.mapper;
|
||||
|
||||
import cn.iocoder.yudao.module.tickets.entity.DlTwItem;
|
||||
import cn.iocoder.yudao.module.tickets.vo.DlTwItemReqVO;
|
||||
import cn.iocoder.yudao.module.tickets.vo.DlTwItemRespVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@ -25,6 +26,15 @@ public interface DlTwItemMapper extends BaseMapper<DlTwItem> {
|
||||
* @param reqVO 请求对象
|
||||
**/
|
||||
List<DlTwItem> listTwItem(@Param("map") DlTwItemReqVO reqVO);
|
||||
|
||||
/**
|
||||
* APP查询配件申请单列表-按配件分类进行分组
|
||||
* @author vinjor-M
|
||||
* @date 14:04 2024/11/20
|
||||
* @param reqVO
|
||||
* @return java.util.List<cn.iocoder.yudao.module.tickets.vo.DlTwItemRespVO>
|
||||
**/
|
||||
List<DlTwItemRespVO> listTwItemApp(@Param("map") DlTwItemReqVO reqVO);
|
||||
}
|
||||
|
||||
|
||||
|
@ -42,10 +42,11 @@ public interface DlRepairTicketsService extends IService<DlRepairTickets> {
|
||||
* 获得一个工单的详细信息
|
||||
*
|
||||
* @param id 工单ID
|
||||
* @param ifApp 是否是APP发起的查询
|
||||
* @author 小李
|
||||
* @date 16:05 2024/9/21
|
||||
**/
|
||||
DlRepairTicketsRespVO getTicketsById(String id);
|
||||
DlRepairTicketsRespVO getTicketsById(String id,Boolean ifApp);
|
||||
|
||||
/**
|
||||
* 维修工单表 作废
|
||||
@ -172,7 +173,7 @@ public interface DlRepairTicketsService extends IService<DlRepairTickets> {
|
||||
* @date 11:30 2024/10/24
|
||||
* @return java.util.Map<java.lang.String,java.lang.Integer>
|
||||
**/
|
||||
Map<String,Integer> getBossNum();
|
||||
Map<String,Long> getBossNum(String selectType,String startDate,String endDate);
|
||||
|
||||
/**
|
||||
* 服务顾问通知客户取车
|
||||
@ -235,4 +236,30 @@ public interface DlRepairTicketsService extends IService<DlRepairTickets> {
|
||||
* @param id 工单ID
|
||||
**/
|
||||
void removeTicketById(String id);
|
||||
|
||||
/**
|
||||
* 服务顾问交车
|
||||
* @author vinjor-M
|
||||
* @date 16:51 2024/11/13
|
||||
* @param respVO
|
||||
**/
|
||||
void overOrder(DlRepairTicketsRespVO respVO);
|
||||
|
||||
/**
|
||||
* 判断是否工单子表的任何一个类目没有价格或价格为0
|
||||
*
|
||||
* @param id 工单ID
|
||||
* @author 小李
|
||||
* @date 15:00 2024/11/16
|
||||
**/
|
||||
Boolean hasPrice(String id);
|
||||
|
||||
/**
|
||||
* 根据工单ID查客户和车辆信息
|
||||
*
|
||||
* @author 小李
|
||||
* @date 19:07 2024/11/18
|
||||
* @param id id
|
||||
**/
|
||||
CustomerAndCarVO getCusAndCarById(String id);
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.tickets.service;
|
||||
import cn.iocoder.yudao.module.tickets.entity.DlTicketWares;
|
||||
import cn.iocoder.yudao.module.tickets.vo.DlTicketWaresReqVO;
|
||||
import cn.iocoder.yudao.module.tickets.vo.DlTicketWaresRespVO;
|
||||
import cn.iocoder.yudao.module.tickets.vo.DlTwItemRespVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
@ -104,4 +105,22 @@ public interface DlTicketWaresService extends IService<DlTicketWares> {
|
||||
* @date 15:38 2024/10/22
|
||||
**/
|
||||
Map<String,Integer> getWorkerTodo();
|
||||
|
||||
/**
|
||||
* 修改是否传给保险公司
|
||||
*
|
||||
* @author 小李
|
||||
* @date 15:48 2024/11/18
|
||||
* @param respVO 对象
|
||||
**/
|
||||
void updateSafe(DlTicketWaresRespVO respVO);
|
||||
|
||||
/**
|
||||
* 根据选择的配件生成采购单需要的数据
|
||||
*
|
||||
* @author 小李
|
||||
* @date 18:14 2024/11/18
|
||||
* @param ids ids
|
||||
**/
|
||||
Map<String, List<DlTwItemRespVO>> getByIds(List<String> ids);
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package cn.iocoder.yudao.module.tickets.service;
|
||||
|
||||
import cn.iocoder.yudao.module.tickets.entity.DlTwItem;
|
||||
import cn.iocoder.yudao.module.tickets.vo.AddTwiVO;
|
||||
import cn.iocoder.yudao.module.tickets.vo.DlTwItemReqVO;
|
||||
import cn.iocoder.yudao.module.tickets.vo.DlTwItemRespVO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
@ -23,4 +24,22 @@ public interface DlTwItemService extends IService<DlTwItem> {
|
||||
* @param reqVO 请求对象
|
||||
**/
|
||||
List<DlTwItemRespVO> listTwItem(DlTwItemReqVO reqVO);
|
||||
|
||||
/**
|
||||
* 给配件申请表子表添加数据
|
||||
*
|
||||
* @author 小李
|
||||
* @date 17:47 2024/11/13
|
||||
* @param addTwiVO 对象
|
||||
**/
|
||||
void addTwi(AddTwiVO addTwiVO);
|
||||
|
||||
/**
|
||||
* APP查询配件申请单列表-按配件分类进行分组
|
||||
* @author vinjor-M
|
||||
* @date 14:03 2024/11/20
|
||||
* @param reqVO
|
||||
* @return java.lang.Object
|
||||
**/
|
||||
Object listApp(DlTwItemReqVO reqVO);
|
||||
}
|
||||
|
@ -2,11 +2,14 @@ package cn.iocoder.yudao.module.tickets.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
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.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.security.core.LoginUser;
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
|
||||
import cn.iocoder.yudao.module.base.entity.RepairWorker;
|
||||
import cn.iocoder.yudao.module.base.service.RepairRecordsService;
|
||||
import cn.iocoder.yudao.module.base.service.RepairWorkerService;
|
||||
@ -20,6 +23,7 @@ import cn.iocoder.yudao.module.conf.entity.BaseType;
|
||||
import cn.iocoder.yudao.module.conf.service.BaseTypeService;
|
||||
import cn.iocoder.yudao.module.custom.entity.*;
|
||||
import cn.iocoder.yudao.module.custom.service.*;
|
||||
import cn.iocoder.yudao.module.custom.vo.CarMainReqVO;
|
||||
import cn.iocoder.yudao.module.custom.vo.CarMainRespVO;
|
||||
import cn.iocoder.yudao.module.custom.vo.CustomerMainRespVO;
|
||||
import cn.iocoder.yudao.module.order.entity.RepairOrderInfo;
|
||||
@ -48,6 +52,7 @@ import cn.iocoder.yudao.module.tickets.entity.DlRepairTitem;
|
||||
import cn.iocoder.yudao.module.tickets.entity.DlTicketWares;
|
||||
import cn.iocoder.yudao.module.tickets.entity.DlTwItem;
|
||||
import cn.iocoder.yudao.module.tickets.mapper.DlRepairTicketsMapper;
|
||||
import cn.iocoder.yudao.module.tickets.mapper.DlRepairTitemMapper;
|
||||
import cn.iocoder.yudao.module.tickets.service.DlRepairTicketsService;
|
||||
import cn.iocoder.yudao.module.tickets.service.DlRepairTitemService;
|
||||
import cn.iocoder.yudao.module.tickets.service.DlTicketWaresService;
|
||||
@ -100,6 +105,10 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
|
||||
|
||||
@Resource
|
||||
private DlRepairTitemService titemService;
|
||||
@Resource
|
||||
private DlRepairTitemMapper repairTitemMapper;
|
||||
@Resource
|
||||
private DlRepairTicketsMapper repairTicketsMapper;
|
||||
|
||||
@Resource
|
||||
private DeptApi deptApi;
|
||||
@ -220,7 +229,6 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
|
||||
// });
|
||||
|
||||
|
||||
|
||||
// 门店信息
|
||||
Long deptId = SecurityFrameworkUtils.getLoginUserDeptId();
|
||||
DeptRespDTO dept = deptApi.getDept(deptId);
|
||||
@ -254,7 +262,7 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
|
||||
// 新增子表
|
||||
itemList.forEach(item -> {
|
||||
item.setTicketId(ticketsRespVO.getId());
|
||||
if(null==item.getSaleId()){
|
||||
if (null == item.getSaleId()) {
|
||||
//默认销售人员是当前用户
|
||||
item.setSaleId(loginUser.getId());
|
||||
item.setSaleName(loginUser.getInfo().get("nickname"));
|
||||
@ -334,11 +342,12 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
|
||||
* 获得一个工单的详细信息
|
||||
*
|
||||
* @param id 工单ID
|
||||
* @param ifApp 是否是APP发起的查询
|
||||
* @author 小李
|
||||
* @date 16:05 2024/9/21
|
||||
**/
|
||||
@Override
|
||||
public DlRepairTicketsRespVO getTicketsById(String id) {
|
||||
public DlRepairTicketsRespVO getTicketsById(String id,Boolean ifApp) {
|
||||
// 查工单主表
|
||||
DlRepairTickets dlRepairTickets = baseMapper.selectById(id);
|
||||
DlRepairTicketsRespVO result = BeanUtil.toBean(dlRepairTickets, DlRepairTicketsRespVO.class);
|
||||
@ -365,21 +374,59 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
|
||||
}
|
||||
result.setProjects(projects);
|
||||
|
||||
// 取配件
|
||||
List<DlRepairTitemReqVO> wares = items.stream().filter(item -> item.getItemType().equals("02")).collect(Collectors.toList());
|
||||
if (CollectionUtil.isNotEmpty(wares)) {
|
||||
// 单位字典
|
||||
List<DictDataRespDTO> recordTypeList = dictDataApi.getDictDataList(DICT_REPAIR_UNIT);
|
||||
Map<String, String> unitMap = recordTypeList.stream().collect(Collectors.toMap(DictDataRespDTO::getValue, DictDataRespDTO::getLabel));
|
||||
|
||||
Set<String> ids = wares.stream().map(DlRepairTitemReqVO::getPartId).collect(Collectors.toSet());
|
||||
List<RepairWares> repairWares = waresService.listByIds(ids);
|
||||
items.forEach(item -> {
|
||||
repairWares.stream().filter(i -> i.getId().equals(item.getPartId())).findFirst().ifPresent(item::setWare);
|
||||
item.setItemUnit(unitMap.get(item.getItemUnit()));
|
||||
});
|
||||
if(ifApp){
|
||||
//app的逻辑
|
||||
List<AppWaresGroupVO> waresGroupList = new ArrayList<>();
|
||||
//查这个工单的配件
|
||||
List<DlRepairTitemReqVO> waresList = repairTitemMapper.selectByTicketId(id);
|
||||
if (CollectionUtil.isNotEmpty(waresList)) {
|
||||
//先过滤出itenTypeId为null或空,或者itemTypeName为null或空的,为单独一个组
|
||||
List<DlRepairTitemReqVO> nullList = waresList.stream().filter(item->StringUtils.isEmpty(item.getItemTypeId()) || StringUtils.isEmpty(item.getItemTypeName())).collect(Collectors.toList());
|
||||
if (CollectionUtil.isNotEmpty(nullList)) {
|
||||
AppWaresGroupVO waresGroupVO = new AppWaresGroupVO();
|
||||
waresGroupVO.setWares(nullList);
|
||||
waresGroupVO.setGroupName("未知分组");
|
||||
waresGroupVO.setNums(nullList.size());
|
||||
waresGroupVO.setTotalAmount(nullList.stream().peek(item->{
|
||||
if(null==item.getItemMoney()){
|
||||
item.setItemMoney(new BigDecimal(0));
|
||||
}
|
||||
}).map(DlRepairTitem::getItemMoney).reduce(BigDecimal.ZERO,BigDecimal::add));
|
||||
waresGroupList.add(waresGroupVO);
|
||||
}
|
||||
//过滤出有分类的进行分组
|
||||
Map<String,List<DlRepairTitemReqVO>> groupListMap = waresList.stream().filter(item->StringUtils.isNotEmpty(item.getItemTypeId()) && StringUtils.isNotEmpty(item.getItemTypeName())).collect(Collectors.groupingBy(DlRepairTitem::getItemTypeId));
|
||||
for (String key:groupListMap.keySet()){
|
||||
AppWaresGroupVO waresGroupVO = new AppWaresGroupVO();
|
||||
waresGroupVO.setWares(groupListMap.get(key));
|
||||
waresGroupVO.setGroupName(groupListMap.get(key).get(0).getItemTypeName());
|
||||
waresGroupVO.setGroupId(key);
|
||||
waresGroupVO.setNums(groupListMap.get(key).size());
|
||||
waresGroupVO.setTotalAmount(groupListMap.get(key).stream().peek(item->{
|
||||
if(null==item.getItemMoney()){
|
||||
item.setItemMoney(new BigDecimal(0));
|
||||
}
|
||||
}).map(DlRepairTitem::getItemMoney).reduce(BigDecimal.ZERO,BigDecimal::add));
|
||||
waresGroupList.add(waresGroupVO);
|
||||
}
|
||||
}
|
||||
result.setWaresGroupList(waresGroupList);
|
||||
}else{
|
||||
// 取配件----原有逻辑-电脑端
|
||||
List<DlRepairTitemReqVO> wares = items.stream().filter(item -> item.getItemType().equals("02")).collect(Collectors.toList());
|
||||
if (CollectionUtil.isNotEmpty(wares)) {
|
||||
// 单位字典
|
||||
List<DictDataRespDTO> recordTypeList = dictDataApi.getDictDataList(DICT_REPAIR_UNIT);
|
||||
Map<String, String> unitMap = recordTypeList.stream().collect(Collectors.toMap(DictDataRespDTO::getValue, DictDataRespDTO::getLabel));
|
||||
Set<String> ids = wares.stream().map(DlRepairTitemReqVO::getPartId).collect(Collectors.toSet());
|
||||
List<RepairWares> repairWares = waresService.listByIds(ids);
|
||||
items.forEach(item -> {
|
||||
repairWares.stream().filter(i -> i.getId().equals(item.getPartId())).findFirst().ifPresent(item::setWare);
|
||||
item.setUnitText(unitMap.get(item.getItemUnit()));
|
||||
});
|
||||
}
|
||||
result.setWares(wares);
|
||||
}
|
||||
result.setWares(wares);
|
||||
// 取附加
|
||||
List<DlRepairTitemReqVO> others = items.stream().filter(item -> item.getItemType().equals("03")).collect(Collectors.toList());
|
||||
if (CollectionUtil.isNotEmpty(others)) {
|
||||
@ -413,7 +460,7 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
|
||||
// 作废维修工单
|
||||
DlRepairTickets tickets = new DlRepairTickets();
|
||||
tickets.setId(repairTicketsReqVO.getId());
|
||||
if (ObjectUtil.isNotEmpty(repairTicketsReqVO.getRemark())){
|
||||
if (ObjectUtil.isNotEmpty(repairTicketsReqVO.getRemark())) {
|
||||
tickets.setRemark(repairTicketsReqVO.getRemark());
|
||||
}
|
||||
tickets.setTicketsStatus("03");
|
||||
@ -445,15 +492,18 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
|
||||
|
||||
// 更新工单
|
||||
// 在这里把工单的状态更新为已完成---需要判断,如果是线上支付,需要在支付回调更新
|
||||
if (!repairTicketsRespVO.getPayType().equals("01")){
|
||||
repairTicketsRespVO.setIsFinish("1");
|
||||
if (!repairTicketsRespVO.getPayType().equals("01")) {
|
||||
// 不在这儿结束
|
||||
// repairTicketsRespVO.setIsFinish("1");
|
||||
baseMapper.updateById(repairTicketsRespVO);
|
||||
}else {
|
||||
} else {
|
||||
// 线下结账和签单挂账,直接算已支付
|
||||
repairOrderInfo.setPayTime(LocalDateTime.now());
|
||||
repairOrderInfo.setOrderStatus("1");
|
||||
}
|
||||
repairOrderInfoService.updateById(repairOrderInfo);
|
||||
// 记录日志
|
||||
repairRecordsService.saveRepairRecord(one.getGoodsId(), null, RecordTypeEnum.JS.getCode(), "线下支付结算", null);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -850,6 +900,8 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
|
||||
String userRoleCode = getUserRole();
|
||||
if (userRoleCode.equals(RepairRoleEnum.ADMIN.getCode())) {
|
||||
//维修管理员看所有数据
|
||||
} else if (userRoleCode.equals(RepairRoleEnum.WAREHOUSE.getCode())) {
|
||||
//仓管看到所有数据
|
||||
} else if (userRoleCode.equals(RepairRoleEnum.INSPECTION.getCode())) {
|
||||
//总检
|
||||
if (RepairCons.TICKETS_WAITING.equals(repairTicketsReqVO.getSelectType())) {
|
||||
@ -876,7 +928,7 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
|
||||
if ("".equals(userIdsStr)) {
|
||||
userIdsStr = String.valueOf(worker.getUserId());
|
||||
} else {
|
||||
userIdsStr = "," + worker.getUserId();
|
||||
userIdsStr = userIdsStr + "," + worker.getUserId();
|
||||
}
|
||||
}
|
||||
repairTicketsReqVO.setUserIds(userIds);
|
||||
@ -951,7 +1003,7 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
|
||||
**/
|
||||
@Override
|
||||
@DSTransactional
|
||||
public void updateTake(String id,String image) {
|
||||
public void updateTake(String id, String image) {
|
||||
// 改变时看看是否已经被接了
|
||||
int update = baseMapper.update(new LambdaUpdateWrapper<DlRepairTickets>()
|
||||
.set(DlRepairTickets::getTicketsWorkStatus, TicketsWorkStatusEnum.RECEIVED.getCode())
|
||||
@ -999,21 +1051,75 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
|
||||
}
|
||||
repairWorkerService.sentMessage(reqVO.getNowRepairId(), "您有新的工单要处理");
|
||||
|
||||
//最后记录操作日志--指派施工--pull下来的逻辑
|
||||
String code = RecordTypeEnum.ZPSG.getCode();
|
||||
String remark ="指派施工";
|
||||
// 获取当前操作人的身份----小李新加的逻辑
|
||||
String userRole = getUserRole();
|
||||
if (userRole.equals(RepairRoleEnum.REPAIR_STAFF.getCode())) {
|
||||
//指派施工,施工项目中不包含选中人员处理
|
||||
setTicketItem(reqVO.getId(), reqVO.getNowRepairId(), reqVO.getNowRepairName());
|
||||
}
|
||||
//最后记录操作日志--指派施工--pull下来的逻辑
|
||||
String code = RecordTypeEnum.ZPSG.getCode();
|
||||
String remark = "指派施工";
|
||||
|
||||
// 总检
|
||||
if (userRole.equals(RepairRoleEnum.INSPECTION.getCode())){
|
||||
if (userRole.equals(RepairRoleEnum.INSPECTION.getCode())) {
|
||||
repairRecordsService.saveRepairRecord(reqVO.getId(), null, RecordTypeEnum.NFPG.getCode(), reqVO.getRemark(), reqVO.getImage());
|
||||
}else {
|
||||
} else {
|
||||
// 其他
|
||||
//最后记录操作日志--指派施工
|
||||
repairRecordsService.saveRepairRecord(reqVO.getId(), null, code, remark, null);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 指派施工,施工项目中不包含选中人员处理
|
||||
*
|
||||
* @param ticketId 工单id
|
||||
* @param nowRepairId 当前处理人id
|
||||
* @param nowRepairName 当前处理人名称
|
||||
* @author PQZ
|
||||
* @date 16:30 2024/11/13
|
||||
**/
|
||||
private void setTicketItem(String ticketId, Long nowRepairId, String nowRepairName) {
|
||||
//查询所有维修工
|
||||
List<RepairWorker> list = repairWorkerService.list();
|
||||
//查询当前工单下所有项目
|
||||
LambdaQueryWrapper<DlRepairTitem> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(DlRepairTitem::getTicketId, ticketId);
|
||||
List<DlRepairTitem> itemList = titemService.list(lambdaQueryWrapper);
|
||||
//过滤出不包括当前指派人的值
|
||||
List<DlRepairTitem> filterList = itemList.stream().filter(item -> !item.getRepairNames().contains(nowRepairName)).collect(Collectors.toList());
|
||||
List<DlRepairTitem> saveList = new ArrayList<>();
|
||||
//当前处理人工作组
|
||||
Map<Long, RepairWorker> workerMap = list.stream().collect(Collectors.toMap(RepairWorker::getUserId, worker -> worker));
|
||||
String workType = workerMap.get(nowRepairId).getWorkType();
|
||||
filterList.forEach(item -> {
|
||||
//深拷贝
|
||||
DlRepairTitem saveItem = BeanUtils.toBean(item, DlRepairTitem.class);
|
||||
if (StringUtils.isNotEmpty(saveItem.getRepairIds())) {
|
||||
//取出用户id
|
||||
List<Long> repairIds = Arrays.stream(saveItem.getRepairIds().split(",")).map(Long::parseLong).collect(Collectors.toList());
|
||||
repairIds.forEach(idItem -> {
|
||||
// 获取对应的 worker
|
||||
RepairWorker worker = workerMap.get(idItem);
|
||||
// 检查 worker 是否存在并比较 workType
|
||||
if (worker != null && workType.equals(worker.getWorkType())) {
|
||||
saveList.add(saveItem);
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
saveList.forEach(item -> {
|
||||
String newRepairId = item.getRepairIds() + "," + nowRepairId;
|
||||
String newRepairName = item.getRepairNames() + "," + nowRepairName;
|
||||
item.setRepairIds(newRepairId);
|
||||
item.setRepairNames(newRepairName);
|
||||
});
|
||||
titemService.updateBatchById(saveList);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新工单状态(针对开始施工、施工中记录、施工完成)
|
||||
*
|
||||
@ -1066,7 +1172,7 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
|
||||
施工完成又分四种情况:阶段完成、完成并移交下一班组、完成并移交总检、完成工单,其中部分完成同开始施工、施工中的记录上传一致,只上传,不改变
|
||||
*/
|
||||
// 消息生成
|
||||
String message = createMessage(tickets.getNowRepairName(), tickets.getCarNo(),null==titem?"":titem.getItemName(), respVO.getRecordType(), respVO.getFinishType(), respVO.getNextName());
|
||||
String message = createMessage(tickets.getNowRepairName(), tickets.getCarNo(), null == titem ? "" : titem.getItemName(), respVO.getRecordType(), respVO.getFinishType(), respVO.getNextName());
|
||||
// 通知服务顾问
|
||||
// 如果员工完成了订单
|
||||
if (RecordTypeEnum.SGWCZJ.getCode().equals(respVO.getRecordType()) && "03".equals(respVO.getFinishType())) {
|
||||
@ -1109,7 +1215,7 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
|
||||
}
|
||||
|
||||
//通知客户(开始施工、施工完成)
|
||||
if (respVO.getRecordType().equals(RecordTypeEnum.KSSG.getCode()) || respVO.getRecordType().equals(RecordTypeEnum.SGWCZJ.getCode())){
|
||||
if (respVO.getRecordType().equals(RecordTypeEnum.KSSG.getCode()) || respVO.getRecordType().equals(RecordTypeEnum.SGWCZJ.getCode())) {
|
||||
// 构建消息
|
||||
RepairWorker worker = repairWorkerService.getOne(new LambdaQueryWrapper<RepairWorker>().eq(RepairWorker::getUserId, SecurityFrameworkUtils.getLoginUserId()).last("limit 1"));
|
||||
List<DictDataRespDTO> dataList = dictDataApi.getDictDataList("repair_work_type");
|
||||
@ -1192,7 +1298,11 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
|
||||
repairTicketsReqVO.setSelectType("special");
|
||||
// 维修服务顾问
|
||||
if (userRoleCode.equals(RepairRoleEnum.ADVISOR.getCode())) {
|
||||
repairTicketsReqVO.setNowRepairId(loginUserId);
|
||||
// 查所有的服务顾问
|
||||
List<UserDTO> userDTOS = roleApi.selectUserListByRoleCode(TenantContextHolder.getRequiredTenantId(), RepairRoleEnum.ADVISOR.getCode());
|
||||
List<Long> ids = userDTOS.stream().map(UserDTO::getId).collect(Collectors.toList());
|
||||
repairTicketsReqVO.setNowRepairIds(ids);
|
||||
// repairTicketsReqVO.setNowRepairId(loginUserId);
|
||||
// 因为完成状态需要在交车之后,所以注掉这个
|
||||
// repairTicketsReqVO.setIsFinish("1");
|
||||
} else if (userRoleCode.equals(RepairRoleEnum.INSPECTION.getCode())) {
|
||||
@ -1221,11 +1331,11 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
|
||||
repairRecordsService.saveRepairRecord(respVO.getId(), null, RecordTypeEnum.ZJ.getCode(), respVO.getRemark(), respVO.getImage());
|
||||
// 更新工单
|
||||
baseMapper.update(new LambdaUpdateWrapper<DlRepairTickets>()
|
||||
// 因为完成状态需要在交车之后,所以注掉这个
|
||||
// 因为完成状态需要在交车之后,所以注掉这个
|
||||
// .set(DlRepairTickets::getIsFinish, "1")
|
||||
.setSql("now_repair_id = adviser_id")
|
||||
.setSql("now_repair_name = adviser_name")
|
||||
.eq(DlRepairTickets::getId, respVO.getId())
|
||||
.setSql("now_repair_id = adviser_id")
|
||||
.setSql("now_repair_name = adviser_name")
|
||||
.eq(DlRepairTickets::getId, respVO.getId())
|
||||
);
|
||||
|
||||
boolean flag = syncTicketWaresToTicket(respVO.getId());
|
||||
@ -1343,22 +1453,54 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
|
||||
* @date 11:30 2024/10/24
|
||||
**/
|
||||
@Override
|
||||
public Map<String, Integer> getBossNum() {
|
||||
Map<String, Integer> rtnMap = new HashMap<>();
|
||||
int workingNum = 0;
|
||||
int doneNum = 0;
|
||||
public Map<String, Long> getBossNum(String selectType,String startDate,String endDate) {
|
||||
Map<String, Long> rtnMap = new HashMap<>();
|
||||
//维修中---当前这一时刻
|
||||
long workingNum = 0;
|
||||
//在厂数--当前这一时刻
|
||||
long inCompanyNum = 0;
|
||||
//进场数
|
||||
long newOrderNum=0;
|
||||
//已完成
|
||||
long overNum=0;
|
||||
//已交车
|
||||
long giveCusNum=0;
|
||||
List<DlRepairTickets> repairTickets = this.list();
|
||||
if (!repairTickets.isEmpty()) {
|
||||
Map<String, List<DlRepairTickets>> ifFinishMap = repairTickets.stream().collect(Collectors.groupingBy(DlRepairTickets::getIsFinish));
|
||||
if (ifFinishMap.containsKey("0")) {
|
||||
workingNum = ifFinishMap.get("0").size();
|
||||
}
|
||||
if (ifFinishMap.containsKey("1")) {
|
||||
doneNum = ifFinishMap.get("1").size();
|
||||
workingNum = repairTickets.stream().filter(item -> TicketsStatusEnum.WORKING.getCode().equals(item.getTicketsStatus())).count();
|
||||
inCompanyNum = repairTickets.stream().filter(item -> TicketsStatusEnum.NO_PAY.getCode().equals(item.getTicketsStatus())).count();
|
||||
LocalDateTime currentTime = LocalDateTime.now();
|
||||
if("today".equals(selectType)){
|
||||
String nowDayStr = DateUtil.formatDate(new Date());
|
||||
//查当日进厂数、已完成、已交车
|
||||
newOrderNum = repairTickets.stream().filter(item -> item.getCreateTime().toLocalDate().equals(currentTime.toLocalDate())).count();
|
||||
//查当日已完成的(总检完成的)
|
||||
overNum = repairTicketsMapper.selectCountByParams(nowDayStr,RecordTypeEnum.ZJ.getCode(),null,null);
|
||||
//查当日已交车的(已结算的)
|
||||
giveCusNum = repairTicketsMapper.selectCountByParams(nowDayStr,RecordTypeEnum.JS.getCode(),null,null);
|
||||
}else if("all".equals(selectType)){
|
||||
//查累计进厂数、已完成、已交车
|
||||
newOrderNum = repairTickets.size();
|
||||
//查累计已完成的(总检完成的)
|
||||
overNum = repairTicketsMapper.selectCountByParams(null,RecordTypeEnum.ZJ.getCode(),null,null);
|
||||
//查累计已交车的(已结算的)
|
||||
giveCusNum = repairTicketsMapper.selectCountByParams(null,RecordTypeEnum.JS.getCode(),null,null);
|
||||
}else {
|
||||
//查某个时间范围内进厂数、已完成、已交车
|
||||
LocalDateTime startTime = LocalDateTime.parse(startDate+" 00:00:00", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||
LocalDateTime endTime = LocalDateTime.parse(endDate+" 23:59:59", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||
newOrderNum = repairTickets.stream().filter(item -> item.getCreateTime().isAfter(startTime) && item.getCreateTime().isBefore(endTime)).count();
|
||||
//查某区间范围内已完成的(总检完成的)
|
||||
overNum = repairTicketsMapper.selectCountByParams(null,RecordTypeEnum.ZJ.getCode(), startDate+" 00:00:00", endDate+" 23:59:59");
|
||||
//查某区间范围内已交车的(已结算的)
|
||||
giveCusNum = repairTicketsMapper.selectCountByParams(null,RecordTypeEnum.JS.getCode(), startDate+" 00:00:00", endDate+" 23:59:59");
|
||||
}
|
||||
}
|
||||
rtnMap.put("workingNum", workingNum);
|
||||
rtnMap.put("doneNum", doneNum);
|
||||
rtnMap.put("inCompanyNum", inCompanyNum);
|
||||
rtnMap.put("newOrderNum", newOrderNum);
|
||||
rtnMap.put("overNum", overNum);
|
||||
rtnMap.put("giveCusNum", giveCusNum);
|
||||
return rtnMap;
|
||||
}
|
||||
|
||||
@ -1407,6 +1549,29 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
|
||||
repairRecordsService.saveRepairRecord(noticeCusVO.getId(), null, RecordTypeEnum.TZQC.getCode(), recordStr, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否工单子表的任何一个类目没有价格或价格为0
|
||||
*
|
||||
* @param id 工单ID
|
||||
* @author 小李
|
||||
* @date 15:00 2024/11/16
|
||||
**/
|
||||
@Override
|
||||
public Boolean hasPrice(String id) {
|
||||
List<DlRepairTitem> titems = titemService.list(new LambdaQueryWrapper<DlRepairTitem>().in(DlRepairTitem::getTicketId, id));
|
||||
for (DlRepairTitem item : titems) {
|
||||
// 如果有为空的,直接报错
|
||||
if (ObjectUtil.isEmpty(item.getItemPrice())) {
|
||||
throw exception0(500, "工单中有项目或配件没有设置价格,请服务顾问填写项目价格,仓库填写配件价格");
|
||||
}
|
||||
// 如果有为0的,那就提示,让操作人选择
|
||||
if (item.getItemPrice().equals(new BigDecimal("0.00"))){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 重新计算工单的一些数值,子表也要重新计算
|
||||
*
|
||||
@ -1428,7 +1593,8 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
|
||||
titem.setId(item.getId());
|
||||
// 取出折扣
|
||||
BigDecimal discount = item.getItemDiscount() == null ? new BigDecimal("1") : item.getItemDiscount();
|
||||
titem.setItemMoney(item.getItemPrice().multiply(BigDecimal.valueOf(item.getItemCount())).multiply(discount));
|
||||
BigDecimal itemPrice = item.getItemPrice() == null ? BigDecimal.ZERO : item.getItemPrice();
|
||||
titem.setItemMoney(itemPrice.multiply(BigDecimal.valueOf(item.getItemCount())).multiply(discount));
|
||||
return titem;
|
||||
}).collect(Collectors.toList());
|
||||
// 更新
|
||||
@ -1637,6 +1803,50 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
|
||||
// 记录操作日志
|
||||
repairRecordsService.saveRepairRecord(id, null, RecordTypeEnum.SCGG.getCode(), null, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 服务顾问交车
|
||||
*
|
||||
* @param respVO
|
||||
* @author vinjor-M
|
||||
* @date 16:51 2024/11/13
|
||||
**/
|
||||
@Override
|
||||
public void overOrder(DlRepairTicketsRespVO respVO) {
|
||||
// 更新工单状态
|
||||
baseMapper.update(new LambdaUpdateWrapper<DlRepairTickets>()
|
||||
.set(DlRepairTickets::getTicketsWorkStatus, TicketsWorkStatusEnum.END.getCode())
|
||||
.set(DlRepairTickets::getTicketsStatus, TicketsStatusEnum.OVER.getCode())
|
||||
//交车时才能把工单置为完成
|
||||
.set(DlRepairTickets::getIsFinish, "1")
|
||||
.eq(DlRepairTickets::getId, respVO.getId())
|
||||
);
|
||||
|
||||
// 记录日志
|
||||
repairRecordsService.saveRepairRecord(respVO.getId(), null, RecordTypeEnum.JC.getCode(), respVO.getRemark(), respVO.getImage());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据工单ID查客户和车辆信息
|
||||
*
|
||||
* @author 小李
|
||||
* @date 19:07 2024/11/18
|
||||
* @param id id
|
||||
**/
|
||||
@Override
|
||||
public CustomerAndCarVO getCusAndCarById(String id){
|
||||
// 查工单
|
||||
DlRepairTickets tickets = baseMapper.selectById(id);
|
||||
// 查用户
|
||||
CustomerMain customerMain = customerService.getById(tickets.getUserId());
|
||||
// 查车辆
|
||||
CarMain carMain = carMainService.getById(tickets.getCarId());
|
||||
// 映射
|
||||
CustomerAndCarVO customerAndCarVO = new CustomerAndCarVO();
|
||||
customerAndCarVO.setUserInfo(customerMain);
|
||||
customerAndCarVO.setCarInfo(BeanUtil.toBean(carMain, CarMainReqVO.class));
|
||||
return customerAndCarVO;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.tickets.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.common.RecordTypeEnum;
|
||||
import cn.iocoder.yudao.common.RepairRoleEnum;
|
||||
import cn.iocoder.yudao.common.SoStatusEnum;
|
||||
@ -10,6 +11,8 @@ 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;
|
||||
import cn.iocoder.yudao.module.base.service.RepairWorkerService;
|
||||
import cn.iocoder.yudao.module.conf.entity.BaseType;
|
||||
import cn.iocoder.yudao.module.conf.service.BaseTypeService;
|
||||
import cn.iocoder.yudao.module.custom.entity.CustomerMain;
|
||||
import cn.iocoder.yudao.module.custom.service.CustomerMainService;
|
||||
import cn.iocoder.yudao.module.project.entity.RepairWares;
|
||||
@ -32,10 +35,12 @@ import cn.iocoder.yudao.module.tickets.service.DlTicketWaresService;
|
||||
import cn.iocoder.yudao.module.tickets.service.DlTwItemService;
|
||||
import cn.iocoder.yudao.module.tickets.vo.DlTicketWaresReqVO;
|
||||
import cn.iocoder.yudao.module.tickets.vo.DlTicketWaresRespVO;
|
||||
import cn.iocoder.yudao.module.tickets.vo.DlTwItemRespVO;
|
||||
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
@ -102,6 +107,9 @@ public class DlTicketWaresServiceImpl extends ServiceImpl<DlTicketWaresMapper, D
|
||||
@Resource
|
||||
private CustomerMainService customerMainService;
|
||||
|
||||
@Resource
|
||||
private BaseTypeService baseTypeService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
@ -201,21 +209,27 @@ public class DlTicketWaresServiceImpl extends ServiceImpl<DlTicketWaresMapper, D
|
||||
ticketWares.setAdviserId(Long.valueOf(tickets.getAdviserId()));
|
||||
ticketWares.setAdviserName(tickets.getAdviserName());
|
||||
|
||||
// 图片
|
||||
if (ObjectUtil.isNotEmpty(respVO.getImages())){
|
||||
ticketWares.setImages(respVO.getImages());
|
||||
}
|
||||
baseMapper.insertOrUpdate(ticketWares);
|
||||
|
||||
// 新增、修改子表
|
||||
List<DlTwItem> list = respVO.getItems().stream()
|
||||
.map(item -> {
|
||||
DlTwItem twItem = BeanUtil.toBean(item, DlTwItem.class);
|
||||
twItem.setTwId(ticketWares.getId());
|
||||
twItem.setWaresStatus("");
|
||||
twItem.setWaresAlreadyCount(0);
|
||||
return twItem;
|
||||
}).collect(Collectors.toList());
|
||||
if (CollectionUtil.isEmpty(list)) {
|
||||
throw exception0(500, "配件列表为空");
|
||||
if (CollectionUtil.isNotEmpty(respVO.getItems())){
|
||||
List<DlTwItem> list = respVO.getItems().stream()
|
||||
.map(item -> {
|
||||
DlTwItem twItem = BeanUtil.toBean(item, DlTwItem.class);
|
||||
twItem.setTwId(ticketWares.getId());
|
||||
twItem.setWaresStatus("");
|
||||
twItem.setWaresAlreadyCount(0);
|
||||
return twItem;
|
||||
}).collect(Collectors.toList());
|
||||
if (CollectionUtil.isEmpty(list)) {
|
||||
throw exception0(500, "配件列表为空");
|
||||
}
|
||||
twItemService.saveOrUpdateBatch(list);
|
||||
}
|
||||
twItemService.saveOrUpdateBatch(list);
|
||||
|
||||
// 通知对应的维修服务顾问和总检
|
||||
// 维修服务顾问即创建工单时选的是谁
|
||||
@ -319,7 +333,7 @@ public class DlTicketWaresServiceImpl extends ServiceImpl<DlTicketWaresMapper, D
|
||||
DlTwItem twItem = allTwitems.stream().filter(i -> i.getWaresId().equals(item.getId())).findFirst().orElse(null);
|
||||
titem.setItemCount(twItem != null ? twItem.getWaresCount() : 0);
|
||||
titem.setItemUnit(item.getUnit());
|
||||
titem.setItemPrice(item.getPrice() != null ? item.getPrice() : BigDecimal.ZERO);
|
||||
titem.setItemPrice((item.getPrice() != null) ? item.getPrice() : BigDecimal.ZERO);
|
||||
titem.setItemDiscount(BigDecimal.ONE);
|
||||
titem.setItemMoney(titem.getItemPrice().multiply(BigDecimal.valueOf(titem.getItemCount())).multiply(titem.getItemDiscount()));
|
||||
titem.setRepairIds(String.valueOf(ticketWares.getRepairId()));
|
||||
@ -620,6 +634,74 @@ public class DlTicketWaresServiceImpl extends ServiceImpl<DlTicketWaresMapper, D
|
||||
return rtnMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改是否传给保险公司
|
||||
*
|
||||
* @author 小李
|
||||
* @date 15:48 2024/11/18
|
||||
* @param respVO 对象
|
||||
**/
|
||||
@Override
|
||||
public void updateSafe(DlTicketWaresRespVO respVO){
|
||||
// 先取出状态
|
||||
String toSafe = respVO.getToSafe();
|
||||
// 准备更新条件
|
||||
LambdaUpdateWrapper<DlTicketWares> lambdaUpdate = Wrappers.lambdaUpdate(DlTicketWares.class);
|
||||
lambdaUpdate.eq(DlTicketWares::getId, respVO.getId());
|
||||
lambdaUpdate.set(DlTicketWares::getToSafe, respVO.getToSafe());
|
||||
// 根据状态更新
|
||||
if (toSafe.equals("1")){
|
||||
lambdaUpdate.set(DlTicketWares::getSafeName, respVO.getSafeName());
|
||||
lambdaUpdate.set(DlTicketWares::getSafeContact, respVO.getSafeContact());
|
||||
lambdaUpdate.set(DlTicketWares::getSafeMobile, respVO.getSafeMobile());
|
||||
}
|
||||
// 更新
|
||||
baseMapper.update(lambdaUpdate);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据选择的配件生成采购单需要的数据
|
||||
*
|
||||
* @author 小李
|
||||
* @date 18:14 2024/11/18
|
||||
* @param ids ids
|
||||
**/
|
||||
@Override
|
||||
public Map<String, List<DlTwItemRespVO>> getByIds(List<String> ids){
|
||||
// 查配件申请表子表
|
||||
List<DlTwItem> twItems = twItemService.listByIds(ids);
|
||||
// 查配件
|
||||
List<String> waresIds = twItems.stream().map(DlTwItem::getWaresId).collect(Collectors.toList());
|
||||
List<RepairWares> wares = repairWaresService.listByIds(waresIds);
|
||||
// 关联配件申请表子项和配件
|
||||
List<DlTwItemRespVO> newTwItems = twItems.stream().map(item -> {
|
||||
DlTwItemRespVO twItem = BeanUtil.toBean(item, DlTwItemRespVO.class);
|
||||
RepairWares ware = wares.stream().filter(i -> i.getId().equals(item.getWaresId())).findFirst().orElse(null);
|
||||
if (ware != null) {
|
||||
twItem.setWares(ware);
|
||||
}
|
||||
return twItem;
|
||||
}).collect(Collectors.toList());
|
||||
// 分组
|
||||
Map<String, List<DlTwItemRespVO>> map = newTwItems.stream().collect(Collectors.groupingBy(item -> {
|
||||
String key = item.getWares().getType();
|
||||
return key != null && !key.isEmpty() ? key : "default";
|
||||
}));
|
||||
// 查分类
|
||||
List<BaseType> baseTypes = baseTypeService.listByIds(map.keySet());
|
||||
Map<String, String> TypeMap = baseTypes.stream().collect(Collectors.toMap(BaseType::getId, BaseType::getName));
|
||||
// 映射
|
||||
Map<String, List<DlTwItemRespVO>> result = new HashMap<>();
|
||||
for (Map.Entry<String, List<DlTwItemRespVO>> entry : map.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
String newKey = TypeMap.get(key);
|
||||
if (newKey == null || newKey.isEmpty()) {
|
||||
newKey = "未分类";
|
||||
}
|
||||
result.put(newKey, entry.getValue());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -8,20 +8,28 @@ import cn.iocoder.yudao.module.system.api.dict.DictDataApi;
|
||||
import cn.iocoder.yudao.module.system.api.dict.dto.DictDataRespDTO;
|
||||
import cn.iocoder.yudao.module.tickets.entity.DlTwItem;
|
||||
import cn.iocoder.yudao.module.tickets.mapper.DlTwItemMapper;
|
||||
import cn.iocoder.yudao.module.tickets.service.DlTicketWaresService;
|
||||
import cn.iocoder.yudao.module.tickets.service.DlTwItemService;
|
||||
import cn.iocoder.yudao.module.tickets.vo.AddTwiVO;
|
||||
import cn.iocoder.yudao.module.tickets.vo.AppWaresGroupVO;
|
||||
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.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static cn.iocoder.yudao.common.RepairCons.DICT_REPAIR_UNIT;
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception0;
|
||||
|
||||
/**
|
||||
* 针对表【dl_tw_item(工单配件申请/退回子表)】的数据库操作Service实现
|
||||
@ -33,6 +41,8 @@ import static cn.iocoder.yudao.common.RepairCons.DICT_REPAIR_UNIT;
|
||||
public class DlTwItemServiceImpl extends ServiceImpl<DlTwItemMapper, DlTwItem>
|
||||
implements DlTwItemService {
|
||||
|
||||
@Resource
|
||||
private DlTwItemMapper dlTwItemMapper;
|
||||
@Resource
|
||||
private RepairWaresService repairWaresService;
|
||||
@Resource
|
||||
@ -40,6 +50,9 @@ public class DlTwItemServiceImpl extends ServiceImpl<DlTwItemMapper, DlTwItem>
|
||||
@Resource
|
||||
@Lazy
|
||||
private RepairWaresService waresService;
|
||||
@Resource
|
||||
@Lazy
|
||||
private DlTicketWaresService ticketWaresService;
|
||||
|
||||
/**
|
||||
* 根据主表查看全部
|
||||
@ -78,6 +91,153 @@ public class DlTwItemServiceImpl extends ServiceImpl<DlTwItemMapper, DlTwItem>
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 给配件申请表子表添加数据
|
||||
*
|
||||
* @author 小李
|
||||
* @date 17:47 2024/11/13
|
||||
* @param addTwiVO 对象
|
||||
**/
|
||||
@Override
|
||||
public void addTwi(AddTwiVO addTwiVO){
|
||||
// 构建子表数据
|
||||
if (CollectionUtil.isEmpty(addTwiVO.getItems())){
|
||||
throw exception0(500, "请选择配件");
|
||||
}
|
||||
// 查出该配件申请单已有的所有配件,这里只取没有审核过(通过、驳回的不要,同一个配件如果已经审核过了又添加,还是算新的)
|
||||
List<DlTwItem> oldData = baseMapper.selectList(new LambdaQueryWrapper<DlTwItem>().and(i -> {
|
||||
i.in(DlTwItem::getTwId, addTwiVO.getId())
|
||||
.eq(DlTwItem::getWaresStatus, "");
|
||||
}));
|
||||
if (CollectionUtil.isNotEmpty(oldData)){
|
||||
// 取配件ID
|
||||
List<String> ids = oldData.stream().map(DlTwItem::getWaresId).collect(Collectors.toList());
|
||||
// 过滤添加的
|
||||
List<AddTwiVO.AddTwiVoItem> add = addTwiVO.getItems().stream().filter(item -> !ids.contains(item.getId())).collect(Collectors.toList());
|
||||
// 过滤存在的
|
||||
List<AddTwiVO.AddTwiVoItem> update = addTwiVO.getItems().stream().filter(item -> ids.contains(item.getId())).collect(Collectors.toList());
|
||||
// 添加
|
||||
if (CollectionUtil.isNotEmpty(add)){
|
||||
List<DlTwItem> twItems = add.stream().map(item -> {
|
||||
DlTwItem twItem = new DlTwItem();
|
||||
twItem.setTwId(addTwiVO.getId());
|
||||
twItem.setWaresId(item.getId());
|
||||
twItem.setWaresName(item.getName());
|
||||
twItem.setWaresCount(item.getCount());
|
||||
twItem.setWaresAlreadyCount(0);
|
||||
twItem.setWaresStatus("");
|
||||
twItem.setRemark(item.getRemark());
|
||||
return twItem;
|
||||
}).collect(Collectors.toList());
|
||||
// 新增
|
||||
baseMapper.insert(twItems);
|
||||
}
|
||||
// 更新
|
||||
if (CollectionUtil.isNotEmpty(update)){
|
||||
List<DlTwItem> twItems = update.stream().map(item -> {
|
||||
DlTwItem twItem = oldData.stream().filter(i -> i.getWaresId().equals(item.getId())).findFirst().orElse(null);
|
||||
// 只更新数量,其他不变
|
||||
if (twItem != null) {
|
||||
twItem.setWaresCount(twItem.getWaresCount() + item.getCount());
|
||||
}
|
||||
return twItem;
|
||||
}).collect(Collectors.toList());
|
||||
baseMapper.updateById(twItems);
|
||||
}
|
||||
}else {
|
||||
List<DlTwItem> twItems = addTwiVO.getItems().stream().map(item -> {
|
||||
DlTwItem twItem = new DlTwItem();
|
||||
twItem.setTwId(addTwiVO.getId());
|
||||
twItem.setWaresId(item.getId());
|
||||
twItem.setWaresName(item.getName());
|
||||
twItem.setWaresCount(item.getCount());
|
||||
twItem.setWaresAlreadyCount(0);
|
||||
twItem.setWaresStatus("");
|
||||
twItem.setRemark(item.getRemark());
|
||||
return twItem;
|
||||
}).collect(Collectors.toList());
|
||||
// 新增
|
||||
baseMapper.insert(twItems);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* APP查询配件申请单列表-按配件分类进行分组
|
||||
*
|
||||
* @param reqVO
|
||||
* @return java.lang.Object
|
||||
* @author vinjor-M
|
||||
* @date 14:03 2024/11/20
|
||||
**/
|
||||
@Override
|
||||
public Object listApp(DlTwItemReqVO reqVO) {
|
||||
// 查记录
|
||||
List<DlTwItemRespVO> dlTwItemRespVOList = dlTwItemMapper.listTwItemApp(reqVO);
|
||||
List<AppWaresGroupVO> waresGroupList = new ArrayList<>();
|
||||
if (CollectionUtil.isNotEmpty(dlTwItemRespVOList)) {
|
||||
//先过滤出itenTypeId为null或空,或者itemTypeName为null或空的,为单独一个组
|
||||
List<DlTwItemRespVO> nullList = dlTwItemRespVOList.stream().filter(item-> StringUtils.isEmpty(item.getTypeId()) || StringUtils.isEmpty(item.getTypeName())).collect(Collectors.toList());
|
||||
if (CollectionUtil.isNotEmpty(nullList)) {
|
||||
AppWaresGroupVO waresGroupVO = new AppWaresGroupVO();
|
||||
//审核通过数量、不通过数量、待审核数量
|
||||
final int[] numArray= {0,0,0};
|
||||
waresGroupVO.setTwItemList(nullList.stream().peek(item->{
|
||||
if(StringUtils.isEmpty(item.getWaresStatus())){
|
||||
//待审核
|
||||
numArray[2]++;
|
||||
item.setSelected(false);
|
||||
}else{
|
||||
if("1".equals(item.getWaresStatus())){
|
||||
//通过
|
||||
numArray[0]++;
|
||||
}else{
|
||||
//不通过
|
||||
numArray[1]++;
|
||||
}
|
||||
item.setApprovalTime(item.getUpdateTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
||||
}
|
||||
}).collect(Collectors.toList()));
|
||||
waresGroupVO.setGroupName("未知分组");
|
||||
waresGroupVO.setNums(nullList.size());
|
||||
waresGroupVO.setAllowNum(numArray[0]);
|
||||
waresGroupVO.setNoNum(numArray[1]);
|
||||
waresGroupVO.setWaitingNum(numArray[2]);
|
||||
waresGroupList.add(waresGroupVO);
|
||||
}
|
||||
//过滤出有分类的进行分组
|
||||
Map<String,List<DlTwItemRespVO>> groupListMap = dlTwItemRespVOList.stream().filter(item->StringUtils.isNotEmpty(item.getTypeId()) && StringUtils.isNotEmpty(item.getTypeName())).collect(Collectors.groupingBy(DlTwItemRespVO::getTypeId));
|
||||
for (String key:groupListMap.keySet()){
|
||||
AppWaresGroupVO waresGroupVO = new AppWaresGroupVO();
|
||||
//审核通过数量、不通过数量、待审核数量
|
||||
final int[] numArray= {0,0,0};
|
||||
waresGroupVO.setTwItemList(groupListMap.get(key).stream().peek(item->{
|
||||
if(StringUtils.isEmpty(item.getWaresStatus())){
|
||||
//待审核
|
||||
numArray[2]++;
|
||||
item.setSelected(false);
|
||||
}else{
|
||||
if("1".equals(item.getWaresStatus())){
|
||||
//通过
|
||||
numArray[0]++;
|
||||
}else{
|
||||
//不通过
|
||||
numArray[1]++;
|
||||
}
|
||||
item.setApprovalTime(item.getUpdateTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
||||
}
|
||||
}).collect(Collectors.toList()));
|
||||
waresGroupVO.setGroupName(groupListMap.get(key).get(0).getTypeName());
|
||||
waresGroupVO.setGroupId(key);
|
||||
waresGroupVO.setNums(groupListMap.get(key).size());
|
||||
waresGroupVO.setAllowNum(numArray[0]);
|
||||
waresGroupVO.setNoNum(numArray[1]);
|
||||
waresGroupVO.setWaitingNum(numArray[2]);
|
||||
waresGroupList.add(waresGroupVO);
|
||||
}
|
||||
}
|
||||
return waresGroupList;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -0,0 +1,42 @@
|
||||
package cn.iocoder.yudao.module.tickets.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 给配件申请表子表添加数据
|
||||
*
|
||||
* @author 小李
|
||||
* @date 17:41 2024/11/13
|
||||
**/
|
||||
@Data
|
||||
public class AddTwiVO {
|
||||
|
||||
private String id;
|
||||
|
||||
private List<AddTwiVoItem> items;
|
||||
|
||||
/**
|
||||
* 配件的信息
|
||||
*
|
||||
* @author 小李
|
||||
* @date 17:45 2024/11/13
|
||||
**/
|
||||
@Data
|
||||
public static class AddTwiVoItem {
|
||||
|
||||
/** 配件ID */
|
||||
private String id;
|
||||
|
||||
/** 配件名称 */
|
||||
private String name;
|
||||
|
||||
/** 配件数量 */
|
||||
private Integer count;
|
||||
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package cn.iocoder.yudao.module.tickets.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.stockOperate.vo.DlRepairSoiRespVO;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* app使用的配件明细,按分类分组后的
|
||||
* @author vinjor-M
|
||||
* @date 10:10 2024/11/19
|
||||
**/
|
||||
@Data
|
||||
public class AppWaresGroupVO {
|
||||
/** 分组ID(分类ID) */
|
||||
private String groupId;
|
||||
/** 分组名称(分类名称) */
|
||||
private String groupName;
|
||||
/** 配件总数量 */
|
||||
private Integer nums;
|
||||
/** 总价 */
|
||||
private BigDecimal totalAmount;
|
||||
/** 配件明细 */
|
||||
private List<DlRepairTitemReqVO> wares;
|
||||
/** 配件申请单配件明细 */
|
||||
private List<DlTwItemRespVO> twItemList;
|
||||
/** 领料、退料单配件明细 */
|
||||
private List<DlRepairSoiRespVO> soiRespVOList;
|
||||
|
||||
/** 审核通过数量-- */
|
||||
private Integer allowNum;
|
||||
/** 待审核数量-- */
|
||||
private Integer waitingNum;
|
||||
/** 审核不通过数量-- */
|
||||
private Integer noNum;
|
||||
}
|
@ -36,4 +36,10 @@ public class DlRepairTicketsReqVO extends DlRepairTickets {
|
||||
|
||||
/** 图片路径 */
|
||||
private String image;
|
||||
|
||||
/** 当前操作人包含集合,主要用在服务顾问那儿 */
|
||||
private List<Long> nowRepairIds;
|
||||
|
||||
/** 客户来源 */
|
||||
private String cusFrom;
|
||||
}
|
||||
|
@ -63,4 +63,6 @@ public class DlRepairTicketsRespVO extends DlRepairTickets {
|
||||
/** 维修班组长是否可以重新派工--当前施工人是自己或者本班组内的人员 */
|
||||
private Boolean canOperate;
|
||||
|
||||
/** app分组回显专用--配件明细 */
|
||||
List<AppWaresGroupVO> waresGroupList;
|
||||
}
|
||||
|
@ -23,4 +23,9 @@ public class DlRepairTitemReqVO extends DlRepairTitem {
|
||||
// 附加详情
|
||||
private DlRepairOther other;
|
||||
|
||||
/** 配件分类名称 */
|
||||
private String itemTypeName;
|
||||
/** 配件单位名称 */
|
||||
private String unitText;
|
||||
|
||||
}
|
||||
|
@ -4,6 +4,8 @@ import cn.iocoder.yudao.module.project.entity.RepairWares;
|
||||
import cn.iocoder.yudao.module.tickets.entity.DlTwItem;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 工单配件申请/退回子表响应VO
|
||||
*
|
||||
@ -15,6 +17,18 @@ public class DlTwItemRespVO extends DlTwItem {
|
||||
|
||||
/** 配件详情 */
|
||||
private RepairWares wares;
|
||||
/** 配件分类id */
|
||||
private String typeId;
|
||||
/** 配件分类名称 */
|
||||
private String typeName;
|
||||
/** 配件计量单位名称 */
|
||||
private String unitText;
|
||||
/** 是否选中 */
|
||||
private Boolean selected;
|
||||
/** 售价 */
|
||||
private BigDecimal salePrice;
|
||||
/** 库存 */
|
||||
private Integer stock;
|
||||
/** 审核时间 */
|
||||
private String approvalTime;
|
||||
}
|
||||
|
@ -101,4 +101,33 @@
|
||||
AND so_status = #{status}
|
||||
AND deleted = 0
|
||||
</select>
|
||||
<select id="selectByIdGroup" resultType="cn.iocoder.yudao.module.stockOperate.vo.DlRepairSoiRespVO">
|
||||
SELECT
|
||||
drs.id,
|
||||
drs.so_id,
|
||||
drs.raw_id,
|
||||
drs.soi_type,
|
||||
drs.goods_id,
|
||||
drs.goods_type,
|
||||
drs.ware_id,
|
||||
drs.goods_count,
|
||||
drs.in_count,
|
||||
drs.goods_price,
|
||||
drs.remark,
|
||||
drw.type AS type_id,
|
||||
drw.name AS goods_name,
|
||||
dbt.`name` AS type_name,
|
||||
drw.price AS sale_price,
|
||||
drw.stock AS stock,
|
||||
sdd.label AS unit_text
|
||||
FROM
|
||||
dl_repair_soi drs
|
||||
LEFT JOIN dl_repair_wares drw ON drs.goods_id = drw.id
|
||||
LEFT JOIN dl_base_type dbt ON drw.type = dbt.id
|
||||
LEFT JOIN system_dict_data sdd ON drw.unit = sdd.`value`
|
||||
AND sdd.dict_type = 'repair_unit'
|
||||
WHERE
|
||||
drs.deleted = '0'
|
||||
AND drs.so_id=#{id}
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -69,4 +69,83 @@
|
||||
)
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<resultMap id="SoiAndWares" type="cn.iocoder.yudao.module.stockOperate.vo.DlRepairSoiRespVO">
|
||||
<id property="id" column="id" />
|
||||
<result property="soId" column="so_id" />
|
||||
<result property="soiType" column="soi_type" />
|
||||
<result property="goodsId" column="goods_id" />
|
||||
<result property="goodsType" column="goods_type" />
|
||||
<result property="wareId" column="ware_id" />
|
||||
<result property="goodsCount" column="goods_count" />
|
||||
<result property="goodsPrice" column="goods_price" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="inCount" column="in_count" />
|
||||
<result property="rawId" column="raw_id" />
|
||||
<result property="typeName" column="type_name" />
|
||||
|
||||
<!-- 嵌套的结果映射 -->
|
||||
<association property="wares" javaType="cn.iocoder.yudao.module.project.entity.RepairWares">
|
||||
<id property="id" column="wares_id" />
|
||||
<result property="barCode" column="bar_code" />
|
||||
<result property="code" column="code" />
|
||||
<result property="name" column="name" />
|
||||
<result property="model" column="model" />
|
||||
<result property="price" column="price" />
|
||||
<result property="purPrice" column="pur_price" />
|
||||
<result property="type" column="type" />
|
||||
<result property="unit" column="unit" />
|
||||
<result property="warehouse" column="warehouse" />
|
||||
<result property="miniStock" column="mini_stock" />
|
||||
<result property="maxStock" column="max_stock" />
|
||||
<result property="stock" column="stock" />
|
||||
<result property="img" column="img" />
|
||||
<result property="attribute" column="attribute" />
|
||||
<result property="corpId" column="corp_id" />
|
||||
<result property="coverImg" column="cover_img" />
|
||||
<result property="carModel" column="car_model" />
|
||||
<result property="remark" column="wares_remark" />
|
||||
<result property="status" column="status" />
|
||||
<result property="dataForm" column="data_form" />
|
||||
</association>
|
||||
</resultMap>
|
||||
<select id="getMapBySoIdAndQuery" resultMap="SoiAndWares">
|
||||
select
|
||||
drs.*,
|
||||
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 drs
|
||||
left join dl_repair_wares drw
|
||||
on drs.goods_id = drw.id
|
||||
where drs.deleted = '0' and drw.deleted = '0'
|
||||
and drs.so_id = #{id}
|
||||
<if test="query != null and query != '' and query != 'null'">
|
||||
and (
|
||||
drw.name like concat('%', #{query}, '%')
|
||||
or
|
||||
drw.code like concat('%', #{query}, '%')
|
||||
or
|
||||
drw.model like concat('%', #{query}, '%')
|
||||
)
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -214,9 +214,13 @@
|
||||
, IF(FIND_IN_SET(drt.now_repair_id, #{map.userIdsStr}) > 0,true,false) AS can_operate
|
||||
</if>
|
||||
from dl_repair_tickets drt
|
||||
<if test="map.cusFrom != null and map.cusFrom!=''">
|
||||
-- 按客户来源查,需要关联客户表 --
|
||||
left join base_customer_main bcm ON drt.user_id = bcm.id
|
||||
</if>
|
||||
left join dl_repair_titem drti
|
||||
on drt.id = drti.ticket_id AND drti.deleted = '0'
|
||||
where (drt.deleted = '0') AND drt.tickets_status IN ('04','05','01','07')
|
||||
where (drt.deleted = '0') AND drt.tickets_status IN ('04','05','01','07','06','02')
|
||||
<if test="map.ticketNo != null and map.ticketNo != ''">
|
||||
and (
|
||||
drt.ticket_no like concat('%', #{map.ticketNo}, '%')
|
||||
@ -233,15 +237,44 @@
|
||||
<if test="map.searchTimeArray != null and map.searchTimeArray.length > 0">
|
||||
and (drt.create_time between #{map.searchTimeArray[0]} and #{map.searchTimeArray[1]})
|
||||
</if>
|
||||
<if test="map.repairType !=null and map.repairType !=''">
|
||||
AND (drt.repair_type=#{map.repairType})
|
||||
</if>
|
||||
<if test="map.cusFrom != null and map.cusFrom!=''">
|
||||
<choose>
|
||||
<when test="map.cusFrom == '06'">
|
||||
-- 公务车,查政企客户 --
|
||||
AND (bcm.type_code='03')
|
||||
</when>
|
||||
<when test="map.cusFrom == '04'">
|
||||
-- 企业用车,查代办客户 --
|
||||
AND (bcm.type_code='02')
|
||||
</when>
|
||||
<otherwise>
|
||||
-- 家庭自用车01、客户转介绍02、员工转介绍03、救援转维修05 --
|
||||
AND (bcm.inviter_type=#{map.cusFrom})
|
||||
</otherwise>
|
||||
</choose>
|
||||
</if>
|
||||
<choose>
|
||||
<when test="map.selectType=='special'">
|
||||
-- 小李用的逻辑 --
|
||||
<if test="map.isFinish != null and map.isFinish != ''">
|
||||
-- 小李用的逻辑--isFinish不需要了 --
|
||||
<!-- <if test="map.isFinish != null and map.isFinish != ''">
|
||||
AND ( drt.is_finish = #{map.isFinish})
|
||||
</if>
|
||||
</if> -->
|
||||
-- 总检查待处理还是用这个 --
|
||||
<if test="map.nowRepairId != null and map.nowRepairId != ''">
|
||||
AND ( drt.now_repair_id = #{map.nowRepairId})
|
||||
</if>
|
||||
-- 服务顾问查待处理(服务顾问之间可以相互查) --
|
||||
<if test="map.nowRepairIds != null and map.nowRepairIds.size > 0">
|
||||
AND (
|
||||
drt.now_repair_id in
|
||||
<foreach collection="map.nowRepairIds" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
</when>
|
||||
<otherwise>
|
||||
-- 正常查询用的逻辑 --
|
||||
@ -255,10 +288,11 @@
|
||||
)
|
||||
</when>
|
||||
<otherwise>
|
||||
-- 服务顾问和仓管查待办都是查未结束的工单 --
|
||||
AND drt.is_finish = '0'
|
||||
<if test="map.adviserId != null and map.adviserId != ''">
|
||||
-- 查服务顾问 待处理的 工单未完成并且服务顾问是自己的 工单已完成且当前处理人是自己的--
|
||||
AND ( drt.is_finish = '0' AND drt.adviser_id = #{map.adviserId} )
|
||||
OR (drt.is_finish = '1' AND drt.now_repair_id = #{map.adviserId})
|
||||
-- 查服务顾问 当前处理人或服务顾问是自己的--
|
||||
AND ( drt.adviser_id = #{map.adviserId} OR drt.now_repair_id = #{map.adviserId})
|
||||
</if>
|
||||
<if test="map.userIds != null and map.userIds.size > 0">
|
||||
-- 查总检待处理的 --
|
||||
@ -304,6 +338,10 @@
|
||||
<select id="getPageTypeAll" resultMap="APPBaseResultMap">
|
||||
select drt.*
|
||||
from dl_repair_tickets drt
|
||||
<if test="map.cusFrom != null and map.cusFrom!=''">
|
||||
-- 按客户来源查,需要关联客户表 --
|
||||
left join base_customer_main bcm ON drt.user_id = bcm.id
|
||||
</if>
|
||||
left join dl_repair_titem drti
|
||||
on drt.id = drti.ticket_id AND drti.deleted = '0'
|
||||
where drt.deleted = '0'
|
||||
@ -323,6 +361,25 @@
|
||||
<if test="map.searchTimeArray != null and map.searchTimeArray.length > 0">
|
||||
and drt.create_time between #{map.searchTimeArray[0]} and #{map.searchTimeArray[1]}
|
||||
</if>
|
||||
<if test="map.repairType !=null and map.repairType !=''">
|
||||
AND (drt.repair_type=#{map.repairType})
|
||||
</if>
|
||||
<if test="map.cusFrom != null and map.cusFrom!=''">
|
||||
<choose>
|
||||
<when test="map.cusFrom == '06'">
|
||||
-- 公务车,查政企客户 --
|
||||
AND (bcm.type_code='03')
|
||||
</when>
|
||||
<when test="map.cusFrom == '04'">
|
||||
-- 企业用车,查代办客户 --
|
||||
AND (bcm.type_code='02')
|
||||
</when>
|
||||
<otherwise>
|
||||
-- 家庭自用车01、客户转介绍02、员工转介绍03、救援转维修05 --
|
||||
AND (bcm.inviter_type=#{map.cusFrom})
|
||||
</otherwise>
|
||||
</choose>
|
||||
</if>
|
||||
<if test="map.adviserId != null and map.adviserId != ''">
|
||||
-- 服务顾问查所有的就是服务顾问是自己的 --
|
||||
and drt.adviser_id = #{map.adviserId}
|
||||
@ -338,4 +395,23 @@
|
||||
GROUP BY drt.id
|
||||
order by drt.update_time desc
|
||||
</select>
|
||||
<select id="selectCountByParams" resultType="java.lang.Long">
|
||||
SELECT
|
||||
COUNT(DISTINCT drt.id)
|
||||
FROM
|
||||
dl_repair_tickets drt
|
||||
LEFT JOIN dl_repair_records drr ON drt.id = drr.ticket_id
|
||||
AND drr.deleted = '0'
|
||||
WHERE
|
||||
drt.deleted = '0'
|
||||
AND drt.tickets_status !='03'
|
||||
AND drr.type = #{recordCode}
|
||||
<if test="nowDate!=null and nowDate!=''">
|
||||
AND drr.create_time LIKE CONCAT(#{nowDate},'%')
|
||||
</if>
|
||||
<if test="startTime!=null">
|
||||
AND drr.create_time >= #{startTime}
|
||||
AND drr.create_time <= #{endTime}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -109,4 +109,37 @@
|
||||
drt.update_time,
|
||||
drri.create_time
|
||||
</select>
|
||||
<select id="selectByTicketId" resultType="cn.iocoder.yudao.module.tickets.vo.DlRepairTitemReqVO">
|
||||
SELECT
|
||||
drt.id,
|
||||
drt.ticket_id,
|
||||
drt.item_name ,
|
||||
drt.item_count ,
|
||||
drt.item_unit ,
|
||||
drt.item_price ,
|
||||
drt.item_discount ,
|
||||
drt.item_money ,
|
||||
drt.item_type ,
|
||||
drt.part_id ,
|
||||
drt.item_status ,
|
||||
drt.remark ,
|
||||
drt.tenant_id ,
|
||||
drt.deleted ,
|
||||
drt.creator ,
|
||||
drt.create_time ,
|
||||
drt.updater ,
|
||||
drt.update_time,
|
||||
drw.type AS item_type_id,
|
||||
dbt.`name` AS item_type_name,
|
||||
sdd.label AS unit_text
|
||||
FROM
|
||||
dl_repair_titem drt
|
||||
LEFT JOIN dl_repair_wares drw ON drt.part_id = drw.id
|
||||
LEFT JOIN dl_base_type dbt ON drw.type = dbt.id
|
||||
LEFT JOIN system_dict_data sdd ON drw.unit = sdd.value AND sdd.dict_type='repair_unit'
|
||||
WHERE drt.ticket_id = #{ticketId}
|
||||
AND drt.item_type = '02'
|
||||
AND drt.deleted = '0'
|
||||
ORDER BY drw.type,drt.create_time
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -21,6 +21,11 @@
|
||||
<result property="status" column="status" jdbcType="VARCHAR"/>
|
||||
<result property="remark" column="remark" jdbcType="VARCHAR"/>
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="images" column="images" />
|
||||
<result property="toSafe" column="to_safe" />
|
||||
<result property="safeName" column="safe_name" />
|
||||
<result property="safeContact" column="safe_contact" />
|
||||
<result property="safeMobile" column="safe_mobile" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_SQL">
|
||||
@ -40,7 +45,12 @@
|
||||
dtw.adviser_name,
|
||||
dtw.status,
|
||||
dtw.remark,
|
||||
dtw.create_time
|
||||
dtw.create_time,
|
||||
dtw.images,
|
||||
dtw.to_safe,
|
||||
dtw.safe_name,
|
||||
dtw.safe_contact,
|
||||
dtw.safe_mobile
|
||||
from dl_ticket_wares dtw
|
||||
left join dl_repair_tickets drt
|
||||
on dtw.ticket_id = drt.id
|
||||
|
@ -47,4 +47,44 @@
|
||||
and dti.wares_status = #{map.waresStatus}
|
||||
</if>
|
||||
</select>
|
||||
<select id="listTwItemApp" resultType="cn.iocoder.yudao.module.tickets.vo.DlTwItemRespVO">
|
||||
SELECT
|
||||
dti.id,
|
||||
dti.tw_id,
|
||||
dti.wares_id,
|
||||
dti.wares_name,
|
||||
dti.wares_count,
|
||||
dti.wares_already_count,
|
||||
dti.wares_status,
|
||||
dti.handle_id,
|
||||
dti.handle_name,
|
||||
dti.update_time,
|
||||
dti.remark,
|
||||
drw.type AS type_id,
|
||||
dbt.`name` AS type_name,
|
||||
drw.price AS sale_price,
|
||||
drw.stock AS stock,
|
||||
sdd.label AS unit_text
|
||||
FROM
|
||||
dl_tw_item dti
|
||||
LEFT JOIN dl_repair_wares drw ON dti.wares_id = drw.id
|
||||
LEFT JOIN dl_base_type dbt ON drw.type = dbt.id
|
||||
LEFT JOIN system_dict_data sdd ON drw.unit = sdd.`value` AND sdd.dict_type = 'repair_unit'
|
||||
WHERE
|
||||
dti.deleted = '0'
|
||||
<if test="map.twId != null and map.twId != ''">
|
||||
and dti.tw_id = #{map.twId}
|
||||
</if>
|
||||
<if test="map.query != null and map.query != ''">
|
||||
and (
|
||||
dti.wares_name like concat('%', #{map.query}, '%')
|
||||
)
|
||||
</if>
|
||||
<if test="map.waresStatus != null and map.waresStatus != ''">
|
||||
and dti.wares_status = #{map.waresStatus}
|
||||
</if>
|
||||
ORDER BY
|
||||
drw.type,
|
||||
dti.create_time
|
||||
</select>
|
||||
</mapper>
|
||||
|
Loading…
Reference in New Issue
Block a user