Compare commits

...

18 Commits

Author SHA1 Message Date
1cd6750710 bug 2026-03-26 01:47:35 +08:00
b745bb8482 bug 2026-03-26 01:14:31 +08:00
9a9dc780e4 Merge branch 'deng' into deng-release 2026-03-26 00:48:29 +08:00
3208f2b8a3 bug 2026-03-26 00:48:05 +08:00
44b6bf04d5 Merge branch 'deng' into deng-release 2026-03-25 21:05:48 +08:00
75f33e37d7 bug 2026-03-25 00:56:45 +08:00
17751bd0ab bug fixed 内部人员教育下载不了文件 2026-03-25 00:48:45 +08:00
82d68ed669 bug fixed mpoint 2026-03-23 23:23:22 +08:00
09fce43c98 bug fixed mpoint 2026-03-23 23:20:00 +08:00
9895757c92 Merge branch 'deng' into deng-release 2026-03-23 21:42:59 +08:00
bce9cc42e8 bug fixed active 2026-03-23 21:42:19 +08:00
6de1aabe80 bug fixed 所属部门 2026-03-17 00:53:23 +08:00
3ea3e0a9af bug fixed 2026-03-17 00:04:44 +08:00
56da3dc9ff bug fixed 2026-03-16 20:31:00 +08:00
2bfa643373 namespace 2026-03-12 09:01:47 +08:00
5e52e1db7c Merge branch 'deng' into deng-release 2026-03-12 01:45:42 +08:00
1c8f1f98d5 Merge branch 'deng' into deng-release 2026-03-12 01:13:27 +08:00
3da9c9afb5 业务流程类别bug bak 2026-03-12 01:02:22 +08:00
29 changed files with 2159 additions and 1817 deletions

View File

