【admin&front】 新增&优化 # 1、优化小程序维修单退仓申请 2、新增信息核对返修功能 3、新增退仓申请,报废申请,领料申请,入库申请审核不通过功能 4、后台管理支持导出多个客户的领机单报表,领机单添加到货时间、客户名称、备注、质保期限;移除维修结果 5、新增除维修人员外,所有可查看领料明细都需要添加配件单价字段;配件单价计算方式客户配件采购因子 * 单价 6、小程序新增报废流程添加质检步骤(上传图片+备注) 7、优化部分检修单bug
parent
04602a0ffb
commit
8058ce8a52
|
@ -38,6 +38,7 @@ public class ClientController {
|
|||
PageResult<ClientListVo> list = iClientService.list(pageParam, params);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 客户详情
|
||||
*
|
||||
|
|
|
@ -8,6 +8,7 @@ import com.hcy.admin.vo.client.EquipmentListVo;
|
|||
import com.hcy.admin.vo.client.EquipmentDetailVo;
|
||||
import com.hcy.common.core.AjaxResult;
|
||||
import com.hcy.common.core.PageResult;
|
||||
import com.hcy.common.exception.OperateException;
|
||||
import com.hcy.common.utils.QRCodeUtil;
|
||||
import com.hcy.common.validator.annotation.IDMust;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
@ -65,7 +66,8 @@ public class EquipmentController {
|
|||
@PostMapping("/add")
|
||||
public Object add(@Validated(value = EquipmentParam.create.class) @RequestBody EquipmentParam equipmentParam) {
|
||||
if (iEquipmentService.checkEquipmentNumberUnique(equipmentParam)) {
|
||||
return AjaxResult.success(300,"","新增设备失败,设备编号已存在");
|
||||
// return AjaxResult.success(300,"","新增设备失败,设备编号已存在");
|
||||
throw new OperateException("新增设备失败,设备编号已存在!");
|
||||
}
|
||||
iEquipmentService.add(equipmentParam);
|
||||
return AjaxResult.success();
|
||||
|
@ -82,7 +84,7 @@ public class EquipmentController {
|
|||
@PostMapping("/edit")
|
||||
public Object edit(@Validated(value = EquipmentParam.update.class) @RequestBody EquipmentParam equipmentParam) {
|
||||
if (iEquipmentService.checkEquipmentNumberUnique(equipmentParam)) {
|
||||
return AjaxResult.success("修改设备失败,设备编号已存在");
|
||||
throw new OperateException("编辑设备失败,设备编号已存在!");
|
||||
}
|
||||
iEquipmentService.edit(equipmentParam);
|
||||
return AjaxResult.success();
|
||||
|
|
|
@ -117,4 +117,18 @@ public class ParentRepairOrderController {
|
|||
public void exportExcel(@Validated @RequestBody ParentRepairOrderParam params, HttpServletResponse response) {
|
||||
iParentRepairOrderService.exportExcel(params,response);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "导出客户领机报表")
|
||||
@PostMapping(value="/clientCollarExcel")
|
||||
@ResponseBody
|
||||
public void clientCollarExcel(HttpServletResponse response) {
|
||||
iParentRepairOrderService.clientCollarExcel(response);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "导出客户入库WIP表")
|
||||
@PostMapping(value="/warehouseWarrantWIPExcel")
|
||||
@ResponseBody
|
||||
public void warehouseWarrantWIPExcel(HttpServletResponse response) {
|
||||
iParentRepairOrderService.warehouseWarrantWIPExcel(response);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -136,5 +136,15 @@ public class RepairOrderAuditController {
|
|||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 报废申请 - 质检
|
||||
*
|
||||
* @author hcy
|
||||
* @return Object
|
||||
*/
|
||||
@PostMapping("/qualityTesting")
|
||||
public Object qualityTesting(@RequestBody RepairOrderAuditParam repairOrderAuditParam) {
|
||||
iRepairOrderAuditService.qualityTesting(repairOrderAuditParam);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -272,4 +272,17 @@ public class RepairOrderController {
|
|||
List<OrderSparePartListVo> list = iRepairOrderService.partsList(repairOrderParam);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据工单号和审核id查出使用配件列表
|
||||
*
|
||||
* @author hcy
|
||||
* @param repairOrderParam 搜索参数
|
||||
* @return Object
|
||||
*/
|
||||
@GetMapping("/partsUseList")
|
||||
public Object partsUseList(RepairOrderParam repairOrderParam) {
|
||||
List<OrderSparePartUseListVo> list = iRepairOrderService.partsUseList(repairOrderParam);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -109,4 +109,5 @@ public class SparePartController {
|
|||
PageResult<SparePartListVo> list = iSparePartService.purchaseList(pageParam, params);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.hcy.admin.service.client.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
|
@ -21,6 +22,7 @@ import com.hcy.common.mapper.client.EquipmentMapper;
|
|||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
@ -136,10 +138,12 @@ public class ClientServiceImpl implements IClientService {
|
|||
* @param clientParam 参数
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public void add(ClientParam clientParam) {
|
||||
LambdaQueryWrapper<Client> queryWrapper = new LambdaQueryWrapper<Client>()
|
||||
.eq(Client::getIsDelete, GlobalConstant.NOT_DELETE)
|
||||
.eq(Client::getPhone, clientParam.getPhone())
|
||||
.or()
|
||||
.eq(Client::getClientNo, clientParam.getClientNo());
|
||||
|
||||
Integer count = clientMapper.selectCount(queryWrapper);
|
||||
|
@ -161,12 +165,9 @@ public class ClientServiceImpl implements IClientService {
|
|||
*/
|
||||
@Override
|
||||
public void edit(ClientParam clientParam) {
|
||||
Long id = clientParam.getId();
|
||||
String clientNo = clientParam.getClientNo();
|
||||
|
||||
Client model = clientMapper.selectOne(
|
||||
new QueryWrapper<Client>()
|
||||
.eq("id", id)
|
||||
.eq("id", clientParam.getId())
|
||||
.eq("is_delete", GlobalConstant.NOT_DELETE)
|
||||
.last("limit 1"));
|
||||
|
||||
|
@ -174,13 +175,18 @@ public class ClientServiceImpl implements IClientService {
|
|||
|
||||
LambdaQueryWrapper<Client> queryWrapper = new LambdaQueryWrapper<Client>()
|
||||
.eq(Client::getIsDelete, GlobalConstant.NOT_DELETE)
|
||||
.ne(Client::getId,id)
|
||||
.eq(Client::getPhone, clientParam.getPhone())
|
||||
.eq(Client::getClientNo,clientNo);
|
||||
.eq(Client::getPhone, clientParam.getPhone());
|
||||
Client phone = clientMapper.selectOne(queryWrapper);
|
||||
if (phone != null && !Objects.equals(phone.getId(), model.getId())) {
|
||||
throw new OperateException("手机号码不可重复!");
|
||||
}
|
||||
|
||||
Integer count = clientMapper.selectCount(queryWrapper);
|
||||
if(count > 0){
|
||||
throw new OperateException("客户编号或手机号码重复");
|
||||
LambdaQueryWrapper<Client> clientNoQueryWrapper = new LambdaQueryWrapper<Client>()
|
||||
.eq(Client::getIsDelete, GlobalConstant.NOT_DELETE)
|
||||
.eq(Client::getClientNo, clientParam.getClientNo());
|
||||
Client clientNo = clientMapper.selectOne(clientNoQueryWrapper);
|
||||
if (clientNo != null && !Objects.equals(clientNo.getId(), model.getId())) {
|
||||
throw new OperateException("客户编号不可重复!");
|
||||
}
|
||||
|
||||
BeanUtils.copyProperties(clientParam,model);
|
||||
|
|
|
@ -205,12 +205,12 @@ public class EquipmentServiceImpl implements IEquipmentService {
|
|||
model.setClientId(equipmentParam.getClientId());
|
||||
model.setModuleId(equipmentParam.getModuleId());
|
||||
model.setNumber(equipmentParam.getNumber());
|
||||
Integer count = equipmentMapper.selectCount(new LambdaQueryWrapper<Equipment>()
|
||||
.eq(Equipment::getIsDelete, GlobalConstant.NOT_DELETE)
|
||||
.eq(Equipment::getNumber, equipmentParam.getNumber()));
|
||||
if(count > 0){
|
||||
throw new OperateException("设备编号不可重复!");
|
||||
}
|
||||
// Integer count = equipmentMapper.selectCount(new LambdaQueryWrapper<Equipment>()
|
||||
// .eq(Equipment::getIsDelete, GlobalConstant.NOT_DELETE)
|
||||
// .eq(Equipment::getNumber, equipmentParam.getNumber()));
|
||||
// if(count > 0){
|
||||
// throw new OperateException("设备编号不可重复!");
|
||||
// }
|
||||
model.setName(equipmentParam.getName());
|
||||
model.setModel(equipmentParam.getModel());
|
||||
model.setManufacturers(equipmentParam.getManufacturers());
|
||||
|
@ -370,11 +370,11 @@ public class EquipmentServiceImpl implements IEquipmentService {
|
|||
// 如果查询结果model为null,或者查询到的记录的ID等于bo.getId(),
|
||||
// 则表示number是唯一的,因此返回true。
|
||||
if (ObjectUtil.isNull(model) || model.getId().equals(bo.getId())) {
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
// 否则,返回false表示number不唯一。
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -75,4 +75,16 @@ public interface IParentRepairOrderService {
|
|||
* @return
|
||||
*/
|
||||
void exportExcel(ParentRepairOrderParam params, HttpServletResponse response);
|
||||
|
||||
/**
|
||||
* 导出客户领机报表
|
||||
* @param response
|
||||
*/
|
||||
void clientCollarExcel(HttpServletResponse response);
|
||||
|
||||
/**
|
||||
* 导出客户入库WIP表
|
||||
* @param response
|
||||
*/
|
||||
void warehouseWarrantWIPExcel(HttpServletResponse response);
|
||||
}
|
||||
|
|
|
@ -74,4 +74,10 @@ public interface IRepairOrderAuditService {
|
|||
* 配货打印
|
||||
*/
|
||||
void distributionPrinting(RepairOrderAuditParam repairOrderAuditParam);
|
||||
|
||||
/**
|
||||
* 质检
|
||||
* @param repairOrderAuditParam
|
||||
*/
|
||||
void qualityTesting(RepairOrderAuditParam repairOrderAuditParam);
|
||||
}
|
||||
|
|
|
@ -3,10 +3,7 @@ package com.hcy.admin.service.order;
|
|||
import com.hcy.admin.validate.common.PageParam;
|
||||
import com.hcy.admin.validate.order.RepairOrderParam;
|
||||
import com.hcy.admin.vo.excel.ModuleMaintenanceExcel;
|
||||
import com.hcy.admin.vo.order.MaintenanceReportOrderListVo;
|
||||
import com.hcy.admin.vo.order.OrderSparePartListVo;
|
||||
import com.hcy.admin.vo.order.RepairOrderListVo;
|
||||
import com.hcy.admin.vo.order.RepairOrderDetailVo;
|
||||
import com.hcy.admin.vo.order.*;
|
||||
import com.hcy.common.core.PageResult;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
@ -154,4 +151,12 @@ public interface IRepairOrderService {
|
|||
* @return
|
||||
*/
|
||||
List<OrderSparePartListVo> partsList(RepairOrderParam repairOrderParam);
|
||||
|
||||
|
||||
/**
|
||||
* 根据工单号和审核id查出使用配件列表
|
||||
* @param repairOrderParam
|
||||
* @return
|
||||
*/
|
||||
List<OrderSparePartUseListVo> partsUseList(RepairOrderParam repairOrderParam);
|
||||
}
|
||||
|
|
|
@ -280,6 +280,15 @@ public class MaintenanceOrderServiceImpl implements IMaintenanceOrderService {
|
|||
vo.setSparePartStockAuditDetailVo(sparePartStockAuditDetailVo);
|
||||
}
|
||||
|
||||
//全包工单报价为0,半包正常显示 actualAmount; // 实际金额 clientType; // 桩点维修类型 0-全包 1-半包
|
||||
Client clientType = clientMapper.findClientById(vo.getClientId());
|
||||
if(clientType != null){
|
||||
if(clientType.getClientType() == ClientStatusEnum.PLIE_POINT_ALL_WRAPPED.getStatus()){
|
||||
vo.setTotalAmount(BigDecimal.valueOf(0));
|
||||
vo.setActualAmount(BigDecimal.valueOf(0));
|
||||
}
|
||||
}
|
||||
|
||||
//设置配件清单
|
||||
List<OrderSparePart> orderSpareParts = orderSparePartMapper.selectList(new LambdaQueryWrapper<OrderSparePart>()
|
||||
.eq(OrderSparePart::getMaintenanceOrderId, model.getId()));
|
||||
|
@ -291,6 +300,14 @@ public class MaintenanceOrderServiceImpl implements IMaintenanceOrderService {
|
|||
if(warehouse != null){
|
||||
orderSparePartListVo.setWarehouseName(warehouse.getWarehouseName());
|
||||
}
|
||||
orderSparePartListVo.setUnitPrice(String.valueOf(item.getUnitPrice())); // 单价
|
||||
//判断是否是全包客户,全包客户费用为0
|
||||
if(clientType != null){
|
||||
if(clientType.getClientType() == ClientStatusEnum.PLIE_POINT_ALL_WRAPPED.getStatus()){
|
||||
orderSparePartListVo.setTotalPrice(BigDecimal.valueOf(0));
|
||||
}
|
||||
}
|
||||
|
||||
orderSparePartListVos.add(orderSparePartListVo);
|
||||
}
|
||||
vo.setSparePartList(orderSparePartListVos);
|
||||
|
@ -316,18 +333,10 @@ public class MaintenanceOrderServiceImpl implements IMaintenanceOrderService {
|
|||
//设置订单操作记录
|
||||
LambdaQueryWrapper<OrderOperateRecord> queryWrapper = new LambdaQueryWrapper<OrderOperateRecord>()
|
||||
.eq(OrderOperateRecord::getOrderType, OrderOperateRecordEnum.MAINTENANCE.getStatus())
|
||||
.eq(OrderOperateRecord::getOrderId, model.getId());
|
||||
.eq(OrderOperateRecord::getOrderId, model.getId())
|
||||
.orderByDesc(OrderOperateRecord::getCreateTime);
|
||||
vo.setOrderOperateRecords(orderOperateRecordMapper.selectList(queryWrapper));;
|
||||
|
||||
//全包工单报价为0,半包正常显示 actualAmount; // 实际金额 clientType; // 桩点维修类型 0-全包 1-半包
|
||||
Client clientType = clientMapper.findClientById(vo.getClientId());
|
||||
if(clientType != null){
|
||||
if(clientType.getClientType() == ClientStatusEnum.PLIE_POINT_ALL_WRAPPED.getStatus()){
|
||||
vo.setTotalAmount(BigDecimal.valueOf(0));
|
||||
vo.setActualAmount(BigDecimal.valueOf(0));
|
||||
}
|
||||
}
|
||||
|
||||
//配件领用状态
|
||||
SparePartStockAudit receiverStatus = sparePartStockAuditMapper.selectOne(new LambdaQueryWrapper<SparePartStockAudit>()
|
||||
.eq(SparePartStockAudit::getOrderId, model.getId())
|
||||
|
|
|
@ -8,7 +8,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.yulichang.query.MPJQueryWrapper;
|
||||
import com.hcy.admin.AdminThreadLocal;
|
||||
import com.hcy.admin.service.order.IParentRepairOrderService;
|
||||
import com.hcy.admin.validate.common.PageParam;
|
||||
import com.hcy.admin.validate.order.ParentRepairOrderParam;
|
||||
|
@ -37,15 +37,9 @@ import com.hcy.common.mapper.setting.DictDataMapper;
|
|||
import com.hcy.common.mapper.sparePart.SparePartMapper;
|
||||
import com.hcy.common.mapper.system.SystemAuthAdminMapper;
|
||||
import com.hcy.common.mapper.user.UserMapper;
|
||||
import com.hcy.common.utils.ArrayUtil;
|
||||
import com.hcy.common.utils.StringUtil;
|
||||
import com.hcy.common.utils.TimeUtil;
|
||||
import com.hcy.common.utils.UrlUtil;
|
||||
import com.hcy.common.config.GlobalConfig;
|
||||
import com.hcy.common.utils.excel.EasyExcelUtil;
|
||||
import com.hcy.common.utils.excel.LocalImageModifyStrategy;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -54,10 +48,10 @@ import org.springframework.util.Assert;
|
|||
import javax.annotation.Resource;
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.net.URL;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
@ -418,12 +412,15 @@ public class ParentRepairOrderServiceImpl implements IParentRepairOrderService {
|
|||
//报废单
|
||||
List<ScrapForm> scrapFormList = new ArrayList<>();
|
||||
int index3 = 1;
|
||||
//报废单
|
||||
//难修改派单 退仓单
|
||||
List<BeyondRepairOrder> beyondRepairOrderList = new ArrayList<>();
|
||||
int index4 = 1;
|
||||
//领机单
|
||||
List<MachineClaimNote> machineClaimNoteList = new ArrayList<>();
|
||||
int index5 = 1;
|
||||
//维修工序单
|
||||
List<ClientCollarExcel> clientCollarExcelList = new ArrayList<>();
|
||||
int index6 = 1;
|
||||
|
||||
for (ParentRepairOrder parentRepairOrder : parentRepairOrders) {
|
||||
List<RepairOrder> repairOrderList = repairOrderMapper.findRepairOrderByParentId(parentRepairOrder.getId());
|
||||
|
@ -433,10 +430,15 @@ public class ParentRepairOrderServiceImpl implements IParentRepairOrderService {
|
|||
// if(contentAdmin != null){
|
||||
// offerDetail.setCreator(contentAdmin.getUsername());
|
||||
// }
|
||||
|
||||
//设置客户信息
|
||||
Client client = clientMapper.findClientById(parentRepairOrder.getClientId());
|
||||
//客户配件采购因子
|
||||
BigDecimal purchaseDivisor = null;
|
||||
|
||||
if(client != null){
|
||||
offerDetail.setClientName(client.getClientName());
|
||||
purchaseDivisor = client.getPurchaseDivisor(); // 配件采购价格因子
|
||||
}
|
||||
//获取工单编号
|
||||
offerDetail.setOrderNo(parentRepairOrder.getOrderNo());
|
||||
|
@ -514,11 +516,17 @@ public class ParentRepairOrderServiceImpl implements IParentRepairOrderService {
|
|||
//单位数据获取配件表数据
|
||||
SparePart sparePart = sparePartMapper.selectOne(new LambdaQueryWrapper<SparePart>()
|
||||
.eq(SparePart::getId, orderSparePartDto.getSparePartsId()));
|
||||
//配件单价 = 客户采购价格因子 * 配件单价
|
||||
DecimalFormat df1 = new DecimalFormat("0.00");
|
||||
BigDecimal unitPrice = null;
|
||||
if(sparePart != null){
|
||||
getMaterialsOrder.setUnit(sparePart.getUnit());
|
||||
if(purchaseDivisor != null && sparePart.getUnitPrice() != null){
|
||||
unitPrice = sparePart.getUnitPrice().multiply(purchaseDivisor);
|
||||
}
|
||||
getMaterialsOrder.setUnitPrice(df1.format(unitPrice));
|
||||
}
|
||||
|
||||
|
||||
index1++;
|
||||
getMaterialsOrderList.add(getMaterialsOrder);
|
||||
offerDetail.setTotalQty(offerDetail.getTotalQty() + orderSparePartDto.getCount());
|
||||
|
@ -578,7 +586,9 @@ public class ParentRepairOrderServiceImpl implements IParentRepairOrderService {
|
|||
//返回维修前照片
|
||||
RepairOrderStepData preMaintenanceImg = repairOrderStepDataMapper.selectOne(new LambdaQueryWrapper<RepairOrderStepData>()
|
||||
.eq(RepairOrderStepData::getRepairOrderId, item.getId())
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.PRE_MAINTENANCE_IMG.getStatus()));
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.PRE_MAINTENANCE_IMG.getStatus())
|
||||
.orderByDesc(RepairOrderStepData::getCreateTime)
|
||||
.last("limit 1"));
|
||||
if(preMaintenanceImg != null){
|
||||
try{
|
||||
List<URL> imgList1 = new ArrayList<>();
|
||||
|
@ -597,7 +607,9 @@ public class ParentRepairOrderServiceImpl implements IParentRepairOrderService {
|
|||
//返回维修中照片
|
||||
RepairOrderStepData inMaintenanceImg = repairOrderStepDataMapper.selectOne(new LambdaQueryWrapper<RepairOrderStepData>()
|
||||
.eq(RepairOrderStepData::getRepairOrderId, item.getId())
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.IN_MAINTENANCE_IMG.getStatus()));
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.IN_MAINTENANCE_IMG.getStatus())
|
||||
.orderByDesc(RepairOrderStepData::getCreateTime)
|
||||
.last("limit 1"));
|
||||
if(inMaintenanceImg != null){
|
||||
try{
|
||||
List<URL> imgList1 = new ArrayList<>();
|
||||
|
@ -615,7 +627,9 @@ public class ParentRepairOrderServiceImpl implements IParentRepairOrderService {
|
|||
//返回维修后照片
|
||||
RepairOrderStepData afterRepairImg = repairOrderStepDataMapper.selectOne(new LambdaQueryWrapper<RepairOrderStepData>()
|
||||
.eq(RepairOrderStepData::getRepairOrderId, item.getId())
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.AFTER_REPAIR_IMG.getStatus()));
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.AFTER_REPAIR_IMG.getStatus())
|
||||
.orderByDesc(RepairOrderStepData::getCreateTime)
|
||||
.last("limit 1"));
|
||||
if(afterRepairImg != null){
|
||||
try{
|
||||
List<URL> imgList1 = new ArrayList<>();
|
||||
|
@ -634,21 +648,43 @@ public class ParentRepairOrderServiceImpl implements IParentRepairOrderService {
|
|||
/*
|
||||
更换明细 replacementDetail
|
||||
更换损坏器件明细
|
||||
(格式:维修主板:物料位号 * 配件编码 * 配件名称 * 规格型号 * 更换数量)
|
||||
(格式:维修主板:物料位号 * 配件编码 * 配件名称 * 规格型号 * 更换数量 * 配件单价)
|
||||
PFC:C1 * CST9830-001 * 螺母 * 30A500V * 1
|
||||
1、获取配件清单
|
||||
*/
|
||||
List<OrderSparePartUse> orderSparePartUses = orderSparePartUseMapper.selectList(new LambdaQueryWrapper<OrderSparePartUse>()
|
||||
.eq(OrderSparePartUse::getRepairOrderId, item.getId()));
|
||||
|
||||
// List<OrderSparePartUse> orderSparePartUses = orderSparePartUseMapper.selectList(new LambdaQueryWrapper<OrderSparePartUse>()
|
||||
// .eq(OrderSparePartUse::getRepairOrderId, item.getId())
|
||||
// .eq(repairOrderAudit != null , OrderSparePartUse::getRepairOrderAuditId, repairOrderAudit.getId())
|
||||
// );
|
||||
List<OrderSparePartUse> orderSparePartUses = new ArrayList<>();
|
||||
if(repairOrderAudit != null){
|
||||
orderSparePartUses = orderSparePartUseMapper.selectList(new LambdaQueryWrapper<OrderSparePartUse>()
|
||||
.eq(OrderSparePartUse::getRepairOrderId, item.getId())
|
||||
.eq(repairOrderAudit != null , OrderSparePartUse::getRepairOrderAuditId, repairOrderAudit.getId())
|
||||
);
|
||||
}
|
||||
|
||||
if(orderSparePartUses != null){
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (OrderSparePartUse orderSparePartUs : orderSparePartUses) {
|
||||
if (sb.length() > 0) {
|
||||
sb.append("\n");
|
||||
}
|
||||
//获取当前配件单价
|
||||
SparePart sparePart = sparePartMapper.selectOne(new LambdaQueryWrapper<SparePart>()
|
||||
.eq(SparePart::getId, orderSparePartUs.getSparePartsId()));
|
||||
//配件单价 = 客户采购价格因子 * 配件单价
|
||||
DecimalFormat df1 = new DecimalFormat("0.00");
|
||||
BigDecimal unitPrice = null;
|
||||
if(purchaseDivisor != null && sparePart.getUnitPrice() != null){
|
||||
unitPrice = sparePart.getUnitPrice().multiply(purchaseDivisor);
|
||||
}
|
||||
|
||||
sb.append(orderSparePartUs.getRepairMotherboard()).append(":").append(orderSparePartUs.getMaterialPositionNumber()).append(" * ")
|
||||
.append(orderSparePartUs.getSparePartsCode()).append(" * ").append(orderSparePartUs.getSparePartsName()).append(" * ")
|
||||
.append(orderSparePartUs.getSpecificationsModel()).append(" * ").append(orderSparePartUs.getUseNumber());
|
||||
.append(orderSparePartUs.getSpecificationsModel()).append(" * ").append(orderSparePartUs.getUseNumber()).append(" * ")
|
||||
.append(df1.format(unitPrice));
|
||||
}
|
||||
// 将数据转换为指定格式的字符串
|
||||
String detail = sb.toString();
|
||||
|
@ -719,7 +755,21 @@ public class ParentRepairOrderServiceImpl implements IParentRepairOrderService {
|
|||
if(operationsSuggest != null){
|
||||
scrapForm.setOperationsSuggest(operationsSuggest.getName());
|
||||
}
|
||||
scrapForm.setCreator(offerDetail.getCreator());
|
||||
//审核人
|
||||
SystemAuthAdmin creator = systemAuthAdminMapper.selectOne(new LambdaQueryWrapper<SystemAuthAdmin>()
|
||||
.eq(SystemAuthAdmin::getId, repairOrderAudit.getAuditorId())
|
||||
.eq(SystemAuthAdmin::getIsDelete, GlobalConstant.NOT_DELETE));
|
||||
if(creator != null){
|
||||
scrapForm.setCreator(creator.getUsername());
|
||||
}
|
||||
//确认人
|
||||
SystemAuthAdmin qualityTestingName = systemAuthAdminMapper.selectOne(new LambdaQueryWrapper<SystemAuthAdmin>()
|
||||
.eq(SystemAuthAdmin::getId, repairOrderAudit.getQualityTestingId()) // 质检人id
|
||||
.eq(SystemAuthAdmin::getIsDelete, GlobalConstant.NOT_DELETE));
|
||||
if(qualityTestingName != null){
|
||||
scrapForm.setQualityTestingName(qualityTestingName.getUsername());
|
||||
}
|
||||
|
||||
scrapForm.setDeliveryTime(TimeUtil.dateToString(parentRepairOrder.getCreateTime(), TimeConstant.DATE_FORMAT));
|
||||
scrapFormList.add(scrapForm);
|
||||
index3++;
|
||||
|
@ -733,75 +783,68 @@ public class ParentRepairOrderServiceImpl implements IParentRepairOrderService {
|
|||
if(repairOrderAuditsList.isEmpty()){
|
||||
continue;
|
||||
}
|
||||
for (RepairOrderAudit RepairOrderAudit : repairOrderAuditsList) {
|
||||
BeyondRepairOrder beyondRepairOrder = new BeyondRepairOrder();
|
||||
beyondRepairOrder.setIndex(index4); //序号
|
||||
beyondRepairOrder.setOrderNo(parentRepairOrder.getOrderNo()); //单据编号
|
||||
beyondRepairOrder.setSpecificationsModel(item.getModuleNumber()); //型号/规格
|
||||
beyondRepairOrder.setModelCode(item.getModuleCode()); //模块代码
|
||||
beyondRepairOrder.setPower(distMap.get(item.getModulePower().toString())); //功率
|
||||
|
||||
if(item.getRepairOrNot() != null){
|
||||
beyondRepairOrder.setIsRepair(item.getRepairOrNot() == 0 ? "是" : "否"); //是否返修
|
||||
}
|
||||
|
||||
String maintenanceManName = null;
|
||||
|
||||
if(item.getPreviousMaintenanceStaffId() != null){
|
||||
SystemAuthAdmin maintenanceMan = systemAuthAdminMapper.findSystemAuthAdminById(Math.toIntExact(item.getPreviousMaintenanceStaffId()));
|
||||
if(maintenanceMan != null){
|
||||
maintenanceManName = "原:" + maintenanceMan.getUsername(); //原维修人员
|
||||
}
|
||||
}
|
||||
if(item.getReceiverId() != null){
|
||||
SystemAuthAdmin maintenanceMan = systemAuthAdminMapper.findSystemAuthAdminById(Math.toIntExact(item.getReceiverId()));
|
||||
if(maintenanceMan != null){
|
||||
if(maintenanceManName != null){
|
||||
maintenanceManName = maintenanceManName + "\n现:" + maintenanceMan.getUsername();
|
||||
}else{
|
||||
maintenanceManName = "现:" + maintenanceMan.getUsername(); //维修人员
|
||||
}
|
||||
}
|
||||
}
|
||||
beyondRepairOrder.setMaintenanceMan(maintenanceManName);
|
||||
|
||||
//退仓原因
|
||||
beyondRepairOrder.setReasonForWithdrawal(RepairOrderAudit.getReasonForWithdrawal()); // 退仓原因
|
||||
|
||||
|
||||
/*
|
||||
更换明细 replacementDetail
|
||||
更换损坏器件明细
|
||||
(格式:维修主板:物料位号 * 配件编码 * 配件名称 * 规格型号 * 更换数量)
|
||||
PFC:C1 * CST9830-001 * 螺母 * 30A500V * 1
|
||||
1、获取配件清单
|
||||
*/
|
||||
List<OrderSparePartUse> orderSparePartUses = orderSparePartUseMapper.selectList(new LambdaQueryWrapper<OrderSparePartUse>()
|
||||
.eq(OrderSparePartUse::getRepairOrderId, item.getId()));
|
||||
if(orderSparePartUses != null){
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (OrderSparePartUse orderSparePartUs : orderSparePartUses) {
|
||||
if (sb.length() > 0) {
|
||||
sb.append("\n");
|
||||
}
|
||||
sb.append(orderSparePartUs.getRepairMotherboard()).append(":").append(orderSparePartUs.getMaterialPositionNumber()).append(" * ")
|
||||
.append(orderSparePartUs.getSparePartsCode()).append(" * ").append(orderSparePartUs.getSparePartsName()).append(" * ")
|
||||
.append(orderSparePartUs.getSpecificationsModel()).append(" * ").append(orderSparePartUs.getUseNumber());
|
||||
}
|
||||
// 将数据转换为指定格式的字符串
|
||||
String detail = sb.toString();
|
||||
beyondRepairOrder.setReplacementDetail(detail);
|
||||
}
|
||||
beyondRepairOrder.setCreator(offerDetail.getCreator()); //制单人
|
||||
beyondRepairOrder.setDeliveryTime(TimeUtil.dateToString(parentRepairOrder.getCreateTime(), TimeConstant.DATE_FORMAT)); //制单日期
|
||||
|
||||
beyondRepairOrderList.add(beyondRepairOrder);
|
||||
index4++;
|
||||
BeyondRepairOrder beyondRepairOrder = new BeyondRepairOrder();
|
||||
beyondRepairOrder.setIndex(index4); //序号
|
||||
beyondRepairOrder.setOrderNo(parentRepairOrder.getOrderNo()); //单据编号
|
||||
beyondRepairOrder.setSpecificationsModel(item.getModuleNumber()); //型号/规格
|
||||
beyondRepairOrder.setModelCode(item.getModuleCode()); //模块代码
|
||||
beyondRepairOrder.setPower(distMap.get(item.getModulePower().toString())); //功率
|
||||
if(item.getRepairOrNot() != null){
|
||||
beyondRepairOrder.setIsRepair(item.getRepairOrNot() == 0 ? "是" : "否"); //是否返修
|
||||
}
|
||||
SystemAuthAdmin systemAuthAdmin = new SystemAuthAdmin();
|
||||
if(item.getReceiverId() != null){
|
||||
systemAuthAdmin = systemAuthAdminMapper.findSystemAuthAdminById(Math.toIntExact(item.getReceiverId()));
|
||||
}
|
||||
|
||||
String yuan = "";
|
||||
String reasonForWithdrawal = "";
|
||||
|
||||
for (RepairOrderAudit repairOrderAudit : repairOrderAuditsList) {
|
||||
//获取维修人员
|
||||
User userById = userMapper.findUserById(repairOrderAudit.getApplicantId());
|
||||
if(userById != null){
|
||||
yuan = yuan + userById.getUsername() + ",";
|
||||
}
|
||||
|
||||
//难修原因
|
||||
reasonForWithdrawal = reasonForWithdrawal + "(" + userById.getUsername() + ")\n" + "维修了什么?\n1、" + repairOrderAudit.getWhatWasRepairedOne() + "\n2、" +
|
||||
repairOrderAudit.getWhatWasRepairedTwo() + "\n3、" + repairOrderAudit.getWhatWasRepairedThree() + "\n现在遇到了什么问题?\n1、"
|
||||
+ repairOrderAudit.getQuestionOne() + "\n2、" + repairOrderAudit.getQuestionTwo() + "\n3、" + repairOrderAudit.getQuestionThree() + "\n";
|
||||
|
||||
|
||||
}
|
||||
//删除维修人员最后一个逗号
|
||||
if(yuan != null && yuan != ""){
|
||||
yuan= yuan.substring(0,yuan.length() -1);
|
||||
}
|
||||
|
||||
//维修人员
|
||||
if(StringUtil.isEmpty(yuan)){
|
||||
beyondRepairOrder.setMaintenanceMan("现:"+systemAuthAdmin.getUsername());
|
||||
}else{
|
||||
if(systemAuthAdmin.getUsername() != null){
|
||||
if(yuan.equals(systemAuthAdmin.getUsername())){
|
||||
beyondRepairOrder.setMaintenanceMan("现:"+systemAuthAdmin.getUsername());
|
||||
}else {
|
||||
beyondRepairOrder.setMaintenanceMan("原:" + yuan + "\n现:"+systemAuthAdmin.getUsername());
|
||||
}
|
||||
}else{
|
||||
beyondRepairOrder.setMaintenanceMan("原:" + yuan);
|
||||
}
|
||||
}
|
||||
|
||||
beyondRepairOrder.setReasonForWithdrawal(reasonForWithdrawal); // 退仓原因
|
||||
beyondRepairOrder.setCreator(offerDetail.getCreator()); //制单人
|
||||
beyondRepairOrder.setDeliveryTime(TimeUtil.dateToString(parentRepairOrder.getCreateTime(), TimeConstant.DATE_FORMAT)); //制单日期
|
||||
|
||||
beyondRepairOrderList.add(beyondRepairOrder);
|
||||
index4++;
|
||||
}
|
||||
if(ids.equals("5")){
|
||||
//5-领机单
|
||||
MachineClaimNote machineClaimNote = new MachineClaimNote();
|
||||
machineClaimNote.setOrderNo(parentRepairOrder.getOrderNo()); //单据编号
|
||||
machineClaimNote.setIndex(index5); //序号
|
||||
machineClaimNote.setSpecificationsModel(item.getModuleNumber()); //型号/规格
|
||||
machineClaimNote.setModelCode(item.getModuleCode()); //模块代码
|
||||
|
@ -830,11 +873,75 @@ public class ParentRepairOrderServiceImpl implements IParentRepairOrderService {
|
|||
machineClaimNoteList.add(machineClaimNote);
|
||||
index5++;
|
||||
}
|
||||
if(ids.equals("6")){
|
||||
//6-维修工序单
|
||||
ClientCollarExcel clientCollarExcel = new ClientCollarExcel();
|
||||
clientCollarExcel.setOrderNo(parentRepairOrder.getOrderNo()); //工单编号
|
||||
clientCollarExcel.setIndex(index6); //序号
|
||||
clientCollarExcel.setSpecificationsModel(item.getModuleNumber()); //型号/规格
|
||||
clientCollarExcel.setModelCode(item.getModuleCode()); //模块代码
|
||||
clientCollarExcel.setPower(distMap.get(item.getModulePower().toString())); //功率
|
||||
if(item.getScrapOrNot() != null){ //排查结果
|
||||
clientCollarExcel.setScrapOrNot(item.getScrapOrNot() == 0 ? "报废" : "维修");
|
||||
}
|
||||
|
||||
//设置客户信息
|
||||
Client clientName = clientMapper.findClientById(item.getClientId());
|
||||
if(clientName != null){
|
||||
clientCollarExcel.setClientName(client.getClientName());
|
||||
}
|
||||
|
||||
// 维修人员
|
||||
if(item.getReceiverId() != null){
|
||||
SystemAuthAdmin maintenanceMan = systemAuthAdminMapper.findSystemAuthAdminById(Math.toIntExact(item.getReceiverId()));
|
||||
if(maintenanceMan != null){
|
||||
clientCollarExcel.setMaintenanceMan(maintenanceMan.getUsername());
|
||||
}
|
||||
}
|
||||
|
||||
//拆机图片 setDismantle
|
||||
clientCollarExcel.setDismantle(imgExcel(item.getId(), RepairOrderStopEnum.DISMANTLE.getStatus()));
|
||||
//除尘 dedusting
|
||||
clientCollarExcel.setDedusting(imgExcel(item.getId(), RepairOrderStopEnum.DEDUSTING.getStatus()));
|
||||
//功能测试 functionalTestImg
|
||||
clientCollarExcel.setFunctionalTestImg(imgExcel(item.getId(), RepairOrderStopEnum.FUNCTIONAL_TEST.getStatus()));
|
||||
//DC&PFC组装 assembleImg
|
||||
clientCollarExcel.setAssembleImg(imgExcel(item.getId(), RepairOrderStopEnum.DC_AND_PFC_ASSEMBLE.getStatus()));
|
||||
//补强三防漆和点胶 reinforcingThreeAntiPaintAndDispensing
|
||||
clientCollarExcel.setReinforcingThreeAntiPaintAndDispensing(imgExcel(item.getId(), RepairOrderStopEnum.REINFORCING_THREE_ANTI_PAINT_AND_DISPENSING.getStatus()));
|
||||
//模块装配 moduleAssembly
|
||||
clientCollarExcel.setModuleAssembly(imgExcel(item.getId(), RepairOrderStopEnum.MODULE_ASSEMBLY.getStatus()));
|
||||
//老化测试 agingTest
|
||||
clientCollarExcel.setAgingTest(imgExcel(item.getId(), RepairOrderStopEnum.AGING_TEST.getStatus()));
|
||||
//报废图片 scrapPicture
|
||||
RepairOrderAudit scrapRepairOrderAudit = repairOrderAuditMapper.findRepairOrderAuditByRepairOrderIdAndReviewRequest(item.getId(),3L);
|
||||
if(scrapRepairOrderAudit != null){
|
||||
try{
|
||||
List<URL> imgList1 = new ArrayList<>();
|
||||
String[] arr = scrapRepairOrderAudit.getScrapImg().split(",");// 报废图片
|
||||
for (String s : arr) {
|
||||
imgList1.add(new URL(s));
|
||||
}
|
||||
clientCollarExcel.setScrapPicture(imgList1);
|
||||
}catch (Exception e) {
|
||||
System.out.println("导出异常");
|
||||
}
|
||||
}
|
||||
//返回维修前照片
|
||||
clientCollarExcel.setRepairFront(imgExcel(item.getId(), RepairOrderStopEnum.PRE_MAINTENANCE_IMG.getStatus()));
|
||||
//返回维修中照片
|
||||
clientCollarExcel.setRepairIng(imgExcel(item.getId(), RepairOrderStopEnum.IN_MAINTENANCE_IMG.getStatus()));
|
||||
//返回维修后照片
|
||||
clientCollarExcel.setRepairBack(imgExcel(item.getId(), RepairOrderStopEnum.AFTER_REPAIR_IMG.getStatus()));
|
||||
|
||||
clientCollarExcelList.add(clientCollarExcel);
|
||||
index6++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 7; i++) {
|
||||
for (int i = 0; i < 8; i++) {
|
||||
WriteSheet sheet = EasyExcel.writerSheet(i).build();
|
||||
switch (i){
|
||||
case 0:
|
||||
|
@ -864,6 +971,10 @@ public class ParentRepairOrderServiceImpl implements IParentRepairOrderService {
|
|||
writer.fill(offerDetail, sheet);
|
||||
writer.fill(machineClaimNoteList, fillConfig, sheet);
|
||||
break;
|
||||
case 6:
|
||||
writer.fill(offerDetail, sheet);
|
||||
writer.fill(clientCollarExcelList, fillConfig, sheet);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -877,4 +988,227 @@ public class ParentRepairOrderServiceImpl implements IParentRepairOrderService {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询步骤图片
|
||||
* @param repairOrderId
|
||||
* @param repairStep
|
||||
* @return
|
||||
*/
|
||||
public List<URL> imgExcel(Long repairOrderId, Integer repairStep){
|
||||
RepairOrderStepData dismantle = repairOrderStepDataMapper.selectOne(new LambdaQueryWrapper<RepairOrderStepData>()
|
||||
.eq(RepairOrderStepData::getRepairOrderId, repairOrderId)
|
||||
.eq(RepairOrderStepData::getRepairStep, repairStep)
|
||||
.eq(RepairOrderStepData::getIsDelete, GlobalConstant.NOT_DELETE)
|
||||
.orderByDesc(RepairOrderStepData::getCreateTime)
|
||||
.last("limit 1"));
|
||||
if(dismantle != null){
|
||||
try{
|
||||
List<URL> imgList = new ArrayList<>();
|
||||
String[] arr = dismantle.getImg().split(",");
|
||||
for (String s : arr) {
|
||||
imgList.add(new URL(s));
|
||||
}
|
||||
return imgList;
|
||||
}catch (Exception e) {
|
||||
System.out.println("导出异常");
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出客户领机报表
|
||||
*
|
||||
* @param response
|
||||
*/
|
||||
@Override
|
||||
public void clientCollarExcel(HttpServletResponse response) {
|
||||
try {
|
||||
|
||||
LambdaQueryWrapper<ParentRepairOrder> lambdaQueryWrapper = new LambdaQueryWrapper<ParentRepairOrder>()
|
||||
.eq(ParentRepairOrder::getIsDelete, GlobalConstant.NOT_DELETE);
|
||||
//查询待导出的维修单
|
||||
List<ParentRepairOrder> parentRepairOrders = parentRepairOrderMapper.selectList(lambdaQueryWrapper);
|
||||
|
||||
// 文件模板输入流,将 excel 模板放到 resources 目录下
|
||||
InputStream templateFile = new ClassPathResource("templates/excel/ClientCollar.xlsx").getInputStream();
|
||||
|
||||
//功率字典
|
||||
Map<String, String> distMap = dictDataMapper.selectList(new LambdaQueryWrapper<DictData>()
|
||||
.eq(DictData::getIsDelete, GlobalConstant.NOT_DELETE)
|
||||
.eq(DictData::getTypeId, 46))
|
||||
.stream()
|
||||
.collect(Collectors.toMap(DictData::getValue, DictData::getName));
|
||||
|
||||
ServletOutputStream out = response.getOutputStream();
|
||||
FillConfig fillConfig = FillConfig.builder().forceNewRow(true).build();
|
||||
//设置多sheet输出流
|
||||
ExcelWriter writer = EasyExcel
|
||||
.write(out)
|
||||
.withTemplate(templateFile)
|
||||
// 使用图片处理策略
|
||||
.registerWriteHandler(
|
||||
// 设置每张图片的宽度为 100px,转换因子为 32
|
||||
new LocalImageModifyStrategy(100, 32))
|
||||
.build();
|
||||
//公共数据
|
||||
OfferDetailEntity offerDetail = new OfferDetailEntity();
|
||||
//客户领机单
|
||||
List<ClientCollerExcel> clientCollerExcelList = new ArrayList<>();
|
||||
int index = 1;
|
||||
|
||||
for (ParentRepairOrder parentRepairOrder : parentRepairOrders) {
|
||||
List<RepairOrder> repairOrderList = repairOrderMapper.findRepairOrderByParentId(parentRepairOrder.getId());
|
||||
|
||||
//获取制单时间
|
||||
offerDetail.setDeliveryTime(TimeUtil.dateToString(new Date(), TimeConstant.DATE_FORMAT));
|
||||
|
||||
//获取制单人
|
||||
SystemAuthAdmin contentAdmin = systemAuthAdminMapper.findSystemAuthAdminById(AdminThreadLocal.getAdminId());
|
||||
if(contentAdmin != null){
|
||||
offerDetail.setCreator(contentAdmin.getUsername());
|
||||
}
|
||||
|
||||
for (RepairOrder item : repairOrderList) {
|
||||
//5-领机单
|
||||
ClientCollerExcel machineClaimNote = new ClientCollerExcel();
|
||||
//客户名称
|
||||
Client client = clientMapper.findClientById(parentRepairOrder.getClientId());
|
||||
if(client != null){
|
||||
machineClaimNote.setClientName(client.getClientName());
|
||||
}
|
||||
|
||||
machineClaimNote.setOrderNo(parentRepairOrder.getOrderNo()); //单据编号
|
||||
machineClaimNote.setIndex(index); //序号
|
||||
machineClaimNote.setSpecificationsModel(item.getModuleNumber()); //型号/规格
|
||||
machineClaimNote.setModelCode(item.getModuleCode()); //模块代码
|
||||
machineClaimNote.setPower(distMap.get(item.getModulePower().toString())); //功率
|
||||
|
||||
if(item.getRepairOrNot() != null){
|
||||
machineClaimNote.setIsRepair(item.getRepairOrNot() == 0 ? "是" : "否"); //是否返修
|
||||
}
|
||||
|
||||
if(item.getReceiverId() != null){
|
||||
SystemAuthAdmin maintenanceMan = systemAuthAdminMapper.findSystemAuthAdminById(Math.toIntExact(item.getReceiverId()));
|
||||
if(maintenanceMan != null){
|
||||
machineClaimNote.setMaintenanceMan(maintenanceMan.getUsername()); //维修人员
|
||||
}
|
||||
}else{
|
||||
machineClaimNote.setMaintenanceMan("未派单"); //没有维修人员就是还没有派单
|
||||
}
|
||||
|
||||
clientCollerExcelList.add(machineClaimNote);
|
||||
index++;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
WriteSheet sheet = EasyExcel.writerSheet(0).build();
|
||||
|
||||
offerDetail.setTotalQty(index == 1 ? 0 : index - 1);
|
||||
writer.fill(offerDetail, sheet);
|
||||
writer.fill(clientCollerExcelList, fillConfig, sheet);
|
||||
|
||||
|
||||
writer.finish();
|
||||
out.close();
|
||||
templateFile.close();
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
throw new OperateException("导出报表出现错误:"+e.getLocalizedMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出客户入库WIP表
|
||||
*
|
||||
* @param response
|
||||
*/
|
||||
@Override
|
||||
public void warehouseWarrantWIPExcel(HttpServletResponse response) {
|
||||
try {
|
||||
|
||||
LambdaQueryWrapper<ParentRepairOrder> lambdaQueryWrapper = new LambdaQueryWrapper<ParentRepairOrder>()
|
||||
.eq(ParentRepairOrder::getIsDelete, GlobalConstant.NOT_DELETE);
|
||||
//查询待导出的维修单
|
||||
List<ParentRepairOrder> parentRepairOrders = parentRepairOrderMapper.selectList(lambdaQueryWrapper);
|
||||
|
||||
// 文件模板输入流,将 excel 模板放到 resources 目录下
|
||||
InputStream templateFile = new ClassPathResource("templates/excel/WarehouseWarrantWIP.xlsx").getInputStream();
|
||||
|
||||
//功率字典
|
||||
Map<String, String> distMap = dictDataMapper.selectList(new LambdaQueryWrapper<DictData>()
|
||||
.eq(DictData::getIsDelete, GlobalConstant.NOT_DELETE)
|
||||
.eq(DictData::getTypeId, 46))
|
||||
.stream()
|
||||
.collect(Collectors.toMap(DictData::getValue, DictData::getName));
|
||||
|
||||
ServletOutputStream out = response.getOutputStream();
|
||||
FillConfig fillConfig = FillConfig.builder().forceNewRow(true).build();
|
||||
//设置多sheet输出流
|
||||
ExcelWriter writer = EasyExcel
|
||||
.write(out)
|
||||
.withTemplate(templateFile)
|
||||
// 使用图片处理策略
|
||||
.registerWriteHandler(
|
||||
// 设置每张图片的宽度为 100px,转换因子为 32
|
||||
new LocalImageModifyStrategy(100, 32))
|
||||
.build();
|
||||
//公共数据
|
||||
OfferDetailEntity offerDetail = new OfferDetailEntity();
|
||||
//客户入库WIP单
|
||||
List<WarehouseWarrantWIPExcel> warehouseWarrantWIPExcelList = new ArrayList<>();
|
||||
int index = 1;
|
||||
|
||||
for (ParentRepairOrder parentRepairOrder : parentRepairOrders) {
|
||||
List<RepairOrder> repairOrderList = repairOrderMapper.findRepairOrderByParentId(parentRepairOrder.getId());
|
||||
|
||||
for (RepairOrder item : repairOrderList) {
|
||||
//入库WIP表
|
||||
WarehouseWarrantWIPExcel warehouseWarrantWIPExcel = new WarehouseWarrantWIPExcel();
|
||||
//客户名称
|
||||
Client client = clientMapper.findClientById(parentRepairOrder.getClientId());
|
||||
if(client != null){
|
||||
warehouseWarrantWIPExcel.setClientName(client.getClientName());
|
||||
}
|
||||
warehouseWarrantWIPExcel.setOrderNo(parentRepairOrder.getOrderNo()); //单据编号
|
||||
warehouseWarrantWIPExcel.setIndex(index); //序号
|
||||
warehouseWarrantWIPExcel.setWarehousingDate(TimeUtil.dateToString(item.getCreateTime(), TimeConstant.DATE_FORMAT)); // 入库日期
|
||||
warehouseWarrantWIPExcel.setSpecificationsModel(item.getModuleNumber()); //型号/规格
|
||||
warehouseWarrantWIPExcel.setModelCode(item.getModuleCode()); //模块代码
|
||||
warehouseWarrantWIPExcel.setPower(distMap.get(item.getModulePower().toString())); //功率
|
||||
if(item.getRepairOrNot() != null){
|
||||
warehouseWarrantWIPExcel.setIsRepair(item.getRepairOrNot() == 0 ? "是" : "否"); //是否返修
|
||||
}
|
||||
// if(item.getReceiverId() != null){
|
||||
// SystemAuthAdmin maintenanceMan = systemAuthAdminMapper.findSystemAuthAdminById(Math.toIntExact(item.getReceiverId()));
|
||||
// if(maintenanceMan != null){
|
||||
// warehouseWarrantWIPExcel.setMaintenanceMan(maintenanceMan.getUsername()); //维修人员
|
||||
// }
|
||||
// }else{
|
||||
// warehouseWarrantWIPExcel.setMaintenanceMan("未派单"); //没有维修人员就是还没有派单
|
||||
// }
|
||||
|
||||
warehouseWarrantWIPExcelList.add(warehouseWarrantWIPExcel);
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
||||
WriteSheet sheet = EasyExcel.writerSheet(0).build();
|
||||
|
||||
offerDetail.setTotalQty(index == 1 ? 0 : index - 1);
|
||||
writer.fill(offerDetail, sheet);
|
||||
writer.fill(warehouseWarrantWIPExcelList, fillConfig, sheet);
|
||||
|
||||
|
||||
writer.finish();
|
||||
out.close();
|
||||
templateFile.close();
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
throw new OperateException("导出报表出现错误:"+e.getLocalizedMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ import com.hcy.admin.service.order.IRepairOrderAuditService;
|
|||
import com.hcy.admin.validate.common.PageParam;
|
||||
import com.hcy.admin.validate.order.RepairOrderAuditParam;
|
||||
import com.hcy.admin.vo.order.*;
|
||||
import com.hcy.common.constant.GlobalConstant;
|
||||
import com.hcy.common.constant.TimeConstant;
|
||||
import com.hcy.common.core.PageResult;
|
||||
import com.hcy.common.dto.order.OrderSparePart;
|
||||
|
@ -34,11 +35,14 @@ import com.hcy.common.mapper.user.UserMapper;
|
|||
import com.hcy.common.mapper.warehouse.WarehouseMapper;
|
||||
import com.hcy.common.plugin.notice.engine.SmsNotice;
|
||||
import com.hcy.common.utils.TimeUtil;
|
||||
import org.apache.xmlbeans.impl.common.GlobalLock;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
|
@ -159,10 +163,14 @@ public class RepairOrderAuditServiceImpl implements IRepairOrderAuditService {
|
|||
.eq(ParentRepairOrder::getId, repairOrder.getParentRepairOrderId()));
|
||||
vo.setOrderNo(parentRepairOrder.getOrderNo());
|
||||
|
||||
//客户配件采购因子
|
||||
BigDecimal purchaseDivisor = null;
|
||||
//客户名称
|
||||
Client client = clientMapper.selectOne(new LambdaQueryWrapper<Client>()
|
||||
.eq(Client::getId, repairOrder.getClientId()));
|
||||
vo.setClientName(client.getClientName());
|
||||
purchaseDivisor = client.getPurchaseDivisor(); // 配件采购价格因子
|
||||
|
||||
|
||||
//模块型号、模块代码
|
||||
vo.setModuleCode(repairOrder.getModuleCode());
|
||||
|
@ -173,16 +181,28 @@ public class RepairOrderAuditServiceImpl implements IRepairOrderAuditService {
|
|||
.eq(User::getId, model.getApplicantId()));
|
||||
vo.setApplicantName(user.getUsername());
|
||||
|
||||
//配件领料备注
|
||||
//故障排查 - 配件领料备注
|
||||
RepairOrderStepData repairOrderStepData = repairOrderStepDataMapper.selectOne(new LambdaQueryWrapper<RepairOrderStepData>()
|
||||
.eq(RepairOrderStepData::getRepairOrderId, model.getRepairOrderId())
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.TROUBLESHOOTING.getStatus())
|
||||
.or()
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.RECOLLAR_FITTING.getStatus())
|
||||
.orderByDesc(RepairOrderStepData::getCreateTime)
|
||||
.last("limit 1"));//故障排查
|
||||
if(repairOrderStepData != null){
|
||||
vo.setReceiveRemark(repairOrderStepData.getRemark());
|
||||
}
|
||||
|
||||
//重领配件备注 recollarFittingRemark
|
||||
RepairOrderStepData recollarFittingRemark = repairOrderStepDataMapper.selectOne(new LambdaQueryWrapper<RepairOrderStepData>()
|
||||
.eq(RepairOrderStepData::getRepairOrderId, model.getRepairOrderId())
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.RECOLLAR_FITTING.getStatus())
|
||||
.orderByDesc(RepairOrderStepData::getCreateTime)
|
||||
.last("limit 1"));//故障排查
|
||||
if(recollarFittingRemark != null){
|
||||
vo.setRecollarFittingRemark(recollarFittingRemark.getRemark());
|
||||
}
|
||||
|
||||
//配件领用数据
|
||||
Integer number = 0; //领用数量
|
||||
|
||||
|
@ -199,13 +219,26 @@ public class RepairOrderAuditServiceImpl implements IRepairOrderAuditService {
|
|||
.eq(Warehouse::getId, orderSparePart.getWarehouseId()));
|
||||
orderSparePartListVo.setWarehouseName(warehouse.getWarehouseName());
|
||||
|
||||
//单位数据获取配件表数据
|
||||
SparePart sparePart = sparePartMapper.selectOne(new LambdaQueryWrapper<SparePart>()
|
||||
.eq(SparePart::getId, orderSparePart.getSparePartsId()));
|
||||
//配件单价 = 客户采购价格因子 * 配件单价
|
||||
DecimalFormat df1 = new DecimalFormat("0.00");
|
||||
BigDecimal unitPrice = null;
|
||||
if(purchaseDivisor != null && sparePart.getUnitPrice() != null){
|
||||
unitPrice = sparePart.getUnitPrice().multiply(purchaseDivisor);
|
||||
}
|
||||
orderSparePartListVo.setUnitPrice(df1.format(unitPrice));
|
||||
|
||||
orderSparePartListVoList.add(orderSparePartListVo);
|
||||
|
||||
number += orderSparePart.getCount();
|
||||
}
|
||||
}else{
|
||||
orderSparePartList = orderSparePartMapper.selectList(new LambdaQueryWrapper<OrderSparePart>()
|
||||
.eq(OrderSparePart::getRepairOrderId, model.getRepairOrderId()));
|
||||
.eq(OrderSparePart::getRepairOrderId, model.getRepairOrderId())
|
||||
.eq(OrderSparePart::getIsDelete, GlobalConstant.NOT_DELETE));
|
||||
|
||||
for (OrderSparePart orderSparePart : orderSparePartList) {
|
||||
OrderSparePartListVo orderSparePartListVo = new OrderSparePartListVo();
|
||||
BeanUtils.copyProperties(orderSparePart, orderSparePartListVo);
|
||||
|
@ -215,6 +248,17 @@ public class RepairOrderAuditServiceImpl implements IRepairOrderAuditService {
|
|||
.eq(Warehouse::getId, orderSparePart.getWarehouseId()));
|
||||
orderSparePartListVo.setWarehouseName(warehouse.getWarehouseName());
|
||||
|
||||
//单位数据获取配件表数据
|
||||
SparePart sparePart = sparePartMapper.selectOne(new LambdaQueryWrapper<SparePart>()
|
||||
.eq(SparePart::getId, orderSparePart.getSparePartsId()));
|
||||
//配件单价 = 客户采购价格因子 * 配件单价
|
||||
DecimalFormat df1 = new DecimalFormat("0.00");
|
||||
BigDecimal unitPrice = null;
|
||||
if(purchaseDivisor != null && sparePart.getUnitPrice() != null){
|
||||
unitPrice = sparePart.getUnitPrice().multiply(purchaseDivisor);
|
||||
}
|
||||
orderSparePartListVo.setUnitPrice(df1.format(unitPrice));
|
||||
|
||||
orderSparePartListVoList.add(orderSparePartListVo);
|
||||
|
||||
number += orderSparePart.getCount();
|
||||
|
@ -281,28 +325,36 @@ public class RepairOrderAuditServiceImpl implements IRepairOrderAuditService {
|
|||
//返回维修前照片
|
||||
RepairOrderStepData preMaintenanceImg = repairOrderStepDataMapper.selectOne(new LambdaQueryWrapper<RepairOrderStepData>()
|
||||
.eq(RepairOrderStepData::getRepairOrderId, model.getRepairOrderId())
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.PRE_MAINTENANCE_IMG.getStatus()));
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.PRE_MAINTENANCE_IMG.getStatus())
|
||||
.orderByDesc(RepairOrderStepData::getCreateTime)
|
||||
.last("limit 1"));
|
||||
if(preMaintenanceImg != null){
|
||||
vo.setPreMaintenanceImg(preMaintenanceImg.getImg());
|
||||
}
|
||||
//返回维修中照片
|
||||
RepairOrderStepData inMaintenanceImg = repairOrderStepDataMapper.selectOne(new LambdaQueryWrapper<RepairOrderStepData>()
|
||||
.eq(RepairOrderStepData::getRepairOrderId, model.getRepairOrderId())
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.IN_MAINTENANCE_IMG.getStatus()));
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.IN_MAINTENANCE_IMG.getStatus())
|
||||
.orderByDesc(RepairOrderStepData::getCreateTime)
|
||||
.last("limit 1"));
|
||||
if(inMaintenanceImg != null){
|
||||
vo.setInMaintenanceImg(inMaintenanceImg.getImg());
|
||||
}
|
||||
//返回维修后照片
|
||||
RepairOrderStepData afterRepairImg = repairOrderStepDataMapper.selectOne(new LambdaQueryWrapper<RepairOrderStepData>()
|
||||
.eq(RepairOrderStepData::getRepairOrderId, model.getRepairOrderId())
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.AFTER_REPAIR_IMG.getStatus()));
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.AFTER_REPAIR_IMG.getStatus())
|
||||
.orderByDesc(RepairOrderStepData::getCreateTime)
|
||||
.last("limit 1"));
|
||||
if(afterRepairImg != null){
|
||||
vo.setAfterRepairImg(afterRepairImg.getImg());
|
||||
}
|
||||
//返回良品入库照片
|
||||
RepairOrderStepData img = repairOrderStepDataMapper.selectOne(new LambdaQueryWrapper<RepairOrderStepData>()
|
||||
.eq(RepairOrderStepData::getRepairOrderId, model.getRepairOrderId())
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.GOOD_PRODUCTS_ARE_STORED.getStatus()));
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.GOOD_PRODUCTS_ARE_STORED.getStatus())
|
||||
.orderByDesc(RepairOrderStepData::getCreateTime)
|
||||
.last("limit 1"));
|
||||
if(img != null){
|
||||
vo.setImg(img.getImg());
|
||||
vo.setEnterRemark(img.getRemark());
|
||||
|
@ -312,10 +364,23 @@ public class RepairOrderAuditServiceImpl implements IRepairOrderAuditService {
|
|||
List<OrderSparePartUseVo> orderSparePartUseListVoList = new ArrayList<>();
|
||||
List<OrderSparePartUse> sparePartUseParamsList = orderSparePartUseMapper.selectList(new LambdaQueryWrapper<OrderSparePartUse>()
|
||||
.eq(OrderSparePartUse::getRepairOrderId, model.getRepairOrderId())
|
||||
.eq(OrderSparePartUse::getRepairOrderAuditId, model.getId())
|
||||
.eq(OrderSparePartUse::getReviewRequest, RepairOrderAuditStatusEnum.GOOD_PRODUCTS_ARE_STORED.getStatus()));
|
||||
for (OrderSparePartUse orderSparePartUse : sparePartUseParamsList) {
|
||||
OrderSparePartUseVo orderSparePartUsetListVo = new OrderSparePartUseVo();
|
||||
BeanUtils.copyProperties(orderSparePartUse, orderSparePartUsetListVo);
|
||||
|
||||
//单位数据获取配件表数据
|
||||
SparePart sparePart = sparePartMapper.selectOne(new LambdaQueryWrapper<SparePart>()
|
||||
.eq(SparePart::getId, orderSparePartUse.getSparePartsId()));
|
||||
//配件单价 = 客户采购价格因子 * 配件单价
|
||||
DecimalFormat df1 = new DecimalFormat("0.00");
|
||||
BigDecimal unitPrice = null;
|
||||
if(purchaseDivisor != null && sparePart.getUnitPrice() != null){
|
||||
unitPrice = sparePart.getUnitPrice().multiply(purchaseDivisor);
|
||||
}
|
||||
orderSparePartUsetListVo.setUnitPrice(df1.format(unitPrice));
|
||||
|
||||
orderSparePartUseListVoList.add(orderSparePartUsetListVo);
|
||||
}
|
||||
vo.setSparePartUseParams(orderSparePartUseListVoList); //配件使用列表
|
||||
|
@ -324,10 +389,23 @@ public class RepairOrderAuditServiceImpl implements IRepairOrderAuditService {
|
|||
List<OrderSparePartUseVo> replaceDamagedPartsListVoList = new ArrayList<>();
|
||||
List<OrderSparePartUse> replaceDamagedParts = orderSparePartUseMapper.selectList(new LambdaQueryWrapper<OrderSparePartUse>()
|
||||
.eq(OrderSparePartUse::getRepairOrderId, model.getRepairOrderId())
|
||||
.eq(OrderSparePartUse::getRepairOrderAuditId, model.getId())
|
||||
.eq(OrderSparePartUse::getReviewRequest, RepairOrderAuditStatusEnum.CANCELLATION_REQUEST.getStatus()));
|
||||
for (OrderSparePartUse orderSparePartUse : replaceDamagedParts) {
|
||||
OrderSparePartUseVo orderSparePartUsetListVo = new OrderSparePartUseVo();
|
||||
BeanUtils.copyProperties(orderSparePartUse, orderSparePartUsetListVo);
|
||||
|
||||
//单位数据获取配件表数据
|
||||
SparePart sparePart = sparePartMapper.selectOne(new LambdaQueryWrapper<SparePart>()
|
||||
.eq(SparePart::getId, orderSparePartUse.getSparePartsId()));
|
||||
//配件单价 = 客户采购价格因子 * 配件单价
|
||||
DecimalFormat df1 = new DecimalFormat("0.00");
|
||||
BigDecimal unitPrice = null;
|
||||
if(purchaseDivisor != null && sparePart.getUnitPrice() != null){
|
||||
unitPrice = sparePart.getUnitPrice().multiply(purchaseDivisor);
|
||||
}
|
||||
orderSparePartUsetListVo.setUnitPrice(df1.format(unitPrice));
|
||||
|
||||
replaceDamagedPartsListVoList.add(orderSparePartUsetListVo);
|
||||
}
|
||||
vo.setReplaceDamagedParts(replaceDamagedPartsListVoList); //更换损坏配件清单
|
||||
|
@ -342,6 +420,23 @@ public class RepairOrderAuditServiceImpl implements IRepairOrderAuditService {
|
|||
vo.setWithdrawalImg(withdrawalImg.getImg());
|
||||
}
|
||||
|
||||
//退仓原因
|
||||
String reasonForWithdrawal = null; // 退仓原因
|
||||
reasonForWithdrawal = "维修了什么?\n1、" + model.getWhatWasRepairedOne() + "\n2、" +
|
||||
model.getWhatWasRepairedTwo() + "\n3、" + model.getWhatWasRepairedThree() + "\n现在遇到了什么问题?\n1、"
|
||||
+ model.getQuestionOne() + "\n2、" + model.getQuestionTwo() + "\n3、" + model.getQuestionThree();
|
||||
vo.setReasonForWithdrawal(reasonForWithdrawal);
|
||||
|
||||
//取消原因 reasonOfCancellation; // 取消原因
|
||||
RepairOrderStepData reasonOfCancellation = repairOrderStepDataMapper.selectOne(new LambdaQueryWrapper<RepairOrderStepData>()
|
||||
.eq(RepairOrderStepData::getRepairOrderId, model.getRepairOrderId())
|
||||
.eq(RepairOrderStepData::getTitle, "配件领料已取消")
|
||||
.orderByDesc(RepairOrderStepData::getCreateTime)
|
||||
.last("limit 1"));
|
||||
if(reasonOfCancellation != null){
|
||||
vo.setReasonOfCancellation(reasonOfCancellation.getRemark());
|
||||
}
|
||||
|
||||
return vo;
|
||||
}
|
||||
|
||||
|
@ -487,9 +582,19 @@ public class RepairOrderAuditServiceImpl implements IRepairOrderAuditService {
|
|||
vo.setApplicantName(applicantName.getUsername());
|
||||
}
|
||||
|
||||
//1、先获取维修模块单
|
||||
RepairOrder repairOrder1 = repairOrderMapper.selectOne(new LambdaQueryWrapper<RepairOrder>()
|
||||
.eq(RepairOrder::getId, item.getRepairOrderId())
|
||||
.eq(RepairOrder::getIsDelete, GlobalConstant.NOT_DELETE));
|
||||
//客户配件采购因子
|
||||
BigDecimal purchaseDivisor = null;
|
||||
//客户名称
|
||||
Client client = clientMapper.selectOne(new LambdaQueryWrapper<Client>()
|
||||
.eq(Client::getId, repairOrder1.getClientId()));
|
||||
purchaseDivisor = client.getPurchaseDivisor(); // 配件采购价格因子
|
||||
|
||||
//配件领用数据
|
||||
Integer number = 0; //领用数量
|
||||
|
||||
List<OrderSparePartListVo> orderSparePartListVoList = new ArrayList<>();
|
||||
List<OrderSparePart> orderSparePartList = orderSparePartMapper.findOrderSparePartByRepairOrderIdAndRepairOrderAuditId(
|
||||
item.getRepairOrderId(),item.getId());
|
||||
|
@ -499,6 +604,17 @@ public class RepairOrderAuditServiceImpl implements IRepairOrderAuditService {
|
|||
orderSparePartListVoList.add(orderSparePartListVo);
|
||||
|
||||
number += orderSparePart.getCount();
|
||||
|
||||
//单位数据获取配件表数据
|
||||
SparePart sparePart = sparePartMapper.selectOne(new LambdaQueryWrapper<SparePart>()
|
||||
.eq(SparePart::getId, orderSparePartListVo.getSparePartsId()));
|
||||
//配件单价 = 客户采购价格因子 * 配件单价
|
||||
DecimalFormat df1 = new DecimalFormat("0.00");
|
||||
BigDecimal unitPrice = null;
|
||||
if(purchaseDivisor != null && sparePart.getUnitPrice() != null){
|
||||
unitPrice = sparePart.getUnitPrice().multiply(purchaseDivisor);
|
||||
}
|
||||
orderSparePartListVo.setUnitPrice(df1.format(unitPrice));
|
||||
}
|
||||
|
||||
vo.setOrderSparePartListVoList(orderSparePartListVoList); //订单配件
|
||||
|
@ -535,6 +651,12 @@ public class RepairOrderAuditServiceImpl implements IRepairOrderAuditService {
|
|||
vo.setWithdrawalImg(repairOrderStepData.getImg());// 退仓申请图片
|
||||
}
|
||||
|
||||
//退仓原因
|
||||
String reasonForWithdrawal = null; // 退仓原因
|
||||
reasonForWithdrawal = "维修了什么?\n1、" + item.getWhatWasRepairedOne() + "\n2、" +
|
||||
item.getWhatWasRepairedTwo() + "\n3、" + item.getWhatWasRepairedThree() + "\n现在遇到了什么问题?\n1、"
|
||||
+ item.getQuestionOne() + "\n2、" + item.getQuestionTwo() + "\n3、" + item.getQuestionThree();
|
||||
vo.setReasonForWithdrawal(reasonForWithdrawal);
|
||||
}
|
||||
|
||||
list.add(vo);
|
||||
|
@ -542,6 +664,7 @@ public class RepairOrderAuditServiceImpl implements IRepairOrderAuditService {
|
|||
|
||||
return PageResult.iPageHandle(iPage.getTotal(), iPage.getCurrent(), iPage.getSize(), list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核
|
||||
*
|
||||
|
@ -568,8 +691,9 @@ public class RepairOrderAuditServiceImpl implements IRepairOrderAuditService {
|
|||
if(model.getReviewRequest() == RepairOrderAuditStatusEnum.APPLICATION_FOR_SCRAP.getStatus()){
|
||||
//报废申请审核
|
||||
if(repairOrderAuditParam.getAuditResult() == RepairOrderAuditStatusEnum.ALREADY_PASSED.getStatus()){
|
||||
//已通过,审核状态为:待入库
|
||||
model.setAuditStatus(RepairOrderAuditStatusEnum.STOCK_PENDING.getStatus());// 审核状态(0=待审核、1=待入库、2=审核未通过、3=已完成,4=待领取、5=待确认)
|
||||
// 已通过,审核状态为:待质检
|
||||
// 审核状态(0=待审核、1=待入库、2=审核未通过、3=已完成,4=待领取、5=待确认、6=已取消、7=待质检、8=质检不通过)
|
||||
model.setAuditStatus(RepairOrderAuditStatusEnum.WAIT_FOR_QUALITY_INSPECTION.getStatus());
|
||||
|
||||
//新增维修单操作记录
|
||||
RepairOrderStepData repairOrderStepData = new RepairOrderStepData();
|
||||
|
@ -583,11 +707,18 @@ public class RepairOrderAuditServiceImpl implements IRepairOrderAuditService {
|
|||
} else if (repairOrderAuditParam.getAuditResult() == RepairOrderAuditStatusEnum.NOT_PASS.getStatus()) {
|
||||
//未通过,审核状态为:审核未通过
|
||||
model.setAuditStatus(RepairOrderAuditStatusEnum.FAIL_THE_AUDIT.getStatus());// 审核状态(0=待审核、1=待入库、2=审核未通过、3=已完成,4=待领取、5=待确认)
|
||||
//报废申请不通过-工单步骤回到故障排查
|
||||
//1、先获取维修模块单
|
||||
repairOrder.setRepairNextStep(RepairOrderStopEnum.TROUBLESHOOTING.getStatus()); // 下个步骤
|
||||
repairOrder.setOrderStatus(RepairOrderStatusEnum.UNDER_INVESTIGATION.getStatus()); // 工单状态为2、排查中
|
||||
repairOrder.setScrapOrNot(null); // 是否报废(0=是,1=否)
|
||||
repairOrderMapper.updateById(repairOrder);
|
||||
|
||||
//新增维修单操作记录
|
||||
RepairOrderStepData repairOrderStepData = new RepairOrderStepData();
|
||||
repairOrderStepData.setRepairOrderId(model.getRepairOrderId());// 维修单id
|
||||
repairOrderStepData.setRemark("管理员【"+AdminThreadLocal.get("username")+"】完成审核,审核结果:不通过,审核意见:"+repairOrderAuditParam.getAuditOpinion());// 备注
|
||||
repairOrderStepData.setTitle("管理员进行审核"); // 标题
|
||||
repairOrderStepData.setTitle("管理员进行报废申请审核"); // 标题
|
||||
repairOrderStepData.setAuditStatus(AuditStateEnum.NOT_PASS_STATE.getStatus()); //审核不通过
|
||||
repairOrderStepData.setCreatorId(Long.valueOf(AdminThreadLocal.getAdminId())); //创建人
|
||||
repairOrderStepData.setCreateTime(new Date()); // 创建时间
|
||||
|
@ -597,7 +728,9 @@ public class RepairOrderAuditServiceImpl implements IRepairOrderAuditService {
|
|||
// 领料申请审核
|
||||
if(repairOrderAuditParam.getAuditResult() == RepairOrderAuditStatusEnum.NOT_PASS.getStatus()){
|
||||
//配件领用审核不通过
|
||||
// RepairOrder repairOrder = repairOrderMapper.findRepairOrderById(model.getRepairOrderId());
|
||||
//未通过,审核状态为:审核未通过
|
||||
model.setAuditStatus(RepairOrderAuditStatusEnum.FAIL_THE_AUDIT.getStatus());// 审核状态(0=待审核、1=待入库、2=审核未通过、3=已完成,4=待领取、5=待确认)
|
||||
|
||||
if(repairOrder != null){
|
||||
repairOrder.setReturnCause(repairOrderAuditParam.getAuditOpinion());
|
||||
repairOrder.setRepairNextStep(RepairOrderStopEnum.RECOLLAR_FITTING.getStatus());//维修单审核不通过步骤为重领配件
|
||||
|
@ -609,7 +742,7 @@ public class RepairOrderAuditServiceImpl implements IRepairOrderAuditService {
|
|||
RepairOrderStepData repairOrderStepData = new RepairOrderStepData();
|
||||
repairOrderStepData.setRepairOrderId(model.getRepairOrderId());// 维修单id
|
||||
repairOrderStepData.setRemark("管理员【"+AdminThreadLocal.get("username")+"】完成审核,审核结果:不通过,审核意见:"+repairOrderAuditParam.getAuditOpinion());// 备注
|
||||
repairOrderStepData.setTitle("管理员进行审核"); // 标题
|
||||
repairOrderStepData.setTitle("管理员进行领料申请审核"); // 标题
|
||||
repairOrderStepData.setAuditStatus(AuditStateEnum.NOT_PASS_STATE.getStatus()); //审核不通过
|
||||
repairOrderStepData.setCreatorId(Long.valueOf(AdminThreadLocal.getAdminId())); //创建人
|
||||
repairOrderStepData.setCreateTime(new Date()); // 创建时间
|
||||
|
@ -638,7 +771,6 @@ public class RepairOrderAuditServiceImpl implements IRepairOrderAuditService {
|
|||
.last("limit 1"));
|
||||
// 出库时需要判断库存数量是否大于出库数量,大于才允许出库;反之,提示备件库存数量不足
|
||||
if (sparePart.getQuantity() >= orderSparePart.getCount()) {
|
||||
/*model.setAuditState(AuditStateEnum.UNREVIEWED.getStatus());*/
|
||||
sparePart.setQuantity(sparePart.getQuantity() - orderSparePart.getCount());
|
||||
} else {
|
||||
throw new OperateException("备件库存数量不足,请联系客服人员!");
|
||||
|
@ -676,6 +808,12 @@ public class RepairOrderAuditServiceImpl implements IRepairOrderAuditService {
|
|||
//未通过,审核状态为:审核未通过
|
||||
model.setAuditStatus(RepairOrderAuditStatusEnum.FAIL_THE_AUDIT.getStatus());// 审核状态(0=待审核、1=待入库、2=审核未通过、3=已完成,4=待领取、5=待确认)
|
||||
|
||||
//良品入库申请不通过-工单步骤回到上传维修前
|
||||
//1、先获取维修模块单信息
|
||||
repairOrder.setRepairNextStep(RepairOrderStopEnum.PRE_MAINTENANCE_IMG.getStatus()); // 下个步骤
|
||||
repairOrder.setOrderStatus(RepairOrderStatusEnum.IN_MAINTENANCE.getStatus()); // 工单状态为 4、维修中
|
||||
repairOrderMapper.updateById(repairOrder);
|
||||
|
||||
//新增维修单操作记录
|
||||
RepairOrderStepData repairOrderStepData = new RepairOrderStepData();
|
||||
repairOrderStepData.setRepairOrderId(model.getRepairOrderId());// 维修单id
|
||||
|
@ -707,6 +845,12 @@ public class RepairOrderAuditServiceImpl implements IRepairOrderAuditService {
|
|||
model.setAuditStatus(RepairOrderAuditStatusEnum.FAIL_THE_AUDIT.getStatus());// 审核状态(0=待审核、1=待入库、2=审核未通过、3=已完成,4=待领取、5=待确认)
|
||||
//申请退仓,是否在退仓中(0=是,1=否)
|
||||
repairOrder.setReturning(RepairOrderStatusEnum.NO.getStatus());
|
||||
|
||||
//如果当前步骤是确认签名,下一个步骤就是重领配件
|
||||
if(repairOrder.getRepairNextStep() == RepairOrderStopEnum.CONFIRMATION_SIGNATURE.getStatus()){
|
||||
repairOrder.setRepairNextStep(RepairOrderStopEnum.RECOLLAR_FITTING.getStatus());// 当前步骤为重领配件
|
||||
}
|
||||
|
||||
repairOrderMapper.updateById(repairOrder);
|
||||
|
||||
//新增维修单操作记录
|
||||
|
@ -753,4 +897,70 @@ public class RepairOrderAuditServiceImpl implements IRepairOrderAuditService {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 质检
|
||||
*
|
||||
* @param repairOrderAuditParam
|
||||
*/
|
||||
@Override
|
||||
public void qualityTesting(RepairOrderAuditParam repairOrderAuditParam) {
|
||||
RepairOrderAudit model = repairOrderAuditMapper.selectOne(
|
||||
new QueryWrapper<RepairOrderAudit>()
|
||||
.eq("id", repairOrderAuditParam.getId())
|
||||
.eq("is_delete", 0)
|
||||
.last("limit 1"));
|
||||
|
||||
Assert.notNull(model, "数据不存在!");
|
||||
|
||||
model.setQualityTestingResult(repairOrderAuditParam.getQualityTestingResult()); // 质检结果(0=通过,1=不通过)
|
||||
model.setQualityTestingId(Long.valueOf(AdminThreadLocal.getAdminId())); // 质检人
|
||||
model.setQualityTestingTime(new Date());// 质检时间
|
||||
model.setQualityTestingOpinion(repairOrderAuditParam.getQualityTestingOpinion()); // 质检意见
|
||||
model.setQualityTestingImg(repairOrderAuditParam.getQualityTestingImg()); // 质检图片
|
||||
|
||||
if(repairOrderAuditParam.getQualityTestingResult() == RepairOrderAuditStatusEnum.ALREADY_PASSED.getStatus()){
|
||||
// 已通过,审核状态为:待入库
|
||||
// 审核状态(0=待审核、1=待入库、2=审核未通过、3=已完成,4=待领取、5=待确认、6=已取消、7=待质检、8=质检不通过)
|
||||
model.setAuditStatus(RepairOrderAuditStatusEnum.STOCK_PENDING.getStatus());
|
||||
|
||||
//新增维修单操作记录
|
||||
RepairOrderStepData repairOrderStepData = new RepairOrderStepData();
|
||||
repairOrderStepData.setRepairOrderId(model.getRepairOrderId());// 维修单id
|
||||
repairOrderStepData.setImg(repairOrderAuditParam.getQualityTestingImg()); // 质检图片
|
||||
repairOrderStepData.setRemark("管理员【"+AdminThreadLocal.get("username")+"】完成质检,质检通过");// 备注
|
||||
repairOrderStepData.setTitle("管理员进行报废申请质检"); // 标题
|
||||
repairOrderStepData.setAuditStatus(AuditStateEnum.ALREADY_PASSED.getStatus()); //审核通过
|
||||
repairOrderStepData.setCreatorId(Long.valueOf(AdminThreadLocal.getAdminId())); //创建人
|
||||
repairOrderStepData.setCreateTime(new Date()); // 创建时间
|
||||
repairOrderStepDataMapper.insert(repairOrderStepData);
|
||||
|
||||
} else if (repairOrderAuditParam.getQualityTestingResult() == RepairOrderAuditStatusEnum.NOT_PASS.getStatus()) {
|
||||
// 未通过,审核状态为:质检不通过
|
||||
// 审核状态(0=待审核、1=待入库、2=审核未通过、3=已完成,4=待领取、5=待确认、6=已取消、7=待质检、8=质检不通过)
|
||||
model.setAuditStatus(RepairOrderAuditStatusEnum.FAILURE_OF_QUALITY_INSPECTION.getStatus());
|
||||
//报废申请不通过-工单步骤回到故障排查
|
||||
//1、先获取维修模块单
|
||||
RepairOrder repairOrder1 = repairOrderMapper.selectOne(new LambdaQueryWrapper<RepairOrder>()
|
||||
.eq(RepairOrder::getId, model.getRepairOrderId())
|
||||
.eq(RepairOrder::getIsDelete, GlobalConstant.NOT_DELETE));
|
||||
repairOrder1.setRepairNextStep(RepairOrderStopEnum.TROUBLESHOOTING.getStatus()); // 下个步骤
|
||||
repairOrder1.setOrderStatus(RepairOrderStatusEnum.UNDER_INVESTIGATION.getStatus()); // 工单状态为2、排查中
|
||||
repairOrder1.setScrapOrNot(null); // 是否报废(0=是,1=否)
|
||||
repairOrderMapper.updateById(repairOrder1);
|
||||
|
||||
//新增维修单操作记录
|
||||
RepairOrderStepData repairOrderStepData = new RepairOrderStepData();
|
||||
repairOrderStepData.setRepairOrderId(model.getRepairOrderId());// 维修单id
|
||||
repairOrderStepData.setImg(repairOrderAuditParam.getQualityTestingImg()); // 质检图片
|
||||
repairOrderStepData.setRemark("管理员【"+AdminThreadLocal.get("username")+"】完成质检,质检结果:不通过,质检意见:"+repairOrderAuditParam.getQualityTestingOpinion());
|
||||
repairOrderStepData.setTitle("管理员进行报废申请质检"); // 标题
|
||||
repairOrderStepData.setAuditStatus(AuditStateEnum.NOT_PASS_STATE.getStatus()); //审核不通过
|
||||
repairOrderStepData.setCreatorId(Long.valueOf(AdminThreadLocal.getAdminId())); //创建人
|
||||
repairOrderStepData.setCreateTime(new Date()); // 创建时间
|
||||
repairOrderStepDataMapper.insert(repairOrderStepData);
|
||||
}
|
||||
|
||||
repairOrderAuditMapper.updateById(model);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -85,6 +85,7 @@ import java.io.UnsupportedEncodingException;
|
|||
import java.math.BigDecimal;
|
||||
import java.net.URL;
|
||||
import java.net.URLEncoder;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
@ -234,28 +235,36 @@ public class RepairOrderServiceImpl implements IRepairOrderService {
|
|||
//返回维修前照片
|
||||
RepairOrderStepData preMaintenanceImg = repairOrderStepDataMapper.selectOne(new LambdaQueryWrapper<RepairOrderStepData>()
|
||||
.eq(RepairOrderStepData::getRepairOrderId, item.getId())
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.PRE_MAINTENANCE_IMG.getStatus()));
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.PRE_MAINTENANCE_IMG.getStatus())
|
||||
.orderByDesc(RepairOrderStepData::getCreateTime)
|
||||
.last("limit 1"));
|
||||
if(preMaintenanceImg != null){
|
||||
vo.setPreMaintenanceImg(preMaintenanceImg.getImg());
|
||||
}
|
||||
//返回维修中照片
|
||||
RepairOrderStepData inMaintenanceImg = repairOrderStepDataMapper.selectOne(new LambdaQueryWrapper<RepairOrderStepData>()
|
||||
.eq(RepairOrderStepData::getRepairOrderId, item.getId())
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.IN_MAINTENANCE_IMG.getStatus()));
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.IN_MAINTENANCE_IMG.getStatus())
|
||||
.orderByDesc(RepairOrderStepData::getCreateTime)
|
||||
.last("limit 1"));
|
||||
if(inMaintenanceImg != null){
|
||||
vo.setInMaintenanceImg(inMaintenanceImg.getImg());
|
||||
}
|
||||
//返回维修后照片
|
||||
RepairOrderStepData afterRepairImg = repairOrderStepDataMapper.selectOne(new LambdaQueryWrapper<RepairOrderStepData>()
|
||||
.eq(RepairOrderStepData::getRepairOrderId, item.getId())
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.AFTER_REPAIR_IMG.getStatus()));
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.AFTER_REPAIR_IMG.getStatus())
|
||||
.orderByDesc(RepairOrderStepData::getCreateTime)
|
||||
.last("limit 1"));
|
||||
if(afterRepairImg != null){
|
||||
vo.setAfterRepairImg(afterRepairImg.getImg());
|
||||
}
|
||||
//返回故障点照片 faultPointImg; // 故障点照片
|
||||
RepairOrderStepData troubleshooting = repairOrderStepDataMapper.selectOne(new LambdaQueryWrapper<RepairOrderStepData>()
|
||||
.eq(RepairOrderStepData::getRepairOrderId, item.getId())
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.TROUBLESHOOTING.getStatus()));
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.TROUBLESHOOTING.getStatus())
|
||||
.orderByDesc(RepairOrderStepData::getCreateTime)
|
||||
.last("limit 1"));
|
||||
if(troubleshooting != null){
|
||||
vo.setFaultPointImg(troubleshooting.getImg());
|
||||
}
|
||||
|
@ -293,7 +302,9 @@ public class RepairOrderServiceImpl implements IRepairOrderService {
|
|||
if(model.getOrderStatus() == RepairOrderStatusEnum.FINISHED.getStatus()){
|
||||
RepairOrderStepData stepData = repairOrderStepDataMapper.selectOne(new LambdaQueryWrapper<RepairOrderStepData>()
|
||||
.eq(RepairOrderStepData::getRepairOrderId, model.getId())
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.GOOD_PRODUCTS_ARE_STORED.getStatus()));
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.GOOD_PRODUCTS_ARE_STORED.getStatus())
|
||||
.orderByDesc(RepairOrderStepData::getCreateTime)
|
||||
.last("limit 1"));
|
||||
if(stepData != null){
|
||||
vo.setImg(stepData.getImg());
|
||||
vo.setEnterRemark(stepData.getRemark());
|
||||
|
@ -305,6 +316,8 @@ public class RepairOrderServiceImpl implements IRepairOrderService {
|
|||
ParentRepairOrder parentRepairOrder = parentRepairOrderMapper.selectOne(new LambdaQueryWrapper<ParentRepairOrder>()
|
||||
.eq(ParentRepairOrder::getId, model.getParentRepairOrderId()));
|
||||
vo.setOrderNo(parentRepairOrder.getOrderNo());
|
||||
//客户配件采购因子
|
||||
BigDecimal purchaseDivisor = null;
|
||||
|
||||
//客户名称 负责人 联系电话
|
||||
Client clientName = clientMapper.selectOne(
|
||||
|
@ -315,6 +328,7 @@ public class RepairOrderServiceImpl implements IRepairOrderService {
|
|||
vo.setDirector(clientName.getDirector());
|
||||
vo.setPhone(clientName.getPhone());
|
||||
vo.setMaintainType(clientName.getMaintainType());
|
||||
purchaseDivisor = clientName.getPurchaseDivisor(); // 配件采购价格因子
|
||||
}
|
||||
//创建人名称
|
||||
User creatorName = userMapper.selectOne(
|
||||
|
@ -391,7 +405,8 @@ public class RepairOrderServiceImpl implements IRepairOrderService {
|
|||
}
|
||||
//设置配件清单
|
||||
List<OrderSparePart> orderSpareParts = orderSparePartMapper.selectList(new LambdaQueryWrapper<OrderSparePart>()
|
||||
.eq(OrderSparePart::getRepairOrderId, model.getId()));
|
||||
.eq(OrderSparePart::getRepairOrderId, model.getId())
|
||||
.eq(OrderSparePart::getIsDelete, GlobalConstant.NOT_DELETE));
|
||||
List<OrderSparePartListVo> orderSparePartListVos = new ArrayList<>();
|
||||
for (OrderSparePart item : orderSpareParts) {
|
||||
OrderSparePartListVo orderSparePartListVo = new OrderSparePartListVo();
|
||||
|
@ -400,6 +415,18 @@ public class RepairOrderServiceImpl implements IRepairOrderService {
|
|||
Warehouse warehouse = warehouseMapper.selectOne(new LambdaQueryWrapper<Warehouse>()
|
||||
.eq(Warehouse::getId, item.getWarehouseId()));
|
||||
orderSparePartListVo.setWarehouseName(warehouse.getWarehouseName());
|
||||
|
||||
//单位数据获取配件表数据
|
||||
SparePart sparePart = sparePartMapper.selectOne(new LambdaQueryWrapper<SparePart>()
|
||||
.eq(SparePart::getId, item.getSparePartsId()));
|
||||
//配件单价 = 客户采购价格因子 * 配件单价
|
||||
DecimalFormat df1 = new DecimalFormat("0.00");
|
||||
BigDecimal unitPrice = null;
|
||||
if(purchaseDivisor != null && sparePart.getUnitPrice() != null){
|
||||
unitPrice = sparePart.getUnitPrice().multiply(purchaseDivisor);
|
||||
}
|
||||
orderSparePartListVo.setUnitPrice(df1.format(unitPrice));
|
||||
|
||||
orderSparePartListVos.add(orderSparePartListVo);
|
||||
}
|
||||
vo.setSparePartList(orderSparePartListVos);
|
||||
|
@ -477,21 +504,27 @@ public class RepairOrderServiceImpl implements IRepairOrderService {
|
|||
//返回维修前照片
|
||||
RepairOrderStepData preMaintenanceImg = repairOrderStepDataMapper.selectOne(new LambdaQueryWrapper<RepairOrderStepData>()
|
||||
.eq(RepairOrderStepData::getRepairOrderId, model.getId())
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.PRE_MAINTENANCE_IMG.getStatus()));
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.PRE_MAINTENANCE_IMG.getStatus())
|
||||
.orderByDesc(RepairOrderStepData::getCreateTime)
|
||||
.last("limit 1"));
|
||||
if(preMaintenanceImg != null){
|
||||
vo.setPreMaintenanceImg(preMaintenanceImg.getImg());
|
||||
}
|
||||
//返回维修中照片
|
||||
RepairOrderStepData inMaintenanceImg = repairOrderStepDataMapper.selectOne(new LambdaQueryWrapper<RepairOrderStepData>()
|
||||
.eq(RepairOrderStepData::getRepairOrderId, model.getId())
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.IN_MAINTENANCE_IMG.getStatus()));
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.IN_MAINTENANCE_IMG.getStatus())
|
||||
.orderByDesc(RepairOrderStepData::getCreateTime)
|
||||
.last("limit 1"));
|
||||
if(inMaintenanceImg != null){
|
||||
vo.setInMaintenanceImg(inMaintenanceImg.getImg());
|
||||
}
|
||||
//返回维修后照片
|
||||
RepairOrderStepData afterRepairImg = repairOrderStepDataMapper.selectOne(new LambdaQueryWrapper<RepairOrderStepData>()
|
||||
.eq(RepairOrderStepData::getRepairOrderId, model.getId())
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.AFTER_REPAIR_IMG.getStatus()));
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.AFTER_REPAIR_IMG.getStatus())
|
||||
.orderByDesc(RepairOrderStepData::getCreateTime)
|
||||
.last("limit 1"));
|
||||
if(afterRepairImg != null){
|
||||
vo.setAfterRepairImg(afterRepairImg.getImg());
|
||||
}
|
||||
|
@ -507,7 +540,8 @@ public class RepairOrderServiceImpl implements IRepairOrderService {
|
|||
|
||||
//配件编码
|
||||
List<OrderPartCode> orderPartCodes = orderPartCodeMapper.selectList(new LambdaQueryWrapper<OrderPartCode>()
|
||||
.eq(OrderPartCode::getRepairOrderId, vo.getId()));
|
||||
.eq(OrderPartCode::getRepairOrderId, vo.getId())
|
||||
.eq(OrderPartCode::getIsDelete, GlobalConstant.NOT_DELETE));
|
||||
if(orderPartCodes != null){
|
||||
vo.setOrderPartCodeList(orderPartCodes);
|
||||
}
|
||||
|
@ -554,7 +588,11 @@ public class RepairOrderServiceImpl implements IRepairOrderService {
|
|||
// 维修信息
|
||||
RepairOrderAudit repairOrderAudit1 = repairOrderAuditMapper.selectOne(new LambdaQueryWrapper<RepairOrderAudit>()
|
||||
.eq(RepairOrderAudit::getRepairOrderId, model.getId())
|
||||
.in(RepairOrderAudit::getReviewRequest, Arrays.asList(RepairOrderAuditStatusEnum.GOOD_PRODUCTS_ARE_STORED.getStatus(),RepairOrderAuditStatusEnum.FILL_IN_MAINTENANCE_INFORMATION.getStatus())));
|
||||
.in(RepairOrderAudit::getReviewRequest, Arrays.asList(RepairOrderAuditStatusEnum.GOOD_PRODUCTS_ARE_STORED.getStatus(),
|
||||
RepairOrderAuditStatusEnum.FILL_IN_MAINTENANCE_INFORMATION.getStatus()))
|
||||
.eq(RepairOrderAudit::getIsDelete, GlobalConstant.NOT_DELETE)
|
||||
.orderByDesc(RepairOrderAudit::getCreateTime)
|
||||
.last("limit 1"));
|
||||
if(repairOrderAudit1 != null){
|
||||
RepairOrderAuditListVo repairOrderAuditListVo = new RepairOrderAuditListVo();
|
||||
BeanUtils.copyProperties(repairOrderAudit1,repairOrderAuditListVo);
|
||||
|
@ -593,6 +631,18 @@ public class RepairOrderServiceImpl implements IRepairOrderService {
|
|||
for (OrderSparePartUse orderSparePartUs : orderSparePartUses) {
|
||||
OrderSparePartUseVo ospUserVo = new OrderSparePartUseVo();
|
||||
BeanUtils.copyProperties(orderSparePartUs,ospUserVo);
|
||||
|
||||
//单位数据获取配件表数据
|
||||
SparePart sparePart = sparePartMapper.selectOne(new LambdaQueryWrapper<SparePart>()
|
||||
.eq(SparePart::getId, orderSparePartUs.getSparePartsId()));
|
||||
//配件单价 = 客户采购价格因子 * 配件单价
|
||||
DecimalFormat df1 = new DecimalFormat("0.00");
|
||||
BigDecimal unitPrice = null;
|
||||
if(purchaseDivisor != null && sparePart.getUnitPrice() != null){
|
||||
unitPrice = sparePart.getUnitPrice().multiply(purchaseDivisor);
|
||||
}
|
||||
ospUserVo.setUnitPrice(df1.format(unitPrice));
|
||||
|
||||
ospUserVoList.add(ospUserVo);
|
||||
}
|
||||
repairOrderAuditListVo.setPartsUseList(ospUserVoList);
|
||||
|
@ -620,6 +670,18 @@ public class RepairOrderServiceImpl implements IRepairOrderService {
|
|||
for (OrderSparePartUse orderSparePartUs : orderSparePartUses) {
|
||||
OrderSparePartUseVo ospUserVo = new OrderSparePartUseVo();
|
||||
BeanUtils.copyProperties(orderSparePartUs,ospUserVo);
|
||||
|
||||
//单位数据获取配件表数据
|
||||
SparePart sparePart = sparePartMapper.selectOne(new LambdaQueryWrapper<SparePart>()
|
||||
.eq(SparePart::getId, orderSparePartUs.getSparePartsId()));
|
||||
//配件单价 = 客户采购价格因子 * 配件单价
|
||||
DecimalFormat df1 = new DecimalFormat("0.00");
|
||||
BigDecimal unitPrice = null;
|
||||
if(purchaseDivisor != null && sparePart.getUnitPrice() != null){
|
||||
unitPrice = sparePart.getUnitPrice().multiply(purchaseDivisor);
|
||||
}
|
||||
ospUserVo.setUnitPrice(df1.format(unitPrice));
|
||||
|
||||
ospUserVoList.add(ospUserVo);
|
||||
}
|
||||
repairOrderAuditListVo.setPartsUseList(ospUserVoList);
|
||||
|
@ -1129,11 +1191,14 @@ public class RepairOrderServiceImpl implements IRepairOrderService {
|
|||
.eq(SystemAuthAdmin::getId, repairOrderParam.getReceiverId()));
|
||||
|
||||
//第一次派单维修人员为空,就将第一次派单的人给原维修人员,第二次就获取第一次的维修员为原维修人员
|
||||
if(repairOrder.getReceiverId() == null){
|
||||
if(repairOrder.getReceiverId() == null && repairOrder.getPreviousMaintenanceStaffId() == null){
|
||||
repairOrder.setPreviousMaintenanceStaffId(repairOrderParam.getReceiverId()); // 原维修人员id
|
||||
}else{
|
||||
}else if(repairOrder.getPreviousMaintenanceStaffId() == null){
|
||||
repairOrder.setPreviousMaintenanceStaffId(repairOrder.getReceiverId());
|
||||
}
|
||||
// else{
|
||||
// repairOrder.setPreviousMaintenanceStaffId(repairOrder.getReceiverId());
|
||||
// }
|
||||
|
||||
repairOrder.setReceiverId(repairOrderParam.getReceiverId()); // 接单人id
|
||||
repairOrder.setReceiverTime(new Date());//receiverTime; // 接单时间
|
||||
|
@ -1452,21 +1517,27 @@ public class RepairOrderServiceImpl implements IRepairOrderService {
|
|||
//返回维修前照片
|
||||
RepairOrderStepData preMaintenanceImg = repairOrderStepDataMapper.selectOne(new LambdaQueryWrapper<RepairOrderStepData>()
|
||||
.eq(RepairOrderStepData::getRepairOrderId, item.getId())
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.PRE_MAINTENANCE_IMG.getStatus()));
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.PRE_MAINTENANCE_IMG.getStatus())
|
||||
.orderByDesc(RepairOrderStepData::getCreateTime)
|
||||
.last("limit 1"));
|
||||
if(preMaintenanceImg != null){
|
||||
vo.setRepairFront(preMaintenanceImg.getImg());
|
||||
}
|
||||
//返回维修中照片
|
||||
RepairOrderStepData inMaintenanceImg = repairOrderStepDataMapper.selectOne(new LambdaQueryWrapper<RepairOrderStepData>()
|
||||
.eq(RepairOrderStepData::getRepairOrderId, item.getId())
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.IN_MAINTENANCE_IMG.getStatus()));
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.IN_MAINTENANCE_IMG.getStatus())
|
||||
.orderByDesc(RepairOrderStepData::getCreateTime)
|
||||
.last("limit 1"));
|
||||
if(inMaintenanceImg != null){
|
||||
vo.setRepairIng(inMaintenanceImg.getImg());
|
||||
}
|
||||
//返回维修后照片
|
||||
RepairOrderStepData afterRepairImg = repairOrderStepDataMapper.selectOne(new LambdaQueryWrapper<RepairOrderStepData>()
|
||||
.eq(RepairOrderStepData::getRepairOrderId, item.getId())
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.AFTER_REPAIR_IMG.getStatus()));
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.AFTER_REPAIR_IMG.getStatus())
|
||||
.orderByDesc(RepairOrderStepData::getCreateTime)
|
||||
.last("limit 1"));
|
||||
if(afterRepairImg != null){
|
||||
vo.setRepairBack(afterRepairImg.getImg());
|
||||
}
|
||||
|
@ -1592,6 +1663,7 @@ public class RepairOrderServiceImpl implements IRepairOrderService {
|
|||
repairOrderDto.setMaintenanceResult(RepairOrderStatusEnum.OK.getStatus());
|
||||
|
||||
List<RepairOrderDto> repairOrderDtoList = repairOrderMapper.maintenanceReportExcel(repairOrderDto);
|
||||
|
||||
for(RepairOrderDto item : repairOrderDtoList) {
|
||||
NormalMaintenanceExcel vo = new NormalMaintenanceExcel();
|
||||
BeanUtils.copyProperties(item, vo);
|
||||
|
@ -1627,7 +1699,9 @@ public class RepairOrderServiceImpl implements IRepairOrderService {
|
|||
//返回维修前照片
|
||||
RepairOrderStepData preMaintenanceImg = repairOrderStepDataMapper.selectOne(new LambdaQueryWrapper<RepairOrderStepData>()
|
||||
.eq(RepairOrderStepData::getRepairOrderId, item.getId())
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.PRE_MAINTENANCE_IMG.getStatus()));
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.PRE_MAINTENANCE_IMG.getStatus())
|
||||
.orderByDesc(RepairOrderStepData::getCreateTime)
|
||||
.last("limit 1"));
|
||||
if(preMaintenanceImg != null){
|
||||
try{
|
||||
List<URL> imgList1 = new ArrayList<>();
|
||||
|
@ -1646,7 +1720,9 @@ public class RepairOrderServiceImpl implements IRepairOrderService {
|
|||
//返回维修中照片
|
||||
RepairOrderStepData inMaintenanceImg = repairOrderStepDataMapper.selectOne(new LambdaQueryWrapper<RepairOrderStepData>()
|
||||
.eq(RepairOrderStepData::getRepairOrderId, item.getId())
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.IN_MAINTENANCE_IMG.getStatus()));
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.IN_MAINTENANCE_IMG.getStatus())
|
||||
.orderByDesc(RepairOrderStepData::getCreateTime)
|
||||
.last("limit 1"));
|
||||
if(inMaintenanceImg != null){
|
||||
try{
|
||||
List<URL> imgList1 = new ArrayList<>();
|
||||
|
@ -1664,7 +1740,9 @@ public class RepairOrderServiceImpl implements IRepairOrderService {
|
|||
//返回维修后照片
|
||||
RepairOrderStepData afterRepairImg = repairOrderStepDataMapper.selectOne(new LambdaQueryWrapper<RepairOrderStepData>()
|
||||
.eq(RepairOrderStepData::getRepairOrderId, item.getId())
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.AFTER_REPAIR_IMG.getStatus()));
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.AFTER_REPAIR_IMG.getStatus())
|
||||
.orderByDesc(RepairOrderStepData::getCreateTime)
|
||||
.last("limit 1"));
|
||||
if(afterRepairImg != null){
|
||||
try{
|
||||
List<URL> imgList1 = new ArrayList<>();
|
||||
|
@ -1680,6 +1758,14 @@ public class RepairOrderServiceImpl implements IRepairOrderService {
|
|||
}
|
||||
}
|
||||
|
||||
//设置客户信息
|
||||
Client client = clientMapper.findClientById(item.getClientId());
|
||||
//客户配件采购因子
|
||||
BigDecimal purchaseDivisor = null;
|
||||
if(client != null){
|
||||
purchaseDivisor = client.getPurchaseDivisor(); // 配件采购价格因子
|
||||
}
|
||||
|
||||
/*
|
||||
更换明细 replacementDetail
|
||||
更换损坏器件明细
|
||||
|
@ -1695,9 +1781,19 @@ public class RepairOrderServiceImpl implements IRepairOrderService {
|
|||
if (sb.length() > 0) {
|
||||
sb.append(";");
|
||||
}
|
||||
//获取当前配件单价
|
||||
SparePart sparePart = sparePartMapper.selectOne(new LambdaQueryWrapper<SparePart>()
|
||||
.eq(SparePart::getId, orderSparePartUs.getSparePartsId()));
|
||||
//配件单价 = 客户采购价格因子 * 配件单价
|
||||
DecimalFormat df1 = new DecimalFormat("0.00");
|
||||
BigDecimal unitPrice = null;
|
||||
if(purchaseDivisor != null && sparePart.getUnitPrice() != null){
|
||||
unitPrice = sparePart.getUnitPrice().multiply(purchaseDivisor);
|
||||
}
|
||||
sb.append(orderSparePartUs.getRepairMotherboard()).append(":").append(orderSparePartUs.getMaterialPositionNumber()).append(" * ")
|
||||
.append(orderSparePartUs.getSparePartsCode()).append(" * ").append(orderSparePartUs.getSparePartsName()).append(" * ")
|
||||
.append(orderSparePartUs.getSpecificationsModel()).append(" * ").append(orderSparePartUs.getUseNumber());
|
||||
.append(orderSparePartUs.getSpecificationsModel()).append(" * ").append(orderSparePartUs.getUseNumber()).append(" * ")
|
||||
.append(df1.format(unitPrice));
|
||||
}
|
||||
// 将数据转换为指定格式的字符串
|
||||
String detail = sb.toString();
|
||||
|
@ -1752,7 +1848,9 @@ public class RepairOrderServiceImpl implements IRepairOrderService {
|
|||
//返回维修前照片
|
||||
RepairOrderStepData preMaintenanceImg = repairOrderStepDataMapper.selectOne(new LambdaQueryWrapper<RepairOrderStepData>()
|
||||
.eq(RepairOrderStepData::getRepairOrderId, item.getId())
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.PRE_MAINTENANCE_IMG.getStatus()));
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.PRE_MAINTENANCE_IMG.getStatus())
|
||||
.orderByDesc(RepairOrderStepData::getCreateTime)
|
||||
.last("limit 1"));
|
||||
if(preMaintenanceImg != null){
|
||||
try{
|
||||
List<URL> imgList1 = new ArrayList<>();
|
||||
|
@ -1771,7 +1869,9 @@ public class RepairOrderServiceImpl implements IRepairOrderService {
|
|||
//返回维修中照片
|
||||
RepairOrderStepData inMaintenanceImg = repairOrderStepDataMapper.selectOne(new LambdaQueryWrapper<RepairOrderStepData>()
|
||||
.eq(RepairOrderStepData::getRepairOrderId, item.getId())
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.IN_MAINTENANCE_IMG.getStatus()));
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.IN_MAINTENANCE_IMG.getStatus())
|
||||
.orderByDesc(RepairOrderStepData::getCreateTime)
|
||||
.last("limit 1"));
|
||||
if(inMaintenanceImg != null){
|
||||
try{
|
||||
List<URL> imgList1 = new ArrayList<>();
|
||||
|
@ -1789,7 +1889,9 @@ public class RepairOrderServiceImpl implements IRepairOrderService {
|
|||
//返回维修后照片
|
||||
RepairOrderStepData afterRepairImg = repairOrderStepDataMapper.selectOne(new LambdaQueryWrapper<RepairOrderStepData>()
|
||||
.eq(RepairOrderStepData::getRepairOrderId, item.getId())
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.AFTER_REPAIR_IMG.getStatus()));
|
||||
.eq(RepairOrderStepData::getRepairStep, RepairOrderStopEnum.AFTER_REPAIR_IMG.getStatus())
|
||||
.orderByDesc(RepairOrderStepData::getCreateTime)
|
||||
.last("limit 1"));
|
||||
if(afterRepairImg != null){
|
||||
try{
|
||||
List<URL> imgList1 = new ArrayList<>();
|
||||
|
@ -1804,7 +1906,13 @@ public class RepairOrderServiceImpl implements IRepairOrderService {
|
|||
System.out.println("导出异常");
|
||||
}
|
||||
}
|
||||
|
||||
//设置客户信息
|
||||
Client client = clientMapper.findClientById(item.getClientId());
|
||||
//客户配件采购因子
|
||||
BigDecimal purchaseDivisor = null;
|
||||
if(client != null){
|
||||
purchaseDivisor = client.getPurchaseDivisor(); // 配件采购价格因子
|
||||
}
|
||||
/*
|
||||
更换明细 replacementDetail
|
||||
更换损坏器件明细
|
||||
|
@ -1820,9 +1928,19 @@ public class RepairOrderServiceImpl implements IRepairOrderService {
|
|||
if (sb.length() > 0) {
|
||||
sb.append(";");
|
||||
}
|
||||
//获取当前配件单价
|
||||
SparePart sparePart = sparePartMapper.selectOne(new LambdaQueryWrapper<SparePart>()
|
||||
.eq(SparePart::getId, orderSparePartUs.getSparePartsId()));
|
||||
//配件单价 = 客户采购价格因子 * 配件单价
|
||||
DecimalFormat df1 = new DecimalFormat("0.00");
|
||||
BigDecimal unitPrice = null;
|
||||
if(purchaseDivisor != null && sparePart.getUnitPrice() != null){
|
||||
unitPrice = sparePart.getUnitPrice().multiply(purchaseDivisor);
|
||||
}
|
||||
sb.append(orderSparePartUs.getRepairMotherboard()).append(":").append(orderSparePartUs.getMaterialPositionNumber()).append(" * ")
|
||||
.append(orderSparePartUs.getSparePartsCode()).append(" * ").append(orderSparePartUs.getSparePartsName()).append(" * ")
|
||||
.append(orderSparePartUs.getSpecificationsModel()).append(" * ").append(orderSparePartUs.getUseNumber());
|
||||
.append(orderSparePartUs.getSpecificationsModel()).append(" * ").append(orderSparePartUs.getUseNumber()).append(" * ")
|
||||
.append(df1.format(unitPrice));
|
||||
}
|
||||
// 将数据转换为指定格式的字符串
|
||||
String detail = sb.toString();
|
||||
|
@ -2000,6 +2118,17 @@ public class RepairOrderServiceImpl implements IRepairOrderService {
|
|||
.eq(OrderSparePart::getRepairOrderAuditId, repairOrderParam.getRepairOrderAuditId())
|
||||
.eq(OrderSparePart::getIsDelete, GlobalConstant.NOT_DELETE));
|
||||
|
||||
//客户配件采购因子
|
||||
BigDecimal purchaseDivisor = null;
|
||||
//维修工单信息
|
||||
RepairOrder repairOrder = repairOrderMapper.selectOne(new LambdaQueryWrapper<RepairOrder>()
|
||||
.eq(RepairOrder::getId, repairOrderParam.getId()));
|
||||
//客户信息
|
||||
Client client = clientMapper.selectOne(new LambdaQueryWrapper<Client>()
|
||||
.eq(Client::getId, repairOrder.getClientId()));
|
||||
purchaseDivisor = client.getPurchaseDivisor(); // 配件采购价格因子
|
||||
|
||||
|
||||
List<OrderSparePartListVo> orderSparePartListVos = new ArrayList<>();
|
||||
for (OrderSparePart item : orderSpareParts) {
|
||||
OrderSparePartListVo orderSparePartListVo = new OrderSparePartListVo();
|
||||
|
@ -2008,10 +2137,68 @@ public class RepairOrderServiceImpl implements IRepairOrderService {
|
|||
Warehouse warehouse = warehouseMapper.selectOne(new LambdaQueryWrapper<Warehouse>()
|
||||
.eq(Warehouse::getId, item.getWarehouseId()));
|
||||
orderSparePartListVo.setWarehouseName(warehouse.getWarehouseName());
|
||||
|
||||
//单位数据获取配件表数据
|
||||
SparePart sparePart = sparePartMapper.selectOne(new LambdaQueryWrapper<SparePart>()
|
||||
.eq(SparePart::getId, item.getSparePartsId()));
|
||||
//配件单价 = 客户采购价格因子 * 配件单价
|
||||
DecimalFormat df1 = new DecimalFormat("0.00");
|
||||
BigDecimal unitPrice = null;
|
||||
if(purchaseDivisor != null && sparePart.getUnitPrice() != null){
|
||||
unitPrice = sparePart.getUnitPrice().multiply(purchaseDivisor);
|
||||
}
|
||||
orderSparePartListVo.setUnitPrice(df1.format(unitPrice));
|
||||
|
||||
orderSparePartListVos.add(orderSparePartListVo);
|
||||
}
|
||||
|
||||
return orderSparePartListVos;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据工单号和审核id查出使用配件列表
|
||||
*
|
||||
* @param repairOrderParam
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<OrderSparePartUseListVo> partsUseList(RepairOrderParam repairOrderParam) {
|
||||
//根据工单号和审核id查出配件列表
|
||||
List<OrderSparePartUse> orderSparePartsUse = orderSparePartUseMapper.selectList(new LambdaQueryWrapper<OrderSparePartUse>()
|
||||
.eq(OrderSparePartUse::getRepairOrderId, repairOrderParam.getId())
|
||||
.eq(OrderSparePartUse::getRepairOrderAuditId, repairOrderParam.getRepairOrderAuditId())
|
||||
.eq(OrderSparePartUse::getIsDelete, GlobalConstant.NOT_DELETE));
|
||||
|
||||
//客户配件采购因子
|
||||
BigDecimal purchaseDivisor = null;
|
||||
//维修工单信息
|
||||
RepairOrder repairOrder = repairOrderMapper.selectOne(new LambdaQueryWrapper<RepairOrder>()
|
||||
.eq(RepairOrder::getId, repairOrderParam.getId()));
|
||||
//客户信息
|
||||
Client client = clientMapper.selectOne(new LambdaQueryWrapper<Client>()
|
||||
.eq(Client::getId, repairOrder.getClientId()));
|
||||
purchaseDivisor = client.getPurchaseDivisor(); // 配件采购价格因子
|
||||
|
||||
|
||||
List<OrderSparePartUseListVo> orderSparePartUseListVos = new ArrayList<>();
|
||||
for (OrderSparePartUse item : orderSparePartsUse) {
|
||||
OrderSparePartUseListVo orderSparePartUseListVo = new OrderSparePartUseListVo();
|
||||
BeanUtils.copyProperties(item, orderSparePartUseListVo);
|
||||
//单位数据获取配件表数据
|
||||
SparePart sparePart = sparePartMapper.selectOne(new LambdaQueryWrapper<SparePart>()
|
||||
.eq(SparePart::getId, item.getSparePartsId()));
|
||||
//配件单价 = 客户采购价格因子 * 配件单价
|
||||
DecimalFormat df1 = new DecimalFormat("0.00");
|
||||
BigDecimal unitPrice = null;
|
||||
if(purchaseDivisor != null && sparePart.getUnitPrice() != null){
|
||||
unitPrice = sparePart.getUnitPrice().multiply(purchaseDivisor);
|
||||
}
|
||||
orderSparePartUseListVo.setUnitPrice(df1.format(unitPrice));
|
||||
|
||||
orderSparePartUseListVos.add(orderSparePartUseListVo);
|
||||
}
|
||||
|
||||
return orderSparePartUseListVos;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -570,6 +570,7 @@ public class RepairOrderShippingServiceImpl implements IRepairOrderShippingServi
|
|||
releaseRecordListExcel.getRemarkMap().put(RepairOrderStatusEnum.EMPTY.getDesc()
|
||||
,releaseRecordListExcel.getRemarkMap().get(RepairOrderStatusEnum.EMPTY.getDesc()) == null ? 1 : releaseRecordListExcel.getRemarkMap().get(RepairOrderStatusEnum.EMPTY.getDesc()) + 1);
|
||||
}
|
||||
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (String flag : releaseRecordListExcel.getRemarkMap().keySet()) {
|
||||
if(RepairOrderStatusEnum.SCRAP.getDesc().equals(flag)){
|
||||
|
|
|
@ -303,7 +303,8 @@ public class SparePartServiceImpl implements ISparePartService {
|
|||
queryWrapper.or();
|
||||
queryWrapper.like("spare_parts_name", pageDto.getLikeWork());
|
||||
}
|
||||
|
||||
//出库和调拨,选配件的时候,库存数量为0的不应出现 查询要加个字段
|
||||
queryWrapper.ne("quantity", 0);
|
||||
queryWrapper.eq("is_delete", 0);
|
||||
queryWrapper.orderByDesc("id");
|
||||
|
||||
|
@ -352,11 +353,11 @@ public class SparePartServiceImpl implements ISparePartService {
|
|||
|
||||
//出库和调拨,选配件的时候,库存数量为0的不应出现 查询要加个字段
|
||||
String s = params.get("outAllotType");
|
||||
if(s != null && s.equals("0") && item.getQuantity() == 0){
|
||||
System.out.println("出库和调拨时,库存数量为0的不应出现!!!");
|
||||
}else{
|
||||
// if(s != null && s.equals("0") && item.getQuantity() == 0){
|
||||
// System.out.println("出库和调拨时,库存数量为0的不应出现!!!");
|
||||
// }else{
|
||||
list.add(vo);
|
||||
}
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -466,6 +466,7 @@ public class SparePartStockAuditServiceImpl implements ISparePartStockAuditServi
|
|||
sparePartAudit.setStockAuditId(model.getId());
|
||||
sparePartAudit.setSparePartsId(sparePart.getId());
|
||||
sparePartAudit.setCount(item.getCount());
|
||||
sparePartAudit.setUnitPrice(item.getUnitPrice()); // 单价
|
||||
sparePartAuditMapper.insert(sparePartAudit);//插入备件审核信息
|
||||
}
|
||||
}
|
||||
|
|
|
@ -290,6 +290,7 @@ public class SystemAuthAdminServiceImpl implements ISystemAuthAdminService {
|
|||
vo.setProvince(regionMap.get(sysAdmin.getProvinceId()));
|
||||
vo.setCity(regionMap.get(sysAdmin.getCityId()));
|
||||
vo.setDistrict(regionMap.get(sysAdmin.getDistrictId()));
|
||||
vo.setGoodSkill(sysAdmin.getGoodSkill());//goodSkill; //擅长技能
|
||||
return vo;
|
||||
}
|
||||
|
||||
|
@ -344,6 +345,7 @@ public class SystemAuthAdminServiceImpl implements ISystemAuthAdminService {
|
|||
user.setLastLoginTime(System.currentTimeMillis() / 1000); // 最后登录时间
|
||||
user.setCreateTime(System.currentTimeMillis() / 1000); // 最后登录时间
|
||||
user.setMobile(systemAuthAdminParam.getPhone()); // 用户电话
|
||||
user.setGoodSkill(systemAuthAdminParam.getGoodSkill()); //擅长技能
|
||||
userMapper.insert(user);
|
||||
model.setUserId(user.getId().longValue());
|
||||
}
|
||||
|
@ -371,6 +373,7 @@ public class SystemAuthAdminServiceImpl implements ISystemAuthAdminService {
|
|||
model.setEmail(systemAuthAdminParam.getEmail());
|
||||
model.setTechnicalGrade(systemAuthAdminParam.getTechnicalGrade());
|
||||
model.setIsApprentice(systemAuthAdminParam.getIsApprentice());
|
||||
model.setGoodSkill(systemAuthAdminParam.getGoodSkill());
|
||||
systemAuthAdminMapper.insert(model);
|
||||
//获取管理员id
|
||||
Long adminId = model.getId().longValue();
|
||||
|
@ -477,6 +480,7 @@ public class SystemAuthAdminServiceImpl implements ISystemAuthAdminService {
|
|||
user.setLastLoginTime(System.currentTimeMillis() / 1000);
|
||||
user.setCreateTime(System.currentTimeMillis() / 1000);
|
||||
user.setMobile(systemAuthAdminParam.getPhone());
|
||||
user.setGoodSkill(systemAuthAdminParam.getGoodSkill());
|
||||
userMapper.insert(user);
|
||||
systemAuthAdmin.setUserId(user.getId().longValue());
|
||||
}else if(!systemAuthAdminParam.getPhone().equals(systemAuthAdmin.getPhone())){
|
||||
|
@ -491,11 +495,13 @@ public class SystemAuthAdminServiceImpl implements ISystemAuthAdminService {
|
|||
User user = userMapper.selectById(systemAuthAdmin.getUserId());
|
||||
user.setPassword(pwd);// 用户密码
|
||||
user.setSalt(salt);// 加密盐巴
|
||||
user.setGoodSkill(systemAuthAdminParam.getGoodSkill());
|
||||
userMapper.updateById(user);
|
||||
}
|
||||
|
||||
|
||||
systemAuthAdmin.setUpdateTime(System.currentTimeMillis() / 1000);
|
||||
systemAuthAdmin.setGoodSkill(systemAuthAdminParam.getGoodSkill());
|
||||
systemAuthAdminMapper.updateById(systemAuthAdmin);
|
||||
|
||||
this.cacheAdminUserByUid(systemAuthAdminParam.getId());
|
||||
|
@ -536,6 +542,7 @@ public class SystemAuthAdminServiceImpl implements ISystemAuthAdminService {
|
|||
model.setAvatar(avatar);
|
||||
model.setNickname(systemAuthAdminParam.getNickname());
|
||||
model.setUpdateTime(System.currentTimeMillis() / 1000);
|
||||
model.setGoodSkill(systemAuthAdminParam.getGoodSkill());
|
||||
|
||||
if (systemAuthAdminParam.getPassword() != null && !systemAuthAdminParam.getPassword().equals("")) {
|
||||
String currPassword = ToolsUtil.makeMd5(systemAuthAdminParam.getCurrPassword() + model.getSalt());
|
||||
|
|
|
@ -166,22 +166,24 @@ public class WarehouseServiceImpl implements IWarehouseService {
|
|||
.in("id", ids));
|
||||
for (Long id : ids) {
|
||||
//仓库存在配件且配件数量不为0时,不允许删除
|
||||
SparePart sparePart = sparePartMapper.selectOne(
|
||||
List<SparePart> sparePartList = sparePartMapper.selectList(
|
||||
new QueryWrapper<SparePart>()
|
||||
.eq("warehouse_id", id)
|
||||
.eq("is_delete", 0));
|
||||
|
||||
for (SparePart sparePart : sparePartList) {
|
||||
if(sparePart.getQuantity() != 0){
|
||||
throw new OperateException("仓库存在配件且配件数量不为0时,不允许删除!");
|
||||
}
|
||||
}
|
||||
|
||||
Warehouse pModel = warehouseMapper.selectOne(
|
||||
new QueryWrapper<Warehouse>()
|
||||
.select("id,pid,warehouse_name")
|
||||
.eq("pid", id)
|
||||
.eq("is_delete", 0)
|
||||
.last("limit 1"));
|
||||
if(sparePart != null && sparePart.getQuantity() != 0){
|
||||
|
||||
}else{
|
||||
Warehouse pModel = warehouseMapper.selectOne(
|
||||
new QueryWrapper<Warehouse>()
|
||||
.select("id,pid,warehouse_name")
|
||||
.eq("pid", id)
|
||||
.eq("is_delete", 0)
|
||||
.last("limit 1"));
|
||||
Assert.isNull(pModel, "请先删除子级仓库");
|
||||
}
|
||||
Assert.isNull(pModel, "请先删除子级仓库");
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -27,8 +27,6 @@ public class ClientParam implements Serializable {
|
|||
|
||||
private Long userId;
|
||||
|
||||
@NotNull(message = "clientNo参数缺失", groups = {create.class, update.class})
|
||||
@DecimalMin(value = "0", message = "clientNo参数值不能少于0", groups = {create.class, update.class})
|
||||
private String clientNo;
|
||||
|
||||
@NotNull(message = "clientName参数缺失", groups = {create.class, update.class})
|
||||
|
|
|
@ -84,4 +84,10 @@ public class RepairOrderAuditParam implements Serializable {
|
|||
private String orderNo; // 订单编号
|
||||
private String moduleCode; // 模块代码
|
||||
private String clientName; // 客户名称
|
||||
|
||||
private Integer qualityTestingResult; // 质检结果(0=通过,1=不通过)
|
||||
private Long qualityTestingId; // 质检人
|
||||
private Date qualityTestingTime; // 质检时间
|
||||
private String qualityTestingOpinion; // 质检意见
|
||||
private String qualityTestingImg; // 质检图片
|
||||
}
|
||||
|
|
|
@ -79,5 +79,5 @@ public class SystemAuthAdminParam implements Serializable {
|
|||
private Integer receiveOrderStatus; //接单状态(0=休假/停止接单中 1=作业中 2=可接单)
|
||||
private Integer isApprentice; // 是否学徒 0=否,1=是
|
||||
private String likeWork; // 模糊查询(姓名/联系电话)
|
||||
|
||||
private String goodSkill; //擅长技能
|
||||
}
|
||||
|
|
|
@ -39,8 +39,8 @@ public class BeyondRepairOrder {
|
|||
@ApiModelProperty(value = "退仓原因")
|
||||
private String reasonForWithdrawal;
|
||||
|
||||
@ApiModelProperty(value = "更换明细")
|
||||
private String replacementDetail;
|
||||
// @ApiModelProperty(value = "更换明细")
|
||||
// private String replacementDetail;
|
||||
|
||||
@ApiModelProperty(value = "制单人")
|
||||
private String creator;
|
||||
|
|
|
@ -0,0 +1,89 @@
|
|||
package com.hcy.admin.vo.excel.order;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
|
||||
import com.hcy.common.utils.excel.DownloadUrlConverter;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.net.URL;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ContentRowHeight(100)
|
||||
public class ClientCollarExcel {
|
||||
|
||||
@ApiModelProperty(value = "序号")
|
||||
private Integer index;
|
||||
|
||||
@ApiModelProperty(value = "工单编号")
|
||||
private String orderNo;
|
||||
|
||||
@ApiModelProperty(value = "客户名称")
|
||||
private String clientName;
|
||||
|
||||
@ApiModelProperty(value = "型号/规格")
|
||||
private String specificationsModel;
|
||||
|
||||
@ApiModelProperty(value = "模块代码")
|
||||
private String modelCode;
|
||||
|
||||
@ApiModelProperty(value = "功率")
|
||||
private String power;
|
||||
|
||||
@ApiModelProperty(value = "维修人员")
|
||||
private String maintenanceMan;
|
||||
|
||||
@ApiModelProperty(value = "拆机")
|
||||
@ExcelProperty(value = "拆机", converter = DownloadUrlConverter.class)
|
||||
private List<URL> dismantle;
|
||||
|
||||
@ApiModelProperty(value = "除尘")
|
||||
@ExcelProperty(value = "除尘", converter = DownloadUrlConverter.class)
|
||||
private List<URL> dedusting;
|
||||
|
||||
@ApiModelProperty(value = "排查结果")
|
||||
private String scrapOrNot;
|
||||
|
||||
@ApiModelProperty(value = "维修前图片")
|
||||
@ExcelProperty(value = "维修前图片", converter = DownloadUrlConverter.class)
|
||||
private List<URL> repairFront;
|
||||
|
||||
@ApiModelProperty(value = "维修中图片")
|
||||
@ExcelProperty(value = "维修中图片", converter = DownloadUrlConverter.class)
|
||||
private List<URL> repairIng;
|
||||
|
||||
@ApiModelProperty(value = "维修后图片")
|
||||
@ExcelProperty(value = "维修后图片)", converter = DownloadUrlConverter.class)
|
||||
private List<URL> repairBack;
|
||||
|
||||
@ApiModelProperty(value = "功能测试")
|
||||
@ExcelProperty(value = "功能测试", converter = DownloadUrlConverter.class)
|
||||
private List<URL> functionalTestImg;
|
||||
|
||||
@ApiModelProperty(value = "DC&PFC组装")
|
||||
@ExcelProperty(value = "DC&PFC组装", converter = DownloadUrlConverter.class)
|
||||
private List<URL> assembleImg;
|
||||
|
||||
@ApiModelProperty(value = "补强三防漆和点胶")
|
||||
@ExcelProperty(value = "补强三防漆和点胶", converter = DownloadUrlConverter.class)
|
||||
private List<URL> reinforcingThreeAntiPaintAndDispensing;
|
||||
|
||||
@ApiModelProperty(value = "模块装配")
|
||||
@ExcelProperty(value = "模块装配", converter = DownloadUrlConverter.class)
|
||||
private List<URL> moduleAssembly;
|
||||
|
||||
@ApiModelProperty(value = "老化测试")
|
||||
@ExcelProperty(value = "老化测试", converter = DownloadUrlConverter.class)
|
||||
private List<URL> agingTest;
|
||||
|
||||
@ApiModelProperty(value = "报废图片")
|
||||
@ExcelProperty(value = "报废图片", converter = DownloadUrlConverter.class)
|
||||
private List<URL> scrapPicture;
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
package com.hcy.admin.vo.excel.order;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 客户领机单
|
||||
*/
|
||||
public class ClientCollerExcel {
|
||||
|
||||
@ApiModelProperty(value = "序号")
|
||||
private Integer index;
|
||||
|
||||
@ApiModelProperty(value = "客户名称")
|
||||
private String clientName;
|
||||
|
||||
@ApiModelProperty(value = "单据编号")
|
||||
private String orderNo;
|
||||
|
||||
@ApiModelProperty(value = "型号/规格")
|
||||
private String specificationsModel;
|
||||
|
||||
@ApiModelProperty(value = "模块代码")
|
||||
private String modelCode;
|
||||
|
||||
@ApiModelProperty(value = "功率")
|
||||
private String power;
|
||||
|
||||
@ApiModelProperty(value = "是否返修")
|
||||
private String isRepair;
|
||||
|
||||
@ApiModelProperty(value = "维修人员")
|
||||
private String maintenanceMan;
|
||||
|
||||
@ApiModelProperty(value = "到货日期")
|
||||
private String arrivalTime;
|
||||
|
||||
@ApiModelProperty(value = "质保期限")
|
||||
private String warrantyPeriod;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
}
|
|
@ -7,6 +7,8 @@ import lombok.Builder;
|
|||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
|
@ -46,6 +48,9 @@ public class GetMaterialsOrder {
|
|||
@ApiModelProperty(value = "领取人员")
|
||||
private String recipient;
|
||||
|
||||
@ApiModelProperty(value = "配件单价")
|
||||
private String unitPrice;
|
||||
|
||||
@ApiModelProperty(value = "制单人")
|
||||
private String creator;
|
||||
|
||||
|
|
|
@ -18,6 +18,9 @@ public class MachineClaimNote {
|
|||
@ApiModelProperty(value = "序号")
|
||||
private Integer index;
|
||||
|
||||
@ApiModelProperty(value = "单据编号")
|
||||
private String orderNo;
|
||||
|
||||
@ApiModelProperty(value = "型号/规格")
|
||||
private String specificationsModel;
|
||||
|
||||
|
@ -30,11 +33,19 @@ public class MachineClaimNote {
|
|||
@ApiModelProperty(value = "是否返修")
|
||||
private String isRepair;
|
||||
|
||||
@ApiModelProperty(value = "维修结论")
|
||||
private String result;
|
||||
|
||||
@ApiModelProperty(value = "维修人员")
|
||||
private String maintenanceMan;
|
||||
|
||||
@ApiModelProperty(value = "快递到达日期")
|
||||
private String deliveryDate;
|
||||
|
||||
@ApiModelProperty(value = "维修周期")
|
||||
private String maintenanceCycle;
|
||||
|
||||
@ApiModelProperty(value = "质保期限")
|
||||
private String warrantyPeriod;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
|
|
|
@ -59,9 +59,12 @@ public class ScrapForm {
|
|||
@ApiModelProperty(value = "运维建议")
|
||||
private String operationsSuggest;
|
||||
|
||||
@ApiModelProperty(value = "制单及经手人")
|
||||
@ApiModelProperty(value = "审核人")
|
||||
private String creator;
|
||||
|
||||
@ApiModelProperty(value = "确认人") // 质检人
|
||||
private String qualityTestingName;
|
||||
|
||||
@ApiModelProperty(value = "制单日期")
|
||||
private String deliveryTime;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,57 @@
|
|||
package com.hcy.admin.vo.excel.order;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 入库WIP表
|
||||
*/
|
||||
public class WarehouseWarrantWIPExcel {
|
||||
|
||||
@ApiModelProperty(value = "序号")
|
||||
private Integer index;
|
||||
|
||||
@ApiModelProperty(value = "客户名称")
|
||||
private String clientName;
|
||||
|
||||
@ApiModelProperty(value = "单据编号")
|
||||
private String orderNo;
|
||||
|
||||
@ApiModelProperty(value = "快递到达日期")
|
||||
private String deliveryDate;
|
||||
|
||||
@ApiModelProperty(value = "入库日期")
|
||||
private String warehousingDate;
|
||||
|
||||
@ApiModelProperty(value = "型号/规格")
|
||||
private String specificationsModel;
|
||||
|
||||
@ApiModelProperty(value = "模块代码")
|
||||
private String modelCode;
|
||||
|
||||
@ApiModelProperty(value = "功率")
|
||||
private String power;
|
||||
|
||||
@ApiModelProperty(value = "是否返修")
|
||||
private String isRepair;
|
||||
|
||||
// @ApiModelProperty(value = "维修人员")
|
||||
// private String maintenanceMan;
|
||||
|
||||
@ApiModelProperty(value = "维修周期")
|
||||
private String maintenanceCycle;
|
||||
|
||||
@ApiModelProperty(value = "质保期限")
|
||||
private String warrantyPeriod;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
|
@ -46,4 +46,5 @@ public class UserLargeDataVo implements Serializable {
|
|||
private String province; //省
|
||||
private String city; //市
|
||||
private String district; //区
|
||||
private String goodSkill; //擅长技能
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ public class OrderSparePartListVo implements Serializable {
|
|||
private Long warehouseId; // 所属仓库id
|
||||
private String specificationsModel; // 规格型号
|
||||
private String unit; // 单位
|
||||
private BigDecimal unitPrice; // 价格
|
||||
private String unitPrice; // 价格
|
||||
private Integer quantity; // 库存数量
|
||||
private Integer count; // 出入库数量
|
||||
private BigDecimal totalPrice; // 总价
|
||||
|
|
|
@ -23,7 +23,7 @@ public class OrderSparePartUseListVo implements Serializable {
|
|||
private Long warehouseId; // 仓库id
|
||||
private String specificationsModel; // 规格型号
|
||||
private String unit; // 单位
|
||||
private BigDecimal unitPrice; // 价格
|
||||
private String unitPrice; // 价格
|
||||
private Integer count; // 出入库数量
|
||||
private Integer quantity; // 库存数量
|
||||
private Integer useNumber; // 使用数量
|
||||
|
|
|
@ -23,7 +23,7 @@ public class OrderSparePartUseVo implements Serializable {
|
|||
private Long warehouseId; // 仓库id
|
||||
private String specificationsModel; // 规格型号
|
||||
private String unit; // 单位
|
||||
private BigDecimal unitPrice; // 价格
|
||||
private String unitPrice; // 价格
|
||||
private Integer count; // 出入库数量
|
||||
private Integer quantity; // 库存数量
|
||||
private Integer useNumber; // 使用数量
|
||||
|
|
|
@ -71,5 +71,19 @@ public class RepairOrderAuditDetailVo implements Serializable {
|
|||
|
||||
private String withdrawalImg; // 退仓图片
|
||||
|
||||
private String recollarFittingRemark; // 重领配件备注
|
||||
|
||||
private Integer qualityTestingResult; // 质检结果(0=通过,1=不通过)
|
||||
private Long qualityTestingId; // 质检人
|
||||
private Date qualityTestingTime; // 质检时间
|
||||
private String qualityTestingOpinion; // 质检意见
|
||||
private String qualityTestingImg; // 质检图片
|
||||
private String whatWasRepairedOne; // 维修了什么1
|
||||
private String whatWasRepairedTwo; // 维修了什么2
|
||||
private String whatWasRepairedThree; // 维修了什么3
|
||||
private String questionOne; // 问题1
|
||||
private String questionTwo; // 问题2
|
||||
private String questionThree; // 问题3
|
||||
|
||||
private String reasonOfCancellation; // 取消原因
|
||||
}
|
||||
|
|
|
@ -61,4 +61,17 @@ public class RepairOrderAuditListVo implements Serializable {
|
|||
private String withdrawalImg; // 退仓申请图片
|
||||
private List<OrderSparePartUseVo> partsUseList; // 配件使用清单
|
||||
private String cancellationRequestImg; // 退仓申请图片
|
||||
|
||||
private Integer qualityTestingResult; // 质检结果(0=通过,1=不通过)
|
||||
private Long qualityTestingId; // 质检人
|
||||
private Date qualityTestingTime; // 质检时间
|
||||
private String qualityTestingOpinion; // 质检意见
|
||||
private String qualityTestingImg; // 质检图片
|
||||
private String whatWasRepairedOne; // 维修了什么1
|
||||
private String whatWasRepairedTwo; // 维修了什么2
|
||||
private String whatWasRepairedThree; // 维修了什么3
|
||||
private String questionOne; // 问题1
|
||||
private String questionTwo; // 问题2
|
||||
private String questionThree; // 问题3
|
||||
|
||||
}
|
||||
|
|
|
@ -176,4 +176,6 @@ public class RepairOrderDetailVo implements Serializable {
|
|||
private RepairOrderAuditListVo cancellationRequestListVo; // 退仓申请信息
|
||||
|
||||
private RepairOrderAuditDetailVo scrapDate;//报废审核信息
|
||||
private Integer receiveOrNot; // 是否已领用(0=是,1=否)
|
||||
|
||||
}
|
||||
|
|
|
@ -107,4 +107,16 @@ public class RepairOrderListVo implements Serializable {
|
|||
private Integer repairNextStep; // 下个步骤(0=拆机,1=清洗,2=故障排查,3=确认签名,4=重领配件,5=上传维修前图片,6=上传维修中图片,7=上传维修后图片,8=补强三防漆,9=补强点胶,10=DC&PFC组装,11=补强三防漆和点胶,12=模块装配,13=功能测试,14=老化测试,15=包装出货,16=填写回单)
|
||||
private List<OrderPartCode> orderPartCodeList; // 配件编码列表
|
||||
private Integer timeoutOrNot; // 是否超时(0=是,1=否)
|
||||
|
||||
private Long faultPhenomenonId; // 故障现象id
|
||||
private Long faultCauseId; // 故障原因id
|
||||
private Long sourceOfDamageId; // 损坏原因id
|
||||
private Long operationsSuggestId; // 运维建议id
|
||||
|
||||
private Integer type; // 扫码核对(0=入库,1=返修)
|
||||
private String returnReason; // 返修原因
|
||||
private Integer returning; //是否在退仓中(0=是,1=否)
|
||||
private Integer feedingOrNot; //是否在补料中(0=是,1=否)
|
||||
private Integer receiveOrNot; // 是否已领用(0=是,1=否)
|
||||
|
||||
}
|
||||
|
|
|
@ -33,4 +33,6 @@ public class RepairOrderShippingListVo implements Serializable {
|
|||
|
||||
private Integer index; // 序号
|
||||
private List<RepairOrderListVo> repairOrderList; //发货清单
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -20,4 +20,5 @@ public class RepairOrderStepDataVo implements Serializable {
|
|||
private Date createTime; // 创建时间
|
||||
private String creatorName; // 创建人名称
|
||||
private Integer isApprentice; //是否学徒:0=否 1=是
|
||||
private Integer scrapOrNot; // 是否报废(0=是,1=否)
|
||||
}
|
||||
|
|
|
@ -43,5 +43,5 @@ public class SystemAuthAdminVo implements Serializable {
|
|||
private Integer technicalGrade; // 技术等级(0=初级,1=中级,2=高级)
|
||||
private Integer receiveOrderStatus; //接单状态(0=休假/停止接单中 1=作业中 2=可接单)
|
||||
private Integer isApprentice; // 是否学徒 0=否,1=是
|
||||
|
||||
private String goodSkill; //擅长技能
|
||||
}
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -40,5 +40,6 @@ public class SystemAuthAdminDto implements Serializable {
|
|||
private Integer technicalGrade; // 技术等级(0=初级,1=中级,2=高级)
|
||||
private Integer isApprentice; // 是否学徒 0=否,1=是
|
||||
private String likeWork; // 模糊查询(姓名/联系电话)
|
||||
private String goodSkill; //擅长技能
|
||||
|
||||
}
|
||||
|
|
|
@ -45,5 +45,15 @@ public class RepairOrderAuditDto implements Serializable {
|
|||
private Date createTime; // 创建时间
|
||||
private Date updateTime; // 更新时间
|
||||
private Date deleteTime; // 删除时间
|
||||
|
||||
private Integer qualityTestingResult; // 质检结果(0=通过,1=不通过)
|
||||
private Long qualityTestingId; // 质检人
|
||||
private Date qualityTestingTime; // 质检时间
|
||||
private String qualityTestingOpinion; // 质检意见
|
||||
private String qualityTestingImg; // 质检图片
|
||||
private String whatWasRepairedOne; // 维修了什么1
|
||||
private String whatWasRepairedTwo; // 维修了什么2
|
||||
private String whatWasRepairedThree; // 维修了什么3
|
||||
private String questionOne; // 问题1
|
||||
private String questionTwo; // 问题2
|
||||
private String questionThree; // 问题3
|
||||
}
|
|
@ -113,4 +113,6 @@ public class RepairOrderDto implements Serializable {
|
|||
private String endTime; //结束时间
|
||||
private String maintenanceMan; //维修人员
|
||||
private Integer feedingOrNot; //是否在补料中(0=是,1=否)
|
||||
private Integer receiveOrNot; // 是否已领用(0=是,1=否)
|
||||
|
||||
}
|
||||
|
|
|
@ -46,4 +46,5 @@ public class UserLargeDataDto implements Serializable {
|
|||
private String province; //省
|
||||
private String city; //市
|
||||
private String district; //区
|
||||
private String goodSkill; //擅长技能
|
||||
}
|
||||
|
|
|
@ -18,5 +18,6 @@ public class OrderPartCode implements Serializable {
|
|||
private Long id; // 配件编码id
|
||||
private Long repairOrderId; // 维修单id
|
||||
private String partCode; // 配件编码
|
||||
|
||||
private String partName; // 配件名称
|
||||
private Integer isDelete; // 是否删除 0-未删除 1-删除
|
||||
}
|
|
@ -18,6 +18,7 @@ public class OrderSparePartUse implements Serializable {
|
|||
@TableId(value="id", type= IdType.AUTO)
|
||||
private Long id; // 主键id
|
||||
private Long repairOrderId; // 维修订单id
|
||||
private Long repairOrderAuditId; // 维修模块审核id
|
||||
private Integer reviewRequest; // 审核申请(0-退仓申请、1-领料申请、2-良品入库、3-报废申请)
|
||||
private Long sparePartsId; // 备件id
|
||||
private String sparePartsCode; // 备件编码
|
||||
|
|
|
@ -102,5 +102,5 @@ public class RepairOrder implements Serializable {
|
|||
private String returnReason; // 返修原因
|
||||
private Integer returning; //是否在退仓中(0=是,1=否)
|
||||
private Integer feedingOrNot; //是否在补料中(0=是,1=否)
|
||||
|
||||
private Integer receiveOrNot; // 是否已领用(0=是,1=否)
|
||||
}
|
|
@ -43,4 +43,15 @@ public class RepairOrderAudit implements Serializable {
|
|||
private Date updateTime; // 更新时间
|
||||
private Date deleteTime; // 删除时间
|
||||
|
||||
private Integer qualityTestingResult; // 质检结果(0=通过,1=不通过)
|
||||
private Long qualityTestingId; // 质检人
|
||||
private Date qualityTestingTime; // 质检时间
|
||||
private String qualityTestingOpinion; // 质检意见
|
||||
private String qualityTestingImg; // 质检图片
|
||||
private String whatWasRepairedOne; // 维修了什么1
|
||||
private String whatWasRepairedTwo; // 维修了什么2
|
||||
private String whatWasRepairedThree; // 维修了什么3
|
||||
private String questionOne; // 问题1
|
||||
private String questionTwo; // 问题2
|
||||
private String questionThree; // 问题3
|
||||
}
|
|
@ -2,6 +2,7 @@ package com.hcy.common.entity.order;
|
|||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.models.auth.In;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
@ -33,11 +34,13 @@ public class RepairOrderStepData implements Serializable {
|
|||
private Long creatorId; // 创建人id
|
||||
private Date createTime; // 创建时间
|
||||
private Integer isDelete; // 是否删除: [0=否, 1=是]
|
||||
private Integer scrapOrNot; // 是否报废(0=是,1=否)
|
||||
|
||||
public RepairOrderStepData() {
|
||||
}
|
||||
|
||||
public RepairOrderStepData(Long repairOrderId, Integer repairStep, String remark, String img, String title, Long creatorId) {
|
||||
public RepairOrderStepData(Long repairOrderId, Integer repairStep, String remark, String img, String title,
|
||||
Long creatorId) {
|
||||
this.repairOrderId = repairOrderId;
|
||||
this.repairStep = repairStep;
|
||||
this.remark = remark;
|
||||
|
@ -46,17 +49,19 @@ public class RepairOrderStepData implements Serializable {
|
|||
this.creatorId = creatorId;
|
||||
}
|
||||
|
||||
public RepairOrderStepData(Long repairOrderId, Integer repairStep, String remark, String img, String title, Integer dscType, Integer auditStatus, Long creatorId) {
|
||||
public RepairOrderStepData(Long repairOrderId, Integer repairStep, String remark, String img, String title,
|
||||
Long creatorId, Long repairOrderAuditId) {
|
||||
this.repairOrderId = repairOrderId;
|
||||
this.repairStep = repairStep;
|
||||
this.remark = remark;
|
||||
this.img = img;
|
||||
this.title = title;
|
||||
this.dscType = dscType;
|
||||
this.auditStatus = auditStatus;
|
||||
this.creatorId = creatorId;
|
||||
this.repairOrderAuditId = repairOrderAuditId;
|
||||
}
|
||||
public RepairOrderStepData(Long repairOrderId, Integer repairStep, String remark, String img, String title, Integer dscType, Integer auditStatus, Long creatorId, Long repairOrderAuditId) {
|
||||
|
||||
public RepairOrderStepData(Long repairOrderId, Integer repairStep, String remark, String img, String title,
|
||||
Integer dscType, Integer auditStatus, Long creatorId, Long repairOrderAuditId) {
|
||||
this.repairOrderId = repairOrderId;
|
||||
this.repairStep = repairStep;
|
||||
this.remark = remark;
|
||||
|
@ -67,7 +72,48 @@ public class RepairOrderStepData implements Serializable {
|
|||
this.creatorId = creatorId;
|
||||
this.repairOrderAuditId = repairOrderAuditId;
|
||||
}
|
||||
public RepairOrderStepData(Long repairOrderId, Integer repairStep, String remark, String img, String title, Integer auditStatus, Long creatorId) {
|
||||
|
||||
public RepairOrderStepData(Long repairOrderId, Integer repairStep, String remark, String img, String title,
|
||||
Integer dscType, Integer auditStatus, Long creatorId, Integer scrapOrNot) {
|
||||
this.repairOrderId = repairOrderId;
|
||||
this.repairStep = repairStep;
|
||||
this.remark = remark;
|
||||
this.img = img;
|
||||
this.title = title;
|
||||
this.dscType = dscType;
|
||||
this.auditStatus = auditStatus;
|
||||
this.creatorId = creatorId;
|
||||
this.scrapOrNot = scrapOrNot;
|
||||
}
|
||||
|
||||
public RepairOrderStepData(Long repairOrderId, Integer repairStep, String remark, String img, String title, Integer dscType,
|
||||
Integer auditStatus, Long creatorId, Long repairOrderAuditId, Integer scrapOrNot) {
|
||||
this.repairOrderId = repairOrderId;
|
||||
this.repairStep = repairStep;
|
||||
this.remark = remark;
|
||||
this.img = img;
|
||||
this.title = title;
|
||||
this.dscType = dscType;
|
||||
this.auditStatus = auditStatus;
|
||||
this.creatorId = creatorId;
|
||||
this.repairOrderAuditId = repairOrderAuditId;
|
||||
this.scrapOrNot = scrapOrNot;
|
||||
}
|
||||
|
||||
public RepairOrderStepData(Long repairOrderId, Integer repairStep, String remark, String img, String title, Integer auditStatus,
|
||||
Long creatorId,Integer scrapOrNot) {
|
||||
this.repairOrderId = repairOrderId;
|
||||
this.repairStep = repairStep;
|
||||
this.remark = remark;
|
||||
this.img = img;
|
||||
this.title = title;
|
||||
this.auditStatus = auditStatus;
|
||||
this.creatorId = creatorId;
|
||||
this.scrapOrNot = scrapOrNot;
|
||||
}
|
||||
|
||||
public RepairOrderStepData(Long repairOrderId, Integer repairStep, String remark, String img, String title, Integer auditStatus,
|
||||
Long creatorId) {
|
||||
this.repairOrderId = repairOrderId;
|
||||
this.repairStep = repairStep;
|
||||
this.remark = remark;
|
||||
|
@ -77,7 +123,8 @@ public class RepairOrderStepData implements Serializable {
|
|||
this.creatorId = creatorId;
|
||||
}
|
||||
|
||||
public RepairOrderStepData(Long id , Long repairOrderId, Integer repairStep, String remark, String img, String title, Long creatorId, Date createTime) {
|
||||
public RepairOrderStepData(Long id , Long repairOrderId, Integer repairStep, String remark, String img, String title,
|
||||
Long creatorId, Date createTime) {
|
||||
this.id = id;
|
||||
this.repairOrderId = repairOrderId;
|
||||
this.repairStep = repairStep;
|
||||
|
@ -88,7 +135,21 @@ public class RepairOrderStepData implements Serializable {
|
|||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public RepairOrderStepData(Long id ,Long repairOrderId, Integer repairStep, String remark, String img, String title, Integer dscType, Integer auditStatus, Long creatorId, Date createTime) {
|
||||
public RepairOrderStepData(Long id , Long repairOrderId, Integer repairStep, String remark, String img, String title,
|
||||
Long creatorId, Date createTime, Long repairOrderAuditId) {
|
||||
this.id = id;
|
||||
this.repairOrderId = repairOrderId;
|
||||
this.repairStep = repairStep;
|
||||
this.remark = remark;
|
||||
this.img = img;
|
||||
this.title = title;
|
||||
this.creatorId = creatorId;
|
||||
this.createTime = createTime;
|
||||
this.repairOrderAuditId = repairOrderAuditId;
|
||||
}
|
||||
|
||||
public RepairOrderStepData(Long id ,Long repairOrderId, Integer repairStep, String remark, String img, String title,
|
||||
Integer dscType, Integer auditStatus, Long creatorId, Date createTime, Integer scrapOrNot) {
|
||||
this.id = id;
|
||||
this.repairOrderId = repairOrderId;
|
||||
this.repairStep = repairStep;
|
||||
|
@ -99,9 +160,12 @@ public class RepairOrderStepData implements Serializable {
|
|||
this.auditStatus = auditStatus;
|
||||
this.creatorId = creatorId;
|
||||
this.createTime = createTime;
|
||||
this.scrapOrNot = scrapOrNot;
|
||||
}
|
||||
|
||||
public RepairOrderStepData(Long id ,Long repairOrderId, Integer repairStep, String remark, String img, String title, Integer dscType, Integer auditStatus, Long creatorId, Date createTime, Long repairOrderAuditId) {
|
||||
|
||||
public RepairOrderStepData(Long id ,Long repairOrderId, Integer repairStep, String remark, String img, String title, Integer dscType,
|
||||
Integer auditStatus, Long creatorId, Date createTime, Long repairOrderAuditId, Integer scrapOrNot) {
|
||||
this.id = id;
|
||||
this.repairOrderId = repairOrderId;
|
||||
this.repairStep = repairStep;
|
||||
|
@ -113,9 +177,11 @@ public class RepairOrderStepData implements Serializable {
|
|||
this.creatorId = creatorId;
|
||||
this.createTime = createTime;
|
||||
this.repairOrderAuditId = repairOrderAuditId;
|
||||
this.scrapOrNot = scrapOrNot;
|
||||
}
|
||||
|
||||
public RepairOrderStepData(Long id ,Long repairOrderId, Integer repairStep, String remark, String img, String title, Integer auditStatus, Long creatorId, Date createTime) {
|
||||
public RepairOrderStepData(Long id ,Long repairOrderId, Integer repairStep, String remark, String img,
|
||||
String title, Integer auditStatus, Long creatorId, Date createTime) {
|
||||
this.id = id;
|
||||
this.repairOrderId = repairOrderId;
|
||||
this.repairStep = repairStep;
|
||||
|
@ -126,4 +192,32 @@ public class RepairOrderStepData implements Serializable {
|
|||
this.creatorId = creatorId;
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public RepairOrderStepData(Long id ,Long repairOrderId, Integer repairStep, String remark, String img,
|
||||
String title, Integer auditStatus, Long creatorId, Date createTime,Long repairOrderAuditId) {
|
||||
this.id = id;
|
||||
this.repairOrderId = repairOrderId;
|
||||
this.repairStep = repairStep;
|
||||
this.remark = remark;
|
||||
this.img = img;
|
||||
this.title = title;
|
||||
this.auditStatus = auditStatus;
|
||||
this.creatorId = creatorId;
|
||||
this.createTime = createTime;
|
||||
this.repairOrderAuditId = repairOrderAuditId;
|
||||
}
|
||||
|
||||
public RepairOrderStepData(Long id , Long repairOrderId, Integer repairStep, String remark, String img, String title,
|
||||
Integer auditStatus, Long creatorId, Date createTime, Integer scrapOrNot) {
|
||||
this.id = id;
|
||||
this.repairOrderId = repairOrderId;
|
||||
this.repairStep = repairStep;
|
||||
this.remark = remark;
|
||||
this.img = img;
|
||||
this.title = title;
|
||||
this.auditStatus = auditStatus;
|
||||
this.creatorId = creatorId;
|
||||
this.createTime = createTime;
|
||||
this.scrapOrNot = scrapOrNot;
|
||||
}
|
||||
}
|
|
@ -48,4 +48,5 @@ public class SystemAuthAdmin implements Serializable {
|
|||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private Long userId; //用户id
|
||||
private Integer isApprentice; // 是否学徒 0=否,1=是
|
||||
private String goodSkill; //擅长技能
|
||||
}
|
||||
|
|
|
@ -45,4 +45,5 @@ public class User implements Serializable {
|
|||
private String longitude; // 经度
|
||||
private String latitude; // 纬度
|
||||
private Long warehouseId; // 仓库id
|
||||
private String goodSkill; //擅长技能
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ import java.util.Map;
|
|||
* @author dabin
|
||||
*/
|
||||
public enum RepairOrderAuditStatusEnum {
|
||||
// 审核状态(0=待审核、1=待入库、2=审核未通过、3=已完成,4=待领取、5=待确认、6=已取消)
|
||||
// 审核状态(0=待审核、1=待入库、2=审核未通过、3=已完成,4=待领取、5=待确认、6=已取消、7=待质检、8=质检不通过)
|
||||
TO_BE_REVIEWED(0,"待审核"),
|
||||
STOCK_PENDING(1,"待入库"),
|
||||
FAIL_THE_AUDIT(2,"审核未通过"),
|
||||
|
@ -17,6 +17,9 @@ public enum RepairOrderAuditStatusEnum {
|
|||
UNCLAIMED(4,"待领取"),
|
||||
TO_BE_CONFIRMED(5,"待确认"),
|
||||
CANCELED(6,"已取消"),
|
||||
WAIT_FOR_QUALITY_INSPECTION(7, "待质检"),
|
||||
FAILURE_OF_QUALITY_INSPECTION(8, "质检不通过"),
|
||||
|
||||
|
||||
//审核事项(0-退仓申请、1-领料申请、2-良品入库、3-报废申请、4-填写维修信息)
|
||||
CANCELLATION_REQUEST(0,"退仓申请"),
|
||||
|
|
|
@ -53,6 +53,10 @@ public enum RepairOrderStatusEnum {
|
|||
APPLICATION_FOR_SCRAP(3,"报废申请"),
|
||||
FILL_IN_MAINTENANCE_INFORMATION(4,"填写维修信息"),
|
||||
|
||||
//扫码核对(0=入库,1=返修)
|
||||
STORAGE(0,"入库"),
|
||||
REPAIR(1,"返修"),
|
||||
|
||||
//发货状态(0=未发货,1=已发货)
|
||||
NOT_YET_SHIPPED(0,"未发货"),
|
||||
SHIPPED(1,"已发货");
|
||||
|
|
|
@ -40,7 +40,7 @@ public interface OrderSparePartMapper extends IBaseMapper<OrderSparePart> {
|
|||
"WHERE\n" +
|
||||
"\troa.repair_order_id = #{moduleId} \n" +
|
||||
"\tAND roa.review_request = 1\n" +
|
||||
"\tAND roa.audit_status = 3")
|
||||
"\tAND roa.audit_status = 3 and osp.is_delete = 0")
|
||||
List<OrderSparePartDto> findOrderSparePartByModuleId(@Param("moduleId") Long moduleId);
|
||||
|
||||
/**
|
||||
|
@ -48,7 +48,7 @@ public interface OrderSparePartMapper extends IBaseMapper<OrderSparePart> {
|
|||
* @param repairOrderId 检修工单id
|
||||
* @return 数量
|
||||
*/
|
||||
@Select("SELECT * FROM la_order_spare_part WHERE repair_order_id = #{repairOrderId} and repair_order_audit_id = #{repairOrderAuditId}")
|
||||
@Select("SELECT * FROM la_order_spare_part WHERE is_delete = 0 and repair_order_id = #{repairOrderId} and repair_order_audit_id = #{repairOrderAuditId}")
|
||||
List<OrderSparePart> findOrderSparePartByRepairOrderIdAndRepairOrderAuditId(@Param("repairOrderId") Long repairOrderId,
|
||||
@Param("repairOrderAuditId") Long repairOrderAuditId);
|
||||
}
|
||||
|
|
|
@ -25,9 +25,9 @@ public interface RepairOrderAuditMapper extends IBaseMapper<RepairOrderAudit> {
|
|||
*/
|
||||
IPage<RepairOrderAuditDto> auditMattersList(@Param("page") Page page, @Param("param")RepairOrderAuditDto repairOrderAuditDto);
|
||||
|
||||
@Select("select * from la_repair_order_audit where repair_order_id = #{repairOrderId} and review_request = #{reviewRequest}")
|
||||
@Select("select * from la_repair_order_audit where audit_status = 3 and repair_order_id = #{repairOrderId} and review_request = #{reviewRequest} ORDER BY create_time desc LIMIT 1")
|
||||
RepairOrderAudit findRepairOrderAuditByRepairOrderIdAndReviewRequest(@Param("repairOrderId") Long repairOrderId,@Param("reviewRequest") Long reviewRequest);
|
||||
@Select("select * from la_repair_order_audit where repair_order_id = #{repairOrderId} and (review_request = #{reviewRequestOne} or review_request = #{reviewRequestTwo})")
|
||||
@Select("select * from la_repair_order_audit where repair_order_id = #{repairOrderId} and (review_request = #{reviewRequestOne} or review_request = #{reviewRequestTwo}) ORDER BY create_time desc LIMIT 1")
|
||||
RepairOrderAudit findRepairOrderAuditByRepairOrderIdAndTwoReviewRequest(@Param("repairOrderId") Long repairOrderId,@Param("reviewRequestOne") Long reviewRequestOne,
|
||||
@Param("reviewRequestTwo") Long reviewRequestTwo);
|
||||
@Select("select * from la_repair_order_audit where repair_order_id = #{repairOrderId} and (review_request = #{reviewRequestOne} or review_request = #{reviewRequestTwo} or review_request = #{reviewRequestThree})")
|
||||
|
|
|
@ -83,6 +83,13 @@ public interface RepairOrderMapper extends IBaseMapper<RepairOrder> {
|
|||
*/
|
||||
Page<RepairOrderDto> repairModulePageList(@Param("page") Page page, @Param("form") RepairOrderDto form);
|
||||
|
||||
/**
|
||||
* 维修模块列表,不分页
|
||||
* @param form
|
||||
* @return
|
||||
*/
|
||||
List<RepairOrderDto> repairModuleList(@Param("form") RepairOrderDto form);
|
||||
|
||||
/**
|
||||
* 审核事项
|
||||
* @param page
|
||||
|
|
|
@ -239,6 +239,39 @@
|
|||
order by ro.update_time desc
|
||||
</select>
|
||||
|
||||
<select id="repairModuleList" resultType="com.hcy.common.dto.order.RepairOrderDto">
|
||||
SELECT
|
||||
ro.*,
|
||||
saa.username AS receiverName,
|
||||
c.client_name AS clientName,
|
||||
c.short_name,
|
||||
pro.order_no
|
||||
FROM
|
||||
la_repair_order AS ro
|
||||
LEFT JOIN la_client AS c ON ro.client_id = c.id
|
||||
LEFT JOIN la_system_auth_admin AS saa ON ro.receiver_id = saa.id
|
||||
LEFT JOIN la_parent_repair_order as pro on ro.parent_repair_order_id = pro.id
|
||||
where
|
||||
ro.is_delete = 0
|
||||
<if test="form.receiverId != null">
|
||||
and ro.receiver_id = #{form.receiverId}
|
||||
</if>
|
||||
<if test="form.clientId != null">
|
||||
and ro.client_id = #{form.clientId}
|
||||
</if>
|
||||
<if test="form.creatorId != null">
|
||||
and ro.creator_id = #{form.creatorId}
|
||||
</if>
|
||||
<if test="form.likeWork != null and form.likeWork != ''">
|
||||
and (pro.order_no like concat('%', #{form.likeWork}, '%')
|
||||
or ro.module_code LIKE concat('%', #{form.likeWork}, '%')
|
||||
or c.client_name like concat('%', #{form.likeWork}, '%'))
|
||||
</if>
|
||||
<if test="form.orderStatus != null">
|
||||
and find_in_set(ro.order_status,#{form.orderStatus})
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="auditMattersList" resultType="com.hcy.common.dto.order.RepairOrderDto">
|
||||
SELECT
|
||||
ro.*,
|
||||
|
|
|
@ -10,6 +10,7 @@ import com.hcy.front.validate.PageParam;
|
|||
import com.hcy.front.validate.order.MaintenanceOrderParam;
|
||||
import com.hcy.front.validate.order.RepairOrderParam;
|
||||
import com.hcy.front.vo.order.OrderSparePartListVo;
|
||||
import com.hcy.front.vo.order.OrderSparePartUseListVo;
|
||||
import com.hcy.front.vo.order.RepairOrderDetailVo;
|
||||
import com.hcy.front.vo.order.RepairOrderListVo;
|
||||
import lombok.extern.java.Log;
|
||||
|
@ -296,6 +297,19 @@ public class RepairOrderController {
|
|||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据工单号和审核id查出使用配件列表
|
||||
*
|
||||
* @author hcy
|
||||
* @param repairOrderParam 搜索参数
|
||||
* @return Object
|
||||
*/
|
||||
@GetMapping("/partsUseList")
|
||||
public Object partsUseList(RepairOrderParam repairOrderParam) {
|
||||
List<OrderSparePartUseListVo> list = iRepairOrderService.partsUseList(repairOrderParam);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 备件领用补料申请
|
||||
* @param repairOrderParam 参数
|
||||
|
|
|
@ -95,7 +95,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|||
@Override
|
||||
public UserCenterVo center(Integer userId) {
|
||||
User user = userMapper.selectOne(new QueryWrapper<User>()
|
||||
.select("id,sn,avatar,real_name,nickname,username,mobile,receive_order_status,warehouse_id")
|
||||
.select("id,sn,avatar,real_name,nickname,username,mobile,receive_order_status,warehouse_id,good_skill")
|
||||
.eq("id", userId)
|
||||
.last("limit 1"));
|
||||
|
||||
|
|
|
@ -3,10 +3,7 @@ package com.hcy.front.service.order;
|
|||
import com.hcy.common.core.PageResult;
|
||||
import com.hcy.front.validate.PageParam;
|
||||
import com.hcy.front.validate.order.RepairOrderParam;
|
||||
import com.hcy.front.vo.order.OrderSparePartListVo;
|
||||
import com.hcy.front.vo.order.OrderStatusCountVo;
|
||||
import com.hcy.front.vo.order.RepairOrderDetailVo;
|
||||
import com.hcy.front.vo.order.RepairOrderListVo;
|
||||
import com.hcy.front.vo.order.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -152,4 +149,11 @@ public interface IRepairOrderService {
|
|||
* @return
|
||||
*/
|
||||
List<OrderSparePartListVo> partsList(RepairOrderParam repairOrderParam);
|
||||
|
||||
/**
|
||||
* 根据工单号和审核id查出使用配件列表
|
||||
* @param repairOrderParam
|
||||
* @return
|
||||
*/
|
||||
List<OrderSparePartUseListVo> partsUseList(RepairOrderParam repairOrderParam);
|
||||
}
|
||||
|
|
|
@ -972,9 +972,9 @@ public class MaintenanceOrderServiceImpl implements IMaintenanceOrderService {
|
|||
.eq(maintenanceOrderDto.getReceiverId() != null, MaintenanceOrder::getReceiverId, maintenanceOrderDto.getReceiverId()));
|
||||
|
||||
OrderStatusCountVo orderStatusCountVo = new OrderStatusCountVo();
|
||||
// orderStatusCountVo.setPendingOrderCount(pendingOrderCount);
|
||||
orderStatusCountVo.setPendingOrderCount(pendingOrderCount);
|
||||
orderStatusCountVo.setCheckingCount(checkingCount);
|
||||
// orderStatusCountVo.setToBeConfirmedCount(toBeConfirmedCount);
|
||||
orderStatusCountVo.setToBeConfirmedCount(toBeConfirmedCount);
|
||||
orderStatusCountVo.setInMaintenanceCount(inMaintenanceCount);
|
||||
orderStatusCountVo.setCompletedCount(completedCount);
|
||||
return orderStatusCountVo;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|||
import com.hcy.common.constant.GlobalConstant;
|
||||
import com.hcy.common.entity.sparePart.SparePart;
|
||||
import com.hcy.common.entity.warehouse.Warehouse;
|
||||
import com.hcy.common.exception.OperateException;
|
||||
import com.hcy.common.mapper.sparePart.SparePartMapper;
|
||||
import com.hcy.common.mapper.warehouse.WarehouseMapper;
|
||||
import com.hcy.common.utils.ArrayUtil;
|
||||
|
@ -150,22 +151,24 @@ public class WarehouseServiceImpl implements IWarehouseService {
|
|||
.in("id", ids));
|
||||
for (Long id : ids) {
|
||||
//仓库存在配件且配件数量不为0时,不允许删除
|
||||
SparePart sparePart = sparePartMapper.selectOne(
|
||||
List<SparePart> sparePartList = sparePartMapper.selectList(
|
||||
new QueryWrapper<SparePart>()
|
||||
.eq("warehouse_id", id)
|
||||
.eq("is_delete", 0));
|
||||
|
||||
for (SparePart sparePart : sparePartList) {
|
||||
if(sparePart.getQuantity() != 0){
|
||||
throw new OperateException("仓库存在配件且配件数量不为0时,不允许删除!");
|
||||
}
|
||||
}
|
||||
|
||||
Warehouse pModel = warehouseMapper.selectOne(
|
||||
new QueryWrapper<Warehouse>()
|
||||
.select("id,pid,warehouse_name")
|
||||
.eq("pid", id)
|
||||
.eq("is_delete", 0)
|
||||
.last("limit 1"));
|
||||
if(sparePart != null && sparePart.getQuantity() != 0){
|
||||
|
||||
}else{
|
||||
Warehouse pModel = warehouseMapper.selectOne(
|
||||
new QueryWrapper<Warehouse>()
|
||||
.select("id,pid,warehouse_name")
|
||||
.eq("pid", id)
|
||||
.eq("is_delete", 0)
|
||||
.last("limit 1"));
|
||||
Assert.isNull(pModel, "请先删除子级仓库");
|
||||
}
|
||||
Assert.isNull(pModel, "请先删除子级仓库");
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -82,4 +82,16 @@ public class RepairOrderAuditParam implements Serializable {
|
|||
|
||||
private String orderNo; // 订单编号
|
||||
|
||||
private Integer qualityTestingResult; // 质检结果(0=通过,1=不通过)
|
||||
private Long qualityTestingId; // 质检人
|
||||
private Date qualityTestingTime; // 质检时间
|
||||
private String qualityTestingOpinion; // 质检意见
|
||||
private String qualityTestingImg; // 质检图片
|
||||
private String whatWasRepairedOne; // 维修了什么1
|
||||
private String whatWasRepairedTwo; // 维修了什么2
|
||||
private String whatWasRepairedThree; // 维修了什么3
|
||||
private String questionOne; // 问题1
|
||||
private String questionTwo; // 问题2
|
||||
private String questionThree; // 问题3
|
||||
|
||||
}
|
||||
|
|
|
@ -170,4 +170,15 @@ public class RepairOrderParam implements Serializable {
|
|||
private Long repairOrderAuditId; //维修单审核id
|
||||
private Integer feedingOrNot; //是否在补料中(0=是,1=否)
|
||||
private Integer changeStepOrNot; //是否改步骤(0=是,1=否)
|
||||
|
||||
private String whatWasRepairedOne; // 维修了什么1
|
||||
private String whatWasRepairedTwo; // 维修了什么2
|
||||
private String whatWasRepairedThree; // 维修了什么3
|
||||
private String questionOne; // 问题1
|
||||
private String questionTwo; // 问题2
|
||||
private String questionThree; // 问题3
|
||||
|
||||
private Long repairOrderStepDataId; // 步骤记录id
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ public class OrderSparePartUseListVo implements Serializable {
|
|||
private Long warehouseId; // 仓库id
|
||||
private String specificationsModel; // 规格型号
|
||||
private String unit; // 单位
|
||||
private BigDecimal unitPrice; // 价格
|
||||
private String unitPrice; // 价格
|
||||
private Integer count; // 出入库数量
|
||||
private Integer quantity; // 库存数量
|
||||
private Integer useNumber; // 使用数量
|
||||
|
|
|
@ -15,6 +15,7 @@ public class OrderSparePartUseVo implements Serializable {
|
|||
|
||||
private Long id; // 主键id
|
||||
private Long repairOrderId; // 维修订单id
|
||||
private Long repairOrderAuditId; // 维修模块审核id
|
||||
private Long sparePartsId; // 备件id
|
||||
private Integer reviewRequest; // 审核申请(0-退仓申请、1-领料申请、2-良品入库、3-报废申请)
|
||||
private String sparePartsCode; // 备件编码
|
||||
|
|
|
@ -24,4 +24,6 @@ public class OrderStatusCountVo implements Serializable {
|
|||
private Integer toBeInspectedCount; // 待巡检数量
|
||||
private Integer duringInspectionCount; // 巡检中
|
||||
|
||||
private Integer pendingOrderCount; // 待接单数量
|
||||
private Integer toBeConfirmedCount; // 待确认数量
|
||||
}
|
||||
|
|
|
@ -70,4 +70,16 @@ public class RepairOrderAuditDetailVo implements Serializable {
|
|||
|
||||
private String withdrawalImg; // 退仓图片
|
||||
|
||||
private Integer qualityTestingResult; // 质检结果(0=通过,1=不通过)
|
||||
private Long qualityTestingId; // 质检人
|
||||
private Date qualityTestingTime; // 质检时间
|
||||
private String qualityTestingOpinion; // 质检意见
|
||||
private String qualityTestingImg; // 质检图片
|
||||
private String whatWasRepairedOne; // 维修了什么1
|
||||
private String whatWasRepairedTwo; // 维修了什么2
|
||||
private String whatWasRepairedThree; // 维修了什么3
|
||||
private String questionOne; // 问题1
|
||||
private String questionTwo; // 问题2
|
||||
private String questionThree; // 问题3
|
||||
|
||||
}
|
||||
|
|
|
@ -46,4 +46,16 @@ public class RepairOrderAuditListVo implements Serializable {
|
|||
private String moduleCode; // 模块代码
|
||||
private String cancellationRequestImg; // 退仓申请图片
|
||||
private List<OrderSparePartListVo> orderSparePartListVoList; //订单配件
|
||||
|
||||
private Integer qualityTestingResult; // 质检结果(0=通过,1=不通过)
|
||||
private Long qualityTestingId; // 质检人
|
||||
private Date qualityTestingTime; // 质检时间
|
||||
private String qualityTestingOpinion; // 质检意见
|
||||
private String qualityTestingImg; // 质检图片
|
||||
private String whatWasRepairedOne; // 维修了什么1
|
||||
private String whatWasRepairedTwo; // 维修了什么2
|
||||
private String whatWasRepairedThree; // 维修了什么3
|
||||
private String questionOne; // 问题1
|
||||
private String questionTwo; // 问题2
|
||||
private String questionThree; // 问题3
|
||||
}
|
||||
|
|
|
@ -165,4 +165,7 @@ public class RepairOrderDetailVo implements Serializable {
|
|||
private Integer feedingOrNot; //是否在补料中(0=是,1=否)
|
||||
|
||||
private RepairOrderAuditDetailVo scrapDate;//报废审核信息
|
||||
|
||||
private Integer receiveOrNot; // 是否已领用(0=是,1=否)
|
||||
|
||||
}
|
||||
|
|
|
@ -136,6 +136,7 @@ public class RepairOrderListVo implements Serializable {
|
|||
private String returnReason; // 返修原因
|
||||
private Integer returning; //是否在退仓中(0=是,1=否)
|
||||
private Integer feedingOrNot; //是否在补料中(0=是,1=否)
|
||||
private Integer receiveOrNot; // 是否已领用(0=是,1=否)
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -21,5 +21,6 @@ public class RepairOrderStepDataVo implements Serializable {
|
|||
private String creatorName; // 创建人名称
|
||||
private Integer isApprentice; //是否学徒:0=否 1=是
|
||||
private String role; // 角色主键
|
||||
private Integer scrapOrNot; // 是否报废(0=是,1=否)
|
||||
|
||||
}
|
||||
|
|
|
@ -35,4 +35,5 @@ public class UserCenterVo implements Serializable {
|
|||
private String clientName; // 客户名称
|
||||
private String plantName; // 管辖工厂名称
|
||||
private Integer isApprentice; //是否学徒:0=否 1=是
|
||||
private String goodSkill; //擅长技能
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue