|
@@ -143,8 +143,7 @@ public class DevicMaintainServiceImpl implements DevicMaintainService {
|
|
|
} else {
|
|
|
throw new RuntimeException("文件夹不存在!!!");
|
|
|
}
|
|
|
- String folderPath = "D:\\process"; // 文件夹路径
|
|
|
- List<File> filesToProcess = listFilesToProcess(folderPath);
|
|
|
+ List<File> filesToProcess = listFilesToProcess(filePath);
|
|
|
if(filesToProcess.size()==0){
|
|
|
throw new RuntimeException("文件夹下无有效文件!!!");
|
|
|
}
|
|
@@ -152,13 +151,7 @@ public class DevicMaintainServiceImpl implements DevicMaintainService {
|
|
|
if (file.isFile() && file.getName().endsWith(".doc") && !file.getName().contains("processed")) {
|
|
|
// 处理文件
|
|
|
processFile(file);
|
|
|
- String replace = file.getName().replace(".doc", "_processed.doc");
|
|
|
- File newFile = new File(file.getParent(), replace);
|
|
|
- if (file.renameTo(newFile)) {
|
|
|
- System.out.println("文件重命名成功!");
|
|
|
- } else {
|
|
|
- System.out.println("文件重命名失败!");
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
|
|
|
}
|
|
@@ -264,12 +257,17 @@ public class DevicMaintainServiceImpl implements DevicMaintainService {
|
|
|
if(findProduct == null){
|
|
|
//产品管理
|
|
|
productId = jdbcService.insert("insert", "INSERT INTO a_product (`product_code`, `product_name`, `product_model`, `flat`) VALUES (?,?,?,?);", "xs_"+xsCode, result, productSize, "个");
|
|
|
- //产品物料
|
|
|
- jdbcService.insert("insert","INSERT INTO a_product_material (`parent_id`, `material_id`, `material_amount`, `seq`) VALUES (?,?,1,1);",productId,materialId);
|
|
|
+
|
|
|
}else{
|
|
|
productId=Long.valueOf(findProduct.get("id").toString());
|
|
|
}
|
|
|
|
|
|
+ //产品物料
|
|
|
+ Map<String, Object> findProductMaterial = jdbcService.findOne("select * from a_product_material where parent_id=? and material_id =? limit 1", productId,materialId);
|
|
|
+ if(findProductMaterial == null){
|
|
|
+
|
|
|
+ jdbcService.insert("insert","INSERT INTO a_product_material (`parent_id`, `material_id`, `material_amount`, `seq`) VALUES (?,?,1,1);",productId,materialId);
|
|
|
+ }
|
|
|
|
|
|
//工艺路径
|
|
|
SysFile sysFile = sysFileService.upload(convertToMultipartFile(file));
|
|
@@ -325,7 +323,7 @@ public class DevicMaintainServiceImpl implements DevicMaintainService {
|
|
|
}
|
|
|
if(y > 0 ){
|
|
|
//完工检检
|
|
|
- jdbcService.insert("insert",insertProcessProcedure,processVersionId,14,2,null,2,++y);
|
|
|
+ jdbcService.insert("insert",insertProcessProcedure,processVersionId,14,1,null,2,++y);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -356,6 +354,13 @@ public class DevicMaintainServiceImpl implements DevicMaintainService {
|
|
|
//生产任务下达
|
|
|
jdbcService.update("update a_production_work_order set apply_status=1 where production_order_id=?",productionOrderId);
|
|
|
}
|
|
|
+ String replace = file.getName().replace(".doc", "_已处理.doc");
|
|
|
+ File newFile = new File(file.getParent(), replace);
|
|
|
+ if (file.renameTo(newFile)) {
|
|
|
+ System.out.println("文件重命名成功!");
|
|
|
+ } else {
|
|
|
+ System.out.println("文件重命名失败!");
|
|
|
+ }
|
|
|
fis.close();
|
|
|
document.close();
|
|
|
} catch (IOException e) {
|