@ -63,6 +63,7 @@ import java.util.Locale;
import java.util.Map; import java.util.Map;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
/** /**
* 流程模型控制器 * 流程模型控制器
* *
@ -92,94 +93,97 @@ public class ModelController {
protected TaskService taskService; protected TaskService taskService;
@RequestMapping("/showModelList.do") @RequestMapping("/showModelList.do")
public String showModelList(HttpServletRequest request,Model model) { public String showModelList(HttpServletRequest request, Model model) {
return "/activiti/modelList"; return "/activiti/modelList";
} }
@RequestMapping("/showProcessTechnicsList.do") @RequestMapping("/showProcessTechnicsList.do")
public String showProcessTechnicsList(HttpServletRequest request,Model model) { public String showProcessTechnicsList(HttpServletRequest request, Model model) {
return "/activiti/processTechnicsList"; return "/activiti/processTechnicsList";
} }
/* /*
* 模型副本 * 模型副本
* */ * */
@RequestMapping(value = "copycreat.do") @RequestMapping(value = "copycreat.do")
public ModelAndView copycreat(HttpServletRequest request, public ModelAndView copycreat(HttpServletRequest request,
HttpServletResponse response,Model model HttpServletResponse response, Model model
) throws IOException { ) throws IOException {
int result =0; int result = 0;
User cu = (User)request.getSession().getAttribute("cu"); User cu = (User) request.getSession().getAttribute("cu");
String modelid = request.getParameter("id"); String modelid = request.getParameter("id");
org.activiti.engine.repository.Model modelData = repositoryService.getModel(modelid); org.activiti.engine.repository.Model modelData = repositoryService.getModel(modelid);
ObjectNode modelNode = (ObjectNode) new ObjectMapper().readTree(repositoryService.getModelEditorSource(modelData.getId())); ObjectNode modelNode = (ObjectNode) new ObjectMapper().readTree(repositoryService.getModelEditorSource(modelData.getId()));
byte[] bpmnBytes = null; byte[] bpmnBytes = null;
try { try {
bpmnBytes=modelNode.toString().getBytes("utf-8"); bpmnBytes = modelNode.toString().getBytes("utf-8");
} catch (Exception e) { } catch (Exception e) {
} }
org.activiti.engine.repository.Model modelData_new = repositoryService.newModel(); org.activiti.engine.repository.Model modelData_new = repositoryService.newModel();
ObjectMapper objectMapper = new ObjectMapper(); ObjectMapper objectMapper = new ObjectMapper();
ObjectNode modelObjectNode = objectMapper.createObjectNode(); ObjectNode modelObjectNode = objectMapper.createObjectNode();
modelObjectNode.put(ModelDataJsonConstants.MODEL_NAME,modelData.getName()+"(副本)" ); modelObjectNode.put(ModelDataJsonConstants.MODEL_NAME, modelData.getName() + "(副本)");
modelObjectNode.put(ModelDataJsonConstants.MODEL_REVISION, 1); modelObjectNode.put(ModelDataJsonConstants.MODEL_REVISION, 1);
modelObjectNode.put(ModelDataJsonConstants.MODEL_DESCRIPTION, modelData.getName()+"(副本)"); modelObjectNode.put(ModelDataJsonConstants.MODEL_DESCRIPTION, modelData.getName() + "(副本)");
modelData_new.setMetaInfo(modelObjectNode.toString()); modelData_new.setMetaInfo(modelObjectNode.toString());
modelData_new.setName(modelData.getName()+"(副本)"); modelData_new.setName(modelData.getName() + "(副本)");
modelData_new.setKey(modelData.getKey()); modelData_new.setKey(modelData.getKey());
repositoryService.saveModel(modelData_new); repositoryService.saveModel(modelData_new);
repositoryService.addModelEditorSource(modelData_new.getId(),bpmnBytes ); repositoryService.addModelEditorSource(modelData_new.getId(), bpmnBytes);
result =1; result = 1;
model.addAttribute("result",result); model.addAttribute("result", result);
return new ModelAndView("result"); return new ModelAndView("result");
} }
@RequestMapping("/doimportExcel.do") @RequestMapping("/doimportExcel.do")
public String doimportTechnics(HttpServletRequest request,Model model){ public String doimportTechnics(HttpServletRequest request, Model model) {
return "/activiti/importExcel4Model"; return "/activiti/importExcel4Model";
} }
@RequestMapping(value = "saveImportModel.do") @RequestMapping(value = "saveImportModel.do")
public ModelAndView saveImportActiviti(@RequestParam MultipartFile[] file, HttpServletRequest request, public ModelAndView saveImportActiviti(@RequestParam MultipartFile[] file, HttpServletRequest request,
HttpServletResponse response,Model model) throws IOException { HttpServletResponse response, Model model) throws IOException {
int result=0; int result = 0;
User cu = (User)request.getSession().getAttribute("cu"); User cu = (User) request.getSession().getAttribute("cu");
//要存入的实际地址 //要存入的实际地址
String realPath = request.getSession().getServletContext().getRealPath("/"); String realPath = request.getSession().getServletContext().getRealPath("/");
String pjName = request.getContextPath().substring(1, request.getContextPath().length()); String pjName = request.getContextPath().substring(1, request.getContextPath().length());
realPath = realPath.replace(pjName,"Temp"); realPath = realPath.replace(pjName, "Temp");
//String technicsname=""; //String technicsname="";
List<TaskModel> taskModels= new ArrayList<>();//(technicsname,ptList); List<TaskModel> taskModels = new ArrayList<>();//(technicsname,ptList);
String modelid =processModelService.autoImport(taskModels); String modelid = processModelService.autoImport(taskModels);
List<String> unmainProcedure =new ArrayList<>();//存储未匹配预设工序的工序名 List<String> unmainProcedure = new ArrayList<>();//存储未匹配预设工序的工序名
if(modelid!=null && !modelid.isEmpty()){ if (modelid != null && !modelid.isEmpty()) {
try{ try {
SimpleDateFormat dateFormat = new SimpleDateFormat( SimpleDateFormat dateFormat = new SimpleDateFormat(
"yyyy-MM-dd HH:mm:ss.SSS", Locale.SIMPLIFIED_CHINESE); "yyyy-MM-dd HH:mm:ss.SSS", Locale.SIMPLIFIED_CHINESE);
result=1; result = 1;
}catch(Exception e){ } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
repositoryService.deleteModel(modelid);//管控信息保存失败时,删除模型 repositoryService.deleteModel(modelid);//管控信息保存失败时,删除模型
} }
} }
String res_str=""; String res_str = "";
for (String str : unmainProcedure) { for (String str : unmainProcedure) {
if(!res_str.isEmpty()){ if (!res_str.isEmpty()) {
res_str+=","; res_str += ",";
} }
str=str.replace(" ", "").replace("\n", ""); str = str.replace(" ", "").replace("\n", "");
res_str+=str; res_str += str;
} }
model.addAttribute("result","{\"res\":\""+result+"\",\"unmatch\":\""+res_str+"\"}"); model.addAttribute("result", "{\"res\":\"" + result + "\",\"unmatch\":\"" + res_str + "\"}");
return new ModelAndView("result"); return new ModelAndView("result");
} }
/* //导入文档最后一个sheet /* //导入文档最后一个sheet
public String importByExcel(String realPath, MultipartFile[] file,List<ProcessTechnics> ptList) throws IOException { public String importByExcel(String realPath, MultipartFile[] file,List<ProcessTechnics> ptList) throws IOException {
String technicsname=""; String technicsname="";
//上传文件的原名(即上传前的文件名字) //上传文件的原名(即上传前的文件名字)
@ -240,16 +244,16 @@ public class ModelController {
return technicsname; return technicsname;
} }
*/ //根据导入excel获取工艺名称即产品编号 */ //根据导入excel获取工艺名称即产品编号
private String getTechnicsName(Sheet sheet ,int row_NO){ private String getTechnicsName(Sheet sheet, int row_NO) {
String res=""; String res = "";
Row row = sheet.getRow(row_NO); Row row = sheet.getRow(row_NO);
for(int i=0;i<row.getLastCellNum();i++){ for (int i = 0; i < row.getLastCellNum(); i++) {
String cellcontent=getMergedRegionValue(sheet,row_NO,i); String cellcontent = getMergedRegionValue(sheet, row_NO, i);
if(cellcontent!=null && cellcontent.equals(CommString.Flag_Technics_Name)){ if (cellcontent != null && cellcontent.equals(CommString.Flag_Technics_Name)) {
continue; continue;
}else{ } else {
res=cellcontent; res = cellcontent;
break; break;
} }
@ -418,60 +422,64 @@ public class ModelController {
/* /*
* 获取主工序code * 获取主工序code
* */ * */
/** /**
* 获取合并单元格的值 * 获取合并单元格的值
*
* @param sheet * @param sheet
* @param row * @param row
* @param column * @param column
* @return * @return
*/ */
public String getMergedRegionValue(Sheet sheet ,int row , int column){ public String getMergedRegionValue(Sheet sheet, int row, int column) {
int sheetMergeCount = sheet.getNumMergedRegions(); int sheetMergeCount = sheet.getNumMergedRegions();
for(int i = 0 ; i < sheetMergeCount ; i++){ for (int i = 0; i < sheetMergeCount; i++) {
CellRangeAddress ca = sheet.getMergedRegion(i); CellRangeAddress ca = sheet.getMergedRegion(i);
int firstColumn = ca.getFirstColumn(); int firstColumn = ca.getFirstColumn();
int lastColumn = ca.getLastColumn(); int lastColumn = ca.getLastColumn();
int firstRow = ca.getFirstRow(); int firstRow = ca.getFirstRow();
int lastRow = ca.getLastRow(); int lastRow = ca.getLastRow();
if(row >= firstRow && row <= lastRow){ if (row >= firstRow && row <= lastRow) {
if(column >= firstColumn && column <= lastColumn){ if (column >= firstColumn && column <= lastColumn) {
Row fRow = sheet.getRow(firstRow); Row fRow = sheet.getRow(firstRow);
Cell fCell = fRow.getCell(firstColumn); Cell fCell = fRow.getCell(firstColumn);
return getCellValue(fCell) ; return getCellValue(fCell);
} }
} }
} }
return null ; return null;
} }
/** /**
* 获取单元格的值 * 获取单元格的值
*
* @param cell * @param cell
* @return * @return
*/ */
public String getCellValue(Cell cell){ public String getCellValue(Cell cell) {
if(cell == null) { if (cell == null) {
return ""; return "";
} }
if(cell.getCellType() == CellType.STRING){ if (cell.getCellType() == CellType.STRING) {
return cell.getStringCellValue(); return cell.getStringCellValue();
}else if(cell.getCellType() == CellType.BOOLEAN){ } else if (cell.getCellType() == CellType.BOOLEAN) {
return String.valueOf(cell.getBooleanCellValue()); return String.valueOf(cell.getBooleanCellValue());
}else if(cell.getCellType() == CellType.FORMULA){ } else if (cell.getCellType() == CellType.FORMULA) {
return cell.getCellFormula() ; return cell.getCellFormula();
}else if(cell.getCellType() == CellType.NUMERIC){ } else if (cell.getCellType() == CellType.NUMERIC) {
return String.valueOf(cell.getNumericCellValue()); return String.valueOf(cell.getNumericCellValue());
@ -479,6 +487,7 @@ public class ModelController {
return ""; return "";
} }
/* /*
* 将存在的值赋给目标变量 * 将存在的值赋给目标变量
* */ * */
@ -504,44 +513,45 @@ public class ModelController {
throw new Exception("属性复制失败:" + e.getMessage()); throw new Exception("属性复制失败:" + e.getMessage());
} }
} }
/** /**
* 流程定义列表 * 流程定义列表
* *
* @return * @return
*/ */
@RequestMapping(value = "/getModelList.do") @RequestMapping(value = "/getModelList.do")
public ModelAndView getModelList(HttpServletRequest request,Model model, public ModelAndView getModelList(HttpServletRequest request, Model model,
@RequestParam(value = "page") Integer page, @RequestParam(value = "page") Integer page,
@RequestParam(value = "rows") Integer rows, @RequestParam(value = "rows") Integer rows,
@RequestParam(value = "sort", required=false) String sort, @RequestParam(value = "sort", required = false) String sort,
@RequestParam(value = "order", required=false) String order) { @RequestParam(value = "order", required = false) String order) {
User cu= (User)request.getSession().getAttribute("cu"); User cu = (User) request.getSession().getAttribute("cu");
int startNum=0; int startNum = 0;
if(rows==null || rows==0){ if (rows == null || rows == 0) {
rows = 50; rows = 50;
} }
if(page!=null && page>0){ if (page != null && page > 0) {
startNum =(page-1)*rows; startNum = (page - 1) * rows;
} }
String wherestr = " where 1=1 "; String wherestr = " where 1=1 ";
if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) {
wherestr += " and NAME_ like '%"+request.getParameter("search_name")+"%' "; wherestr += " and NAME_ like '%" + request.getParameter("search_name") + "%' ";
} }
if(request.getParameter("search_code")!=null && !request.getParameter("search_code").isEmpty()){ if (request.getParameter("search_code") != null && !request.getParameter("search_code").isEmpty()) {
wherestr += " and KEY_ like '%"+request.getParameter("search_code")+"%' "; wherestr += " and KEY_ like '%" + request.getParameter("search_code") + "%' ";
}else{ } else {
if(!cu.getId().equals(CommString.ID_Admin)){ if (!cu.getId().equals(CommString.ID_Admin)) {
List<Company> companies = unitService.getCompaniesByUserId(cu.getId()); List<Company> companies = unitService.getCompaniesByUserId(cu.getId());
if(companies!=null && companies.size()>0){ if (companies != null && companies.size() > 0) {
for(int i=0;i<companies.size();i++){ for (int i = 0; i < companies.size(); i++) {
wherestr += " and KEY_ like '%"+companies.get(0).getId()+"%' "; wherestr += " and KEY_ like '%" + companies.get(0).getId() + "%' ";
} }
} }
} }
} }
String sql = "select * from [ACT_RE_MODEL]"+wherestr; String sql = "select * from [ACT_RE_MODEL]" + wherestr;
//page = 2; //page = 2;
// List<org.activiti.engine.repository.Model> list = repositoryService.createModelQuery().orderByCreateTime().desc().listPage(startNum, rows); // List<org.activiti.engine.repository.Model> list = repositoryService.createModelQuery().orderByCreateTime().desc().listPage(startNum, rows);
List<org.activiti.engine.repository.Model> list = repositoryService.createNativeModelQuery().sql(sql).list(); List<org.activiti.engine.repository.Model> list = repositoryService.createNativeModelQuery().sql(sql).list();
@ -565,98 +575,103 @@ public class ModelController {
} }
}*/ }*/
PageInfo<org.activiti.engine.repository.Model> pi = new PageInfo<org.activiti.engine.repository.Model>(list); PageInfo<org.activiti.engine.repository.Model> pi = new PageInfo<org.activiti.engine.repository.Model>(list);
JSONArray json=JSONArray.fromObject(list); JSONArray json = JSONArray.fromObject(list);
String result="{\"total\":"+list.size()+",\"rows\":"+json+"}"; String result = "{\"total\":" + list.size() + ",\"rows\":" + json + "}";
model.addAttribute("result",result); model.addAttribute("result", result);
return new ModelAndView("result"); return new ModelAndView("result");
// page.setTotalCount(processDefinitionQuery.count()); // page.setTotalCount(processDefinitionQuery.count());
// page.setResult(objects); // page.setResult(objects);
// mav.addObject("page", page); // mav.addObject("page", page);
// //
// return mav; // return mav;
} }
/** /**
* 流程定义列表 * 流程定义列表
* *
* @return * @return
*/ */
@RequestMapping(value = "/getModelAll.do") @RequestMapping(value = "/getModelAll.do")
public ModelAndView getModelAll(HttpServletRequest request,Model model) { public ModelAndView getModelAll(HttpServletRequest request, Model model) {
User cu=(User)request.getSession().getAttribute("cu"); User cu = (User) request.getSession().getAttribute("cu");
String userId = cu.getId(); String userId = cu.getId();
String wherestr = " where 1=1 "; String wherestr = " where 1=1 ";
if(request.getParameter("bizid")!=null && !request.getParameter("bizid").isEmpty()){ if (request.getParameter("bizid") != null && !request.getParameter("bizid").isEmpty()) {
wherestr += " and KEY_ like '%"+request.getParameter("bizid")+"%' "; wherestr += " and KEY_ like '%" + request.getParameter("bizid") + "%' ";
} }
String sql = "select * from [ACT_RE_MODEL]"+wherestr; String sql = "select * from [ACT_RE_MODEL]" + wherestr;
List<org.activiti.engine.repository.Model> list = repositoryService.createNativeModelQuery().sql(sql).list(); List<org.activiti.engine.repository.Model> list = repositoryService.createNativeModelQuery().sql(sql).list();
JSONArray json=JSONArray.fromObject(list); JSONArray json = JSONArray.fromObject(list);
JSONArray rows = new JSONArray(); JSONArray rows = new JSONArray();
if(json!=null && json.size()>0){ if (json != null && json.size() > 0) {
for(int i=0;i<json.size();i++){ for (int i = 0; i < json.size(); i++) {
JSONObject job = json.getJSONObject(i); JSONObject job = json.getJSONObject(i);
TaskQuery taskQuery = taskService.createTaskQuery().taskCandidateOrAssigned(userId).processDefinitionKey(job.get("key").toString()); TaskQuery taskQuery = taskService.createTaskQuery().taskCandidateOrAssigned(userId).processDefinitionKey(job.get("key").toString());
List<Task> taskList = taskQuery.list(); List<Task> taskList = taskQuery.list();
int taskNum = taskList.size(); int taskNum = taskList.size();
job.put("taskNum",taskNum); job.put("taskNum", taskNum);
rows.add(job); rows.add(job);
} }
} }
String result="{\"total\":"+list.size()+",\"rows\":"+rows+"}"; String result = "{\"total\":" + list.size() + ",\"rows\":" + rows + "}";
model.addAttribute("result",result); model.addAttribute("result", result);
return new ModelAndView("result"); return new ModelAndView("result");
} }
@RequestMapping("/addModel.do") @RequestMapping("/addModel.do")
public String addModel(HttpServletRequest request,Model model) { public String addModel(HttpServletRequest request, Model model) {
Company company = this.unitService.getCompById(request.getParameter("companyId")); Company company = this.unitService.getCompById(request.getParameter("companyId"));
request.setAttribute("company", company); request.setAttribute("company", company);
return "/activiti/modelAdd"; return "/activiti/modelAdd";
} }
@RequestMapping("/editModel.do") @RequestMapping("/editModel.do")
public String editModel(HttpServletRequest request,Model model) { public String editModel(HttpServletRequest request, Model model) {
String modelId = request.getParameter("modelid"); String modelId = request.getParameter("modelid");
org.activiti.engine.repository.Model modelData = repositoryService.getModel(modelId); org.activiti.engine.repository.Model modelData = repositoryService.getModel(modelId);
model.addAttribute("model", modelData); model.addAttribute("model", modelData);
String metainfo = modelData.getMetaInfo(); String metainfo = modelData.getMetaInfo();
JSONObject modelObjectNode = JSONObject.fromObject(metainfo) ; JSONObject modelObjectNode = JSONObject.fromObject(metainfo);
String description = modelObjectNode.getString(ModelDataJsonConstants.MODEL_DESCRIPTION); String description = modelObjectNode.getString(ModelDataJsonConstants.MODEL_DESCRIPTION);
String[] str =modelData.getKey().split("-"); String[] str = modelData.getKey().split("-");
model.addAttribute("processTypeId", str[0]); model.addAttribute("processTypeId", str[0]);
String companyId = str[1]; String companyId = str[1];
Company company = this.unitService.getCompById(companyId); Company company = this.unitService.getCompById(companyId);
request.setAttribute("company", company); request.setAttribute("company", company);
model.addAttribute("description", description); model.addAttribute("description", description);
if (str.length>2) { if (str.length > 2) {
String maintenanceType = str[2]; String maintenanceType = str[2];
model.addAttribute("maintenanceType", maintenanceType); model.addAttribute("maintenanceType", maintenanceType);
} }
return "/activiti/modelEdit"; return "/activiti/modelEdit";
} }
/** /**
* 编辑流程图 * 编辑流程图
* @author wuping *
* @return * @return
* @author wuping
*/ */
@RequestMapping("/editFlow.do") @RequestMapping("/editFlow.do")
public String editFlow(HttpServletRequest request,Model model) { public String editFlow(HttpServletRequest request, Model model) {
return "/activiti/modelFlowEdit"; return "/activiti/modelFlowEdit";
} }
/** /**
* 编辑流程节点添加业务 * 编辑流程节点添加业务
* @author wuping *
* @return * @return
* @author wuping
*/ */
@RequestMapping("/editNode.do") @RequestMapping("/editNode.do")
public String editNode(HttpServletRequest request,Model model) { public String editNode(HttpServletRequest request, Model model) {
//String prString= request.getParameter("processTypeId"); //String prString= request.getParameter("processTypeId");
String modelid = request.getParameter("modelid"); String modelid = request.getParameter("modelid");
int index=0; int index = 0;
String resourceId = request.getParameter("resourceId"); String resourceId = request.getParameter("resourceId");
String bizId = request.getParameter("bizId"); String bizId = request.getParameter("bizId");
Company company = this.unitService.getCompById(bizId); Company company = this.unitService.getCompById(bizId);
@ -667,22 +682,22 @@ public class ModelController {
Object businessid = ""; Object businessid = "";
try { try {
modelNode = (ObjectNode) new ObjectMapper().readTree(repositoryService.getModelEditorSource(modelid)); modelNode = (ObjectNode) new ObjectMapper().readTree(repositoryService.getModelEditorSource(modelid));
for(int i=0;i<modelNode.get("childShapes").size();i++){ for (int i = 0; i < modelNode.get("childShapes").size(); i++) {
if(modelNode.get("childShapes").path(i).get("resourceId").asText().equals(resourceId)){ if (modelNode.get("childShapes").path(i).get("resourceId").asText().equals(resourceId)) {
index = i; index = i;
break; break;
} }
} }
JsonNode json =modelNode.get("childShapes").path(index); JsonNode json = modelNode.get("childShapes").path(index);
JsonNode properties = json.get("properties"); JsonNode properties = json.get("properties");
System.out.println(properties); System.out.println(properties);
name =properties.get("name").asText(); name = properties.get("name").asText();
JsonNode stencil = json.get("stencil"); JsonNode stencil = json.get("stencil");
nodetype =stencil.get("id").asText(); nodetype = stencil.get("id").asText();
businessid =properties.get("documentation"); businessid = properties.get("documentation");
if(businessid != null){ if (businessid != null) {
businessid =properties.get("documentation").asText(); businessid = properties.get("documentation").asText();
}else{ } else {
businessid = ""; businessid = "";
} }
@ -709,45 +724,50 @@ public class ModelController {
/** /**
* 流程节点列表 * 流程节点列表
* @author wuping *
* @return * @return
* @author wuping
*/ */
@RequestMapping("modelNode.do") @RequestMapping("modelNode.do")
public ModelAndView modelNode(HttpServletRequest request,Model model) { public ModelAndView modelNode(HttpServletRequest request, Model model) {
String modelId = request.getParameter("modelid"); String modelId = request.getParameter("modelid");
org.activiti.engine.repository.Model modelData = repositoryService.getModel(modelId); org.activiti.engine.repository.Model modelData = repositoryService.getModel(modelId);
model.addAttribute("model", modelData); model.addAttribute("model", modelData);
JSONArray jsonArray =new JSONArray(); JSONArray jsonArray = new JSONArray();
Map map; Map map;
try { try {
ObjectNode modelNode = (ObjectNode) new ObjectMapper().readTree(repositoryService.getModelEditorSource(modelData.getId())); ObjectNode modelNode = (ObjectNode) new ObjectMapper().readTree(repositoryService.getModelEditorSource(modelData.getId()));
JsonNode childShapes =modelNode.get("childShapes"); JsonNode childShapes = modelNode.get("childShapes");
if(childShapes!= null && childShapes.size()>0){ if (childShapes != null && childShapes.size() > 0) {
for(int i=0;i<childShapes.size();i++){ for (int i = 0; i < childShapes.size(); i++) {
JsonNode stencil = childShapes.path(i).get("stencil"); JsonNode stencil = childShapes.path(i).get("stencil");
if(stencil.get("id").asText().toString().equals("UserTask")){ if (stencil.get("id").asText().toString().equals("UserTask")) {
JSONObject json = JSONObject.fromObject(childShapes.path(i).toString()); JSONObject json = JSONObject.fromObject(childShapes.path(i).toString());
JSONObject properties = JSONObject.fromObject(json.get("properties").toString()); JSONObject properties = JSONObject.fromObject(json.get("properties").toString());
String documentation = properties.get("documentation").toString(); String documentation = "";
Object documentation1 = properties.get("documentation");
if (documentation1 != null) {
documentation = documentation1.toString();
json.put("businessunit", businessUnitService.selectById(documentation));
}
// 获取节点名称 // 获取节点名称
String nodeName = ""; String nodeName = "";
if(properties.has("name") && properties.get("name") != null) { if (properties.has("name") && properties.get("name") != null) {
nodeName = properties.get("name").toString(); nodeName = properties.get("name").toString();
}else if(properties.has("namename") && properties.get("namename") != null) {
nodeName = properties.get("namename").toString();
} }
// 添加节点名称字段,方便前端显示 // 添加节点名称字段,方便前端显示
json.put("nodeName", nodeName); json.put("nodeName", nodeName);
json.put("businessunit", businessUnitService.selectById(documentation));
String resourceId = json.get("resourceId").toString(); String resourceId = json.get("resourceId").toString();
List<ModelNodeJob> list = this.jobService.selectModelNodeJobListByWhere(" where resource_id='"+resourceId+"' and model_id ='"+modelData.getId()+"' "); List<ModelNodeJob> list = this.jobService.selectModelNodeJobListByWhere(" where resource_id='" + resourceId + "' and model_id ='" + modelData.getId() + "' ");
StringBuilder jobNames= new StringBuilder(); StringBuilder jobNames = new StringBuilder();
StringBuilder jobIds= new StringBuilder(); StringBuilder jobIds = new StringBuilder();
if(list != null && !list.isEmpty()){ if (list != null && !list.isEmpty()) {
for(int j=0;j<list.size();j++){ for (int j = 0; j < list.size(); j++) {
if(list.get(j)!=null){ if (list.get(j) != null) {
if(list.get(j).getName() != null && list.get(j).getName() !="" && list.get(j).getName() != "null"){ if (list.get(j).getName() != null && list.get(j).getName() != "" && list.get(j).getName() != "null") {
jobNames.append(list.get(j).getName()).append(","); jobNames.append(list.get(j).getName()).append(",");
jobIds.append(list.get(j).getJobId()).append(","); jobIds.append(list.get(j).getJobId()).append(",");
} }
@ -756,7 +776,7 @@ public class ModelController {
} }
} }
if(!jobNames.toString().isEmpty()){ if (!jobNames.toString().isEmpty()) {
json.put("jobNames", jobNames.toString()); json.put("jobNames", jobNames.toString());
json.put("jobIds", jobIds.toString()); json.put("jobIds", jobIds.toString());
@ -768,7 +788,7 @@ public class ModelController {
} }
} }
String result = "{\"total\":" + jsonArray.size() + ",\"rows\":" + jsonArray + "}"; String result = "{\"total\":" + jsonArray.size() + ",\"rows\":" + jsonArray + "}";
model.addAttribute("result",result); model.addAttribute("result", result);
} catch (JsonProcessingException e) { } catch (JsonProcessingException e) {
@ -782,32 +802,33 @@ public class ModelController {
return new ModelAndView("result"); return new ModelAndView("result");
} }
/** /**
* 更新模型 * 更新模型
*/ */
@RequestMapping(value = "update", method = RequestMethod.POST) @RequestMapping(value = "update", method = RequestMethod.POST)
public String update(HttpServletRequest request,Model model, public String update(HttpServletRequest request, Model model,
@RequestParam(value ="id") String id, @RequestParam(value = "id") String id,
@RequestParam(value ="name") String name, @RequestParam(value = "name") String name,
@RequestParam(value ="description", required=false) String description, @RequestParam(value = "description", required = false) String description,
@RequestParam(value ="companyid") String companyid, @RequestParam(value = "companyid") String companyid,
@RequestParam(value ="processType") String processType,HttpServletResponse response){ @RequestParam(value = "processType") String processType, HttpServletResponse response) {
User cu= (User)request.getSession().getAttribute("cu"); User cu = (User) request.getSession().getAttribute("cu");
String result=""; String result = "";
try { try {
org.activiti.engine.repository.Model modelData = repositoryService.getModel(id); org.activiti.engine.repository.Model modelData = repositoryService.getModel(id);
modelData.setName(name); modelData.setName(name);
String modelKey=processType+"-"+companyid; String modelKey = processType + "-" + companyid;
String maintenanceType=request.getParameter("maintenanceType"); String maintenanceType = request.getParameter("maintenanceType");
if (ProcessType.B_Maintenance.getId().equals(processType)) { if (ProcessType.B_Maintenance.getId().equals(processType)) {
modelKey+="-"+maintenanceType; modelKey += "-" + maintenanceType;
} }
modelData.setKey(modelKey);//模型key modelData.setKey(modelKey);//模型key
description = StringUtils.defaultString(description); description = StringUtils.defaultString(description);
String metainfo = modelData.getMetaInfo(); String metainfo = modelData.getMetaInfo();
JSONObject modelObjectNode = JSONObject.fromObject(metainfo) ; JSONObject modelObjectNode = JSONObject.fromObject(metainfo);
modelObjectNode.put(ModelDataJsonConstants.MODEL_DESCRIPTION, description); modelObjectNode.put(ModelDataJsonConstants.MODEL_DESCRIPTION, description);
modelData.setMetaInfo(modelObjectNode.toString()); modelData.setMetaInfo(modelObjectNode.toString());
repositoryService.saveModel(modelData); repositoryService.saveModel(modelData);
@ -819,7 +840,7 @@ public class ModelController {
propertiesNode.put("name", modelData.getName()); propertiesNode.put("name", modelData.getName());
modelNode.put("properties", propertiesNode); modelNode.put("properties", propertiesNode);
repositoryService.addModelEditorSource(modelData.getId(), modelNode.toString().getBytes("utf-8")); repositoryService.addModelEditorSource(modelData.getId(), modelNode.toString().getBytes("utf-8"));
result=modelData.getId(); result = modelData.getId();
} catch (Exception e) { } catch (Exception e) {
logger.error("创建模型失败:", e); logger.error("创建模型失败:", e);
} }
@ -827,17 +848,18 @@ public class ModelController {
model.addAttribute("result", result); model.addAttribute("result", result);
return "result"; return "result";
} }
/** /**
* 创建模型 * 创建模型
*/ */
@RequestMapping(value = "create", method = RequestMethod.POST) @RequestMapping(value = "create", method = RequestMethod.POST)
public String create(HttpServletRequest request,Model model, public String create(HttpServletRequest request, Model model,
@RequestParam(value ="name") String name, @RequestParam(value = "name") String name,
@RequestParam(value ="description", required=false) String description, @RequestParam(value = "description", required = false) String description,
@RequestParam(value ="companyid") String companyid, @RequestParam(value = "companyid") String companyid,
@RequestParam(value ="processType") String processType, @RequestParam(value = "processType") String processType,
HttpServletResponse response) { HttpServletResponse response) {
String result=""; String result = "";
try { try {
ObjectMapper objectMapper = new ObjectMapper(); ObjectMapper objectMapper = new ObjectMapper();
ObjectNode editorNode = objectMapper.createObjectNode(); ObjectNode editorNode = objectMapper.createObjectNode();
@ -854,10 +876,10 @@ public class ModelController {
modelObjectNode.put(ModelDataJsonConstants.MODEL_DESCRIPTION, description); modelObjectNode.put(ModelDataJsonConstants.MODEL_DESCRIPTION, description);
modelData.setMetaInfo(modelObjectNode.toString()); modelData.setMetaInfo(modelObjectNode.toString());
modelData.setName(name); modelData.setName(name);
String maintenanceType=request.getParameter("maintenanceType"); String maintenanceType = request.getParameter("maintenanceType");
String modelKey=processType+"-"+companyid; String modelKey = processType + "-" + companyid;
if (ProcessType.B_Maintenance.getId().equals(processType)) { if (ProcessType.B_Maintenance.getId().equals(processType)) {
modelKey+="-"+maintenanceType; modelKey += "-" + maintenanceType;
} }
modelData.setKey(modelKey);//模型key modelData.setKey(modelKey);//模型key
@ -869,37 +891,39 @@ public class ModelController {
repositoryService.saveModel(modelData); repositoryService.saveModel(modelData);
repositoryService.addModelEditorSource(modelData.getId(), editorNode.toString().getBytes("utf-8")); repositoryService.addModelEditorSource(modelData.getId(), editorNode.toString().getBytes("utf-8"));
result=modelData.getId(); result = modelData.getId();
} catch (Exception e) { } catch (Exception e) {
logger.error("创建模型失败:", e); logger.error("创建模型失败:", e);
} }
model.addAttribute("result",result ); model.addAttribute("result", result);
return "result"; return "result";
} }
/** /**
* 更新业务流程节点 * 更新业务流程节点
* @author wuping *
* @return * @return
* @author wuping
*/ */
@RequestMapping("/saveNode.do") @RequestMapping("/saveNode.do")
public String saveNode(HttpServletRequest request,Model model, public String saveNode(HttpServletRequest request, Model model,
@RequestParam(value ="businessid") String businessid, @RequestParam(value = "businessid") String businessid,
@RequestParam(value ="nodename") String nodename, @RequestParam(value = "nodename") String nodename,
@RequestParam(value ="modelid") String modelid, @RequestParam(value = "modelid") String modelid,
@RequestParam(value ="index") String index, @RequestParam(value = "index") String index,
@RequestParam(value = "countersign",required = false,defaultValue = "false") boolean countersign, @RequestParam(value = "countersign", required = false, defaultValue = "false") boolean countersign,
HttpServletResponse response) { HttpServletResponse response) {
String result=""; String result = "";
JsonNode modelNode; JsonNode modelNode;
JSONObject modelobject; JSONObject modelobject;
BpmnModel bpmnModel ; BpmnModel bpmnModel;
BpmnJsonConverter bpmnJsonConverter; BpmnJsonConverter bpmnJsonConverter;
try { try {
int i = Integer.valueOf(index); int i = Integer.valueOf(index);
modelNode = new ObjectMapper().readTree(repositoryService.getModelEditorSource(modelid)); modelNode = new ObjectMapper().readTree(repositoryService.getModelEditorSource(modelid));
modelobject = JSONObject.fromObject(new ObjectMapper().writeValueAsString(modelNode)); modelobject = JSONObject.fromObject(new ObjectMapper().writeValueAsString(modelNode));
JSONObject json= modelobject.getJSONArray("childShapes").getJSONObject(i); JSONObject json = modelobject.getJSONArray("childShapes").getJSONObject(i);
JSONObject properties =json.getJSONObject("properties"); JSONObject properties = json.getJSONObject("properties");
properties.put("documentation", businessid); properties.put("documentation", businessid);
properties.put("name", nodename); properties.put("name", nodename);
properties.put("nodename", nodename); properties.put("nodename", nodename);
@ -944,7 +968,7 @@ public class ModelController {
} catch (Exception e) { } catch (Exception e) {
logger.error("创建模型失败:", e); logger.error("创建模型失败:", e);
} }
model.addAttribute("result",result ); model.addAttribute("result", result);
return "result"; return "result";
} }
@ -952,64 +976,64 @@ public class ModelController {
* 根据Model部署流程 * 根据Model部署流程
*/ */
@RequestMapping(value = "deploy", method = RequestMethod.POST) @RequestMapping(value = "deploy", method = RequestMethod.POST)
public String deploy(HttpServletRequest request,Model model, public String deploy(HttpServletRequest request, Model model,
@RequestParam(value ="modelId") String modelId) { @RequestParam(value = "modelId") String modelId) {
/*String result=processModelService.deploy(modelId); /*String result=processModelService.deploy(modelId);
model.addAttribute("result",result); model.addAttribute("result",result);
return "result";*/ return "result";*/
String result=""; String result = "";
JsonNode modelNode; JsonNode modelNode;
JSONObject modelobject; JSONObject modelobject;
JSONArray childShapes; JSONArray childShapes;
try { try {
modelNode = new ObjectMapper().readTree(repositoryService.getModelEditorSource(modelId)); modelNode = new ObjectMapper().readTree(repositoryService.getModelEditorSource(modelId));
modelobject = JSONObject.fromObject(new ObjectMapper().writeValueAsString(modelNode)); modelobject = JSONObject.fromObject(new ObjectMapper().writeValueAsString(modelNode));
if(modelobject.get("childShapes")!=null){ if (modelobject.get("childShapes") != null) {
childShapes= modelobject.getJSONArray("childShapes"); childShapes = modelobject.getJSONArray("childShapes");
for(int i=0;i<childShapes.size();i++){ for (int i = 0; i < childShapes.size(); i++) {
JSONObject json= childShapes.getJSONObject(i); JSONObject json = childShapes.getJSONObject(i);
JSONObject properties =json.getJSONObject("properties"); JSONObject properties = json.getJSONObject("properties");
JSONObject stencil =json.getJSONObject("stencil"); JSONObject stencil = json.getJSONObject("stencil");
if(!stencil.get("id").toString().equals("StartNoneEvent")&&!stencil.get("id").toString().equals("UserTask")&&!stencil.get("id").toString().equals("SequenceFlow")&&!stencil.get("id").toString().equals("EndNoneEvent") if (!stencil.get("id").toString().equals("StartNoneEvent") && !stencil.get("id").toString().equals("UserTask") && !stencil.get("id").toString().equals("SequenceFlow") && !stencil.get("id").toString().equals("EndNoneEvent")
&&!stencil.get("id").toString().equals("ExclusiveGateway")){ && !stencil.get("id").toString().equals("ExclusiveGateway")) {
model.addAttribute("result","{\"res\":\"0\",\"restr\":\"部署失败,请勿添加除任务、单一选择的网关、开始、结束以外的流程图元素!\"}" ); model.addAttribute("result", "{\"res\":\"0\",\"restr\":\"部署失败,请勿添加除任务、单一选择的网关、开始、结束以外的流程图元素!\"}");
return "result"; return "result";
} }
if(stencil.get("id").toString().equals("UserTask")){ if (stencil.get("id").toString().equals("UserTask")) {
if(properties.get("documentation").toString().equals("")||properties.get("documentation").toString()== null){ if (properties.get("documentation").toString().equals("") || properties.get("documentation").toString() == null) {
model.addAttribute("result","{\"res\":\"0\",\"restr\":\"部署失败,请为节点添加业务!\"}" ); model.addAttribute("result", "{\"res\":\"0\",\"restr\":\"部署失败,请为节点添加业务!\"}");
return "result"; return "result";
} }
} }
//properties.put("documentation", businessid); //properties.put("documentation", businessid);
//properties.put("usertaskassignment", "{\"assignment\":{\"candidateUsers\":[{\"value\":\"#{userIds}\",\"$$hashKey\":\"0BQ\"}],\"assignee\":\"${applicantId}\"}}"); //properties.put("usertaskassignment", "{\"assignment\":{\"candidateUsers\":[{\"value\":\"#{userIds}\",\"$$hashKey\":\"0BQ\"}],\"assignee\":\"${applicantId}\"}}");
if(stencil.get("id").toString().indexOf("SequenceFlow")!=-1){ if (stencil.get("id").toString().indexOf("SequenceFlow") != -1) {
String regEx="[^0-9]"; String regEx = "[^0-9]";
Pattern p = Pattern.compile(regEx); Pattern p = Pattern.compile(regEx);
Matcher m = p.matcher(properties.get("name").toString()); Matcher m = p.matcher(properties.get("name").toString());
String numstr = m.replaceAll("").trim(); String numstr = m.replaceAll("").trim();
numstr=numstr.isEmpty()?"0":numstr; numstr = numstr.isEmpty() ? "0" : numstr;
int num = Integer.valueOf(numstr); int num = Integer.valueOf(numstr);
if(properties.get("name").toString().startsWith("通过")){ if (properties.get("name").toString().startsWith("通过")) {
if(num>0){ if (num > 0) {
properties.put("conditionsequenceflow", "${pass && route=="+num+"}"); properties.put("conditionsequenceflow", "${pass && route==" + num + "}");
}else{ } else {
properties.put("conditionsequenceflow", "${pass}"); properties.put("conditionsequenceflow", "${pass}");
} }
} }
if(properties.get("name").toString().startsWith("不通过")){ if (properties.get("name").toString().startsWith("不通过")) {
if(num>0){ if (num > 0) {
properties.put("conditionsequenceflow", "${!pass && route=="+num+"}"); properties.put("conditionsequenceflow", "${!pass && route==" + num + "}");
}else{ } else {
properties.put("conditionsequenceflow", "${!pass}"); properties.put("conditionsequenceflow", "${!pass}");
} }
} }
} }
} }
}else{ } else {
model.addAttribute("result","{\"res\":\"0\",\"restr\":\"部署失败,请编辑流程图!\"}" ); model.addAttribute("result", "{\"res\":\"0\",\"restr\":\"部署失败,请编辑流程图!\"}");
return "result"; return "result";
} }
@ -1018,12 +1042,12 @@ public class ModelController {
//JSON ----> JsonNode //JSON ----> JsonNode
JsonNode editorNode = mapper.readTree(modelobject.toString()); JsonNode editorNode = mapper.readTree(modelobject.toString());
repositoryService.addModelEditorSource(modelId, editorNode.toString().getBytes("utf-8")); repositoryService.addModelEditorSource(modelId, editorNode.toString().getBytes("utf-8"));
result=processModelService.deploy(modelId); result = processModelService.deploy(modelId);
model.addAttribute("result",result ); model.addAttribute("result", result);
return "result"; return "result";
} catch (Exception e) { } catch (Exception e) {
logger.error("创建模型失败:", e); logger.error("创建模型失败:", e);
model.addAttribute("result","{\"res\":\"0\",\"restr\":\"部署失败!\"}" ); model.addAttribute("result", "{\"res\":\"0\",\"restr\":\"部署失败!\"}");
return "result"; return "result";
} }
@ -1053,8 +1077,8 @@ public class ModelController {
} }
@RequestMapping("/delete.do") @RequestMapping("/delete.do")
public String dodel(HttpServletRequest request,Model model, public String dodel(HttpServletRequest request, Model model,
@RequestParam(value="id") String id){ @RequestParam(value = "id") String id) {
repositoryService.deleteModel(id); repositoryService.deleteModel(id);
model.addAttribute("result", 1); model.addAttribute("result", 1);
return "result"; return "result";
@ -1094,7 +1118,7 @@ public class ModelController {
// 构建模型Key // 构建模型Key
String modelKey = null; String modelKey = null;
User cu = (User)request.getSession().getAttribute("cu"); User cu = (User) request.getSession().getAttribute("cu");
if (companyId != null && !companyId.isEmpty()) { if (companyId != null && !companyId.isEmpty()) {
modelKey = "imported-" + companyId; modelKey = "imported-" + companyId;
} else if (cu != null && !cu.getId().equals(CommString.ID_Admin)) { } else if (cu != null && !cu.getId().equals(CommString.ID_Admin)) {
@ -1145,7 +1169,7 @@ public class ModelController {
try { try {
// 获取当前用户和公司信息 // 获取当前用户和公司信息
User cu = (User)request.getSession().getAttribute("cu"); User cu = (User) request.getSession().getAttribute("cu");
String processTypeId = request.getParameter("processTypeId"); String processTypeId = request.getParameter("processTypeId");
String companyId = request.getParameter("companyId"); String companyId = request.getParameter("companyId");
String maintenanceType = request.getParameter("maintenanceType"); String maintenanceType = request.getParameter("maintenanceType");

View File

@ -93,11 +93,7 @@ public class BusinessUnitController {
public String dosave(HttpServletRequest request,Model model, public String dosave(HttpServletRequest request,Model model,
@ModelAttribute BusinessUnit businessUnit){ @ModelAttribute BusinessUnit businessUnit){
User cu= (User)request.getSession().getAttribute("cu"); User cu= (User)request.getSession().getAttribute("cu");
// Use custom ID if provided, otherwise generate UUID String id = CommUtil.getUUID();
String id = businessUnit.getId();
if(id == null || id.trim().isEmpty()) {
id = CommUtil.getUUID();
}
businessUnit.setId(id); businessUnit.setId(id);
businessUnit.setInsuser(cu.getId()); businessUnit.setInsuser(cu.getId());
businessUnit.setInsdt(CommUtil.nowDate()); businessUnit.setInsdt(CommUtil.nowDate());

View File

@ -327,13 +327,13 @@ public class DataController {
fileIds = fileIds.replace(",","','"); fileIds = fileIds.replace(",","','");
wherestr += " and (id in ('"+fileIds+"') or filename like '%"+fileName+"%') "; wherestr += " and (id in ('"+fileIds+"') or filename like '%"+fileName+"%') ";
} }
if(request.getParameter("masterId")!=null && !request.getParameter("masterId").isEmpty()){ // if(request.getParameter("masterId")!=null && !request.getParameter("masterId").isEmpty()){
String masterId = request.getParameter("masterId"); // String masterId = request.getParameter("masterId");
masterId = masterId.replace(",","','"); // masterId = masterId.replace(",","','");
wherestr += " and masterid in ('"+masterId+"')"; // wherestr += " and masterid in ('"+masterId+"')";
}else if(request.getParameter("equipmentId") == null){ // }else if(request.getParameter("equipmentId") == null){
wherestr += " and masterid in ('')"; // wherestr += " and masterid in ('')";
} // }
if(request.getParameter("equipmentId")!=null && !request.getParameter("equipmentId").isEmpty()){ if(request.getParameter("equipmentId")!=null && !request.getParameter("equipmentId").isEmpty()){
String fileIds = this.equipmentFileService.getFileIds(request.getParameter("equipmentId")); String fileIds = this.equipmentFileService.getFileIds(request.getParameter("equipmentId"));
fileIds = fileIds.replace(",","','"); fileIds = fileIds.replace(",","','");

View File

@ -5696,6 +5696,14 @@ public class EquipmentCardController {
* @param model * @param model
* @return * @return
*/ */
// ├── Water Plant (水厂)
//│ ├── Process Section A (工艺段) ← Previously lost
//│ ├── Process Section B (工艺段) ← Previously lost
//│ ├── Pump Station 1 (泵站) ← Was overwriting above
//│ │ ├── Process Section C (工艺段)
//│ │ └── Process Section D (工艺段)
//│ └── Pump Station 2 (泵站)
// │ └── Process Section E (工艺段)
@RequestMapping("/getProcessSection4EquipmentCardTree.do") @RequestMapping("/getProcessSection4EquipmentCardTree.do")
public String getProcessSection4EquipmentCardTree(HttpServletRequest request, Model model) { public String getProcessSection4EquipmentCardTree(HttpServletRequest request, Model model) {
String unitId = request.getParameter("unitId"); String unitId = request.getParameter("unitId");

View File

@ -36,6 +36,7 @@ import java.util.UUID;
/** /**
* 综合检查 * 综合检查
*
* @author lt * @author lt
*/ */
@Controller @Controller
@ -125,11 +126,13 @@ public class SafetyCheckComprehensiveController {
@RequestMapping("/save.do") @RequestMapping("/save.do")
@ResponseBody @ResponseBody
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Result save(HttpServletRequest request, SafetyCheckComprehensive bean, MultipartFile file) throws Exception { public Result save(HttpServletRequest request, SafetyCheckComprehensive bean, MultipartFile[] multipartFiles) throws Exception {
User cu = (User) request.getSession().getAttribute("cu"); User cu = (User) request.getSession().getAttribute("cu");
bean.setId(UUID.randomUUID().toString()); bean.setId(UUID.randomUUID().toString());
if (file.getSize() > 0) { if (multipartFiles != null) {
safetyFilesService.upload(request, null, SafetyFunctionEnum.SAFETY_CHECK_COMPREHENSIVE.getId(), SafetyCheckStatusEnum.APPLY.getId(), bean.getId()); for (MultipartFile file : multipartFiles) {
safetyFilesService.upload(request, file, SafetyFunctionEnum.SAFETY_CHECK_COMPREHENSIVE.getId(), SafetyCheckStatusEnum.APPLY.getId(), bean.getId());
}
} }
bean.setCheckCode(safetySeqService.code(request, SafetyFunctionEnum.SAFETY_CHECK_COMPREHENSIVE)); bean.setCheckCode(safetySeqService.code(request, SafetyFunctionEnum.SAFETY_CHECK_COMPREHENSIVE));
if (bean.getCheckResult() == SafetyCheckResultEnum.OK.getId()) { if (bean.getCheckResult() == SafetyCheckResultEnum.OK.getId()) {
@ -153,8 +156,8 @@ public class SafetyCheckComprehensiveController {
@RequestMapping("/saveApply.do") @RequestMapping("/saveApply.do")
@ResponseBody @ResponseBody
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Result saveApply(HttpServletRequest request, SafetyCheckComprehensive bean, MultipartFile file) throws Exception { public Result saveApply(HttpServletRequest request, SafetyCheckComprehensive bean, MultipartFile[] file) throws Exception {
if(StringUtils.isEmpty(bean.getDutyUserId())){ if (StringUtils.isEmpty(bean.getDutyUserId())) {
return Result.failed("整改负责人不能为空!"); return Result.failed("整改负责人不能为空!");
} }
@ -232,7 +235,7 @@ public class SafetyCheckComprehensiveController {
@ResponseBody @ResponseBody
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Result apply(HttpServletRequest request, SafetyCheckComprehensive bean) throws IOException, ServiceException { public Result apply(HttpServletRequest request, SafetyCheckComprehensive bean) throws IOException, ServiceException {
if(StringUtils.isEmpty(bean.getDutyUserId())){ if (StringUtils.isEmpty(bean.getDutyUserId())) {
return Result.failed("整改负责人不能为空!"); return Result.failed("整改负责人不能为空!");
} }
update(request, bean); update(request, bean);
@ -336,7 +339,7 @@ public class SafetyCheckComprehensiveController {
@ResponseBody @ResponseBody
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Result response(HttpServletRequest request, SafetyCheckComprehensive bean, String processInstanceId) throws IOException, ServiceException { public Result response(HttpServletRequest request, SafetyCheckComprehensive bean, String processInstanceId) throws IOException, ServiceException {
if(StringUtils.isEmpty(bean.getConfirmUserId())){ if (StringUtils.isEmpty(bean.getConfirmUserId())) {
return Result.failed("验证人不能为空!"); return Result.failed("验证人不能为空!");
} }
@ -388,7 +391,7 @@ public class SafetyCheckComprehensiveController {
bean.getConfirmUserName(), bean.getConfirmUserName(),
bean.getCopyUserId(), bean.getCopyUserId(),
bean.getCopyUserName(), bean.getCopyUserName(),
SafetyCheckStatusEnum.COMPLETE.getTaskRecordPass( bean.getConfirmUserName())); SafetyCheckStatusEnum.COMPLETE.getTaskRecordPass(bean.getConfirmUserName()));
safetyFlowTaskService.saveWorkFlowRecord(true, safetyFlowTaskService.saveWorkFlowRecord(true,
bean.getId(), bean.getId(),
"结束", "结束",

View File

@ -211,7 +211,8 @@ public class SafetyCheckDaylyController {
@ResponseBody @ResponseBody
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Result saveApply(HttpServletRequest request, SafetyCheckDayly bean, MultipartFile file) throws Exception { public Result saveApply(HttpServletRequest request, SafetyCheckDayly bean, MultipartFile file) throws Exception {
if(StringUtils.isEmpty(bean.getDutyUserId())){ if(bean.getCheckResult() != 1 && StringUtils.isEmpty(bean.getDutyUserId())){
// 弱智东西,不相符的才需要整改负责人
return Result.failed("整改负责人不能为空!"); return Result.failed("整改负责人不能为空!");
} }

View File

@ -66,7 +66,7 @@ public class SafetyEducationTraineeController {
**/ **/
@RequestMapping("/add.do") @RequestMapping("/add.do")
public String add(HttpServletRequest request, Model model) throws Exception { public String add(HttpServletRequest request, Model model) throws Exception {
String educationCode =safetySeqService.code(request,SafetyFunctionEnum.EDUCATION_TRAINEE); String educationCode = safetySeqService.code(request, SafetyFunctionEnum.EDUCATION_TRAINEE);
model.addAttribute("educationCode", educationCode); model.addAttribute("educationCode", educationCode);
return "safety/EducationTraineeAdd"; return "safety/EducationTraineeAdd";
} }
@ -82,9 +82,10 @@ public class SafetyEducationTraineeController {
SafetyEducationTrainee educationTrainee = safetyEducationTraineeService.selectById(id); SafetyEducationTrainee educationTrainee = safetyEducationTraineeService.selectById(id);
SafetyFiles file = safetyFilesService.selectById(educationTrainee.getFileId()); SafetyFiles file = safetyFilesService.selectById(educationTrainee.getFileId());
model.addAttribute("bean", educationTrainee); model.addAttribute("bean", educationTrainee);
model.addAttribute("fileName", file==null?"":file.getOriginalFileName()); model.addAttribute("fileName", file == null ? "" : file.getOriginalFileName());
return "safety/EducationTraineeEdit"; return "safety/EducationTraineeEdit";
} }
/** /**
* 跳转至编辑弹窗 * 跳转至编辑弹窗
* *
@ -96,9 +97,10 @@ public class SafetyEducationTraineeController {
SafetyEducationTrainee educationTrainee = safetyEducationTraineeService.selectById(id); SafetyEducationTrainee educationTrainee = safetyEducationTraineeService.selectById(id);
SafetyFiles file = safetyFilesService.selectById(educationTrainee.getFileId()); SafetyFiles file = safetyFilesService.selectById(educationTrainee.getFileId());
model.addAttribute("bean", educationTrainee); model.addAttribute("bean", educationTrainee);
model.addAttribute("fileName",file==null?"":file.getOriginalFileName()); model.addAttribute("fileName", file == null ? "" : file.getOriginalFileName());
return "safety/EducationTraineeView"; return "safety/EducationTraineeView";
} }
/** /**
* 获取分页列表信息 * 获取分页列表信息
* *
@ -169,24 +171,24 @@ public class SafetyEducationTraineeController {
@RequestMapping("/update.do") @RequestMapping("/update.do")
@ResponseBody @ResponseBody
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Result update(HttpServletRequest request,SafetyEducationTrainee bean, MultipartFile file) throws IOException, ParseException { public Result update(HttpServletRequest request, SafetyEducationTrainee bean, MultipartFile file) throws IOException, ParseException {
if (!safetyEducationTraineeService.timeRangeCheck(bean)) { if (!safetyEducationTraineeService.timeRangeCheck(bean)) {
return Result.failed("培训有效期早于培训日期!"); return Result.failed("培训有效期早于培训日期!");
} }
SafetyEducationTrainee oldBean = safetyEducationTraineeService.selectById(bean.getId()); SafetyEducationTrainee oldBean = safetyEducationTraineeService.selectById(bean.getId());
//如果文件id是空的代表用户重新上传的文件先删除原来的文件然后再上传新文件。 //如果文件id是空的代表用户重新上传的文件先删除原来的文件然后再上传新文件。
if (StringUtils.isEmpty(bean.getFileId())&&file.getSize()>0) { if (StringUtils.isEmpty(bean.getFileId()) && file.getSize() > 0) {
List<SafetyFiles> fileBeanList = safetyFilesService.upload(request,file, SafetyFunctionEnum.EDUCATION_TRAINEE.getId(), null, bean.getId()); List<SafetyFiles> fileBeanList = safetyFilesService.upload(request, file, SafetyFunctionEnum.EDUCATION_TRAINEE.getId(), null, bean.getId());
bean.setFileId(fileBeanList.get(0).getId()); bean.setFileId(fileBeanList.get(0).getId());
safetyEducationTraineeService.update(bean); safetyEducationTraineeService.update(bean);
// 删除原来的附件记录 // 删除原来的附件记录
safetyFilesService.deleteById(oldBean.getFileId()); safetyFilesService.deleteById(oldBean.getFileId());
} else if (StringUtils.isEmpty(bean.getFileId()) && file.getSize()==0) { } else if (StringUtils.isEmpty(bean.getFileId()) && file.getSize() == 0) {
bean.setFileId(null); bean.setFileId(null);
safetyEducationTraineeService.update(bean); safetyEducationTraineeService.update(bean);
safetyFilesService.deleteById(oldBean.getFileId()); // safetyFilesService.deleteById(oldBean.getFileId());
}else { } else {
safetyEducationTraineeService.update(bean); safetyEducationTraineeService.update(bean);
} }
return Result.success(); return Result.success();
@ -210,6 +212,7 @@ public class SafetyEducationTraineeController {
} }
return Result.success(); return Result.success();
} }
/** /**
* 删除附件 * 删除附件
* *
@ -224,7 +227,7 @@ public class SafetyEducationTraineeController {
safetyFilesService.deleteById(bean.getFileId()); safetyFilesService.deleteById(bean.getFileId());
bean.setFileId(""); bean.setFileId("");
int row = safetyEducationTraineeService.update(bean); int row = safetyEducationTraineeService.update(bean);
if (row!=0) { if (row != 0) {
return Result.success(); return Result.success();
} }
return Result.failed("删除失败!"); return Result.failed("删除失败!");

View File

@ -170,6 +170,16 @@ public class StaffArchivesController {
return "result"; return "result";
} }
// 更新用户的所属部门
String pid = request.getParameter("pid");
if(StringUtils.isNotBlank(pid)){
User user = this.userService.getUserById(safetyStaffArchives.getUserid());
if(user != null){
user.setPid(pid);
this.userService.updateUserById(user);
}
}
this.staffArchivesService.save(safetyStaffArchives); this.staffArchivesService.save(safetyStaffArchives);
model.addAttribute("result", CommUtil.toJson(Result.success())); model.addAttribute("result", CommUtil.toJson(Result.success()));
return "result"; return "result";
@ -195,6 +205,16 @@ public class StaffArchivesController {
return "result"; return "result";
} }
// 更新用户的所属部门
String pid = request.getParameter("pid");
if(StringUtils.isNotBlank(pid)){
User user = this.userService.getUserById(safetyStaffArchives.getUserid());
if(user != null){
user.setPid(pid);
this.userService.updateUserById(user);
}
}
int result = this.staffArchivesService.update(safetyStaffArchives); int result = this.staffArchivesService.update(safetyStaffArchives);
model.addAttribute("result", CommUtil.toJson(Result.success())); model.addAttribute("result", CommUtil.toJson(Result.success()));
return "result"; return "result";

View File

@ -1607,7 +1607,7 @@ public class MPointController {
mPointExpandService.update(mPoint.getBizid(), mPointExpand); mPointExpandService.update(mPoint.getBizid(), mPointExpand);
} else { } else {
MPointExpand mPointExpand2 = new MPointExpand(); MPointExpand mPointExpand2 = new MPointExpand();
mPointExpand2.setId(CommUtil.getUUID()); // mPointExpand2.setId(CommUtil.getUUID());
mPointExpand2.setInsdt(CommUtil.nowDate()); mPointExpand2.setInsdt(CommUtil.nowDate());
mPointExpand2.setExplain(explain); mPointExpand2.setExplain(explain);
mPointExpand2.setMeasurePointId(mPoint.getId()); mPointExpand2.setMeasurePointId(mPoint.getId());

View File

@ -22,6 +22,10 @@ public class SafetyStaffArchivesVo extends SafetyStaffArchives {
* 性别翻译 * 性别翻译
*/ */
private String sexText; private String sexText;
/**
* 所属部门ID
*/
private String pid;
/** /**
* 所属部门 * 所属部门
*/ */

View File

@ -28,6 +28,7 @@
<result column="caption" property="caption" jdbcType="VARCHAR"/> <result column="caption" property="caption" jdbcType="VARCHAR"/>
<result column="sex" property="sex" jdbcType="VARCHAR"/> <result column="sex" property="sex" jdbcType="VARCHAR"/>
<result column="sexText" property="sexText" jdbcType="VARCHAR"/> <result column="sexText" property="sexText" jdbcType="VARCHAR"/>
<result column="pid" property="pid" jdbcType="VARCHAR"/>
<result column="deptName" property="deptName" jdbcType="VARCHAR"/> <result column="deptName" property="deptName" jdbcType="VARCHAR"/>
</resultMap> </resultMap>
@ -164,6 +165,7 @@
u.caption, u.caption,
u.sex, u.sex,
(case when u.sex='0' then '女' else '男' end) as sexText, (case when u.sex='0' then '女' else '男' end) as sexText,
u.pid,
uu.name as deptName uu.name as deptName
from tb_safety_staff_archives ssa from tb_safety_staff_archives ssa
INNER JOIN tb_user u ON ssa.userid = u.id INNER JOIN tb_user u ON ssa.userid = u.id
@ -178,6 +180,7 @@
u.caption, u.caption,
u.sex, u.sex,
(case when u.sex='0' then '女' else '男' end) as sexText, (case when u.sex='0' then '女' else '男' end) as sexText,
u.pid,
uu.name as deptName uu.name as deptName
from tb_safety_staff_archives ssa from tb_safety_staff_archives ssa
INNER JOIN tb_user u ON ssa.userid = u.id INNER JOIN tb_user u ON ssa.userid = u.id

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.sipai.mapper.scada.MPointDataMapper"> <mapper namespace="scada.MPointDataMapper">
<resultMap id="BaseResultMap" type="com.sipai.entity.scada.MPointData" > <resultMap id="BaseResultMap" type="com.sipai.entity.scada.MPointData" >
<id column="ItemID" property="itemId" jdbcType="BIGINT" /> <id column="ItemID" property="itemId" jdbcType="BIGINT" />
<result column="ParmValue" property="parmValue" jdbcType="DECIMAL" /> <result column="ParmValue" property="parmValue" jdbcType="DECIMAL" />

View File

@ -22,17 +22,14 @@
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</delete> </delete>
<insert id="insert" parameterType="com.sipai.entity.scada.MPointExpand" > <insert id="insert" parameterType="com.sipai.entity.scada.MPointExpand" >
insert into TB_MeasurePoint_Expand (id, insdt, insuser, insert into TB_MeasurePoint_Expand (insdt, insuser,
measure_point_id, explain) measure_point_id, explain)
values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, values (#{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR},
#{measurePointId,jdbcType=VARCHAR}, #{explain,jdbcType=VARCHAR}) #{measurePointId,jdbcType=VARCHAR}, #{explain,jdbcType=VARCHAR})
</insert> </insert>
<insert id="insertSelective" parameterType="com.sipai.entity.scada.MPointExpand" > <insert id="insertSelective" parameterType="com.sipai.entity.scada.MPointExpand" >
insert into TB_MeasurePoint_Expand insert into TB_MeasurePoint_Expand
<trim prefix="(" suffix=")" suffixOverrides="," > <trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="insdt != null" > <if test="insdt != null" >
insdt, insdt,
</if> </if>
@ -47,9 +44,6 @@
</if> </if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides="," > <trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=VARCHAR},
</if>
<if test="insdt != null" > <if test="insdt != null" >
#{insdt,jdbcType=TIMESTAMP}, #{insdt,jdbcType=TIMESTAMP},
</if> </if>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.sipai.mapper.scada.WaterVolumeLJLLMapper"> <mapper namespace="scada.WaterVolumeLJLLMapper">
<resultMap id="BaseResultMap" type="com.sipai.entity.scada.WaterVolumeLJLL" > <resultMap id="BaseResultMap" type="com.sipai.entity.scada.WaterVolumeLJLL" >
<id column="ItemID" property="itemId" jdbcType="BIGINT" /> <id column="ItemID" property="itemId" jdbcType="BIGINT" />
<result column="ParmValue" property="parmValue" jdbcType="DECIMAL" /> <result column="ParmValue" property="parmValue" jdbcType="DECIMAL" />

View File

@ -8424,7 +8424,13 @@ public class EquipmentCardService implements CommService<EquipmentCard> {
} }
} }
if (childlist.size() > 0) { if (childlist.size() > 0) {
// 保留已有的nodes如工艺段将子单元添加到现有nodes中
List<Map<String, Object>> existingNodes = (List<Map<String, Object>>) mp.get("nodes");
if (existingNodes != null && existingNodes.size() > 0) {
existingNodes.addAll(childlist);
} else {
mp.put("nodes", childlist); mp.put("nodes", childlist);
}
getTreeList4ProcessSection(childlist, list); getTreeList4ProcessSection(childlist, list);
} }
} }
@ -8491,7 +8497,13 @@ public class EquipmentCardService implements CommService<EquipmentCard> {
} }
} }
if (childlist.size() > 0) { if (childlist.size() > 0) {
// 保留已有的nodes如设备类型将子单元添加到现有nodes中
List<Map<String, Object>> existingNodes = (List<Map<String, Object>>) mp.get("nodes");
if (existingNodes != null && existingNodes.size() > 0) {
existingNodes.addAll(childlist);
} else {
mp.put("nodes", childlist); mp.put("nodes", childlist);
}
getTreeList4EquipmentClass(childlist, list); getTreeList4EquipmentClass(childlist, list);
} }
} }

View File

@ -46,6 +46,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.XmlPullParserException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.DocumentBuilderFactory;
@ -70,6 +72,7 @@ import static org.apache.poi.ss.usermodel.CellType.FORMULA;
@Service("rptCreateService") @Service("rptCreateService")
//@Service //@Service
public class RptCreateServiceImpl implements RptCreateService { public class RptCreateServiceImpl implements RptCreateService {
private static final Logger logger = LoggerFactory.getLogger(RptCreateServiceImpl.class);
@Resource @Resource
private RptCreateDao rptCreateDao; private RptCreateDao rptCreateDao;
@Resource @Resource
@ -393,7 +396,7 @@ public class RptCreateServiceImpl implements RptCreateService {
} }
} }
Row row2 = sheet.getRow(row); Row row2 = sheet.getRow(row);
HSSFCell cell = (HSSFCell) row2.getCell(column); Cell cell = row2.getCell(column);
return list; return list;
} }
@ -846,21 +849,26 @@ public class RptCreateServiceImpl implements RptCreateService {
// 设定Excel文件所在路径 // 设定Excel文件所在路径
String excelFileName = filelist.get(0).getAbspath(); String excelFileName = filelist.get(0).getAbspath();
// 读取Excel文件内容 // 读取Excel文件内容
HSSFWorkbook workbook = null; Workbook workbook = null;
FileInputStream inputStream = null; FileInputStream inputStream = null;
byte[] bytes_m = commonFileService.getInputStreamBytes(FileNameSpaceEnum.RptInfoSetFile.getNameSpace(), path); byte[] bytes_m = commonFileService.getInputStreamBytes(FileNameSpaceEnum.RptInfoSetFile.getNameSpace(), path);
// Check if bytes_m is null or empty
if (bytes_m == null || bytes_m.length == 0) {
logger.error("Excel file is empty or not found: " + path);
return null;
}
// 直接从本地文件创建Workbook, 从输入流创建Workbook // 直接从本地文件创建Workbook, 从输入流创建Workbook
InputStream ins = new ByteArrayInputStream(bytes_m); InputStream ins = new ByteArrayInputStream(bytes_m);
// 构建Workbook对象, 只读Workbook对象 // 构建Workbook对象, 只读Workbook对象 - use WorkbookFactory to support both .xls and .xlsx
try { try {
workbook = new HSSFWorkbook(ins); workbook = WorkbookFactory.create(ins);
} catch (IOException e) { } catch (IOException e) {
logger.error("Failed to create workbook from file: " + path, e);
e.printStackTrace(); e.printStackTrace();
} }
String endtype = ".xls"; String endtype = path.toLowerCase().endsWith(".xlsx") ? ".xlsx" : ".xls";
// 生成一个样式,用在表格数据 // 生成一个样式,用在表格数据
HSSFCellStyle listStyle = null; CellStyle listStyle = null;
if (endtype.equals(".xls")) {
listStyle = workbook.createCellStyle(); listStyle = workbook.createCellStyle();
// 设置这些样式 // 设置这些样式
listStyle.setBorderBottom(BorderStyle.THIN); listStyle.setBorderBottom(BorderStyle.THIN);
@ -871,10 +879,8 @@ public class RptCreateServiceImpl implements RptCreateService {
listStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 listStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中
//listStyle.setWrapText(false);//不自动换行 //listStyle.setWrapText(false);//不自动换行
//listStyle.setDataFormat(HSSFDataFormat.getBuiltinFormat("0.00"));//设置格式 //listStyle.setDataFormat(HSSFDataFormat.getBuiltinFormat("0.00"));//设置格式
}
// 生成一个样式,用在表格数据 修改过的数据 // 生成一个样式,用在表格数据 修改过的数据
HSSFCellStyle listStyle2 = null; CellStyle listStyle2 = null;
if (endtype.equals(".xls")) {
listStyle2 = workbook.createCellStyle(); listStyle2 = workbook.createCellStyle();
// 设置这些样式 // 设置这些样式
listStyle2.setBorderBottom(BorderStyle.THIN); listStyle2.setBorderBottom(BorderStyle.THIN);
@ -885,7 +891,6 @@ public class RptCreateServiceImpl implements RptCreateService {
listStyle2.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 listStyle2.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中
listStyle2.setFillPattern(FillPatternType.SOLID_FOREGROUND); listStyle2.setFillPattern(FillPatternType.SOLID_FOREGROUND);
listStyle2.setFillForegroundColor(IndexedColors.GREEN.getIndex()); listStyle2.setFillForegroundColor(IndexedColors.GREEN.getIndex());
}
List<RptSpSet> rptSpSetlist = this.rptSpSetService.selectListByWhere(" where pid='" + rptInfoSet.getId() + "' and (active !='" + CommString.Active_False_CH + "' or active is null) order by morder asc"); List<RptSpSet> rptSpSetlist = this.rptSpSetService.selectListByWhere(" where pid='" + rptInfoSet.getId() + "' and (active !='" + CommString.Active_False_CH + "' or active is null) order by morder asc");
if (rptSpSetlist != null && rptSpSetlist.size() > 0) { if (rptSpSetlist != null && rptSpSetlist.size() > 0) {
for (int s = 0; s < rptSpSetlist.size(); s++) { for (int s = 0; s < rptSpSetlist.size(); s++) {
@ -993,10 +998,10 @@ public class RptCreateServiceImpl implements RptCreateService {
if (spname != null && spname.equals(RptSpSet.RptSpSet_Type_Confirm)) { //接班人 类型 if (spname != null && spname.equals(RptSpSet.RptSpSet_Type_Confirm)) { //接班人 类型
for (int ws = 0; ws < workbook.getNumberOfSheets(); ws++) {//获取每个Sheet表 for (int ws = 0; ws < workbook.getNumberOfSheets(); ws++) {//获取每个Sheet表
if (workbook.getSheetName(ws).equals(rptSpSetlist.get(s).getSheet())) { if (workbook.getSheetName(ws).equals(rptSpSetlist.get(s).getSheet())) {
HSSFSheet sheet = workbook.getSheetAt(ws); Sheet sheet = workbook.getSheetAt(ws);
HSSFRow row = sheet.getRow(posy - 1); Row row = sheet.getRow(posy - 1);
if (row != null) { if (row != null) {
HSSFCell cell_d = row.getCell(posx - 1); Cell cell_d = row.getCell(posx - 1);
if (cell_d != null) { if (cell_d != null) {
//插入日志表 //插入日志表
RptLog rptLog = new RptLog(); RptLog rptLog = new RptLog();
@ -1029,10 +1034,10 @@ public class RptCreateServiceImpl implements RptCreateService {
} else if (spname != null && spname.equals(RptSpSet.RptSpSet_Type_Rptdt)) {//日期 类型 } else if (spname != null && spname.equals(RptSpSet.RptSpSet_Type_Rptdt)) {//日期 类型
for (int ws = 0; ws < workbook.getNumberOfSheets(); ws++) {//获取每个Sheet表 for (int ws = 0; ws < workbook.getNumberOfSheets(); ws++) {//获取每个Sheet表
if (workbook.getSheetName(ws).equals(rptSpSetlist.get(s).getSheet())) { if (workbook.getSheetName(ws).equals(rptSpSetlist.get(s).getSheet())) {
HSSFSheet sheet = workbook.getSheetAt(ws); Sheet sheet = workbook.getSheetAt(ws);
HSSFRow row = sheet.getRow(posy - 1); Row row = sheet.getRow(posy - 1);
if (row != null) { if (row != null) {
HSSFCell cell_d = row.getCell(posx - 1); Cell cell_d = row.getCell(posx - 1);
if (cell_d != null) { if (cell_d != null) {
try { try {
cell_d.setCellStyle(cell_d.getCellStyle()); cell_d.setCellStyle(cell_d.getCellStyle());
@ -1058,10 +1063,10 @@ public class RptCreateServiceImpl implements RptCreateService {
} else if (spname != null && spname.equals(RptSpSet.RptSpSet_Type_BanZhang)) {//值班班长 类型 } else if (spname != null && spname.equals(RptSpSet.RptSpSet_Type_BanZhang)) {//值班班长 类型
for (int ws = 0; ws < workbook.getNumberOfSheets(); ws++) {//获取每个Sheet表 for (int ws = 0; ws < workbook.getNumberOfSheets(); ws++) {//获取每个Sheet表
if (workbook.getSheetName(ws).equals(rptSpSetlist.get(s).getSheet())) { if (workbook.getSheetName(ws).equals(rptSpSetlist.get(s).getSheet())) {
HSSFSheet sheet = workbook.getSheetAt(ws); Sheet sheet = workbook.getSheetAt(ws);
HSSFRow row = sheet.getRow(posy - 1); Row row = sheet.getRow(posy - 1);
if (row != null) { if (row != null) {
HSSFCell cell_d = row.getCell(posx - 1); Cell cell_d = row.getCell(posx - 1);
if (cell_d != null) { if (cell_d != null) {
//插入日志表 //插入日志表
RptLog rptLog = new RptLog(); RptLog rptLog = new RptLog();
@ -1094,10 +1099,10 @@ public class RptCreateServiceImpl implements RptCreateService {
} else if (spname != null && spname.equals(RptSpSet.RptSpSet_Type_ZuYuan)) { //值班组员 类型 } else if (spname != null && spname.equals(RptSpSet.RptSpSet_Type_ZuYuan)) { //值班组员 类型
for (int ws = 0; ws < workbook.getNumberOfSheets(); ws++) {//获取每个Sheet表 for (int ws = 0; ws < workbook.getNumberOfSheets(); ws++) {//获取每个Sheet表
if (workbook.getSheetName(ws).equals(rptSpSetlist.get(s).getSheet())) { if (workbook.getSheetName(ws).equals(rptSpSetlist.get(s).getSheet())) {
HSSFSheet sheet = workbook.getSheetAt(ws); Sheet sheet = workbook.getSheetAt(ws);
HSSFRow row = sheet.getRow(posy - 1); Row row = sheet.getRow(posy - 1);
if (row != null) { if (row != null) {
HSSFCell cell_d = row.getCell(posx - 1); Cell cell_d = row.getCell(posx - 1);
if (cell_d != null) { if (cell_d != null) {
//插入日志表 //插入日志表
RptLog rptLog = new RptLog(); RptLog rptLog = new RptLog();
@ -1134,12 +1139,12 @@ public class RptCreateServiceImpl implements RptCreateService {
for (int r = 0; r < rpttemplist.size(); r++) { for (int r = 0; r < rpttemplist.size(); r++) {
for (int ws = 0; ws < workbook.getNumberOfSheets(); ws++) {//获取每个Sheet表 for (int ws = 0; ws < workbook.getNumberOfSheets(); ws++) {//获取每个Sheet表
if (workbook.getSheetName(ws).equals(rptSpSetlist.get(s).getSheet())) { if (workbook.getSheetName(ws).equals(rptSpSetlist.get(s).getSheet())) {
HSSFSheet sheet = workbook.getSheetAt(ws); Sheet sheet = workbook.getSheetAt(ws);
HSSFRow row = sheet.getRow(rpttemplist.get(r).getColposy() - 1); Row row = sheet.getRow(rpttemplist.get(r).getColposy() - 1);
if (row != null) { if (row != null) {
Cell cell_d = row.getCell(rpttemplist.get(r).getColposx() - 1); Cell cell_d = row.getCell(rpttemplist.get(r).getColposx() - 1);
if (cell_d != null) { if (cell_d != null) {
HSSFCellStyle cellStyle = row.getCell(rpttemplist.get(r).getColposx() - 1).getCellStyle(); CellStyle cellStyle = row.getCell(rpttemplist.get(r).getColposx() - 1).getCellStyle();
// HSSFCellStyle cellStyle_r = row.getCell(rpttemplist.get(r).getColposx() - 1).getCellStyle(); // HSSFCellStyle cellStyle_r = row.getCell(rpttemplist.get(r).getColposx() - 1).getCellStyle();
try { try {
/** /**
@ -1286,9 +1291,9 @@ public class RptCreateServiceImpl implements RptCreateService {
*/ */
List<RptLog> list = rptLogService.selectListByWhere("where creat_id = '" + rptCreate.getId() + "'"); List<RptLog> list = rptLogService.selectListByWhere("where creat_id = '" + rptCreate.getId() + "'");
for (RptLog rptLog : list) { for (RptLog rptLog : list) {
HSSFSheet sheet = workbook.getSheet(rptLog.getSheet()); Sheet sheet = workbook.getSheet(rptLog.getSheet());
if (rptLog.getPosyE() != null && !rptLog.getPosyE().equals("") && sheet != null) { if (rptLog.getPosyE() != null && !rptLog.getPosyE().equals("") && sheet != null) {
HSSFRow row = sheet.getRow(Integer.parseInt(rptLog.getPosyE()) - 1); Row row = sheet.getRow(Integer.parseInt(rptLog.getPosyE()) - 1);
if (row != null) { if (row != null) {
Cell cell_d = row.getCell(Integer.parseInt(rptLog.getPosxE()) - 1); Cell cell_d = row.getCell(Integer.parseInt(rptLog.getPosxE()) - 1);
if (cell_d != null) { if (cell_d != null) {

View File

@ -84,13 +84,17 @@ public class SafetyCheckActivityService {
* @Date: 2022/10/10 * @Date: 2022/10/10
**/ **/
public Result audit(String nextUserId, String processInstanceId, int pass) { public Result audit(String nextUserId, String processInstanceId, int pass) {
Task task = List<Task> tasks = workflowService.getTaskService().createTaskQuery().processInstanceId(processInstanceId).active().list();
workflowService.getTaskService().createTaskQuery().processInstanceId(processInstanceId).singleResult(); if (tasks == null || tasks.isEmpty()) {
return Result.failed("No active task found for process instance: " + processInstanceId);
}
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put(CommString.ACTI_KEK_Condition, pass); map.put(CommString.ACTI_KEK_Condition, pass);
map.put(CommString.ACTI_KEK_Assignee, nextUserId); map.put(CommString.ACTI_KEK_Assignee, nextUserId);
map.put(CommString.ACTI_KEK_Candidate_Users, nextUserId); map.put(CommString.ACTI_KEK_Candidate_Users, nextUserId);
for (Task task : tasks) {
workflowService.getTaskService().complete(task.getId(), map); workflowService.getTaskService().complete(task.getId(), map);
}
return Result.success(); return Result.success();
} }

View File

@ -1661,7 +1661,7 @@ public class MPointService {
for (int i = minCellNum; i < maxCellNum; i++) { for (int i = minCellNum; i < maxCellNum; i++) {
HSSFCell mpidCell = mpidRow.getCell(i); HSSFCell mpidCell = mpidRow.getCell(i);
String mpidStr = getStringVal(mpidCell); String mpidStr = getStringVal(mpidCell);
MPoint mPoint = this.selectByWhere(unitId, "where MPointCode like '%" + mpidStr + "%' or ParmName like '%" + mpidStr + "%' "); MPoint mPoint = this.selectByWhere(unitId, "where MPointCode = '"+ mpidStr+"'");
if (mPoint != null) { if (mPoint != null) {
String mpid = mPoint.getMpointcode(); String mpid = mPoint.getMpointcode();
MPointHistory mPointHistory = new MPointHistory(); MPointHistory mPointHistory = new MPointHistory();

View File

@ -75,12 +75,6 @@
<form class="form-horizontal" id="subForm"> <form class="form-horizontal" id="subForm">
<!-- 界面提醒div强制id为alertDiv --> <!-- 界面提醒div强制id为alertDiv -->
<div id="alertDiv"></div> <div id="alertDiv"></div>
<div class="form-group">
<label class="col-sm-3 control-label">业务单元ID</label>
<div class="col-sm-9">
<input type="text" class="form-control" id="id" name="id" placeholder="业务单元ID不填则自动生成" >
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">*业务单元名称</label> <label class="col-sm-3 control-label">*业务单元名称</label>
<div class="col-sm-9"> <div class="col-sm-9">

View File

@ -53,12 +53,6 @@
<form class="form-horizontal" id="subForm"> <form class="form-horizontal" id="subForm">
<div id="alertDiv"></div> <div id="alertDiv"></div>
<input id="id" name="id" type="hidden" value="${businessUnit.id}"/> <input id="id" name="id" type="hidden" value="${businessUnit.id}"/>
<div class="form-group">
<label class="col-sm-3 control-label">业务单元ID</label>
<div class="col-sm-9">
<input type="text" class="form-control" id="displayId" value="${businessUnit.id}" readonly style="background-color: #eee;">
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">*业务单元名称</label> <label class="col-sm-3 control-label">*业务单元名称</label>
<div class="col-sm-9"> <div class="col-sm-9">

View File

@ -110,6 +110,11 @@
url: ext.contextPath +"/activiti/workflow/getProcessTypes4Combo.do", url: ext.contextPath +"/activiti/workflow/getProcessTypes4Combo.do",
dataType: 'json', dataType: 'json',
delay: 250, delay: 250,
data: function (params) {
return {
term: params.term
};
},
processResults: function (data) { processResults: function (data) {
return { return {
results: data results: data
@ -123,8 +128,8 @@
language: "zh-CN", language: "zh-CN",
minimumInputLength: 0, minimumInputLength: 0,
minimumResultsForSearch: 10, minimumResultsForSearch: 10,
formatResult: function formatRepo(repo){return repo.text;}, templateResult: function formatRepo(repo){return repo.text;},
formatSelection: function formatRepoSelection(repo){return repo.text;} templateSelection: function formatRepoSelection(repo){return repo.text;}
}); });
fixSelect2ToTool("search_processType"); fixSelect2ToTool("search_processType");
$("#table").bootstrapTable({ $("#table").bootstrapTable({
@ -151,11 +156,6 @@
columns: [ columns: [
{ {
checkbox: true, checkbox: true,
}, {
field: 'id',
title: '业务单元ID',
align: 'center',
valign: 'middle'
}, { }, {
field: 'name', field: 'name',
title: '业务单元名称', title: '业务单元名称',

View File

@ -62,7 +62,8 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD
selelct_4.val('').trigger("change"); selelct_4.val('').trigger("change");
//TODO 代码有冲突 // Initialize job dropdown with all jobs
onValueChange();
key = setInterval(() => { key = setInterval(() => {
// console.log(document.getElementById('objUserName')) // console.log(document.getElementById('objUserName'))
if ($('#objUserId').val() != old) { if ($('#objUserId').val() != old) {
@ -140,7 +141,14 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD
jobId: { jobId: {
validators: { validators: {
notEmpty: { notEmpty: {
message: '周期类型不能为空' message: '岗位不能为空'
}
}
},
levelType: {
validators: {
notEmpty: {
message: '岗位类型不能为空'
} }
} }
}, },
@ -165,9 +173,17 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD
function onValueChange() { function onValueChange() {
// console.log($('#objUserId').val()) // console.log($('#objUserId').val())
$.post(ext.contextPath + "/user/getJsonJobByUser.do?userId=" + $('#objUserId').val(), function (data) { $.get(ext.contextPath + "/user/getJsonJob.do", function (data) {
// Transform data to Select2 format: {id, text}
var transformedData = [];
$.each(data, function(index, item) {
transformedData.push({
id: item.id,
text: item.name
});
});
$("#jobId").select2({ $("#jobId").select2({
data: data, data: transformedData,
cache: false, cache: false,
placeholder: '请选择',//默认文字提示 placeholder: '请选择',//默认文字提示
// allowClear: true,//允许清空 // allowClear: true,//允许清空
@ -230,6 +246,13 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD
<select class="form-control" id="jobId" name="jobId"></select> <select class="form-control" id="jobId" name="jobId"></select>
</div> </div>
</div> </div>
<div class="form-group">
<label class="col-sm-3 control-label">* 岗位类型:</label>
<div class="col-sm-9">
<select class="form-control" name="levelType" id="status3" style="width: 100%;">
</select>
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">* 周期类型:</label> <label class="col-sm-3 control-label">* 周期类型:</label>
<div class="col-sm-9"> <div class="col-sm-9">

View File

@ -17,17 +17,11 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD
display: flex; display: flex;
padding-left: 50px; padding-left: 50px;
} }
/*.layout{*/
/ display: flex;*/
/ padding-left: 15px;*/
/*}*/
.form-horizontal { .form-horizontal {
padding-top: 20px; padding-top: 20px;
padding-left: 60px; padding-left: 60px;
} }
.right { .right {
margin-left: 50px; margin-left: 50px;
} }

View File

@ -50,10 +50,10 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD
formatResult: function formatRepo(repo) { formatResult: function formatRepo(repo) {
return repo.text; return repo.text;
}, // 函数用来渲染结果 }, // 函数用来渲染结果
formatSelection: function formatRepoSelection(repo) {
return repo.text; return repo.text;
} // 函数用于呈现当前的选择 } // 函数用于呈现当前的选择
}); });
});
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'}); $(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
select_3.val('${bean.educationType}').trigger("change"); select_3.val('${bean.educationType}').trigger("change");

View File

@ -147,6 +147,7 @@
hiddenId: "userid", hiddenId: "userid",
textId: "username", textId: "username",
deptNameDom: "deptName", deptNameDom: "deptName",
deptIdDom: "pid",
sexDom: "sex", sexDom: "sex",
userCardIdDom: "userCardId", userCardIdDom: "userCardId",
userId: userId userId: userId
@ -156,6 +157,18 @@
}); });
} }
//选择所属部门
function showDept4SelectFun() {
$.post(ext.contextPath + '/user/showUnit4Select_Limited.do', {
formId: "subForm",
hiddenId: "pid",
textId: "deptName"
}, function (data) {
$("#deptSelectDiv").html(data);
openModal('unit4SelectModal_Limited');
});
}
</script> </script>
<div class="modal fade" id="subModal"> <div class="modal fade" id="subModal">
<div class="modal-dialog" style="width: 53%"> <div class="modal-dialog" style="width: 53%">
@ -239,8 +252,9 @@
</div> </div>
<label class="col-sm-2 control-label">*所属部门:</label> <label class="col-sm-2 control-label">*所属部门:</label>
<div class="col-sm-4"> <div class="col-sm-4">
<input type="text" class="form-control" id="deptName" name="deptName" placeholder="所属部门" <input type="text" class="form-control" id="deptName" name="deptName" placeholder="点击选择所属部门"
value="" disabled> value="" onclick="showDept4SelectFun();" readonly>
<input type="hidden" id="pid" name="pid" value="">
</div> </div>
</div> </div>
@ -274,3 +288,4 @@
</div> </div>
<!-- /.modal-dialog --> <!-- /.modal-dialog -->
</div> </div>
<div id="deptSelectDiv"></div>

View File

@ -152,6 +152,7 @@
hiddenId: "userid", hiddenId: "userid",
textId: "username", textId: "username",
deptNameDom: "deptName", deptNameDom: "deptName",
deptIdDom: "pid",
sexDom: "sex", sexDom: "sex",
userCardIdDom: "userCardId", userCardIdDom: "userCardId",
userId: userId userId: userId
@ -161,6 +162,18 @@
}); });
} }
//选择所属部门
function showDept4SelectFun() {
$.post(ext.contextPath + '/user/showUnit4Select_Limited.do', {
formId: "subForm",
hiddenId: "pid",
textId: "deptName"
}, function (data) {
$("#deptSelectDiv").html(data);
openModal('unit4SelectModal_Limited');
});
}
</script> </script>
<div class="modal fade" id="subModal"> <div class="modal fade" id="subModal">
<div class="modal-dialog modal-lg"> <div class="modal-dialog modal-lg">
@ -245,8 +258,9 @@
<label class="col-sm-2 control-label">*所属部门:</label> <label class="col-sm-2 control-label">*所属部门:</label>
<div class="col-sm-4"> <div class="col-sm-4">
<input type="text" class="form-control" id="deptName" name="deptName" placeholder="所属部门" <input type="text" class="form-control" id="deptName" name="deptName" placeholder="点击选择所属部门"
value="${safetyStaffArchives.deptName}" disabled> value="${safetyStaffArchives.deptName}" onclick="showDept4SelectFun();" readonly>
<input type="hidden" id="pid" name="pid" value="${safetyStaffArchives.pid}">
</div> </div>
</div> </div>
@ -282,3 +296,4 @@
</div> </div>
<!-- /.modal-dialog --> <!-- /.modal-dialog -->
</div> </div>
<div id="deptSelectDiv"></div>

View File

@ -26,6 +26,9 @@
if(`${param.deptNameDom}` != ""){ if(`${param.deptNameDom}` != ""){
$('#${param.formId} #${param.deptNameDom}').val(resp[0]._pname); $('#${param.formId} #${param.deptNameDom}').val(resp[0]._pname);
} }
if(`${param.deptIdDom}` != ""){
$('#${param.formId} #${param.deptIdDom}').val(resp[0].pid);
}
if(`${param.sexDom}` != ""){ if(`${param.sexDom}` != ""){
$('#${param.formId} #${param.sexDom}').val(resp[0].sex); $('#${param.formId} #${param.sexDom}').val(resp[0].sex);
} }

View File

@ -0,0 +1,180 @@
<%@ page language="java" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<style type="text/css">
#map_canvas {
width: 100%;
height: 100%;
}
#result {
width: 100%
}
#btns {
z-index: 999;
position: fixed;
bottom: 3.5rem;
margin-left: 2.5rem;
padding-left: 0;
border-radius: .25rem;
display: flex;
box-shadow: 0 2px 6px 0 rgba(27, 142, 236, 0.5);
text-align: center;
}
#btns li {
border-right: 1px solid #d2d2d2;
padding: 10px 10px;
height: 100%;
background-color: #fff;
cursor: pointer;
color: #3a79b5;
}
/*.modal-body {
position: relative;
padding: 15px;
}*/
</style>
<script>
window.BMAP_AUTHENTIC_KEY = '7Cc5Kmn672miPzG4qQhvlOrERcXMMinq';
</script>
<script type="text/javascript">
var lushuArray = [];//多人巡检轨迹数
// var map = new BMapGL.Map('map_canvas');
var map = new BMapGL.Map('map_canvas', {
minZoom: 19,
maxZoom: 19
});
map.enableScrollWheelZoom();
// 113.044283, 23.028002 沙口
// 112.911564,23.370377 北江
// 121.374879,30.73846 金山一厂
// 121.363482,30.807332 金山二厂
var x1 = '121.363482';
var y1 = '30.807332';
map.centerAndZoom(new BMapGL.Point(x1, y1), 19);
map.enableScrollWheelZoom(true);//禁止鼠标滚动
map.setMapType(BMAP_EARTH_MAP);// 设置地图类型为地球模式
// var lushu;
//实例化一个轨迹用来生成路线
var drv = new BMapGL.DrivingRoute('佛山', {
onSearchComplete: function (res) {
// if (drv.getStatus() == BMAP_STATUS_SUCCESS) {
var userName = '';//人员名称
var userIcon = '';//人员头像
$.post(ext.contextPath + "/timeEfficiency/patrolRecord/getGPS.do", {patrolRecordId: '${patrolRecord.id}'}, function (data) {
for (let i = 0; i < data.length; i++) {
var gpsStr = [];//gps数组
var str = data[i].data;
for (let j = 0; j < str.length; j++) {
gpsStr.push(str[j])
}
userName = data[i].userName;
if (data[i].icon != null && data[i].icon != '') {
userIcon = data[i].icon;
} else {
userIcon = ext.contextPath + '/IMG/sy/headportrait.png';
}
creatGPSLine(gpsStr, userName, userIcon);
}
}, 'json');
// }
}
});
//调用不同人员的巡检路线
function creatGPSLine(gpsStr, userName, userIcon) {
if (gpsStr != null && gpsStr != '') {
map.addOverlay(new BMapGL.Marker(gpsStr[0]));
map.addOverlay(new BMapGL.Marker(gpsStr[gpsStr.length - 1]));
map.addOverlay(new BMapGL.Polyline(gpsStr, {strokeColor: 'blue'}));
map.setViewport(gpsStr);
var lushu = new BMapGLLib.LuShu(map, gpsStr, {
defaultContent: userName, // "信息窗口文案"
autoView: true, // 是否开启自动视野调整,如果开启那么路书在运动过程中会根据视野自动调整
speed: 50,
icon: new BMapGL.Icon(userIcon, new BMapGL.Size(40, 40), {anchor: new BMapGL.Size(20, 40)}),
enableRotation: false, // 是否设置marker随着道路的走向进行旋转
});
lushuArray.push(lushu);
} else {
}
}
var start = new BMapGL.Point(116.404844, 40);
var end = new BMapGL.Point(116.308102, 40.056057);
drv.search(start, end);
//开始
function run() {
// lushu.start();
for (var i = 0; i < lushuArray.length; i++) {
// console.log(lushuArray[i]);
lushuArray[i].start();//多人轨迹演示
}
}
//停止
function stop() {
// lushu.stop();
for (var i = 0; i < lushuArray.length; i++) {
// console.log(lushuArray[i]);
lushuArray[i].stop();//多人轨迹演示
}
}
//暂停
function pause() {
// lushu.pause();
for (var i = 0; i < lushuArray.length; i++) {
// console.log(lushuArray[i]);
lushuArray[i].pause();//多人轨迹演示
}
}
/*$("hide").onclick = function () {
//隐藏信息窗口
lushu.hideInfoWindow();
}
$("show").onclick = function () {
//展示信息窗口
lushu.showInfoWindow();
}*/
</script>
<div class="modal fade" id="subModal_recordMap">
<div class="modal-dialog modal-xlg" style="width: 1800px;height: 700px;">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">巡检轨迹</h4>
</div>
<div class="modal-body" style="width: 1800px;height: 700px;padding: 0px;">
<div id="map_canvas"></div>
<div id="result"></div>
<ul id='btns'>
<li id="run" onclick="run();">开始</li>
<li id="stop" onclick="stop();">停止</li>
<li id="pause" onclick="pause();">暂停</li>
<%--<li id="hide" onclick="hide();">隐藏信息窗口</li>
<li id="show" onclick="show();">展示信息窗口</li>--%>
</ul>
</div>
</div>
</div>
</div>