采购订单列表推送至企业微信更新20250916
This commit is contained in:
parent
5d6dcd6042
commit
d5a75728b9
@ -79,7 +79,7 @@ public class ExcelUtil {
|
|||||||
}
|
}
|
||||||
public static <T> ExcelResult<T> importExcelSheet2(InputStream is, Class<T> clazz, boolean isValidate) {
|
public static <T> ExcelResult<T> importExcelSheet2(InputStream is, Class<T> clazz, boolean isValidate) {
|
||||||
DefaultExcelListener<T> listener = new DefaultExcelListener<>(isValidate);
|
DefaultExcelListener<T> listener = new DefaultExcelListener<>(isValidate);
|
||||||
EasyExcel.read(is, clazz, listener).sheet(2).doRead();
|
EasyExcel.read(is, clazz, listener).sheet(0).headRowNumber(2).doRead();
|
||||||
return listener.getExcelResult();
|
return listener.getExcelResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -29,6 +29,7 @@ import com.ruoyi.system.domain.dto.JdValidateBomDTO;
|
|||||||
import com.ruoyi.system.domain.dto.JdChildDTO;
|
import com.ruoyi.system.domain.dto.JdChildDTO;
|
||||||
import com.ruoyi.system.domain.vo.BomDetailsVo;
|
import com.ruoyi.system.domain.vo.BomDetailsVo;
|
||||||
import com.ruoyi.system.mapper.FigureSaveMapper;
|
import com.ruoyi.system.mapper.FigureSaveMapper;
|
||||||
|
import com.ruoyi.system.mapper.ProcessOrderProMapper;
|
||||||
import com.ruoyi.system.runner.JdUtil;
|
import com.ruoyi.system.runner.JdUtil;
|
||||||
import com.ruoyi.system.service.*;
|
import com.ruoyi.system.service.*;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@ -76,7 +77,7 @@ public class BomDetailsController extends BaseController {
|
|||||||
private final IProcessOrderProService iProcessOrderProService;
|
private final IProcessOrderProService iProcessOrderProService;
|
||||||
|
|
||||||
private final IFigureSaveService iFigureSaveService;
|
private final IFigureSaveService iFigureSaveService;
|
||||||
|
private final ProcessOrderProMapper processOrderProMapper;
|
||||||
/**
|
/**
|
||||||
* 查询bom明细列表
|
* 查询bom明细列表
|
||||||
*/
|
*/
|
||||||
@ -355,11 +356,11 @@ public class BomDetailsController extends BaseController {
|
|||||||
List<BomDetails> bomDetailsList = new ArrayList<>();
|
List<BomDetails> bomDetailsList = new ArrayList<>();
|
||||||
Set<String> processedMaterials = new HashSet<>(); // 用于跟踪已处理的物料编码
|
Set<String> processedMaterials = new HashSet<>(); // 用于跟踪已处理的物料编码
|
||||||
List<String> failedMaterials = new ArrayList<>(); // 用于跟踪处理失败的物料
|
List<String> failedMaterials = new ArrayList<>(); // 用于跟踪处理失败的物料
|
||||||
|
String totalWeight = "";
|
||||||
// 遍历前端传来的数据
|
// 遍历前端传来的数据
|
||||||
for (Map<String, String> param : bomDetailParams) {
|
for (Map<String, String> param : bomDetailParams) {
|
||||||
String fnumber = param.get("fnumber"); // 物料编码
|
String fnumber = param.get("fnumber"); // 物料编码
|
||||||
String totalWeight = param.get("totalWeight"); // 生产令号
|
totalWeight = param.get("totalWeight"); // 生产令号
|
||||||
|
|
||||||
// 根据物料编码和生产令号查询
|
// 根据物料编码和生产令号查询
|
||||||
List<BomDetails> bomDetails = iBomDetailsService.selectByFNumberAndTotalWeight(fnumber, totalWeight);
|
List<BomDetails> bomDetails = iBomDetailsService.selectByFNumberAndTotalWeight(fnumber, totalWeight);
|
||||||
@ -414,7 +415,10 @@ public class BomDetailsController extends BaseController {
|
|||||||
bomDetailsList.addAll(bomDetails);
|
bomDetailsList.addAll(bomDetails);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//更新项目进度
|
||||||
|
ProcessOrderProBo processOrderProBo = iProcessOrderProService.selectByProjectNumber(totalWeight);
|
||||||
|
processOrderProBo.setBomStatus(2L);
|
||||||
|
processOrderProMapper.selectById(processOrderProBo);
|
||||||
// 返回处理结果
|
// 返回处理结果
|
||||||
return R.ok("成功", bomDetailsList);
|
return R.ok("成功", bomDetailsList);
|
||||||
|
|
||||||
|
|||||||
@ -4,22 +4,11 @@ import java.io.File;
|
|||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import cn.hutool.json.JSONUtil;
|
|
||||||
import com.alibaba.excel.EasyExcel;
|
import com.alibaba.excel.EasyExcel;
|
||||||
import com.alibaba.excel.ExcelWriter;
|
|
||||||
import com.alibaba.excel.converters.Converter;
|
|
||||||
import com.alibaba.excel.enums.CellDataTypeEnum;
|
|
||||||
import com.alibaba.excel.metadata.GlobalConfiguration;
|
|
||||||
import com.alibaba.excel.metadata.data.CellData;
|
|
||||||
import com.alibaba.excel.metadata.property.ExcelContentProperty;
|
|
||||||
import com.alibaba.excel.write.builder.ExcelWriterBuilder;
|
|
||||||
import com.alibaba.excel.write.metadata.WriteSheet;
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
||||||
@ -28,16 +17,12 @@ import com.google.gson.JsonObject;
|
|||||||
import com.kingdee.bos.webapi.sdk.K3CloudApi;
|
import com.kingdee.bos.webapi.sdk.K3CloudApi;
|
||||||
import com.ruoyi.common.utils.HttpRequestUtil;
|
import com.ruoyi.common.utils.HttpRequestUtil;
|
||||||
import com.ruoyi.common.utils.WxRobotUtil;
|
import com.ruoyi.common.utils.WxRobotUtil;
|
||||||
import com.ruoyi.common.utils.file.SmbUtil;
|
|
||||||
import com.ruoyi.common.poi.ExcelTemplateProc;
|
import com.ruoyi.common.poi.ExcelTemplateProc;
|
||||||
import com.ruoyi.common.poi.DynamicDataMapping;
|
import com.ruoyi.common.poi.DynamicDataMapping;
|
||||||
import com.ruoyi.common.exception.ServiceException;
|
|
||||||
import com.ruoyi.system.domain.SafetyStock;
|
import com.ruoyi.system.domain.SafetyStock;
|
||||||
import com.ruoyi.system.domain.WlStockData;
|
import com.ruoyi.system.domain.WlStockData;
|
||||||
import com.ruoyi.system.domain.dto.*;
|
import com.ruoyi.system.domain.dto.*;
|
||||||
import com.ruoyi.system.domain.vo.SafetyStockVo;
|
|
||||||
import com.ruoyi.system.domain.vo.WlStockDataVo;
|
import com.ruoyi.system.domain.vo.WlStockDataVo;
|
||||||
import com.ruoyi.system.mapper.SafetyStockMapper;
|
|
||||||
import com.ruoyi.system.mapper.WlStockDataMapper;
|
import com.ruoyi.system.mapper.WlStockDataMapper;
|
||||||
import com.ruoyi.system.runner.JdUtil;
|
import com.ruoyi.system.runner.JdUtil;
|
||||||
import com.ruoyi.system.service.ISafetyStockService;
|
import com.ruoyi.system.service.ISafetyStockService;
|
||||||
@ -947,7 +932,8 @@ public class KingdeeWorkCenterDataController extends BaseController {
|
|||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
map.put("index", index);
|
map.put("index", index);
|
||||||
map.put("FBillNo", item.getFBillNo());
|
map.put("FBillNo", item.getFBillNo());
|
||||||
map.put("FBillTypeID", item.getFBillTypeID());
|
map.put("FDocumentStatus", item.getFDocumentStatus());
|
||||||
|
map.put("FCloseStatus", item.getFCloseStatus());
|
||||||
map.put("FSuggestPurDate", item.getFSuggestPurDate());
|
map.put("FSuggestPurDate", item.getFSuggestPurDate());
|
||||||
map.put("FSuggestSupplierIdFName", item.getFSuggestSupplierIdFName());
|
map.put("FSuggestSupplierIdFName", item.getFSuggestSupplierIdFName());
|
||||||
map.put("FMaterialIdFNumber", item.getFMaterialIdFNumber());
|
map.put("FMaterialIdFNumber", item.getFMaterialIdFNumber());
|
||||||
@ -1025,7 +1011,12 @@ public class KingdeeWorkCenterDataController extends BaseController {
|
|||||||
for (PurchaseRequestExcelDTO allOrder : allOrders) {
|
for (PurchaseRequestExcelDTO allOrder : allOrders) {
|
||||||
String productionOrderNo = allOrder.getFUCHNText();
|
String productionOrderNo = allOrder.getFUCHNText();
|
||||||
String deliveryDate = allOrder.getFArrivalDate();
|
String deliveryDate = allOrder.getFArrivalDate();
|
||||||
|
if (allOrder.getFCloseStatus().equals("A")){
|
||||||
|
allOrder.setFCloseStatus("未关闭");
|
||||||
|
}
|
||||||
|
if (allOrder.getFDocumentStatus().equals("C")){
|
||||||
|
allOrder.setFDocumentStatus("已审核");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 条件3: 交货日期不能为空,并且必须早于今天
|
// 条件3: 交货日期不能为空,并且必须早于今天
|
||||||
@ -1057,5 +1048,78 @@ public class KingdeeWorkCenterDataController extends BaseController {
|
|||||||
log.info("过滤完成,剩余数量: {}", filteredOrders.size());
|
log.info("过滤完成,剩余数量: {}", filteredOrders.size());
|
||||||
return filteredOrders;
|
return filteredOrders;
|
||||||
}
|
}
|
||||||
|
@Log(title = "采购订单和采购申请单临期数据")
|
||||||
|
@XxlJob("getPurchaseOrder2")
|
||||||
|
@PostMapping("/getPurchaseOrder2")
|
||||||
|
public R<Void> getPurchaseOrder2() {
|
||||||
|
try {
|
||||||
|
// String robotId = "4d2f037d-0cee-493a-a4ff-1758f67b8069";
|
||||||
|
String robotId = "483489b2-b219-468c-851f-f56a34a62d91";
|
||||||
|
// String robotId = "8af8abea-3f21-4ca7-ad0a-5b7a2cf4d78e";
|
||||||
|
String currentTime = DateUtil.format(new Date(), "yyyy年MM月dd日 HH:mm:ss");
|
||||||
|
StringBuilder msg = new StringBuilder();
|
||||||
|
msg.append("🏭 采购订单和采购申请临期(三天)更新\n\n")
|
||||||
|
.append("更新时间:").append(currentTime).append("\n\n")
|
||||||
|
.append("🔧 订单数据统计:\n");
|
||||||
|
|
||||||
|
// 获取采购订单和采购申请数据
|
||||||
|
List<PurchaseOrderExcelDTO> allPurchaseOrderList = JdUtil.getPurchaseOrder();
|
||||||
|
List<PurchaseRequestExcelDTO> allpurchaseRequestList = JdUtil.getPurchaseRequestOrder();
|
||||||
|
|
||||||
|
// 过滤采购订单数据
|
||||||
|
List<PurchaseOrderExcelDTO> purchaseOrderList = filterPurchaseOrders(allPurchaseOrderList);
|
||||||
|
// 过滤采购申请单数据
|
||||||
|
List<PurchaseRequestExcelDTO> purchaseRequestList = filterReqPurchaseOrders(allpurchaseRequestList);
|
||||||
|
|
||||||
|
msg.append("- 采购订单:").append(purchaseOrderList.size()).append("条\n");
|
||||||
|
msg.append("- 采购申请单:").append(purchaseRequestList.size()).append("条\n");
|
||||||
|
|
||||||
|
// 生成Excel文件使用采购模板
|
||||||
|
String fileName = String.format("采购订单和申请数据_%s.xlsx",
|
||||||
|
DateUtil.format(new Date(), "yyyyMMddHHmmss"));
|
||||||
|
String filePath = FileUtils.getTempDirectoryPath() + File.separator + fileName;
|
||||||
|
|
||||||
|
// 准备模板数据
|
||||||
|
Map<String, Object> staticDataMap = new HashMap<>();
|
||||||
|
staticDataMap.put("currentTime", DateUtil.format(new Date(), "yyyy年MM月dd日 HH:mm:ss"));
|
||||||
|
staticDataMap.put("purchaseOrderCount", purchaseOrderList.size());
|
||||||
|
staticDataMap.put("purchaseRequestCount", purchaseRequestList.size());
|
||||||
|
|
||||||
|
List<DynamicDataMapping> dynamicDataMappingList = new ArrayList<>();
|
||||||
|
|
||||||
|
// 添加采购订单数据
|
||||||
|
if (!purchaseOrderList.isEmpty()) {
|
||||||
|
List<Map<String, Object>> orderDataList = convertPurchaseOrderToMapList(purchaseOrderList);
|
||||||
|
dynamicDataMappingList.addAll(DynamicDataMapping.createOneDataList("PurchaseOrderExcelDTO", orderDataList));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加采购申请数据
|
||||||
|
if (!purchaseRequestList.isEmpty()) {
|
||||||
|
List<Map<String, Object>> requestDataList = convertPurchaseRequestToMapList(purchaseRequestList);
|
||||||
|
dynamicDataMappingList.addAll(DynamicDataMapping.createOneDataList("PurchaseRequestExcelDTO", requestDataList));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 使用采购模板生成Excel
|
||||||
|
String templatePath = "EXCEL模板/采购订单模板1.xlsx";
|
||||||
|
ExcelTemplateProc.doExportExcelByTemplateProc(templatePath, filePath, staticDataMap, dynamicDataMappingList);
|
||||||
|
|
||||||
|
// 发送Excel文件
|
||||||
|
File excelFile = new File(filePath);
|
||||||
|
if (excelFile.exists()) {
|
||||||
|
wxRobotUtil.sendFileToWeChatGroup(excelFile, robotId);
|
||||||
|
FileUtils.deleteQuietly(excelFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
msg.append("\n详细数据请查看发送的Excel文件!");
|
||||||
|
wxRobotUtil.sendMsgToWeChatGroup(msg.toString(), robotId, true); // @所有人
|
||||||
|
|
||||||
|
return R.ok();
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("发送工段数据失败", e);
|
||||||
|
return R.fail("发送工段数据失败:" + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,6 +14,7 @@ import com.ruoyi.common.poi.ExcelTemplateProc;
|
|||||||
import com.ruoyi.common.poi.DynamicDataMapping;
|
import com.ruoyi.common.poi.DynamicDataMapping;
|
||||||
import com.ruoyi.system.domain.*;
|
import com.ruoyi.system.domain.*;
|
||||||
import com.ruoyi.system.domain.bo.FigureSaveBo;
|
import com.ruoyi.system.domain.bo.FigureSaveBo;
|
||||||
|
import com.ruoyi.system.domain.dto.ProcessRouteExcelDTO;
|
||||||
import com.ruoyi.system.domain.vo.*;
|
import com.ruoyi.system.domain.vo.*;
|
||||||
import com.ruoyi.system.domain.vo.BomDataVO;
|
import com.ruoyi.system.domain.vo.BomDataVO;
|
||||||
import com.ruoyi.system.mapper.ProcessOrderProMapper;
|
import com.ruoyi.system.mapper.ProcessOrderProMapper;
|
||||||
@ -490,6 +491,7 @@ public class ProcessOrderProController extends BaseController {
|
|||||||
if (!found) {
|
if (!found) {
|
||||||
processDataList.add(item);
|
processDataList.add(item);
|
||||||
}
|
}
|
||||||
|
List<ProcessRouteExcelDTO> excelDTOList = iProcessOrderProService.getRouteAndBomDetail( processDataList,orderPro);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -379,7 +379,7 @@ public class ProcessRouteController extends BaseController {
|
|||||||
ExcelResult<ProcessRouteVo> result = ExcelUtil.importExcelSheet6(file.getInputStream(), ProcessRouteVo.class, true);
|
ExcelResult<ProcessRouteVo> result = ExcelUtil.importExcelSheet6(file.getInputStream(), ProcessRouteVo.class, true);
|
||||||
List<ProcessRouteVo> list1 = result.getList();
|
List<ProcessRouteVo> list1 = result.getList();
|
||||||
// 读取总装部分sheet
|
// 读取总装部分sheet
|
||||||
ExcelResult<ProductionOrderVo> result1 = ExcelUtil.importExcelSheet2(file.getInputStream(), ProductionOrderVo.class, true);
|
ExcelResult<ProductionOrderVo> result1 = ExcelUtil.importExcelSheet1(file.getInputStream(), ProductionOrderVo.class, true);
|
||||||
List<ProductionOrderVo> list = result1.getList();
|
List<ProductionOrderVo> list = result1.getList();
|
||||||
String productionOrderNo = list1.get(0).getRouteDescription();
|
String productionOrderNo = list1.get(0).getRouteDescription();
|
||||||
List<BomDetails> bomDetails = iBomDetailsService.selectByProjectNumber(list1.get(0).getRouteDescription());
|
List<BomDetails> bomDetails = iBomDetailsService.selectByProjectNumber(list1.get(0).getRouteDescription());
|
||||||
|
|||||||
@ -0,0 +1,141 @@
|
|||||||
|
package com.ruoyi.system.domain.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
@Data
|
||||||
|
public class ProcessRouteExcelDTO {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生产令号
|
||||||
|
*/
|
||||||
|
private String routeDescription;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料编码
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String materialCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料名称
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String materialName;
|
||||||
|
/**
|
||||||
|
* 材质
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String material;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单重KG
|
||||||
|
*/
|
||||||
|
private Double discWeight;
|
||||||
|
/**
|
||||||
|
* 材料BOM物料编码
|
||||||
|
*/
|
||||||
|
private String rawMaterialCode;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 材料BOM物料名称
|
||||||
|
*/
|
||||||
|
private String rawMaterialName;
|
||||||
|
/**
|
||||||
|
* bom材质
|
||||||
|
*/
|
||||||
|
private String bomMaterial;
|
||||||
|
/**
|
||||||
|
* 材料BOM单位
|
||||||
|
*/
|
||||||
|
private Double bomDanZhong;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 材料BOM用量
|
||||||
|
*/
|
||||||
|
private Double discUsage;
|
||||||
|
/**
|
||||||
|
* 材料BOM单位
|
||||||
|
*/
|
||||||
|
private String bomUnit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工序号
|
||||||
|
*/
|
||||||
|
private Long processNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工作中心(加工车间)
|
||||||
|
*/
|
||||||
|
private String workCenter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工序名称
|
||||||
|
*/
|
||||||
|
private String processName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工序说明(序描述)
|
||||||
|
*/
|
||||||
|
private String processDescription;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工序控制
|
||||||
|
*/
|
||||||
|
private String processControl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 活动时长
|
||||||
|
*/
|
||||||
|
private Double activityDuration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 活动单位
|
||||||
|
*/
|
||||||
|
private String activityUnit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单台数量
|
||||||
|
*/
|
||||||
|
private Long unitQuantity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 本批数量
|
||||||
|
*/
|
||||||
|
|
||||||
|
private Long batchQuantity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首批数量
|
||||||
|
*/
|
||||||
|
|
||||||
|
private Double firstBatchQuantity;
|
||||||
|
/**
|
||||||
|
* 计划开始时间
|
||||||
|
*/
|
||||||
|
|
||||||
|
private Date planStartTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划结束时间
|
||||||
|
*/
|
||||||
|
|
||||||
|
private Date planEndTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 序开始时间
|
||||||
|
*/
|
||||||
|
private Date xuStartTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 序结束时间
|
||||||
|
*/
|
||||||
|
private Date xuEndTime;
|
||||||
|
|
||||||
|
}
|
||||||
@ -28,6 +28,16 @@ public class PurchaseRequestExcelDTO {
|
|||||||
*/
|
*/
|
||||||
@JsonProperty("FSuggestSupplierId.FName")
|
@JsonProperty("FSuggestSupplierId.FName")
|
||||||
private String FSuggestSupplierIdFName;
|
private String FSuggestSupplierIdFName;
|
||||||
|
/**
|
||||||
|
* 审核状态
|
||||||
|
*/
|
||||||
|
@JsonProperty("FDocumentStatus")
|
||||||
|
private String FDocumentStatus;
|
||||||
|
/**
|
||||||
|
* 关闭状态
|
||||||
|
*/
|
||||||
|
@JsonProperty("FCloseStatus")
|
||||||
|
private String FCloseStatus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 物料编码
|
* 物料编码
|
||||||
|
|||||||
@ -44,31 +44,31 @@ public class EleMaterialsVo {
|
|||||||
/**
|
/**
|
||||||
* 型号
|
* 型号
|
||||||
*/
|
*/
|
||||||
//@ExcelProperty(value = "型号")
|
@ExcelProperty(value = "型号")
|
||||||
private String model;
|
private String model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 材质
|
* 材质
|
||||||
*/
|
*/
|
||||||
//@ExcelProperty(value = "类别")
|
@ExcelProperty(value = "类别")
|
||||||
private String materialType;
|
private String materialType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 单位
|
* 单位
|
||||||
*/
|
*/
|
||||||
// @ExcelProperty(value = "单位")
|
@ExcelProperty(value = "单位")
|
||||||
private String unit;
|
private String unit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 品牌
|
* 品牌
|
||||||
*/
|
*/
|
||||||
//@ExcelProperty(value = "品牌")
|
@ExcelProperty(value = "品牌")
|
||||||
private String brand;
|
private String brand;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
// @ExcelProperty(value = "备注")
|
@ExcelProperty(value = "备注")
|
||||||
private String remarks;
|
private String remarks;
|
||||||
/**
|
/**
|
||||||
* 物料值
|
* 物料值
|
||||||
|
|||||||
@ -20,13 +20,13 @@ public class ProductionOrderVo {
|
|||||||
/**
|
/**
|
||||||
* ID
|
* ID
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "序号")
|
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生产令号
|
* 生产令号
|
||||||
*/
|
*/
|
||||||
|
@ExcelProperty(value = "生产令号")
|
||||||
private String productionOrderNo;
|
private String productionOrderNo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -2578,12 +2578,16 @@ public class JdUtil {
|
|||||||
return purcs; // 返回结果
|
return purcs; // 返回结果
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 采购申请单
|
||||||
|
* @return List<PurchaseRequestExcelDTO>
|
||||||
|
*/
|
||||||
public static List<PurchaseRequestExcelDTO> getPurchaseRequestOrder() {
|
public static List<PurchaseRequestExcelDTO> getPurchaseRequestOrder() {
|
||||||
K3CloudApi client = new K3CloudApi();
|
K3CloudApi client = new K3CloudApi();
|
||||||
// 请求参数,要求为json字符串
|
// 请求参数,要求为json字符串
|
||||||
JsonObject json = new JsonObject();
|
JsonObject json = new JsonObject();
|
||||||
json.addProperty("FormId", "PUR_Requisition");
|
json.addProperty("FormId", "PUR_Requisition");
|
||||||
json.addProperty("FieldKeys", "FBillNo,FBillTypeID,FSuggestPurDate,FSuggestSupplierId.FName,FMaterialId.FNumber,FMaterialName,FPriceUnitId.FName,FReqQty,FArrivalDate,FApplicationDate,F_UCHN_Text,FCreatorId.FName");
|
json.addProperty("FieldKeys", "FBillNo,FBillTypeID,FDocumentStatus,FCloseStatus,FSuggestPurDate,FSuggestSupplierId.FName,FMaterialId.FNumber,FMaterialName,FPriceUnitId.FName,FReqQty,FArrivalDate,FApplicationDate,F_UCHN_Text,FCreatorId.FName");
|
||||||
// 创建过滤条件
|
// 创建过滤条件
|
||||||
JsonObject filterObject = new JsonObject();
|
JsonObject filterObject = new JsonObject();
|
||||||
JsonArray filterString = new JsonArray();
|
JsonArray filterString = new JsonArray();
|
||||||
|
|||||||
@ -167,7 +167,7 @@ public class PDFGenerator {
|
|||||||
// 获取当前时间的毫秒时间戳
|
// 获取当前时间的毫秒时间戳
|
||||||
long timestamp = System.currentTimeMillis();
|
long timestamp = System.currentTimeMillis();
|
||||||
String pdfPath = departmentFolder.getAbsolutePath() + "\\" + fDepartmentName + "_"
|
String pdfPath = departmentFolder.getAbsolutePath() + "\\" + fDepartmentName + "_"
|
||||||
+ materialCode1.replace("/", "_") + "_" + timestamp + ".pdf";
|
+ materialCode1.replace("/", "_") + "_" + productionOrderNumber + ".pdf";
|
||||||
try {
|
try {
|
||||||
// 创建 PDF 文件并写入内容
|
// 创建 PDF 文件并写入内容
|
||||||
PDDocument document = new PDDocument();
|
PDDocument document = new PDDocument();
|
||||||
|
|||||||
@ -4,11 +4,13 @@ import com.ruoyi.common.core.domain.R;
|
|||||||
import com.ruoyi.system.domain.ProcessOrderPro;
|
import com.ruoyi.system.domain.ProcessOrderPro;
|
||||||
import com.ruoyi.system.domain.ProcessRoute;
|
import com.ruoyi.system.domain.ProcessRoute;
|
||||||
import com.ruoyi.system.domain.bo.FigureSaveBo;
|
import com.ruoyi.system.domain.bo.FigureSaveBo;
|
||||||
|
import com.ruoyi.system.domain.dto.ProcessRouteExcelDTO;
|
||||||
import com.ruoyi.system.domain.vo.OverdueProjectVo;
|
import com.ruoyi.system.domain.vo.OverdueProjectVo;
|
||||||
import com.ruoyi.system.domain.vo.ProcessOrderProVo;
|
import com.ruoyi.system.domain.vo.ProcessOrderProVo;
|
||||||
import com.ruoyi.system.domain.bo.ProcessOrderProBo;
|
import com.ruoyi.system.domain.bo.ProcessOrderProBo;
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
import com.ruoyi.common.core.domain.PageQuery;
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
|
import com.ruoyi.system.domain.vo.ProductionOrderVo;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
@ -75,4 +77,6 @@ public interface IProcessOrderProService {
|
|||||||
String uploadContractPDF(Integer id, String originalFilename, MultipartFile filePath);
|
String uploadContractPDF(Integer id, String originalFilename, MultipartFile filePath);
|
||||||
|
|
||||||
List<OverdueProjectVo> getOverdueProjects();
|
List<OverdueProjectVo> getOverdueProjects();
|
||||||
|
|
||||||
|
List<ProcessRouteExcelDTO> getRouteAndBomDetail(List<ProductionOrderVo> processDataList,ProcessOrderPro orderPro);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,13 +19,16 @@ import com.ruoyi.common.utils.file.PDFDocHelper;
|
|||||||
|
|
||||||
import com.ruoyi.system.domain.*;
|
import com.ruoyi.system.domain.*;
|
||||||
import com.ruoyi.system.domain.bo.FigureSaveBo;
|
import com.ruoyi.system.domain.bo.FigureSaveBo;
|
||||||
|
import com.ruoyi.system.domain.dto.ProcessRouteExcelDTO;
|
||||||
import com.ruoyi.system.domain.dto.excuteDrawing.DataInfo;
|
import com.ruoyi.system.domain.dto.excuteDrawing.DataInfo;
|
||||||
import com.ruoyi.system.domain.dto.excuteDrawing.ProductInfo;
|
import com.ruoyi.system.domain.dto.excuteDrawing.ProductInfo;
|
||||||
import com.ruoyi.system.domain.dto.excuteDrawing.PwProductionBill;
|
import com.ruoyi.system.domain.dto.excuteDrawing.PwProductionBill;
|
||||||
import com.ruoyi.system.domain.vo.OverdueProjectVo;
|
import com.ruoyi.system.domain.vo.OverdueProjectVo;
|
||||||
|
import com.ruoyi.system.domain.vo.ProductionOrderVo;
|
||||||
import com.ruoyi.system.listener.FileToZip;
|
import com.ruoyi.system.listener.FileToZip;
|
||||||
import com.ruoyi.system.listener.SmbUtils;
|
import com.ruoyi.system.listener.SmbUtils;
|
||||||
import com.ruoyi.system.mapper.FigureSaveMapper;
|
import com.ruoyi.system.mapper.FigureSaveMapper;
|
||||||
|
import com.ruoyi.system.mapper.MaterialBomMapper;
|
||||||
import com.ruoyi.system.mapper.ProcessRouteMapper;
|
import com.ruoyi.system.mapper.ProcessRouteMapper;
|
||||||
import com.ruoyi.system.service.*;
|
import com.ruoyi.system.service.*;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@ -64,6 +67,7 @@ import java.time.LocalDate;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class ProcessOrderProServiceImpl implements IProcessOrderProService {
|
public class ProcessOrderProServiceImpl implements IProcessOrderProService {
|
||||||
private final FigureSaveMapper figureSaveMapper;
|
private final FigureSaveMapper figureSaveMapper;
|
||||||
|
private final IMaterialBomService materialBomService;
|
||||||
|
|
||||||
private final ProcessOrderProMapper baseMapper;
|
private final ProcessOrderProMapper baseMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
@ -554,7 +558,7 @@ public class ProcessOrderProServiceImpl implements IProcessOrderProService {
|
|||||||
if ("idle".equals(currentStatus) && processState == 4) {
|
if ("idle".equals(currentStatus) && processState == 4) {
|
||||||
ProcessOrderPro processOrderPro = new ProcessOrderPro();
|
ProcessOrderPro processOrderPro = new ProcessOrderPro();
|
||||||
BeanUtils.copyProperties(orderPro,processOrderPro);
|
BeanUtils.copyProperties(orderPro,processOrderPro);
|
||||||
//To do
|
|
||||||
processOrderPro.setBomStatus(1L);//
|
processOrderPro.setBomStatus(1L);//
|
||||||
baseMapper.updateById(processOrderPro);
|
baseMapper.updateById(processOrderPro);
|
||||||
log.info("图纸处理完成!");
|
log.info("图纸处理完成!");
|
||||||
@ -1089,6 +1093,7 @@ public class ProcessOrderProServiceImpl implements IProcessOrderProService {
|
|||||||
return projects;
|
return projects;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 辅助方法:将 java.util.Date 转换为 LocalDate
|
// 辅助方法:将 java.util.Date 转换为 LocalDate
|
||||||
private LocalDate convertToLocalDate(Date date) {
|
private LocalDate convertToLocalDate(Date date) {
|
||||||
if (date != null) {
|
if (date != null) {
|
||||||
@ -1123,5 +1128,21 @@ public class ProcessOrderProServiceImpl implements IProcessOrderProService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 将工艺部分 材料BOM部分 合并成ProcessRouteExcelDTO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<ProcessRouteExcelDTO> getRouteAndBomDetail(List<ProductionOrderVo> processDataList,ProcessOrderPro orderPro) {
|
||||||
|
String proRoot = orderPro.getProductionOrderNo();
|
||||||
|
//工艺部分
|
||||||
|
List<ProcessRoute> processRoutes = iProcessRouteService.selectByProjectNumber(proRoot);
|
||||||
|
List<MaterialBom> materialBoms = materialBomService.selectByProCode(proRoot);
|
||||||
|
for (ProductionOrderVo productionOrderVo : processDataList) {
|
||||||
|
ProcessRouteExcelDTO processRouteExcelDTO = new ProcessRouteExcelDTO();
|
||||||
|
}
|
||||||
|
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user