|
@@ -6,6 +6,9 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.github.zuihou.base.service.SuperServiceImpl;
|
|
|
import com.github.zuihou.business.DemoLine.DemoLineConstant;
|
|
|
+import com.github.zuihou.business.productionReadyCenter.entity.BBomProcedureTool;
|
|
|
+import com.github.zuihou.business.productionReadyCenter.entity.BomProcedure;
|
|
|
+import com.github.zuihou.business.productionReadyCenter.service.BomProcedureToolService;
|
|
|
import com.github.zuihou.business.productionResourceCenter.dao.ProductionresourceBizMapper;
|
|
|
import com.github.zuihou.business.productionResourceCenter.dao.ProgramMapper;
|
|
|
import com.github.zuihou.business.productionResourceCenter.dto.ProgramSaveDTO;
|
|
@@ -13,6 +16,7 @@ import com.github.zuihou.business.productionResourceCenter.dto.ProgramUpdateDTO;
|
|
|
import com.github.zuihou.business.productionResourceCenter.entity.Productionresource;
|
|
|
import com.github.zuihou.business.productionResourceCenter.entity.Program;
|
|
|
import com.github.zuihou.business.productionResourceCenter.entity.ProgramSuitProductionresource;
|
|
|
+import com.github.zuihou.business.productionResourceCenter.entity.Tool;
|
|
|
import com.github.zuihou.business.productionResourceCenter.service.ProgramService;
|
|
|
import com.github.zuihou.business.productionResourceCenter.service.ProgramSuitProductionresourceService;
|
|
|
import com.github.zuihou.common.constant.UrlConfConstant;
|
|
@@ -72,6 +76,9 @@ public class ProgramServiceImpl extends SuperServiceImpl<ProgramMapper, Program>
|
|
|
@Autowired
|
|
|
protected FileServerProperties fileProperties;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private BomProcedureToolService bomProcedureToolService;
|
|
|
+
|
|
|
@Override
|
|
|
public IPage<Program> pageList(IPage page, LbqWrapper<Program> wrapper) {
|
|
|
return baseMapper.pageList(page, wrapper);
|
|
@@ -150,7 +157,7 @@ public class ProgramServiceImpl extends SuperServiceImpl<ProgramMapper, Program>
|
|
|
|
|
|
@Override
|
|
|
public Map getUploadFile(String fileName) {
|
|
|
- return getFileContent(fileName);
|
|
|
+ return getFileContent(fileName,null);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -162,11 +169,11 @@ public class ProgramServiceImpl extends SuperServiceImpl<ProgramMapper, Program>
|
|
|
//获取文件名
|
|
|
fileName = attachmentList.get(0).getFilename();
|
|
|
}
|
|
|
- return getFileContent(fileName);
|
|
|
+ return getFileContent(fileName,model);
|
|
|
}
|
|
|
|
|
|
//文件内容
|
|
|
- public Map getFileContent(String fileName){
|
|
|
+ public Map getFileContent(String fileName,Program model){
|
|
|
Map map = new HashMap<>();
|
|
|
if(StrUtil.isNotEmpty(fileName)){
|
|
|
String tenant = BaseContextHandler.getTenant();
|
|
@@ -181,14 +188,18 @@ public class ProgramServiceImpl extends SuperServiceImpl<ProgramMapper, Program>
|
|
|
List list = FileUtil.loadFileLines(file);
|
|
|
long endTime = System.currentTimeMillis(); //获取结束时间
|
|
|
//插入刀具数据 --- 测试
|
|
|
- List<Map> toolList = new ArrayList<Map>();
|
|
|
- Map programMap = new HashMap();
|
|
|
- programMap.put("specification","规格1");
|
|
|
- programMap.put("model","型号01");
|
|
|
- programMap.put("brand","品牌01");
|
|
|
- programMap.put("usageTime","使用时间");
|
|
|
- programMap.put("duration","持续时间");
|
|
|
- toolList.add(programMap);
|
|
|
+ List<BBomProcedureTool> toolList = null;
|
|
|
+
|
|
|
+ if(model!=null){
|
|
|
+ toolList = bomProcedureToolService.list(Wraps.<BBomProcedureTool>lbQ().eq(BBomProcedureTool::getProgramId,model.getId()));
|
|
|
+ }
|
|
|
+// Map programMap = new HashMap();
|
|
|
+// programMap.put("specification","规格1");
|
|
|
+// programMap.put("model","型号01");
|
|
|
+// programMap.put("brand","品牌01");
|
|
|
+// programMap.put("usageTime","使用时间");
|
|
|
+// programMap.put("duration","持续时间");
|
|
|
+// toolList.add(programMap);
|
|
|
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
if(list != null && list.size() >0){
|