Compare commits
42 Commits
0200e883d7
...
process-de
| Author | SHA1 | Date | |
|---|---|---|---|
| 0377a0cc8c | |||
| ebf57c2e82 | |||
| 6d5c8bfd65 | |||
| b9d6a7458f | |||
| 784ac30847 | |||
| b0e2e58d93 | |||
| 785654a510 | |||
| dafda57a0e | |||
| 9cc4d4a988 | |||
| fadbe2b59f | |||
| c11112b066 | |||
| f33f57f6a7 | |||
| c3babf2c4d | |||
| 04610aa678 | |||
| 596b2a68bf | |||
| 5bacfa37d4 | |||
| a5ac9fb038 | |||
| 1cd6750710 | |||
| b745bb8482 | |||
| 9a9dc780e4 | |||
| 3208f2b8a3 | |||
| 7048001c0c | |||
| 44b6bf04d5 | |||
| e50422d7a7 | |||
| 75f33e37d7 | |||
| 17751bd0ab | |||
| 82d68ed669 | |||
| 09fce43c98 | |||
| 9895757c92 | |||
| bce9cc42e8 | |||
| 9a9a743945 | |||
| 6de1aabe80 | |||
| 3ea3e0a9af | |||
| 56da3dc9ff | |||
| 2bfa643373 | |||
| 5e52e1db7c | |||
| acd1967b1f | |||
| 1c8f1f98d5 | |||
| 3da9c9afb5 | |||
| a187b11c33 | |||
| 7fbf63ed66 | |||
| 0d641d8d4f |
17
pom.xml
17
pom.xml
@ -369,6 +369,12 @@
|
|||||||
<groupId>org.xhtmlrenderer</groupId>
|
<groupId>org.xhtmlrenderer</groupId>
|
||||||
<artifactId>core-renderer</artifactId>
|
<artifactId>core-renderer</artifactId>
|
||||||
<version>R8</version>
|
<version>R8</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>bouncycastle</groupId>
|
||||||
|
<artifactId>bcprov-jdk14</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- 支持css样式渲染 -->
|
<!-- 支持css样式渲染 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -597,6 +603,17 @@
|
|||||||
<groupId>org.redisson</groupId>
|
<groupId>org.redisson</groupId>
|
||||||
<artifactId>redisson</artifactId>
|
<artifactId>redisson</artifactId>
|
||||||
<version>3.11.4</version>
|
<version>3.11.4</version>
|
||||||
|
<exclusions>
|
||||||
|
<!-- 项目仍使用 jodd 3.x,排除 redisson 传入的 jodd 5.x,避免运行时方法签名冲突 -->
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jodd</groupId>
|
||||||
|
<artifactId>jodd-bean</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jodd</groupId>
|
||||||
|
<artifactId>jodd-core</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
<!-- <version>3.13.3</version>-->
|
<!-- <version>3.13.3</version>-->
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- zkclient -->
|
<!-- zkclient -->
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -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");
|
||||||
|
|||||||
@ -0,0 +1,400 @@
|
|||||||
|
package com.sipai.controller.administration;
|
||||||
|
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.sipai.entity.activiti.WorkTask;
|
||||||
|
import com.sipai.entity.administration.LeaveApply;
|
||||||
|
import com.sipai.entity.administration.LeaveCommStr;
|
||||||
|
import com.sipai.entity.base.Result;
|
||||||
|
import com.sipai.entity.business.BusinessUnit;
|
||||||
|
import com.sipai.entity.business.BusinessUnitAudit;
|
||||||
|
import com.sipai.entity.business.BusinessUnitHandle;
|
||||||
|
import com.sipai.entity.business.BusinessUnitRecord;
|
||||||
|
import com.sipai.entity.user.User;
|
||||||
|
import com.sipai.service.activiti.WorkflowProcessDefinitionService;
|
||||||
|
import com.sipai.service.activiti.WorkflowService;
|
||||||
|
import com.sipai.service.administration.LeaveApplyService;
|
||||||
|
import com.sipai.service.business.BusinessUnitAuditService;
|
||||||
|
import com.sipai.service.business.BusinessUnitHandleService;
|
||||||
|
import com.sipai.service.user.UserService;
|
||||||
|
import com.sipai.tools.ActivitiUtil;
|
||||||
|
import com.sipai.tools.CommString;
|
||||||
|
import com.sipai.tools.CommUtil;
|
||||||
|
import net.sf.json.JSONArray;
|
||||||
|
import org.activiti.engine.RuntimeService;
|
||||||
|
import org.activiti.engine.TaskService;
|
||||||
|
import org.activiti.engine.history.HistoricTaskInstance;
|
||||||
|
import org.activiti.engine.impl.pvm.process.ActivityImpl;
|
||||||
|
import org.activiti.engine.runtime.ProcessInstance;
|
||||||
|
import org.activiti.engine.task.Task;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/administration/leaveApply")
|
||||||
|
public class LeaveApplyController {
|
||||||
|
@Resource
|
||||||
|
private LeaveApplyService leaveApplyService;
|
||||||
|
@Resource
|
||||||
|
private WorkflowProcessDefinitionService workflowProcessDefinitionService;
|
||||||
|
@Resource
|
||||||
|
private BusinessUnitHandleService businessUnitHandleService;
|
||||||
|
@Resource
|
||||||
|
private BusinessUnitAuditService businessUnitAuditService;
|
||||||
|
@Resource
|
||||||
|
private WorkflowService workflowService;
|
||||||
|
@Resource
|
||||||
|
private RuntimeService runtimeService;
|
||||||
|
@Resource
|
||||||
|
private TaskService taskService;
|
||||||
|
@Resource
|
||||||
|
private UserService userService;
|
||||||
|
|
||||||
|
@RequestMapping("/showList.do")
|
||||||
|
public String showList(HttpServletRequest request, Model model) {
|
||||||
|
return "/administration/leaveApplyList";
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/getList.do")
|
||||||
|
public ModelAndView getList(HttpServletRequest request, Model model,
|
||||||
|
@RequestParam(value = "page") Integer page,
|
||||||
|
@RequestParam(value = "rows") Integer rows,
|
||||||
|
@RequestParam(value = "sort", required = false) String sort,
|
||||||
|
@RequestParam(value = "order", required = false) String order) {
|
||||||
|
if (sort == null || "id".equals(sort)) {
|
||||||
|
sort = " insdt ";
|
||||||
|
}
|
||||||
|
if (order == null) {
|
||||||
|
order = " desc ";
|
||||||
|
}
|
||||||
|
String wherestr = " where 1=1 ";
|
||||||
|
if (request.getParameter("search_code") != null && !request.getParameter("search_code").isEmpty()) {
|
||||||
|
wherestr += " and unit_id = '" + request.getParameter("search_code") + "'";
|
||||||
|
}
|
||||||
|
if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) {
|
||||||
|
wherestr += " and (reason like '%" + request.getParameter("search_name") + "%' or insuser like '%" + request.getParameter("search_name") + "%')";
|
||||||
|
}
|
||||||
|
if (request.getParameter("applyType") != null && !request.getParameter("applyType").isEmpty()) {
|
||||||
|
wherestr += " and apply_type = '" + request.getParameter("applyType") + "'";
|
||||||
|
}
|
||||||
|
PageHelper.startPage(page, rows);
|
||||||
|
List<LeaveApply> list = this.leaveApplyService.selectListByWhere(wherestr + " order by " + sort + " " + order);
|
||||||
|
PageInfo<LeaveApply> pInfo = new PageInfo<LeaveApply>(list);
|
||||||
|
JSONArray jsonArray = JSONArray.fromObject(list);
|
||||||
|
String result = "{\"total\":" + pInfo.getTotal() + ",\"rows\":" + jsonArray + "}";
|
||||||
|
model.addAttribute("result", result);
|
||||||
|
return new ModelAndView("result");
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/add.do")
|
||||||
|
public String add(HttpServletRequest request, Model model) {
|
||||||
|
return "/administration/leaveApplyAdd";
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/save.do")
|
||||||
|
public String save(HttpServletRequest request, Model model, @ModelAttribute LeaveApply leaveApply) {
|
||||||
|
User cu = (User) request.getSession().getAttribute("cu");
|
||||||
|
leaveApply.setId(CommUtil.getUUID());
|
||||||
|
leaveApply.setInsdt(CommUtil.nowDate());
|
||||||
|
leaveApply.setInsuser(cu.getId());
|
||||||
|
leaveApply.setState(LeaveCommStr.STATE_DRAFT);
|
||||||
|
leaveApply.setDelFlag("0");
|
||||||
|
int result = this.leaveApplyService.save(leaveApply);
|
||||||
|
String resultstr = "{\"res\":\"" + result + "\",\"id\":\"" + leaveApply.getId() + "\"}";
|
||||||
|
model.addAttribute("result", resultstr);
|
||||||
|
return "result";
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/edit.do")
|
||||||
|
public String edit(HttpServletRequest request, Model model, @RequestParam(value = "id") String id) {
|
||||||
|
model.addAttribute("leaveApply", this.leaveApplyService.selectById(id));
|
||||||
|
return "/administration/leaveApplyEdit";
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/update.do")
|
||||||
|
public String update(HttpServletRequest request, Model model, @ModelAttribute LeaveApply leaveApply) {
|
||||||
|
User cu = (User) request.getSession().getAttribute("cu");
|
||||||
|
leaveApply.setUpduser(cu.getId());
|
||||||
|
leaveApply.setUpddt(CommUtil.nowDate());
|
||||||
|
int result = this.leaveApplyService.update(leaveApply);
|
||||||
|
String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + leaveApply.getId() + "\"}";
|
||||||
|
model.addAttribute("result", resstr);
|
||||||
|
return "result";
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/view.do")
|
||||||
|
public String view(HttpServletRequest request, Model model, @RequestParam(value = "id") String id) {
|
||||||
|
model.addAttribute("leaveApply", this.leaveApplyService.selectById(id));
|
||||||
|
return "/administration/leaveApplyView";
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/delete.do")
|
||||||
|
public String delete(HttpServletRequest request, Model model, @RequestParam(value = "id") String id) {
|
||||||
|
int result = this.leaveApplyService.deleteById(id);
|
||||||
|
model.addAttribute("result", result);
|
||||||
|
return "result";
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/deletes.do")
|
||||||
|
public String deletes(HttpServletRequest request, Model model, @RequestParam(value = "ids") String ids) {
|
||||||
|
ids = ids.replace(",", "','");
|
||||||
|
int result = this.leaveApplyService.deleteByWhere("where id in ('" + ids + "')");
|
||||||
|
model.addAttribute("result", result);
|
||||||
|
return "result";
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/startProcess.do")
|
||||||
|
public String startProcess(HttpServletRequest request, Model model, @ModelAttribute LeaveApply leaveApply) {
|
||||||
|
User cu = (User) request.getSession().getAttribute("cu");
|
||||||
|
if (leaveApply.getId() == null || leaveApply.getId().isEmpty()) {
|
||||||
|
leaveApply.setId(CommUtil.getUUID());
|
||||||
|
}
|
||||||
|
leaveApply.setInsuser(cu.getId());
|
||||||
|
leaveApply.setInsdt(CommUtil.nowDate());
|
||||||
|
int result = this.leaveApplyService.doStartProcess(leaveApply);
|
||||||
|
String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + leaveApply.getId() + "\"}";
|
||||||
|
model.addAttribute("result", resstr);
|
||||||
|
return "result";
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/showExecuteView.do")
|
||||||
|
public String showExecuteView(HttpServletRequest request, Model model) {
|
||||||
|
String id = request.getParameter("id");
|
||||||
|
LeaveApply leaveApply = this.leaveApplyService.selectById(id);
|
||||||
|
if (leaveApply == null) {
|
||||||
|
model.addAttribute("businessUnitRecords", JSONArray.fromObject(new ArrayList<BusinessUnitRecord>()));
|
||||||
|
model.addAttribute("finishFlag", false);
|
||||||
|
model.addAttribute("processStarted", false);
|
||||||
|
model.addAttribute("processMessage", "未找到对应的请假申请记录。");
|
||||||
|
if (request.getParameter("inModal") != null) {
|
||||||
|
return "administration/leaveApplyExecuteViewInModal";
|
||||||
|
}
|
||||||
|
return "administration/leaveApplyExecuteView";
|
||||||
|
}
|
||||||
|
request.setAttribute("business", leaveApply);
|
||||||
|
List<BusinessUnitRecord> businessUnitRecords = new ArrayList<BusinessUnitRecord>();
|
||||||
|
User launchUser = userService.getUserById(leaveApply.getInsuser());
|
||||||
|
String recordUser = leaveApply.getAuditMan();
|
||||||
|
BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(
|
||||||
|
leaveApply.getInsdt(), leaveApply.getInsuser(), leaveApply.getId(), leaveApply.getProcessid(),
|
||||||
|
leaveApply.getUnitId(), null, (recordUser == null || recordUser.trim().isEmpty() || "待签收".equals(recordUser))
|
||||||
|
? "提交了请假补假申请,等待审批人签收。"
|
||||||
|
: "提交了请假补假申请至" + recordUser + "进行审批。", launchUser, "流程发起");
|
||||||
|
businessUnitRecords.add(businessUnitRecord);
|
||||||
|
|
||||||
|
boolean processStarted = leaveApply.getProcessdefid() != null && !leaveApply.getProcessdefid().trim().isEmpty();
|
||||||
|
if (processStarted) {
|
||||||
|
List<WorkTask> workTasks = workflowProcessDefinitionService.getAllPDTask(leaveApply.getProcessdefid(), "desc");
|
||||||
|
List<String> keys = new ArrayList<String>();
|
||||||
|
for (WorkTask workTask : workTasks) {
|
||||||
|
keys.add(workTask.getTaskKey());
|
||||||
|
}
|
||||||
|
Set set = new HashSet();
|
||||||
|
set.addAll(keys);
|
||||||
|
keys = new ArrayList<String>();
|
||||||
|
keys.addAll(set);
|
||||||
|
for (String item : keys) {
|
||||||
|
if (BusinessUnit.UNIT_LEAVE_APPLY_HANDLE.equals(item)) {
|
||||||
|
List<BusinessUnitHandle> list = businessUnitHandleService.selectListByWhere("where businessid='" + id + "'");
|
||||||
|
for (BusinessUnitHandle businessUnitHandle : list) {
|
||||||
|
businessUnitRecord = new BusinessUnitRecord(businessUnitHandle);
|
||||||
|
businessUnitRecords.add(businessUnitRecord);
|
||||||
|
}
|
||||||
|
} else if (BusinessUnit.UNIT_LEAVE_APPLY_SECTION_AUDIT.equals(item)
|
||||||
|
|| BusinessUnit.UNIT_LEAVE_APPLY_MANAGER_AUDIT.equals(item)
|
||||||
|
|| BusinessUnit.UNIT_LEAVE_APPLY_GENERAL_MANAGER_AUDIT.equals(item)) {
|
||||||
|
List<BusinessUnitAudit> listAudit = businessUnitAuditService.selectListByWhere("where businessid='" + id + "'");
|
||||||
|
for (BusinessUnitAudit businessUnitAudit : listAudit) {
|
||||||
|
businessUnitRecord = new BusinessUnitRecord(businessUnitAudit);
|
||||||
|
businessUnitRecords.add(businessUnitRecord);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (leaveApply.getProcessid() != null && !leaveApply.getProcessid().trim().isEmpty()) {
|
||||||
|
List<HistoricTaskInstance> list = this.workflowService.getHistoryService().createHistoricTaskInstanceQuery()
|
||||||
|
.processInstanceId(leaveApply.getProcessid()).list();
|
||||||
|
for (HistoricTaskInstance task : list) {
|
||||||
|
if (task.getAssignee() == null || task.getClaimTime() == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
businessUnitRecord = new BusinessUnitRecord(task);
|
||||||
|
businessUnitRecords.add(businessUnitRecord);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Collections.sort(businessUnitRecords, new Comparator<BusinessUnitRecord>() {
|
||||||
|
public int compare(BusinessUnitRecord o1, BusinessUnitRecord o2) {
|
||||||
|
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
|
||||||
|
try {
|
||||||
|
Date dt1 = df.parse(o1.getInsdt());
|
||||||
|
Date dt2 = df.parse(o2.getInsdt());
|
||||||
|
if (dt1.getTime() > dt2.getTime()) {
|
||||||
|
return 1;
|
||||||
|
} else if (dt1.getTime() < dt2.getTime()) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
model.addAttribute("businessUnitRecords", JSONArray.fromObject(businessUnitRecords));
|
||||||
|
long num = 0L;
|
||||||
|
if (leaveApply.getProcessid() != null && !leaveApply.getProcessid().trim().isEmpty()) {
|
||||||
|
num = runtimeService.createProcessInstanceQuery().processInstanceId(leaveApply.getProcessid()).count();
|
||||||
|
}
|
||||||
|
model.addAttribute("finishFlag", processStarted && num <= 0);
|
||||||
|
model.addAttribute("processStarted", processStarted);
|
||||||
|
model.addAttribute("processMessage", processStarted ? "" : "当前请假单尚未发起审批流程,仅显示单据信息。");
|
||||||
|
if (request.getParameter("inModal") != null) {
|
||||||
|
return "administration/leaveApplyExecuteViewInModal";
|
||||||
|
}
|
||||||
|
return "administration/leaveApplyExecuteView";
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/showAudit.do")
|
||||||
|
public String showAudit(HttpServletRequest request, Model model) {
|
||||||
|
String taskId = request.getParameter("taskId");
|
||||||
|
String processInstanceId = request.getParameter("processInstanceId");
|
||||||
|
BusinessUnitAudit businessUnitAudit = new BusinessUnitAudit();
|
||||||
|
|
||||||
|
Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult();
|
||||||
|
model.addAttribute("taskName", task.getName());
|
||||||
|
ProcessInstance pInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
|
||||||
|
|
||||||
|
businessUnitAudit.setId(CommUtil.getUUID());
|
||||||
|
businessUnitAudit.setProcessid(processInstanceId);
|
||||||
|
businessUnitAudit.setTaskid(taskId);
|
||||||
|
businessUnitAudit.setBusinessid(pInstance.getBusinessKey());
|
||||||
|
businessUnitAudit.setTaskdefinitionkey(task.getTaskDefinitionKey());
|
||||||
|
model.addAttribute("businessUnitAudit", businessUnitAudit);
|
||||||
|
model.addAttribute("leaveApply", this.leaveApplyService.selectById(pInstance.getBusinessKey()));
|
||||||
|
|
||||||
|
List<ActivityImpl> activityImpls = workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey());
|
||||||
|
model.addAttribute("showTargetUsersFlag", activityImpls.size() > 0);
|
||||||
|
return "administration/leaveApplyAudit";
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/doAudit.do")
|
||||||
|
public String doAudit(HttpServletRequest request, Model model, @ModelAttribute BusinessUnitAudit businessUnitAudit) {
|
||||||
|
User cu = (User) request.getSession().getAttribute("cu");
|
||||||
|
businessUnitAudit.setInsuser(cu.getId());
|
||||||
|
businessUnitAudit.setInsdt(CommUtil.nowDate());
|
||||||
|
if (businessUnitAudit.getPassstatus() && (businessUnitAudit.getTargetusers() == null || businessUnitAudit.getTargetusers().trim().isEmpty())) {
|
||||||
|
LeaveApply leaveApply = this.leaveApplyService.selectById(businessUnitAudit.getBusinessid());
|
||||||
|
businessUnitAudit.setTargetusers(this.leaveApplyService.getDefaultCandidateUserIdsForNextTask(
|
||||||
|
leaveApply, businessUnitAudit.getTaskdefinitionkey(), businessUnitAudit.getRouteNum(), true));
|
||||||
|
}
|
||||||
|
int result = this.leaveApplyService.doAuditProcess(businessUnitAudit);
|
||||||
|
String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + businessUnitAudit.getId() + "\"}";
|
||||||
|
model.addAttribute("result", resstr);
|
||||||
|
return "result";
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/showHandle.do")
|
||||||
|
public String showHandle(HttpServletRequest request, Model model) {
|
||||||
|
String taskId = request.getParameter("taskId");
|
||||||
|
String processInstanceId = request.getParameter("processInstanceId");
|
||||||
|
String unitId = request.getParameter("unitId");
|
||||||
|
BusinessUnitHandle businessUnitHandle = new BusinessUnitHandle();
|
||||||
|
Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult();
|
||||||
|
model.addAttribute("taskName", task.getName());
|
||||||
|
List<BusinessUnitHandle> businessUnitHandles = this.businessUnitHandleService.selectListByWhere("where processid='" + processInstanceId + "' and taskId='" + taskId + "'");
|
||||||
|
if (businessUnitHandles != null && businessUnitHandles.size() > 0) {
|
||||||
|
businessUnitHandle = businessUnitHandles.get(0);
|
||||||
|
businessUnitHandle.setTaskid(taskId);
|
||||||
|
} else {
|
||||||
|
businessUnitHandle.setId(CommUtil.getUUID());
|
||||||
|
businessUnitHandle.setProcessid(processInstanceId);
|
||||||
|
businessUnitHandle.setTaskid(taskId);
|
||||||
|
ProcessInstance pInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
|
||||||
|
businessUnitHandle.setBusinessid(pInstance.getBusinessKey());
|
||||||
|
businessUnitHandle.setTaskdefinitionkey(task.getTaskDefinitionKey());
|
||||||
|
businessUnitHandle.setUnitid(unitId);
|
||||||
|
}
|
||||||
|
String userIds = businessUnitHandle.getTargetusers();
|
||||||
|
if (userIds != null && !userIds.isEmpty()) {
|
||||||
|
List<User> users = userService.selectListByWhere("where id in('" + userIds.replace(",", "','") + "')");
|
||||||
|
String targetUsersName = "";
|
||||||
|
for (User user : users) {
|
||||||
|
if (!targetUsersName.isEmpty()) {
|
||||||
|
targetUsersName += ",";
|
||||||
|
}
|
||||||
|
targetUsersName += user.getCaption();
|
||||||
|
}
|
||||||
|
model.addAttribute("targetUsersName", targetUsersName);
|
||||||
|
}
|
||||||
|
model.addAttribute("businessUnitHandle", businessUnitHandle);
|
||||||
|
LeaveApply leaveApply = this.leaveApplyService.selectById(businessUnitHandle.getBusinessid());
|
||||||
|
model.addAttribute("leaveApply", leaveApply);
|
||||||
|
List<BusinessUnitAudit> businessUnitAudits = this.businessUnitAuditService.selectListByWhere("where businessId = '" + leaveApply.getId() + "' order by insdt desc");
|
||||||
|
String rejectReason = "";
|
||||||
|
if (businessUnitAudits != null && businessUnitAudits.size() > 0) {
|
||||||
|
rejectReason = businessUnitAudits.get(0).getAuditopinion();
|
||||||
|
}
|
||||||
|
model.addAttribute("rejectReason", rejectReason);
|
||||||
|
ActivityImpl activityImpl = workflowProcessDefinitionService.getNEXTActivityImpl(task.getProcessDefinitionId(), task.getTaskDefinitionKey(), CommString.ACTI_Condition_PASS);
|
||||||
|
model.addAttribute("showTargetUsersFlag", activityImpl != null && "userTask".equals(activityImpl.getProperties().get("type")));
|
||||||
|
return "administration/leaveApplyHandle";
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/doHandle.do")
|
||||||
|
public String doHandle(HttpServletRequest request, Model model,
|
||||||
|
@ModelAttribute LeaveApply leaveApply,
|
||||||
|
@ModelAttribute BusinessUnitHandle businessUnitHandle) {
|
||||||
|
User cu = (User) request.getSession().getAttribute("cu");
|
||||||
|
int result = 0;
|
||||||
|
leaveApply.setUpduser(cu.getId());
|
||||||
|
leaveApply.setUpddt(CommUtil.nowDate());
|
||||||
|
leaveApply.setState(LeaveCommStr.STATE_SECTION_AUDIT);
|
||||||
|
result = this.leaveApplyService.update(leaveApply);
|
||||||
|
if (result > 0) {
|
||||||
|
String routeNum = request.getParameter("routeNum");
|
||||||
|
businessUnitHandle.setStatus(BusinessUnitHandle.Status_FINISH);
|
||||||
|
if (!this.businessUnitHandleService.checkExit(businessUnitHandle)) {
|
||||||
|
businessUnitHandle.setInsuser(cu.getId());
|
||||||
|
businessUnitHandle.setInsdt(CommUtil.nowDate());
|
||||||
|
result = this.businessUnitHandleService.save(businessUnitHandle);
|
||||||
|
} else {
|
||||||
|
result = this.businessUnitHandleService.update(businessUnitHandle);
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
Map<String, Object> variables = new HashMap<String, Object>();
|
||||||
|
variables = ActivitiUtil.fixVariableWithRoute(variables, true, routeNum);
|
||||||
|
if (businessUnitHandle.getTargetusers() == null || businessUnitHandle.getTargetusers().trim().isEmpty()) {
|
||||||
|
businessUnitHandle.setTargetusers(this.leaveApplyService.getDefaultCandidateUserIds(
|
||||||
|
leaveApply, BusinessUnit.UNIT_LEAVE_APPLY_SECTION_AUDIT));
|
||||||
|
}
|
||||||
|
variables.put(CommString.ACTI_KEK_Candidate_Users, businessUnitHandle.getTargetusers());
|
||||||
|
variables.put(CommString.ACTI_KEK_Assignee, null);
|
||||||
|
taskService.complete(businessUnitHandle.getTaskid(), variables);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
result = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + leaveApply.getId() + "\"}";
|
||||||
|
model.addAttribute("result", resstr);
|
||||||
|
return "result";
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/getList4Mobile.do")
|
||||||
|
public Result getList4Mobile(HttpServletRequest request, Model model) {
|
||||||
|
String wherestr = "where 1=1 order by insdt desc";
|
||||||
|
List<LeaveApply> list = this.leaveApplyService.selectListByWhere(wherestr);
|
||||||
|
JSONArray json = JSONArray.fromObject(list);
|
||||||
|
String res = "{\"total\":" + list.size() + ",\"rows\":" + json + "}";
|
||||||
|
return Result.success(res);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -369,7 +369,9 @@ public class AlarmPointController {
|
|||||||
this.mPointService.updateLalarmmin(alarmPoint.getUnitId(), mPoint.getMpointcode());
|
this.mPointService.updateLalarmmin(alarmPoint.getUnitId(), mPoint.getMpointcode());
|
||||||
// mPoint.setLalarmmin(null);
|
// mPoint.setLalarmmin(null);
|
||||||
}
|
}
|
||||||
// this.mPointService.update2(alarmPoint.getUnitId(),mPoint);
|
// Enable TriggerAlarm to allow ScadaAlarmJob to process this MPoint
|
||||||
|
mPoint.setTriggeralarm("1");
|
||||||
|
this.mPointService.update2(alarmPoint.getUnitId(), mPoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (code == Result.SUCCESS) {
|
if (code == Result.SUCCESS) {
|
||||||
|
|||||||
@ -197,16 +197,15 @@ public class ProAlarmController {
|
|||||||
// Iterator<String> sIterator = jsonObject.keys();
|
// Iterator<String> sIterator = jsonObject.keys();
|
||||||
|
|
||||||
JSONArray arr = new JSONArray();
|
JSONArray arr = new JSONArray();
|
||||||
List<XServer> allxServerList = this.xServerService.selectListByWhere(" where 1=1 ");
|
// List<XServer> allxServerList = this.xServerService.selectListByWhere(" where 1=1 ");
|
||||||
for (XServer xServer :
|
// for (XServer xServer : allxServerList) {
|
||||||
allxServerList) {
|
|
||||||
// if (jsonObject.get(xServer.getBizid()) != null) {
|
// if (jsonObject.get(xServer.getBizid()) != null) {
|
||||||
// String code_value = jsonObject.get(xServer.getBizid()).toString();
|
// String code_value = jsonObject.get(xServer.getBizid()).toString();
|
||||||
// code_value = code_value + ",data_stop_alarm";
|
// code_value = code_value + ",data_stop_alarm";
|
||||||
// code_value = code_value.replace(",", "','");
|
// code_value = code_value.replace(",", "','");
|
||||||
// List<ProAlarm> list = this.proAlarmService.selectListByWhere(xServer.getBizid(), wherestr + " and point_code in ('" + code_value + "')"
|
// List<ProAlarm> list = this.proAlarmService.selectListByWhere(xServer.getBizid(), wherestr + " and point_code in ('" + code_value + "')"
|
||||||
// + orderstr);
|
// + orderstr);
|
||||||
List<ProAlarm> list = this.proAlarmService.selectListByWhere(xServer.getBizid(), wherestr + orderstr);
|
List<ProAlarm> list = this.proAlarmService.selectListByWhere(companyId, wherestr + orderstr);
|
||||||
// System.out.println(wherestr + " and point_code in ('" + code_value + "')");
|
// System.out.println(wherestr + " and point_code in ('" + code_value + "')");
|
||||||
if (list != null && list.size() > 0) {
|
if (list != null && list.size() > 0) {
|
||||||
for (int i = 0; i < list.size(); i++) {
|
for (int i = 0; i < list.size(); i++) {
|
||||||
@ -249,7 +248,7 @@ public class ProAlarmController {
|
|||||||
}
|
}
|
||||||
// }
|
// }
|
||||||
|
|
||||||
}
|
// }
|
||||||
model.addAttribute("result", arr);
|
model.addAttribute("result", arr);
|
||||||
return new ModelAndView("result");
|
return new ModelAndView("result");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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());
|
||||||
|
|||||||
@ -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(",","','");
|
||||||
|
|||||||
@ -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");
|
||||||
|
|||||||
@ -37,6 +37,7 @@ import org.activiti.engine.history.HistoricTaskInstance;
|
|||||||
import org.activiti.engine.impl.pvm.process.ActivityImpl;
|
import org.activiti.engine.impl.pvm.process.ActivityImpl;
|
||||||
import org.activiti.engine.runtime.ProcessInstance;
|
import org.activiti.engine.runtime.ProcessInstance;
|
||||||
import org.activiti.engine.task.Task;
|
import org.activiti.engine.task.Task;
|
||||||
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.ui.Model;
|
import org.springframework.ui.Model;
|
||||||
@ -356,7 +357,9 @@ public class MaintenancePlanController {
|
|||||||
model.addAttribute("nowDate", CommUtil.nowDate());
|
model.addAttribute("nowDate", CommUtil.nowDate());
|
||||||
String maintenancePlanId = pInstance.getBusinessKey();
|
String maintenancePlanId = pInstance.getBusinessKey();
|
||||||
List<BusinessUnitAudit> list = this.businessUnitAuditService.selectListByWhere("where businessId = '" + maintenancePlanId + "' order by insdt desc ");
|
List<BusinessUnitAudit> list = this.businessUnitAuditService.selectListByWhere("where businessId = '" + maintenancePlanId + "' order by insdt desc ");
|
||||||
|
if (CollectionUtils.isNotEmpty(list)){
|
||||||
model.addAttribute("businessUnitAudit", list.get(0));
|
model.addAttribute("businessUnitAudit", list.get(0));
|
||||||
|
}
|
||||||
MaintenancePlan maintenancePlan = this.maintenancePlanService.selectById(maintenancePlanId);
|
MaintenancePlan maintenancePlan = this.maintenancePlanService.selectById(maintenancePlanId);
|
||||||
model.addAttribute("maintenancePlan", maintenancePlan);
|
model.addAttribute("maintenancePlan", maintenancePlan);
|
||||||
EquipmentPlan equipmentPlan = this.equipmentPlanService.selectById(maintenancePlanId);
|
EquipmentPlan equipmentPlan = this.equipmentPlanService.selectById(maintenancePlanId);
|
||||||
|
|||||||
@ -279,10 +279,8 @@ public class EquipmentPlanController {
|
|||||||
if (company != null) {
|
if (company != null) {
|
||||||
model.addAttribute("companyName", company.getSname());
|
model.addAttribute("companyName", company.getSname());
|
||||||
}
|
}
|
||||||
User user = userService.getUserById(equipmentPlan.getAuditId());
|
String userNames = userService.getUserNamesByUserIds(equipmentPlan.getAuditId());
|
||||||
if (user != null) {
|
model.addAttribute("userName", userNames);
|
||||||
model.addAttribute("userName", user.getCaption());
|
|
||||||
}
|
|
||||||
EquipmentPlanType equipmentPlanType_big = equipmentPlanTypeService.selectById(equipmentPlan.getPlanTypeBig());
|
EquipmentPlanType equipmentPlanType_big = equipmentPlanTypeService.selectById(equipmentPlan.getPlanTypeBig());
|
||||||
if (equipmentPlanType_big != null) {
|
if (equipmentPlanType_big != null) {
|
||||||
model.addAttribute("planTypeBigName", equipmentPlanType_big.getName());
|
model.addAttribute("planTypeBigName", equipmentPlanType_big.getName());
|
||||||
@ -308,10 +306,8 @@ public class EquipmentPlanController {
|
|||||||
if (company != null) {
|
if (company != null) {
|
||||||
model.addAttribute("companyName", company.getSname());
|
model.addAttribute("companyName", company.getSname());
|
||||||
}
|
}
|
||||||
User user = userService.getUserById(equipmentPlan.getAuditId());
|
String userNames = userService.getUserNamesByUserIds(equipmentPlan.getAuditId());
|
||||||
if (user != null) {
|
model.addAttribute("userName", userNames);
|
||||||
model.addAttribute("userName", user.getCaption());
|
|
||||||
}
|
|
||||||
EquipmentPlanType equipmentPlanType_big = equipmentPlanTypeService.selectById(equipmentPlan.getPlanTypeBig());
|
EquipmentPlanType equipmentPlanType_big = equipmentPlanTypeService.selectById(equipmentPlan.getPlanTypeBig());
|
||||||
if (equipmentPlanType_big != null) {
|
if (equipmentPlanType_big != null) {
|
||||||
model.addAttribute("planTypeBigName", equipmentPlanType_big.getName());
|
model.addAttribute("planTypeBigName", equipmentPlanType_big.getName());
|
||||||
@ -422,10 +418,8 @@ public class EquipmentPlanController {
|
|||||||
if (company != null) {
|
if (company != null) {
|
||||||
model.addAttribute("companyName", company.getSname());
|
model.addAttribute("companyName", company.getSname());
|
||||||
}
|
}
|
||||||
User user = userService.getUserById(equipmentPlan.getAuditId());
|
String userNames = userService.getUserNamesByUserIds(equipmentPlan.getAuditId());
|
||||||
if (user != null) {
|
model.addAttribute("userName", userNames);
|
||||||
model.addAttribute("userName", user.getCaption());
|
|
||||||
}
|
|
||||||
EquipmentPlanType equipmentPlanType_big = equipmentPlanTypeService.selectById(equipmentPlan.getPlanTypeBig());
|
EquipmentPlanType equipmentPlanType_big = equipmentPlanTypeService.selectById(equipmentPlan.getPlanTypeBig());
|
||||||
if (equipmentPlanType_big != null) {
|
if (equipmentPlanType_big != null) {
|
||||||
model.addAttribute("planTypeBigName", equipmentPlanType_big.getName());
|
model.addAttribute("planTypeBigName", equipmentPlanType_big.getName());
|
||||||
|
|||||||
@ -123,7 +123,9 @@ public class PipelineDataController {
|
|||||||
@RequestMapping("/deletes.do")
|
@RequestMapping("/deletes.do")
|
||||||
public String dodeletes(HttpServletRequest request, Model model,
|
public String dodeletes(HttpServletRequest request, Model model,
|
||||||
@RequestParam(value = "ids") String ids) {
|
@RequestParam(value = "ids") String ids) {
|
||||||
int result = this.pipelineDataService.deleteByWhere("where id in (" + ids + ")");
|
// 移除末尾逗号,防止SQL语法错误
|
||||||
|
String cleanIds = ids.replaceAll("[,\\s]+$", "").replaceAll("^[,\\s]+", "");
|
||||||
|
int result = this.pipelineDataService.deleteByWhere("where id in (" + cleanIds + ")");
|
||||||
model.addAttribute("result", result);
|
model.addAttribute("result", result);
|
||||||
return "result";
|
return "result";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -374,6 +374,16 @@ public class RptCreateController {
|
|||||||
@RequestMapping("/doadd.do")
|
@RequestMapping("/doadd.do")
|
||||||
public String doadd(HttpServletRequest request, Model model) {
|
public String doadd(HttpServletRequest request, Model model) {
|
||||||
User cu = (User) request.getSession().getAttribute("cu");
|
User cu = (User) request.getSession().getAttribute("cu");
|
||||||
|
String rptsetId = request.getParameter("rptsetId");
|
||||||
|
|
||||||
|
// 权限验证:检查用户是否有报表生成权限
|
||||||
|
if (rptsetId != null && !rptsetId.isEmpty()) {
|
||||||
|
if (!this.rptCreateService.checkGeneratePermission(rptsetId, cu)) {
|
||||||
|
model.addAttribute("result", "{\"res\":\"您没有该报表的生成权限\",\"msg\":\"您没有该报表的生成权限\"}");
|
||||||
|
return "result";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
request.setAttribute("userId", cu.getId());
|
request.setAttribute("userId", cu.getId());
|
||||||
request.setAttribute("userName", cu.getCaption());
|
request.setAttribute("userName", cu.getCaption());
|
||||||
request.setAttribute("id", CommUtil.getUUID());
|
request.setAttribute("id", CommUtil.getUUID());
|
||||||
@ -432,6 +442,14 @@ public class RptCreateController {
|
|||||||
String rptsetId = request.getParameter("rptsetId");
|
String rptsetId = request.getParameter("rptsetId");
|
||||||
int result = 0;
|
int result = 0;
|
||||||
|
|
||||||
|
// 权限验证:检查用户是否有报表生成权限
|
||||||
|
if (rptCreate.getRptsetId() != null && !rptCreate.getRptsetId().isEmpty()) {
|
||||||
|
if (!this.rptCreateService.checkGeneratePermission(rptCreate.getRptsetId(), cu)) {
|
||||||
|
model.addAttribute("result", "{\"res\":\"您没有该报表的生成权限\",\"msg\":\"您没有该报表的生成权限\"}");
|
||||||
|
return new ModelAndView("result");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
RptInfoSet rptInfoSet = rptInfoSetService.selectById(rptCreate.getRptsetId());
|
RptInfoSet rptInfoSet = rptInfoSetService.selectById(rptCreate.getRptsetId());
|
||||||
if (rptInfoSet != null) {
|
if (rptInfoSet != null) {
|
||||||
//日报
|
//日报
|
||||||
@ -545,6 +563,15 @@ public class RptCreateController {
|
|||||||
User cu = (User) request.getSession().getAttribute("cu");
|
User cu = (User) request.getSession().getAttribute("cu");
|
||||||
String rptsetId = request.getParameter("rptsetId");
|
String rptsetId = request.getParameter("rptsetId");
|
||||||
int result = 0;
|
int result = 0;
|
||||||
|
|
||||||
|
// 权限验证:检查用户是否有报表生成权限
|
||||||
|
if (rptCreate.getRptsetId() != null && !rptCreate.getRptsetId().isEmpty()) {
|
||||||
|
if (!this.rptCreateService.checkGeneratePermission(rptCreate.getRptsetId(), cu)) {
|
||||||
|
model.addAttribute("result", "{\"res\":\"您没有该报表的生成权限\",\"msg\":\"您没有该报表的生成权限\"}");
|
||||||
|
return new ModelAndView("result");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
RptInfoSet rptInfoSet = rptInfoSetService.selectById(rptCreate.getRptsetId());
|
RptInfoSet rptInfoSet = rptInfoSetService.selectById(rptCreate.getRptsetId());
|
||||||
if (rptInfoSet != null) {
|
if (rptInfoSet != null) {
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
@ -750,13 +777,26 @@ public class RptCreateController {
|
|||||||
@RequestMapping("/getSheet.do")
|
@RequestMapping("/getSheet.do")
|
||||||
public String getSheet(HttpServletRequest request, Model model,
|
public String getSheet(HttpServletRequest request, Model model,
|
||||||
@RequestParam(value = "id") String id) {
|
@RequestParam(value = "id") String id) {
|
||||||
|
String path = "";
|
||||||
|
String name = "";
|
||||||
Result_Report result1 = new Result_Report();
|
Result_Report result1 = new Result_Report();
|
||||||
RptCreate rptCreate = this.rptCreateService.selectById(id);
|
RptCreate rptCreate = this.rptCreateService.selectById(id);
|
||||||
if (rptCreate != null) {//报表生成中的预览
|
if (rptCreate != null) {//报表生成中的预览
|
||||||
|
// 优先使用数据库中存储的文件路径,如果没有则构造路径(兼容旧数据)
|
||||||
|
if (rptCreate.getAbspath() != null && !rptCreate.getAbspath().isEmpty()) {
|
||||||
|
path = rptCreate.getAbspath();
|
||||||
|
} else {
|
||||||
|
path = rptCreate.getRptname() + rptCreate.getId() + ".xls";
|
||||||
|
}
|
||||||
|
// 获取文件扩展名
|
||||||
|
String extension = ".xls";
|
||||||
|
if (path.toLowerCase().endsWith(".xlsx")) {
|
||||||
|
extension = ".xlsx";
|
||||||
|
}
|
||||||
|
String sourcePath = rptCreate.getRptname() + extension;
|
||||||
List<RptInfoSetSheet> list = rptInfoSetSheetService.selectListByWhere("where rptInfoSet_id = '" + rptCreate.getRptsetId() + "'");
|
List<RptInfoSetSheet> list = rptInfoSetSheetService.selectListByWhere("where rptInfoSet_id = '" + rptCreate.getRptsetId() + "'");
|
||||||
try {
|
try {
|
||||||
String sourcePath = rptCreate.getRptname();
|
byte[] isb = commonFileService.getInputStreamBytes(FileNameSpaceEnum.RptCreateFile.getNameSpace(), path);
|
||||||
byte[] isb = commonFileService.getInputStreamBytes(FileNameSpaceEnum.RptCreateFile.getNameSpace(), CommUtil.fixRptCreateFileName(rptCreate.getRptname() + rptCreate.getId()));
|
|
||||||
if (isb == null || isb.length == 0) {
|
if (isb == null || isb.length == 0) {
|
||||||
result1 = Result_Report.failed("文件不存在或已被删除");
|
result1 = Result_Report.failed("文件不存在或已被删除");
|
||||||
model.addAttribute("result", CommUtil.toJson(result1));
|
model.addAttribute("result", CommUtil.toJson(result1));
|
||||||
@ -774,7 +814,7 @@ public class RptCreateController {
|
|||||||
List<RptInfoSetSheet> list = rptInfoSetSheetService.selectListByWhere("where rptInfoSet_id = '" + rptInfoSetFile.getMasterid() + "'");
|
List<RptInfoSetSheet> list = rptInfoSetSheetService.selectListByWhere("where rptInfoSet_id = '" + rptInfoSetFile.getMasterid() + "'");
|
||||||
try {
|
try {
|
||||||
String sourcePath = "";
|
String sourcePath = "";
|
||||||
String path = rptInfoSetFile.getAbspath();
|
path = rptInfoSetFile.getAbspath();
|
||||||
// path = path.replaceAll("\\.xlsx", "").replaceAll("\\.xls", "");
|
// path = path.replaceAll("\\.xlsx", "").replaceAll("\\.xls", "");
|
||||||
// byte[] isb = commonFileService.getInputStreamBytes(FileNameSpaceEnum.RptInfoSetFile.getNameSpace(), CommUtil.fixRptCreateFileName(path));
|
// byte[] isb = commonFileService.getInputStreamBytes(FileNameSpaceEnum.RptInfoSetFile.getNameSpace(), CommUtil.fixRptCreateFileName(path));
|
||||||
byte[] isb = commonFileService.getInputStreamBytes(FileNameSpaceEnum.RptInfoSetFile.getNameSpace(), path);
|
byte[] isb = commonFileService.getInputStreamBytes(FileNameSpaceEnum.RptInfoSetFile.getNameSpace(), path);
|
||||||
@ -850,8 +890,18 @@ public class RptCreateController {
|
|||||||
String name = "";
|
String name = "";
|
||||||
RptCreate rptCreate = this.rptCreateService.selectById(id);
|
RptCreate rptCreate = this.rptCreateService.selectById(id);
|
||||||
if (rptCreate != null) {
|
if (rptCreate != null) {
|
||||||
|
// 优先使用数据库中存储的文件路径,如果没有则构造路径(兼容旧数据)
|
||||||
|
if (rptCreate.getAbspath() != null && !rptCreate.getAbspath().isEmpty()) {
|
||||||
|
path = rptCreate.getAbspath();
|
||||||
|
} else {
|
||||||
path = rptCreate.getRptname() + rptCreate.getId() + ".xls";
|
path = rptCreate.getRptname() + rptCreate.getId() + ".xls";
|
||||||
name = rptCreate.getRptname() + ".xls";
|
}
|
||||||
|
// 获取文件扩展名
|
||||||
|
String extension = ".xls";
|
||||||
|
if (path.toLowerCase().endsWith(".xlsx")) {
|
||||||
|
extension = ".xlsx";
|
||||||
|
}
|
||||||
|
name = rptCreate.getRptname() + extension;
|
||||||
}
|
}
|
||||||
byte[] bytes = commonFileService.getInputStreamBytes(FileNameSpaceEnum.RptCreateFile.getNameSpace(), path);
|
byte[] bytes = commonFileService.getInputStreamBytes(FileNameSpaceEnum.RptCreateFile.getNameSpace(), path);
|
||||||
if (bytes == null || bytes.length == 0) {
|
if (bytes == null || bytes.length == 0) {
|
||||||
|
|||||||
@ -123,6 +123,13 @@ public class RptDayLogController {
|
|||||||
User cu = (User) request.getSession().getAttribute("cu");
|
User cu = (User) request.getSession().getAttribute("cu");
|
||||||
String userId = cu.getId();
|
String userId = cu.getId();
|
||||||
|
|
||||||
|
// 权限验证:检查用户是否有填报权限
|
||||||
|
if (!this.rptDayLogService.checkInputPermission(rptdeptId, cu)) {
|
||||||
|
Result result = Result.failed("您没有该报表的填报权限");
|
||||||
|
model.addAttribute("result", CommUtil.toJson(result));
|
||||||
|
return "result";
|
||||||
|
}
|
||||||
|
|
||||||
JSONObject jsonObject = this.rptDayLogService.getJson(null,rptdeptId,rptdt,userId);
|
JSONObject jsonObject = this.rptDayLogService.getJson(null,rptdeptId,rptdt,userId);
|
||||||
|
|
||||||
Result result = Result.success(jsonObject);
|
Result result = Result.success(jsonObject);
|
||||||
@ -149,6 +156,14 @@ public class RptDayLogController {
|
|||||||
@RequestParam(value = "rptdeptId") String rptdeptId) throws IOException {
|
@RequestParam(value = "rptdeptId") String rptdeptId) throws IOException {
|
||||||
User cu = (User) request.getSession().getAttribute("cu");
|
User cu = (User) request.getSession().getAttribute("cu");
|
||||||
String userId = cu.getId();
|
String userId = cu.getId();
|
||||||
|
|
||||||
|
// 权限验证:检查用户是否有填报权限
|
||||||
|
if (!this.rptDayLogService.checkInputPermission(rptdeptId, cu)) {
|
||||||
|
Result result = Result.failed("您没有该报表的填报权限");
|
||||||
|
model.addAttribute("result", CommUtil.toJson(result));
|
||||||
|
return "result";
|
||||||
|
}
|
||||||
|
|
||||||
JSONObject jsonObject = this.rptDayLogService.getJson(id,rptdeptId,null,userId);
|
JSONObject jsonObject = this.rptDayLogService.getJson(id,rptdeptId,null,userId);
|
||||||
model.addAttribute("rptDayLog", jsonObject);
|
model.addAttribute("rptDayLog", jsonObject);
|
||||||
// return "/report/reportdetail";
|
// return "/report/reportdetail";
|
||||||
@ -191,11 +206,19 @@ public class RptDayLogController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/dosave.do")
|
@RequestMapping("/dosave.do")
|
||||||
public String dosave(HttpServletRequest request,Model model){
|
public ModelAndView dosave(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 json = request.getParameter("json");
|
String json = request.getParameter("json");
|
||||||
JSONObject jsonObject = JSONObject.fromObject(json);
|
JSONObject jsonObject = JSONObject.fromObject(json);
|
||||||
|
|
||||||
|
// 权限验证:检查用户是否有填报权限
|
||||||
|
String rptdeptId = (String) jsonObject.get("rptdeptId");
|
||||||
|
if (!this.rptDayLogService.checkInputPermission(rptdeptId, cu)) {
|
||||||
|
model.addAttribute("result", "{\"res\":\"您没有该报表的填报权限\",\"msg\":\"您没有该报表的填报权限\"}");
|
||||||
|
return new ModelAndView("result");
|
||||||
|
}
|
||||||
|
|
||||||
if (jsonObject.get("id")==null||jsonObject.get("id").equals("")) {
|
if (jsonObject.get("id")==null||jsonObject.get("id").equals("")) {
|
||||||
jsonObject.put("id", CommUtil.getUUID());
|
jsonObject.put("id", CommUtil.getUUID());
|
||||||
}
|
}
|
||||||
@ -206,12 +229,12 @@ public class RptDayLogController {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
Result result = Result.failed("插入失败");
|
Result result = Result.failed("插入失败");
|
||||||
model.addAttribute("result", CommUtil.toJson(result));
|
model.addAttribute("result", CommUtil.toJson(result));
|
||||||
return "result";
|
return new ModelAndView("result");
|
||||||
}
|
}
|
||||||
|
|
||||||
Result result = Result.success(null);
|
Result result = Result.success(null);
|
||||||
model.addAttribute("result", CommUtil.toJson(result));
|
model.addAttribute("result", CommUtil.toJson(result));
|
||||||
return "result";
|
return new ModelAndView("result");
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/onekeyAudit.do")//一键审核
|
@RequestMapping("/onekeyAudit.do")//一键审核
|
||||||
@ -268,6 +291,14 @@ public class RptDayLogController {
|
|||||||
@RequestParam(value = "rptdeptId", required=false) String rptdeptId) {
|
@RequestParam(value = "rptdeptId", required=false) String rptdeptId) {
|
||||||
User cu = (User) request.getSession().getAttribute("cu");
|
User cu = (User) request.getSession().getAttribute("cu");
|
||||||
String userId = cu.getId();
|
String userId = cu.getId();
|
||||||
|
|
||||||
|
// 权限验证:检查用户是否有填报权限
|
||||||
|
if (!this.rptDayLogService.checkInputPermission(rptdeptId, cu)) {
|
||||||
|
Result result = Result.failed("您没有该报表的填报权限");
|
||||||
|
model.addAttribute("result", CommUtil.toJson(result));
|
||||||
|
return "result";
|
||||||
|
}
|
||||||
|
|
||||||
MultipartRequest multipartRequest = (MultipartRequest)request;
|
MultipartRequest multipartRequest = (MultipartRequest)request;
|
||||||
|
|
||||||
List<MultipartFile> fileList = multipartRequest.getFiles("filelist");
|
List<MultipartFile> fileList = multipartRequest.getFiles("filelist");
|
||||||
|
|||||||
@ -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("整改负责人不能为空!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -178,8 +181,8 @@ public class SafetyCheckComprehensiveController {
|
|||||||
SafetyCheckStatusEnum.RESPONSE.getTaskTitle(),
|
SafetyCheckStatusEnum.RESPONSE.getTaskTitle(),
|
||||||
bean.getDutyUserId(), // 当前节点审批人
|
bean.getDutyUserId(), // 当前节点审批人
|
||||||
bean.getDutyUserName(), // 当前节点审批人
|
bean.getDutyUserName(), // 当前节点审批人
|
||||||
null, // 抄送人
|
bean.getCopyUserId(), // 抄送人
|
||||||
null,// 抄送人
|
bean.getCopyUserName(),// 抄送人
|
||||||
null);
|
null);
|
||||||
}
|
}
|
||||||
return Result.success();
|
return Result.success();
|
||||||
@ -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("验证人不能为空!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -374,10 +377,9 @@ public class SafetyCheckComprehensiveController {
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Result response(HttpServletRequest request, SafetyCheckComprehensive bean, String processInstanceId, int pass) throws IOException, ServiceException {
|
public Result response(HttpServletRequest request, SafetyCheckComprehensive bean, String processInstanceId, int pass) throws IOException, ServiceException {
|
||||||
|
|
||||||
safetyCheckActivityService.audit(bean.getConfirmUserId(), processInstanceId, pass);
|
|
||||||
|
|
||||||
//通过
|
//通过
|
||||||
if (pass == 1) {
|
if (pass == 1) {
|
||||||
|
safetyCheckActivityService.audit(bean.getConfirmUserId(), processInstanceId, pass);
|
||||||
bean.setStatus(SafetyCheckStatusEnum.COMPLETE.getId());
|
bean.setStatus(SafetyCheckStatusEnum.COMPLETE.getId());
|
||||||
service.update(bean);
|
service.update(bean);
|
||||||
|
|
||||||
@ -388,7 +390,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(),
|
||||||
"结束",
|
"结束",
|
||||||
@ -400,6 +402,7 @@ public class SafetyCheckComprehensiveController {
|
|||||||
}
|
}
|
||||||
//不通过
|
//不通过
|
||||||
else {
|
else {
|
||||||
|
safetyCheckActivityService.audit(bean.getDutyUserId(), processInstanceId, pass);
|
||||||
bean.setStatus(SafetyCheckStatusEnum.APPLY.getId());
|
bean.setStatus(SafetyCheckStatusEnum.APPLY.getId());
|
||||||
service.update(bean);
|
service.update(bean);
|
||||||
safetyFlowTaskService.saveWorkFlowRecord(true,
|
safetyFlowTaskService.saveWorkFlowRecord(true,
|
||||||
|
|||||||
@ -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("整改负责人不能为空!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -235,8 +236,8 @@ public class SafetyCheckDaylyController {
|
|||||||
SafetyCheckStatusEnum.RESPONSE.getTaskTitle(),
|
SafetyCheckStatusEnum.RESPONSE.getTaskTitle(),
|
||||||
bean.getDutyUserId(), // 当前节点审批人
|
bean.getDutyUserId(), // 当前节点审批人
|
||||||
bean.getDutyUserName(), // 当前节点审批人
|
bean.getDutyUserName(), // 当前节点审批人
|
||||||
null, // 抄送人
|
bean.getCopyUserId(), // 抄送人
|
||||||
null,// 抄送人
|
bean.getCopyUserName(),// 抄送人
|
||||||
null);
|
null);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -372,10 +373,9 @@ public class SafetyCheckDaylyController {
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Result response(HttpServletRequest request, SafetyCheckDayly bean, String processInstanceId, int pass) throws IOException, ServiceException {
|
public Result response(HttpServletRequest request, SafetyCheckDayly bean, String processInstanceId, int pass) throws IOException, ServiceException {
|
||||||
|
|
||||||
safetyCheckActivityService.audit(bean.getConfirmUserId(), processInstanceId, pass);
|
|
||||||
|
|
||||||
//通过
|
//通过
|
||||||
if (pass == 1) {
|
if (pass == 1) {
|
||||||
|
safetyCheckActivityService.audit(bean.getConfirmUserId(), processInstanceId, pass);
|
||||||
bean.setStatus(SafetyCheckStatusEnum.COMPLETE.getId());
|
bean.setStatus(SafetyCheckStatusEnum.COMPLETE.getId());
|
||||||
safetyCheckDaylyService.update(bean);
|
safetyCheckDaylyService.update(bean);
|
||||||
|
|
||||||
@ -399,6 +399,7 @@ public class SafetyCheckDaylyController {
|
|||||||
}
|
}
|
||||||
//不通过
|
//不通过
|
||||||
else {
|
else {
|
||||||
|
safetyCheckActivityService.audit(bean.getDutyUserId(), processInstanceId, pass);
|
||||||
bean.setStatus(SafetyCheckStatusEnum.APPLY.getId());
|
bean.setStatus(SafetyCheckStatusEnum.APPLY.getId());
|
||||||
safetyCheckDaylyService.update(bean);
|
safetyCheckDaylyService.update(bean);
|
||||||
safetyFlowTaskService.saveWorkFlowRecord(true,
|
safetyFlowTaskService.saveWorkFlowRecord(true,
|
||||||
|
|||||||
@ -197,8 +197,8 @@ public class SafetyCheckSpecialController {
|
|||||||
SafetyCheckStatusEnum.RESPONSE.getTaskTitle(),
|
SafetyCheckStatusEnum.RESPONSE.getTaskTitle(),
|
||||||
bean.getDutyUserId(), // 当前节点审批人
|
bean.getDutyUserId(), // 当前节点审批人
|
||||||
bean.getDutyUserName(), // 当前节点审批人
|
bean.getDutyUserName(), // 当前节点审批人
|
||||||
null, // 抄送人
|
bean.getCopyUserId(), // 抄送人
|
||||||
null,// 抄送人
|
bean.getCopyUserName(),// 抄送人
|
||||||
null);
|
null);
|
||||||
}
|
}
|
||||||
return Result.success();
|
return Result.success();
|
||||||
@ -393,10 +393,9 @@ public class SafetyCheckSpecialController {
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Result response(HttpServletRequest request, SafetyCheckSpecial bean, String processInstanceId, int pass) throws IOException, ServiceException {
|
public Result response(HttpServletRequest request, SafetyCheckSpecial bean, String processInstanceId, int pass) throws IOException, ServiceException {
|
||||||
|
|
||||||
safetyCheckActivityService.audit(bean.getConfirmUserId(), processInstanceId, pass);
|
|
||||||
|
|
||||||
//通过
|
//通过
|
||||||
if (pass == 1) {
|
if (pass == 1) {
|
||||||
|
safetyCheckActivityService.audit(bean.getConfirmUserId(), processInstanceId, pass);
|
||||||
bean.setStatus(SafetyCheckStatusEnum.COMPLETE.getId());
|
bean.setStatus(SafetyCheckStatusEnum.COMPLETE.getId());
|
||||||
service.update(bean);
|
service.update(bean);
|
||||||
|
|
||||||
@ -419,6 +418,7 @@ public class SafetyCheckSpecialController {
|
|||||||
}
|
}
|
||||||
//不通过
|
//不通过
|
||||||
else {
|
else {
|
||||||
|
safetyCheckActivityService.audit(bean.getDutyUserId(), processInstanceId, pass);
|
||||||
bean.setStatus(SafetyCheckStatusEnum.APPLY.getId());
|
bean.setStatus(SafetyCheckStatusEnum.APPLY.getId());
|
||||||
service.update(bean);
|
service.update(bean);
|
||||||
safetyFlowTaskService.saveWorkFlowRecord(true,
|
safetyFlowTaskService.saveWorkFlowRecord(true,
|
||||||
|
|||||||
@ -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("删除失败!");
|
||||||
|
|||||||
@ -343,8 +343,6 @@ public class SafetyExternalCertificateController {
|
|||||||
int result = 0;
|
int result = 0;
|
||||||
for (String id : ids) {
|
for (String id : ids) {
|
||||||
result += service.deleteById(id);
|
result += service.deleteById(id);
|
||||||
}
|
|
||||||
for (String id : ids) {
|
|
||||||
safetyFilesService.deleteByBizId(id);
|
safetyFilesService.deleteByBizId(id);
|
||||||
}
|
}
|
||||||
model.addAttribute("result", result);
|
model.addAttribute("result", result);
|
||||||
|
|||||||
@ -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";
|
||||||
|
|||||||
@ -227,7 +227,7 @@ public class PatrolModelController {
|
|||||||
User cu=(User)request.getSession().getAttribute("cu");
|
User cu=(User)request.getSession().getAttribute("cu");
|
||||||
String companyId = request.getParameter("bizId");
|
String companyId = request.getParameter("bizId");
|
||||||
String type = request.getParameter("type");
|
String type = request.getParameter("type");
|
||||||
List<PatrolModel> list = this.patrolModelService.selectListByWhere("where unit_id = '"+companyId+"' and type='"+type+"' order by insdt");
|
List<PatrolModel> list = this.patrolModelService.selectListByWhere("where unit_id = '"+companyId+"' order by insdt");
|
||||||
ArrayList<Select2> list4select2 = new ArrayList<Select2>();
|
ArrayList<Select2> list4select2 = new ArrayList<Select2>();
|
||||||
for (int i=0;i<list.size();i++){
|
for (int i=0;i<list.size();i++){
|
||||||
Select2 select2 = new Select2();
|
Select2 select2 = new Select2();
|
||||||
|
|||||||
@ -242,10 +242,11 @@ public class ProcessSectionController {
|
|||||||
@RequestMapping("/getProcessSection4Select.do")
|
@RequestMapping("/getProcessSection4Select.do")
|
||||||
public String getProcessSection4Select(HttpServletRequest request, Model model) {
|
public String getProcessSection4Select(HttpServletRequest request, Model model) {
|
||||||
String companyId = request.getParameter("companyId"); // 默认查询JSBZ???
|
String companyId = request.getParameter("companyId"); // 默认查询JSBZ???
|
||||||
Company company = this.companyService.selectByPrimaryKey(companyId);
|
// 使用unitService获取Unit信息,因为companyId来自tb_unit表
|
||||||
|
Unit unit = this.unitService.getUnitById(companyId);
|
||||||
|
|
||||||
String wherestr = "where 1=1 and active='" + CommString.Active_True + "' ";
|
String wherestr = "where 1=1 and active='" + CommString.Active_True + "' ";
|
||||||
if (company != null && company.getType().equals(CommString.UNIT_TYPE_COMPANY)) { // "C";//公司
|
if (unit != null && unit.getType().equals(CommString.UNIT_TYPE_COMPANY)) { // "C";//公司
|
||||||
String bizs = "";//公司下属所有厂id
|
String bizs = "";//公司下属所有厂id
|
||||||
List<Unit> blist = this.unitService.getParentCompanyChildrenBizByUnitid(companyId);
|
List<Unit> blist = this.unitService.getParentCompanyChildrenBizByUnitid(companyId);
|
||||||
if (blist != null && blist.size() > 0) {
|
if (blist != null && blist.size() > 0) {
|
||||||
@ -257,7 +258,7 @@ public class ProcessSectionController {
|
|||||||
}
|
}
|
||||||
bizs = bizs.replace(",", "','");
|
bizs = bizs.replace(",", "','");
|
||||||
wherestr += " and (unit_id='" + ProcessSection.UnitId_Sys + "' or (code not in (select code from tb_process_section where unit_id='" + ProcessSection.UnitId_Sys + "')) and unit_id in ('" + bizs + "') ) ";
|
wherestr += " and (unit_id='" + ProcessSection.UnitId_Sys + "' or (code not in (select code from tb_process_section where unit_id='" + ProcessSection.UnitId_Sys + "')) and unit_id in ('" + bizs + "') ) ";
|
||||||
} else if (company != null && company.getType().equals(CommString.UNIT_TYPE_BIZ)) { // B 水厂
|
} else if (unit != null && unit.getType().equals(CommString.UNIT_TYPE_BIZ)) { // B 水厂
|
||||||
wherestr += " and unit_id='" + companyId + "' ";
|
wherestr += " and unit_id='" + companyId + "' ";
|
||||||
}
|
}
|
||||||
if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) {
|
if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) {
|
||||||
@ -272,13 +273,13 @@ public class ProcessSectionController {
|
|||||||
for (int i = 0; i < processSections.size(); i++) {
|
for (int i = 0; i < processSections.size(); i++) {
|
||||||
JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
jsonObject.put("id", processSections.get(i).getCode());
|
jsonObject.put("id", processSections.get(i).getCode());
|
||||||
if (company != null && company.getType().equals(CommString.UNIT_TYPE_COMPANY)) { // "C";//公司
|
if (unit != null && unit.getType().equals(CommString.UNIT_TYPE_COMPANY)) { // "C";//公司
|
||||||
if (!processSections.get(i).getUnitId().equals(ProcessSection.UnitId_Sys)) {
|
if (!processSections.get(i).getUnitId().equals(ProcessSection.UnitId_Sys)) {
|
||||||
jsonObject.put("text", processSections.get(i).getSname() + "(" + processSections.get(i).getCompanySname() + ")");
|
jsonObject.put("text", processSections.get(i).getSname() + "(" + processSections.get(i).getCompanySname() + ")");
|
||||||
} else {
|
} else {
|
||||||
jsonObject.put("text", processSections.get(i).getSname());
|
jsonObject.put("text", processSections.get(i).getSname());
|
||||||
}
|
}
|
||||||
} else if (company != null && company.getType().equals(CommString.UNIT_TYPE_BIZ)) { // "B";//水厂
|
} else if (unit != null && unit.getType().equals(CommString.UNIT_TYPE_BIZ)) { // "B";//水厂
|
||||||
jsonObject.put("text", processSections.get(i).getSname());
|
jsonObject.put("text", processSections.get(i).getSname());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -213,6 +213,9 @@ public class RoleController {
|
|||||||
JSONArray json = JSONArray.fromObject(list);
|
JSONArray json = JSONArray.fromObject(list);
|
||||||
model.addAttribute("json", json);
|
model.addAttribute("json", json);
|
||||||
model.addAttribute("roleid", roleid);
|
model.addAttribute("roleid", roleid);
|
||||||
|
if(request.getParameter("bizid") != null && !request.getParameter("bizid").isEmpty()){
|
||||||
|
model.addAttribute("companyId", request.getParameter("bizid"));
|
||||||
|
}
|
||||||
return "user/roleUser";
|
return "user/roleUser";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -17,6 +17,7 @@ import io.swagger.annotations.*;
|
|||||||
import net.sf.json.JSONArray;
|
import net.sf.json.JSONArray;
|
||||||
import net.sf.json.JSONObject;
|
import net.sf.json.JSONObject;
|
||||||
import org.activiti.engine.RepositoryService;
|
import org.activiti.engine.RepositoryService;
|
||||||
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
import org.apache.commons.fileupload.servlet.ServletFileUpload;
|
import org.apache.commons.fileupload.servlet.ServletFileUpload;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -144,11 +145,14 @@ public class UserController {
|
|||||||
wherestr += "and pid in (" + pidstr + ") ";
|
wherestr += "and pid in (" + pidstr + ") ";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
String companyId = request.getParameter("companyId");
|
||||||
|
if (StringUtils.isBlank(companyId) && cu != null && StringUtils.isNotBlank(cu.getId())) {
|
||||||
Company company = unitService.getCompanyByUserId(cu.getId());
|
Company company = unitService.getCompanyByUserId(cu.getId());
|
||||||
String companyId = "-1";
|
|
||||||
if (company != null) {
|
if (company != null) {
|
||||||
companyId = company.getId();
|
companyId = company.getId();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(companyId)) {
|
||||||
List<User> users = unitService.getChildrenUsersById(companyId);
|
List<User> users = unitService.getChildrenUsersById(companyId);
|
||||||
String userIds = "";
|
String userIds = "";
|
||||||
for (User user : users) {
|
for (User user : users) {
|
||||||
@ -160,6 +164,9 @@ public class UserController {
|
|||||||
if (!userIds.isEmpty()) {
|
if (!userIds.isEmpty()) {
|
||||||
wherestr += "and id in ('" + userIds + "') ";
|
wherestr += "and id in ('" + userIds + "') ";
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
wherestr += "and 1=0 ";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -852,11 +859,13 @@ public class UserController {
|
|||||||
public String userForSelectByCompany(HttpServletRequest request, Model model) {
|
public String userForSelectByCompany(HttpServletRequest request, Model model) {
|
||||||
String userIds = request.getParameter("userIds");
|
String userIds = request.getParameter("userIds");
|
||||||
String jobIds = request.getParameter("jobIds");
|
String jobIds = request.getParameter("jobIds");
|
||||||
|
String displayDept = request.getParameter("displayDept");
|
||||||
if (userIds != null && !userIds.isEmpty()) {
|
if (userIds != null && !userIds.isEmpty()) {
|
||||||
List<User> list = this.userService.selectListByWhere("where id in ('" + userIds.replace(",", "','") + "') order by CHARINDEX(','+ id +',','," + userIds + ",')");
|
List<User> list = this.userService.selectListByWhere("where id in ('" + userIds.replace(",", "','") + "') order by CHARINDEX(','+ id +',',','" + userIds + ",')");
|
||||||
model.addAttribute("users", JSONArray.fromObject(list));
|
model.addAttribute("users", JSONArray.fromObject(list));
|
||||||
}
|
}
|
||||||
model.addAttribute("jobIds", jobIds);
|
model.addAttribute("jobIds", jobIds);
|
||||||
|
model.addAttribute("displayDept", displayDept);
|
||||||
return "user/userForSelectByCompany";
|
return "user/userForSelectByCompany";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -864,6 +873,9 @@ public class UserController {
|
|||||||
public String getUsersByIds(HttpServletRequest request, Model model) {
|
public String getUsersByIds(HttpServletRequest request, Model model) {
|
||||||
String userIds = request.getParameter("userIds");
|
String userIds = request.getParameter("userIds");
|
||||||
List<User> list = this.userService.selectListByWhere("where id in ('" + userIds.replace(",", "','") + "') order by CHARINDEX(','+ id +',','," + userIds + ",')");
|
List<User> list = this.userService.selectListByWhere("where id in ('" + userIds.replace(",", "','") + "') order by CHARINDEX(','+ id +',','," + userIds + ",')");
|
||||||
|
if (CollectionUtils.isNotEmpty(list)){
|
||||||
|
list = list.stream().filter(u -> StringUtils.isNotBlank(u.getId())).collect(toList());
|
||||||
|
}
|
||||||
JSONArray json = JSONArray.fromObject(list);
|
JSONArray json = JSONArray.fromObject(list);
|
||||||
model.addAttribute("result", json);
|
model.addAttribute("result", json);
|
||||||
return "result";
|
return "result";
|
||||||
@ -1255,6 +1267,7 @@ public class UserController {
|
|||||||
model.addAttribute("users", JSONArray.fromObject(list));
|
model.addAttribute("users", JSONArray.fromObject(list));
|
||||||
}
|
}
|
||||||
model.addAttribute("jobIds", jobIds);
|
model.addAttribute("jobIds", jobIds);
|
||||||
|
model.addAttribute("displayDept", request.getParameter("displayDept"));
|
||||||
return "user/userForSelectByWorkOrder";
|
return "user/userForSelectByWorkOrder";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1454,6 +1467,7 @@ public class UserController {
|
|||||||
model.addAttribute("users", JSONArray.fromObject(list));
|
model.addAttribute("users", JSONArray.fromObject(list));
|
||||||
}
|
}
|
||||||
model.addAttribute("jobIds", jobIds);
|
model.addAttribute("jobIds", jobIds);
|
||||||
|
model.addAttribute("displayDept", request.getParameter("displayDept"));
|
||||||
return "user/userSelectLayer";
|
return "user/userSelectLayer";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -514,6 +514,21 @@ public class MPointController {
|
|||||||
mp.setProcessSection(processSections.get(0));
|
mp.setProcessSection(processSections.get(0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 取redis点位数据最新值,没有就是0
|
||||||
|
for (MPoint mPoint : list) {
|
||||||
|
String id = mPoint.getId();
|
||||||
|
int num = mPoint.getId().hashCode() % 25;
|
||||||
|
RMapCache<String, String> map_redis_data = redissonClient.getMapCache(CommString.RedisMpointFlag + num);
|
||||||
|
if (map_redis_data.get(id) != null && !"".equals(map_redis_data.get(id))) {
|
||||||
|
String[] str = map_redis_data.get(id).split(";");
|
||||||
|
if (str.length >= 3 && str[1] != null && !str[1].isEmpty() && !"null".equals(str[1])) {
|
||||||
|
mPoint.setParmvalue(new BigDecimal(str[1]));
|
||||||
|
mPoint.setMeasuredt(str[2]);
|
||||||
|
} else {
|
||||||
|
mPoint.setParmvalue(BigDecimal.ZERO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
PageInfo<MPoint> pi = new PageInfo<MPoint>(list);
|
PageInfo<MPoint> pi = new PageInfo<MPoint>(list);
|
||||||
JSONArray json = JSONArray.fromObject(list);
|
JSONArray json = JSONArray.fromObject(list);
|
||||||
result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}";
|
result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}";
|
||||||
@ -1607,7 +1622,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());
|
||||||
@ -4137,8 +4152,15 @@ public class MPointController {
|
|||||||
for (int i = 0; i < ids.length; i++) {
|
for (int i = 0; i < ids.length; i++) {
|
||||||
com.alibaba.fastjson.JSONObject jsonObject2 = new com.alibaba.fastjson.JSONObject();
|
com.alibaba.fastjson.JSONObject jsonObject2 = new com.alibaba.fastjson.JSONObject();
|
||||||
|
|
||||||
//通过es查询bizid
|
//通过数据库查询测点(优先通过unitId和测点编码查询)
|
||||||
MPoint mPoint_es = mPointService.selectById(ids[i]);
|
MPoint mPoint_es = mPointService.selectById(unitId, ids[i]);
|
||||||
|
if (mPoint_es == null) {
|
||||||
|
// 尝试通过测点编码查询
|
||||||
|
List<MPoint> mPointList = mPointService.selectListByWhere(unitId, "where mpointcode='" + ids[i] + "'");
|
||||||
|
if (mPointList != null && mPointList.size() > 0) {
|
||||||
|
mPoint_es = mPointList.get(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
if (mPoint_es != null) {
|
if (mPoint_es != null) {
|
||||||
unitId = mPoint_es.getBizid();
|
unitId = mPoint_es.getBizid();
|
||||||
|
|
||||||
|
|||||||
@ -133,6 +133,9 @@ public class SchedulingController {
|
|||||||
public String doadd(HttpServletRequest request, Model model,
|
public String doadd(HttpServletRequest request, Model model,
|
||||||
@RequestParam(value = "date") String date) {
|
@RequestParam(value = "date") String date) {
|
||||||
model.addAttribute("date", date.substring(0, 10));
|
model.addAttribute("date", date.substring(0, 10));
|
||||||
|
if(request.getParameter("bizid") != null && !request.getParameter("bizid").isEmpty()){
|
||||||
|
model.addAttribute("bizid", request.getParameter("bizid"));
|
||||||
|
}
|
||||||
return "work/schedulingAdd";
|
return "work/schedulingAdd";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -142,6 +145,9 @@ public class SchedulingController {
|
|||||||
String wherestr = " where s.id = '" + schedulingId + "'";
|
String wherestr = " where s.id = '" + schedulingId + "'";
|
||||||
List<Scheduling> scheduling = this.schedulingService.selectCalenderListByWhere(wherestr);
|
List<Scheduling> scheduling = this.schedulingService.selectCalenderListByWhere(wherestr);
|
||||||
model.addAttribute("scheduling", scheduling.get(0));
|
model.addAttribute("scheduling", scheduling.get(0));
|
||||||
|
if(request.getParameter("bizid") != null && !request.getParameter("bizid").isEmpty()){
|
||||||
|
model.addAttribute("bizid", request.getParameter("bizid"));
|
||||||
|
}
|
||||||
return "work/schedulingEdit";
|
return "work/schedulingEdit";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,13 @@
|
|||||||
|
package com.sipai.dao.administration;
|
||||||
|
|
||||||
|
import com.sipai.dao.base.CommDaoImpl;
|
||||||
|
import com.sipai.entity.administration.LeaveApply;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public class LeaveApplyDao extends CommDaoImpl<LeaveApply> {
|
||||||
|
public LeaveApplyDao() {
|
||||||
|
super();
|
||||||
|
this.setMappernamespace("administration.LeaveApplyMapper");
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -50,6 +50,8 @@ public enum ProcessType {
|
|||||||
Administration_Reserve("Administration_Reserve","预案工作"),
|
Administration_Reserve("Administration_Reserve","预案工作"),
|
||||||
/*预案*/
|
/*预案*/
|
||||||
Administration_Temporary("Administration_Temporary","临时任务"),
|
Administration_Temporary("Administration_Temporary","临时任务"),
|
||||||
|
/*请假补假*/
|
||||||
|
Administration_Leave("Administration_Leave","请假补假"),
|
||||||
/*工艺调整*/
|
/*工艺调整*/
|
||||||
Process_Adjustment("Process_Adjustment","工艺调整"),
|
Process_Adjustment("Process_Adjustment","工艺调整"),
|
||||||
/*水质化验*/
|
/*水质化验*/
|
||||||
|
|||||||
267
src/main/java/com/sipai/entity/administration/LeaveApply.java
Normal file
267
src/main/java/com/sipai/entity/administration/LeaveApply.java
Normal file
@ -0,0 +1,267 @@
|
|||||||
|
package com.sipai.entity.administration;
|
||||||
|
|
||||||
|
import com.sipai.entity.base.BusinessUnitAdapter;
|
||||||
|
|
||||||
|
public class LeaveApply extends BusinessUnitAdapter {
|
||||||
|
private String id;
|
||||||
|
private String insdt;
|
||||||
|
private String insuser;
|
||||||
|
private String upduser;
|
||||||
|
private String upddt;
|
||||||
|
private String unitId;
|
||||||
|
private String applyType;
|
||||||
|
private String leaveType;
|
||||||
|
private String startTime;
|
||||||
|
private String endTime;
|
||||||
|
private String hours;
|
||||||
|
private String days;
|
||||||
|
private String reason;
|
||||||
|
private String handoverDesc;
|
||||||
|
private String attachmentIds;
|
||||||
|
private String overtimeRefId;
|
||||||
|
private String overtimeHours;
|
||||||
|
private String actualStartTime;
|
||||||
|
private String actualEndTime;
|
||||||
|
private String state;
|
||||||
|
private String stateName;
|
||||||
|
private String auditManId;
|
||||||
|
private String auditMan;
|
||||||
|
private String submissionTime;
|
||||||
|
private String processid;
|
||||||
|
private String processdefid;
|
||||||
|
private String remark;
|
||||||
|
private String delFlag;
|
||||||
|
private String insuserName;
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInsdt() {
|
||||||
|
return insdt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInsdt(String insdt) {
|
||||||
|
this.insdt = insdt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInsuser() {
|
||||||
|
return insuser;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInsuser(String insuser) {
|
||||||
|
this.insuser = insuser;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUpduser() {
|
||||||
|
return upduser;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUpduser(String upduser) {
|
||||||
|
this.upduser = upduser;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUpddt() {
|
||||||
|
return upddt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUpddt(String upddt) {
|
||||||
|
this.upddt = upddt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUnitId() {
|
||||||
|
return unitId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUnitId(String unitId) {
|
||||||
|
this.unitId = unitId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getApplyType() {
|
||||||
|
return applyType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setApplyType(String applyType) {
|
||||||
|
this.applyType = applyType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLeaveType() {
|
||||||
|
return leaveType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLeaveType(String leaveType) {
|
||||||
|
this.leaveType = leaveType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStartTime() {
|
||||||
|
return startTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStartTime(String startTime) {
|
||||||
|
this.startTime = startTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEndTime() {
|
||||||
|
return endTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEndTime(String endTime) {
|
||||||
|
this.endTime = endTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getHours() {
|
||||||
|
return hours;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHours(String hours) {
|
||||||
|
this.hours = hours;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDays() {
|
||||||
|
return days;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDays(String days) {
|
||||||
|
this.days = days;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getReason() {
|
||||||
|
return reason;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReason(String reason) {
|
||||||
|
this.reason = reason;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getHandoverDesc() {
|
||||||
|
return handoverDesc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHandoverDesc(String handoverDesc) {
|
||||||
|
this.handoverDesc = handoverDesc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAttachmentIds() {
|
||||||
|
return attachmentIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAttachmentIds(String attachmentIds) {
|
||||||
|
this.attachmentIds = attachmentIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOvertimeRefId() {
|
||||||
|
return overtimeRefId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOvertimeRefId(String overtimeRefId) {
|
||||||
|
this.overtimeRefId = overtimeRefId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOvertimeHours() {
|
||||||
|
return overtimeHours;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOvertimeHours(String overtimeHours) {
|
||||||
|
this.overtimeHours = overtimeHours;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getActualStartTime() {
|
||||||
|
return actualStartTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setActualStartTime(String actualStartTime) {
|
||||||
|
this.actualStartTime = actualStartTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getActualEndTime() {
|
||||||
|
return actualEndTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setActualEndTime(String actualEndTime) {
|
||||||
|
this.actualEndTime = actualEndTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getState() {
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setState(String state) {
|
||||||
|
this.state = state;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStateName() {
|
||||||
|
return stateName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStateName(String stateName) {
|
||||||
|
this.stateName = stateName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAuditManId() {
|
||||||
|
return auditManId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAuditManId(String auditManId) {
|
||||||
|
this.auditManId = auditManId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAuditMan() {
|
||||||
|
return auditMan;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAuditMan(String auditMan) {
|
||||||
|
this.auditMan = auditMan;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSubmissionTime() {
|
||||||
|
return submissionTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSubmissionTime(String submissionTime) {
|
||||||
|
this.submissionTime = submissionTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProcessid() {
|
||||||
|
return processid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProcessid(String processid) {
|
||||||
|
this.processid = processid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProcessdefid() {
|
||||||
|
return processdefid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProcessdefid(String processdefid) {
|
||||||
|
this.processdefid = processdefid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRemark() {
|
||||||
|
return remark;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRemark(String remark) {
|
||||||
|
this.remark = remark;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDelFlag() {
|
||||||
|
return delFlag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDelFlag(String delFlag) {
|
||||||
|
this.delFlag = delFlag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInsuserName() {
|
||||||
|
return insuserName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInsuserName(String insuserName) {
|
||||||
|
this.insuserName = insuserName;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,30 @@
|
|||||||
|
package com.sipai.entity.administration;
|
||||||
|
|
||||||
|
public class LeaveCommStr {
|
||||||
|
|
||||||
|
public static final String APPLY_TYPE_LEAVE = "leave";
|
||||||
|
public static final String APPLY_TYPE_COMPENSATORY = "compensatory";
|
||||||
|
|
||||||
|
public static final String STATE_DRAFT = "草稿";
|
||||||
|
public static final String STATE_SECTION_AUDIT = "科长/副科长审批";
|
||||||
|
public static final String STATE_MANAGER_AUDIT = "分管经理审批";
|
||||||
|
public static final String STATE_GENERAL_MANAGER_AUDIT = "总经理审批";
|
||||||
|
public static final String STATE_HANDLE = "退回修改";
|
||||||
|
public static final String STATE_FINISH = "已通过";
|
||||||
|
public static final String STATE_REJECT = "已驳回";
|
||||||
|
|
||||||
|
public static final String[][] APPLY_TYPES = {
|
||||||
|
{APPLY_TYPE_LEAVE, "请假"},
|
||||||
|
{APPLY_TYPE_COMPENSATORY, "补假"}
|
||||||
|
};
|
||||||
|
|
||||||
|
public static final String[][] LEAVE_TYPES = {
|
||||||
|
{"annual", "年假"},
|
||||||
|
{"personal", "事假"},
|
||||||
|
{"sick", "病假"},
|
||||||
|
{"marriage", "婚假"},
|
||||||
|
{"maternity", "产假"},
|
||||||
|
{"funeral", "丧假"},
|
||||||
|
{"adjustment", "调休"}
|
||||||
|
};
|
||||||
|
}
|
||||||
@ -115,6 +115,11 @@ public class BusinessUnit extends SQLAdapter {
|
|||||||
//预案工作审核流程节点
|
//预案工作审核流程节点
|
||||||
public final static String UNIT_Temporary_AUDIT = "temporary_audit";//指标审核
|
public final static String UNIT_Temporary_AUDIT = "temporary_audit";//指标审核
|
||||||
public final static String UNIT_Temporary_HANDLE = "temporary_handle";//指标业务处理
|
public final static String UNIT_Temporary_HANDLE = "temporary_handle";//指标业务处理
|
||||||
|
//请假补假流程节点
|
||||||
|
public final static String UNIT_LEAVE_APPLY_SECTION_AUDIT = "leave_apply_section_audit";
|
||||||
|
public final static String UNIT_LEAVE_APPLY_MANAGER_AUDIT = "leave_apply_manager_audit";
|
||||||
|
public final static String UNIT_LEAVE_APPLY_GENERAL_MANAGER_AUDIT = "leave_apply_general_manager_audit";
|
||||||
|
public final static String UNIT_LEAVE_APPLY_HANDLE = "leave_apply_handle";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 运行模块
|
* 运行模块
|
||||||
|
|||||||
@ -22,6 +22,10 @@ public class SafetyStaffArchivesVo extends SafetyStaffArchives {
|
|||||||
* 性别翻译
|
* 性别翻译
|
||||||
*/
|
*/
|
||||||
private String sexText;
|
private String sexText;
|
||||||
|
/**
|
||||||
|
* 所属部门ID
|
||||||
|
*/
|
||||||
|
private String pid;
|
||||||
/**
|
/**
|
||||||
* 所属部门
|
* 所属部门
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -0,0 +1,160 @@
|
|||||||
|
<?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" >
|
||||||
|
<mapper namespace="administration.LeaveApplyMapper" >
|
||||||
|
<resultMap id="BaseResultMap" type="com.sipai.entity.administration.LeaveApply" >
|
||||||
|
<id column="id" property="id" jdbcType="VARCHAR" />
|
||||||
|
<result column="insdt" property="insdt" jdbcType="TIMESTAMP" />
|
||||||
|
<result column="insuser" property="insuser" jdbcType="VARCHAR" />
|
||||||
|
<result column="upduser" property="upduser" jdbcType="VARCHAR" />
|
||||||
|
<result column="upddt" property="upddt" jdbcType="TIMESTAMP" />
|
||||||
|
<result column="unit_id" property="unitId" jdbcType="VARCHAR" />
|
||||||
|
<result column="apply_type" property="applyType" jdbcType="VARCHAR" />
|
||||||
|
<result column="leave_type" property="leaveType" jdbcType="VARCHAR" />
|
||||||
|
<result column="start_time" property="startTime" jdbcType="TIMESTAMP" />
|
||||||
|
<result column="end_time" property="endTime" jdbcType="TIMESTAMP" />
|
||||||
|
<result column="hours" property="hours" jdbcType="DECIMAL" />
|
||||||
|
<result column="days" property="days" jdbcType="DECIMAL" />
|
||||||
|
<result column="reason" property="reason" jdbcType="VARCHAR" />
|
||||||
|
<result column="handover_desc" property="handoverDesc" jdbcType="VARCHAR" />
|
||||||
|
<result column="attachment_ids" property="attachmentIds" jdbcType="VARCHAR" />
|
||||||
|
<result column="overtime_ref_id" property="overtimeRefId" jdbcType="VARCHAR" />
|
||||||
|
<result column="overtime_hours" property="overtimeHours" jdbcType="DECIMAL" />
|
||||||
|
<result column="actual_start_time" property="actualStartTime" jdbcType="TIMESTAMP" />
|
||||||
|
<result column="actual_end_time" property="actualEndTime" jdbcType="TIMESTAMP" />
|
||||||
|
<result column="state" property="state" jdbcType="VARCHAR" />
|
||||||
|
<result column="audit_man_id" property="auditManId" jdbcType="VARCHAR" />
|
||||||
|
<result column="submission_time" property="submissionTime" jdbcType="TIMESTAMP" />
|
||||||
|
<result column="processid" property="processid" jdbcType="VARCHAR" />
|
||||||
|
<result column="processdefid" property="processdefid" jdbcType="VARCHAR" />
|
||||||
|
<result column="remark" property="remark" jdbcType="VARCHAR" />
|
||||||
|
<result column="del_flag" property="delFlag" jdbcType="CHAR" />
|
||||||
|
</resultMap>
|
||||||
|
<sql id="Base_Column_List" >
|
||||||
|
id, insdt, insuser, upduser, upddt, unit_id, apply_type, leave_type, start_time, end_time,
|
||||||
|
hours, days, reason, handover_desc, attachment_ids, overtime_ref_id, overtime_hours,
|
||||||
|
actual_start_time, actual_end_time, state, audit_man_id, submission_time, processid,
|
||||||
|
processdefid, remark, del_flag
|
||||||
|
</sql>
|
||||||
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List" />
|
||||||
|
from tb_administration_leave_apply
|
||||||
|
where id = #{id,jdbcType=VARCHAR}
|
||||||
|
</select>
|
||||||
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
|
||||||
|
delete from tb_administration_leave_apply
|
||||||
|
where id = #{id,jdbcType=VARCHAR}
|
||||||
|
</delete>
|
||||||
|
<insert id="insert" parameterType="com.sipai.entity.administration.LeaveApply" >
|
||||||
|
insert into tb_administration_leave_apply (
|
||||||
|
id, insdt, insuser, upduser, upddt, unit_id, apply_type, leave_type, start_time, end_time,
|
||||||
|
hours, days, reason, handover_desc, attachment_ids, overtime_ref_id, overtime_hours,
|
||||||
|
actual_start_time, actual_end_time, state, submission_time, processid,
|
||||||
|
processdefid, remark, del_flag)
|
||||||
|
values (
|
||||||
|
#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, #{upduser,jdbcType=VARCHAR}, #{upddt,jdbcType=TIMESTAMP},
|
||||||
|
#{unitId,jdbcType=VARCHAR}, #{applyType,jdbcType=VARCHAR}, #{leaveType,jdbcType=VARCHAR}, #{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP},
|
||||||
|
NULLIF(#{hours,jdbcType=VARCHAR}, ''), NULLIF(#{days,jdbcType=VARCHAR}, ''), #{reason,jdbcType=VARCHAR}, #{handoverDesc,jdbcType=VARCHAR}, #{attachmentIds,jdbcType=VARCHAR},
|
||||||
|
#{overtimeRefId,jdbcType=VARCHAR}, NULLIF(#{overtimeHours,jdbcType=VARCHAR}, ''), #{actualStartTime,jdbcType=TIMESTAMP}, #{actualEndTime,jdbcType=TIMESTAMP},
|
||||||
|
#{state,jdbcType=VARCHAR}, #{submissionTime,jdbcType=TIMESTAMP}, #{processid,jdbcType=VARCHAR},
|
||||||
|
#{processdefid,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{delFlag,jdbcType=CHAR})
|
||||||
|
</insert>
|
||||||
|
<insert id="insertSelective" parameterType="com.sipai.entity.administration.LeaveApply" >
|
||||||
|
insert into tb_administration_leave_apply
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides="," >
|
||||||
|
<if test="id != null" >id,</if>
|
||||||
|
<if test="insdt != null" >insdt,</if>
|
||||||
|
<if test="insuser != null" >insuser,</if>
|
||||||
|
<if test="upduser != null" >upduser,</if>
|
||||||
|
<if test="upddt != null" >upddt,</if>
|
||||||
|
<if test="unitId != null" >unit_id,</if>
|
||||||
|
<if test="applyType != null" >apply_type,</if>
|
||||||
|
<if test="leaveType != null" >leave_type,</if>
|
||||||
|
<if test="startTime != null" >start_time,</if>
|
||||||
|
<if test="endTime != null" >end_time,</if>
|
||||||
|
<if test="hours != null" >hours,</if>
|
||||||
|
<if test="days != null" >days,</if>
|
||||||
|
<if test="reason != null" >reason,</if>
|
||||||
|
<if test="handoverDesc != null" >handover_desc,</if>
|
||||||
|
<if test="attachmentIds != null" >attachment_ids,</if>
|
||||||
|
<if test="overtimeRefId != null" >overtime_ref_id,</if>
|
||||||
|
<if test="overtimeHours != null" >overtime_hours,</if>
|
||||||
|
<if test="actualStartTime != null" >actual_start_time,</if>
|
||||||
|
<if test="actualEndTime != null" >actual_end_time,</if>
|
||||||
|
<if test="state != null" >state,</if>
|
||||||
|
<if test="submissionTime != null" >submission_time,</if>
|
||||||
|
<if test="processid != null" >processid,</if>
|
||||||
|
<if test="processdefid != null" >processdefid,</if>
|
||||||
|
<if test="remark != null" >remark,</if>
|
||||||
|
<if test="delFlag != null" >del_flag,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
||||||
|
<if test="id != null" >#{id,jdbcType=VARCHAR},</if>
|
||||||
|
<if test="insdt != null" >#{insdt,jdbcType=TIMESTAMP},</if>
|
||||||
|
<if test="insuser != null" >#{insuser,jdbcType=VARCHAR},</if>
|
||||||
|
<if test="upduser != null" >#{upduser,jdbcType=VARCHAR},</if>
|
||||||
|
<if test="upddt != null" >#{upddt,jdbcType=TIMESTAMP},</if>
|
||||||
|
<if test="unitId != null" >#{unitId,jdbcType=VARCHAR},</if>
|
||||||
|
<if test="applyType != null" >#{applyType,jdbcType=VARCHAR},</if>
|
||||||
|
<if test="leaveType != null" >#{leaveType,jdbcType=VARCHAR},</if>
|
||||||
|
<if test="startTime != null" >#{startTime,jdbcType=TIMESTAMP},</if>
|
||||||
|
<if test="endTime != null" >#{endTime,jdbcType=TIMESTAMP},</if>
|
||||||
|
<if test="hours != null" >NULLIF(#{hours,jdbcType=VARCHAR}, ''),</if>
|
||||||
|
<if test="days != null" >NULLIF(#{days,jdbcType=VARCHAR}, ''),</if>
|
||||||
|
<if test="reason != null" >#{reason,jdbcType=VARCHAR},</if>
|
||||||
|
<if test="handoverDesc != null" >#{handoverDesc,jdbcType=VARCHAR},</if>
|
||||||
|
<if test="attachmentIds != null" >#{attachmentIds,jdbcType=VARCHAR},</if>
|
||||||
|
<if test="overtimeRefId != null" >#{overtimeRefId,jdbcType=VARCHAR},</if>
|
||||||
|
<if test="overtimeHours != null" >NULLIF(#{overtimeHours,jdbcType=VARCHAR}, ''),</if>
|
||||||
|
<if test="actualStartTime != null" >#{actualStartTime,jdbcType=TIMESTAMP},</if>
|
||||||
|
<if test="actualEndTime != null" >#{actualEndTime,jdbcType=TIMESTAMP},</if>
|
||||||
|
<if test="state != null" >#{state,jdbcType=VARCHAR},</if>
|
||||||
|
<if test="submissionTime != null" >#{submissionTime,jdbcType=TIMESTAMP},</if>
|
||||||
|
<if test="processid != null" >#{processid,jdbcType=VARCHAR},</if>
|
||||||
|
<if test="processdefid != null" >#{processdefid,jdbcType=VARCHAR},</if>
|
||||||
|
<if test="remark != null" >#{remark,jdbcType=VARCHAR},</if>
|
||||||
|
<if test="delFlag != null" >#{delFlag,jdbcType=CHAR},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
<update id="updateByPrimaryKeySelective" parameterType="com.sipai.entity.administration.LeaveApply" >
|
||||||
|
update tb_administration_leave_apply
|
||||||
|
<set >
|
||||||
|
<if test="insdt != null" >insdt = #{insdt,jdbcType=TIMESTAMP},</if>
|
||||||
|
<if test="insuser != null" >insuser = #{insuser,jdbcType=VARCHAR},</if>
|
||||||
|
<if test="upduser != null" >upduser = #{upduser,jdbcType=VARCHAR},</if>
|
||||||
|
<if test="upddt != null" >upddt = #{upddt,jdbcType=TIMESTAMP},</if>
|
||||||
|
<if test="unitId != null" >unit_id = #{unitId,jdbcType=VARCHAR},</if>
|
||||||
|
<if test="applyType != null" >apply_type = #{applyType,jdbcType=VARCHAR},</if>
|
||||||
|
<if test="leaveType != null" >leave_type = #{leaveType,jdbcType=VARCHAR},</if>
|
||||||
|
<if test="startTime != null" >start_time = #{startTime,jdbcType=TIMESTAMP},</if>
|
||||||
|
<if test="endTime != null" >end_time = #{endTime,jdbcType=TIMESTAMP},</if>
|
||||||
|
<if test="hours != null" >hours = NULLIF(#{hours,jdbcType=VARCHAR}, ''),</if>
|
||||||
|
<if test="days != null" >days = NULLIF(#{days,jdbcType=VARCHAR}, ''),</if>
|
||||||
|
<if test="reason != null" >reason = #{reason,jdbcType=VARCHAR},</if>
|
||||||
|
<if test="handoverDesc != null" >handover_desc = #{handoverDesc,jdbcType=VARCHAR},</if>
|
||||||
|
<if test="attachmentIds != null" >attachment_ids = #{attachmentIds,jdbcType=VARCHAR},</if>
|
||||||
|
<if test="overtimeRefId != null" >overtime_ref_id = #{overtimeRefId,jdbcType=VARCHAR},</if>
|
||||||
|
<if test="overtimeHours != null" >overtime_hours = NULLIF(#{overtimeHours,jdbcType=VARCHAR}, ''),</if>
|
||||||
|
<if test="actualStartTime != null" >actual_start_time = #{actualStartTime,jdbcType=TIMESTAMP},</if>
|
||||||
|
<if test="actualEndTime != null" >actual_end_time = #{actualEndTime,jdbcType=TIMESTAMP},</if>
|
||||||
|
<if test="state != null" >state = #{state,jdbcType=VARCHAR},</if>
|
||||||
|
audit_man_id = NULL,
|
||||||
|
<if test="submissionTime != null" >submission_time = #{submissionTime,jdbcType=TIMESTAMP},</if>
|
||||||
|
<if test="processid != null" >processid = #{processid,jdbcType=VARCHAR},</if>
|
||||||
|
<if test="processdefid != null" >processdefid = #{processdefid,jdbcType=VARCHAR},</if>
|
||||||
|
<if test="remark != null" >remark = #{remark,jdbcType=VARCHAR},</if>
|
||||||
|
<if test="delFlag != null" >del_flag = #{delFlag,jdbcType=CHAR},</if>
|
||||||
|
</set>
|
||||||
|
where id = #{id,jdbcType=VARCHAR}
|
||||||
|
</update>
|
||||||
|
<select id="selectListByWhere" parameterType="java.lang.String" resultMap="BaseResultMap" >
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List" />
|
||||||
|
from tb_administration_leave_apply
|
||||||
|
${where}
|
||||||
|
</select>
|
||||||
|
<delete id="deleteByWhere" parameterType="java.lang.String" >
|
||||||
|
delete from tb_administration_leave_apply
|
||||||
|
${where}
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
||||||
@ -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
|
||||||
|
|||||||
@ -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" />
|
||||||
|
|||||||
@ -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>
|
||||||
|
|||||||
@ -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" />
|
||||||
|
|||||||
@ -362,9 +362,22 @@ public class WorkflowProcessDefinitionService {
|
|||||||
String pvmTransitionId = "";
|
String pvmTransitionId = "";
|
||||||
for (WorkTask workTask : list) {
|
for (WorkTask workTask : list) {
|
||||||
PvmTransition item=this.getTransition(processDefId, taskDefId,workTask.getId(),pvmTransitionId);
|
PvmTransition item=this.getTransition(processDefId, taskDefId,workTask.getId(),pvmTransitionId);
|
||||||
|
if (item == null) {
|
||||||
|
// 未找到对应路径时默认标记为通过路径,继续处理其他任务
|
||||||
|
workTask.setPassFlag(true);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
pvmTransitionId = item.getId();
|
pvmTransitionId = item.getId();
|
||||||
String conditionText=String.valueOf(item.getProperty("conditionText"));
|
String conditionText=String.valueOf(item.getProperty("conditionText"));
|
||||||
if (conditionText!=null && conditionText.contains("!"+CommString.ACTI_KEK_Condition)) {
|
// 检测退回路径:支持多种条件表达式格式
|
||||||
|
// ${!pass} / ${pass == false} / ${pass==false} / ${pass != true} / ${pass!=true}
|
||||||
|
boolean isRejectPath = conditionText != null && (
|
||||||
|
conditionText.contains("!"+CommString.ACTI_KEK_Condition) ||
|
||||||
|
conditionText.contains(CommString.ACTI_KEK_Condition+" == false") ||
|
||||||
|
conditionText.contains(CommString.ACTI_KEK_Condition+"==false") ||
|
||||||
|
conditionText.contains(CommString.ACTI_KEK_Condition+" != true") ||
|
||||||
|
conditionText.contains(CommString.ACTI_KEK_Condition+"!=true"));
|
||||||
|
if (isRejectPath) {
|
||||||
workTask.setPassFlag(false);
|
workTask.setPassFlag(false);
|
||||||
}else{
|
}else{
|
||||||
workTask.setPassFlag(true);
|
workTask.setPassFlag(true);
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,477 @@
|
|||||||
|
package com.sipai.service.administration;
|
||||||
|
|
||||||
|
import com.sipai.dao.administration.LeaveApplyDao;
|
||||||
|
import com.sipai.entity.activiti.ProcessType;
|
||||||
|
import com.sipai.entity.administration.LeaveApply;
|
||||||
|
import com.sipai.entity.administration.LeaveCommStr;
|
||||||
|
import com.sipai.entity.base.BusinessUnitAdapter;
|
||||||
|
import com.sipai.entity.business.BusinessUnit;
|
||||||
|
import com.sipai.entity.business.BusinessUnitAudit;
|
||||||
|
import com.sipai.entity.business.BusinessUnitRecord;
|
||||||
|
import com.sipai.entity.maintenance.MaintenanceCommString;
|
||||||
|
import com.sipai.entity.user.User;
|
||||||
|
import com.sipai.service.activiti.WorkflowProcessDefinitionService;
|
||||||
|
import com.sipai.service.activiti.WorkflowService;
|
||||||
|
import com.sipai.service.business.BusinessUnitAuditService;
|
||||||
|
import com.sipai.service.user.JobService;
|
||||||
|
import com.sipai.service.user.UnitService;
|
||||||
|
import com.sipai.service.user.UserJobService;
|
||||||
|
import com.sipai.service.user.UserService;
|
||||||
|
import com.sipai.tools.CommService;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.activiti.engine.repository.ProcessDefinition;
|
||||||
|
import org.activiti.engine.runtime.ProcessInstance;
|
||||||
|
import org.activiti.engine.task.Task;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.LinkedHashSet;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class LeaveApplyService implements CommService<LeaveApply> {
|
||||||
|
@Resource
|
||||||
|
private LeaveApplyDao leaveApplyDao;
|
||||||
|
@Resource
|
||||||
|
private UserService userService;
|
||||||
|
@Resource
|
||||||
|
private WorkflowProcessDefinitionService workflowProcessDefinitionService;
|
||||||
|
@Resource
|
||||||
|
private WorkflowService workflowService;
|
||||||
|
@Resource
|
||||||
|
private BusinessUnitAuditService businessUnitAuditService;
|
||||||
|
@Resource
|
||||||
|
private JobService jobService;
|
||||||
|
@Resource
|
||||||
|
private UserJobService userJobService;
|
||||||
|
@Resource
|
||||||
|
private UnitService unitService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LeaveApply selectById(String id) {
|
||||||
|
LeaveApply leaveApply = this.leaveApplyDao.selectByPrimaryKey(id);
|
||||||
|
this.fillExtraInfo(leaveApply);
|
||||||
|
return leaveApply;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int deleteById(String id) {
|
||||||
|
return this.leaveApplyDao.deleteByPrimaryKey(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int save(LeaveApply leaveApply) {
|
||||||
|
this.normalizeLeaveApply(leaveApply);
|
||||||
|
return this.leaveApplyDao.insert(leaveApply);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int update(LeaveApply leaveApply) {
|
||||||
|
this.normalizeLeaveApply(leaveApply);
|
||||||
|
return this.leaveApplyDao.updateByPrimaryKeySelective(leaveApply);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<LeaveApply> selectListByWhere(String wherestr) {
|
||||||
|
LeaveApply leaveApply = new LeaveApply();
|
||||||
|
leaveApply.setWhere(wherestr);
|
||||||
|
List<LeaveApply> list = this.leaveApplyDao.selectListByWhere(leaveApply);
|
||||||
|
if (list != null) {
|
||||||
|
for (LeaveApply item : list) {
|
||||||
|
this.fillExtraInfo(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int deleteByWhere(String wherestr) {
|
||||||
|
LeaveApply leaveApply = new LeaveApply();
|
||||||
|
leaveApply.setWhere(wherestr);
|
||||||
|
return this.leaveApplyDao.deleteByWhere(leaveApply);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUserNamesByUserIds(String userIds) {
|
||||||
|
if (userIds == null || userIds.isEmpty()) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
userIds = userIds.replace(",", "','");
|
||||||
|
String userNames = "";
|
||||||
|
List<User> users = this.userService.selectListByWhere("where id in ('" + userIds + "')");
|
||||||
|
for (User item : users) {
|
||||||
|
if (!userNames.isEmpty()) {
|
||||||
|
userNames += ",";
|
||||||
|
}
|
||||||
|
userNames += item.getCaption();
|
||||||
|
}
|
||||||
|
return userNames;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public int doStartProcess(LeaveApply leaveApply) {
|
||||||
|
try {
|
||||||
|
this.normalizeLeaveApply(leaveApply);
|
||||||
|
String candidateUserIds = this.getDefaultCandidateUserIds(leaveApply, BusinessUnit.UNIT_LEAVE_APPLY_SECTION_AUDIT);
|
||||||
|
Map<String, Object> variables = new HashMap<String, Object>();
|
||||||
|
if (StringUtils.isBlank(candidateUserIds)) {
|
||||||
|
return MaintenanceCommString.Response_StartProcess_NoUser;
|
||||||
|
}
|
||||||
|
variables.put("userIds", candidateUserIds);
|
||||||
|
variables.put("applyType", leaveApply.getApplyType());
|
||||||
|
variables.put("leaveType", leaveApply.getLeaveType());
|
||||||
|
variables.put("days", leaveApply.getDays());
|
||||||
|
variables.put("hours", leaveApply.getHours());
|
||||||
|
variables.put("applicantId", null);
|
||||||
|
|
||||||
|
List<ProcessDefinition> processDefinitions = workflowProcessDefinitionService.getProcessDefsBykey(
|
||||||
|
ProcessType.Administration_Leave.getId() + "-" + leaveApply.getUnitId());
|
||||||
|
if (processDefinitions == null || processDefinitions.size() == 0) {
|
||||||
|
processDefinitions = workflowProcessDefinitionService.getProcessDefsBykey(ProcessType.Administration_Leave.getId());
|
||||||
|
}
|
||||||
|
if (processDefinitions == null || processDefinitions.size() == 0) {
|
||||||
|
return MaintenanceCommString.Response_StartProcess_NoProcessDef;
|
||||||
|
}
|
||||||
|
|
||||||
|
ProcessInstance processInstance = workflowService.startWorkflow(
|
||||||
|
leaveApply.getId(), leaveApply.getInsuser(), processDefinitions.get(0).getKey(), variables);
|
||||||
|
if (processInstance == null) {
|
||||||
|
throw new RuntimeException();
|
||||||
|
}
|
||||||
|
leaveApply.setProcessid(processInstance.getId());
|
||||||
|
leaveApply.setProcessdefid(processDefinitions.get(0).getId());
|
||||||
|
leaveApply.setState(LeaveCommStr.STATE_SECTION_AUDIT);
|
||||||
|
leaveApply.setSubmissionTime(leaveApply.getInsdt());
|
||||||
|
|
||||||
|
int res = 0;
|
||||||
|
LeaveApply db = this.selectById(leaveApply.getId());
|
||||||
|
if (db != null) {
|
||||||
|
res = this.leaveApplyDao.updateByPrimaryKeySelective(leaveApply);
|
||||||
|
} else {
|
||||||
|
res = this.leaveApplyDao.insert(leaveApply);
|
||||||
|
}
|
||||||
|
if (res == 1) {
|
||||||
|
User user = userService.getUserById(leaveApply.getInsuser());
|
||||||
|
String recordUser = this.getUserNamesByUserIds(candidateUserIds);
|
||||||
|
BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(
|
||||||
|
leaveApply.getInsdt(), leaveApply.getInsuser(), leaveApply.getId(), leaveApply.getProcessid(),
|
||||||
|
leaveApply.getUnitId(), null, StringUtils.isBlank(recordUser)
|
||||||
|
? "提交了请假补假申请,等待审批人签收。"
|
||||||
|
: "提交了请假补假申请至" + recordUser + "进行审批。", user, "流程发起");
|
||||||
|
businessUnitRecord.sendMessage(candidateUserIds, "");
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
throw new RuntimeException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int updateStatus(String id) {
|
||||||
|
LeaveApply leaveApply = this.selectById(id);
|
||||||
|
List<Task> task = workflowService.getTaskService().createTaskQuery().processInstanceId(leaveApply.getProcessid()).list();
|
||||||
|
if (task != null && task.size() > 0) {
|
||||||
|
leaveApply.setState(task.get(0).getName());
|
||||||
|
} else {
|
||||||
|
leaveApply.setState(LeaveCommStr.STATE_FINISH);
|
||||||
|
}
|
||||||
|
return this.update(leaveApply);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public int doAuditProcess(BusinessUnitAudit entity) {
|
||||||
|
try {
|
||||||
|
BusinessUnitAdapter businessUnitAdapter = this.selectById(entity.getBusinessid());
|
||||||
|
int res = businessUnitAuditService.doAudit(entity, businessUnitAdapter);
|
||||||
|
if (res > 0) {
|
||||||
|
this.updateStatus(entity.getBusinessid());
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
throw new RuntimeException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void fillExtraInfo(LeaveApply leaveApply) {
|
||||||
|
if (leaveApply == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (leaveApply.getAuditManId() != null && !leaveApply.getAuditManId().isEmpty()) {
|
||||||
|
leaveApply.setAuditMan(this.getUserNamesByUserIds(leaveApply.getAuditManId()));
|
||||||
|
} else if (StringUtils.isNotBlank(leaveApply.getProcessid())
|
||||||
|
&& !LeaveCommStr.STATE_FINISH.equals(leaveApply.getState())
|
||||||
|
&& !LeaveCommStr.STATE_DRAFT.equals(leaveApply.getState())) {
|
||||||
|
leaveApply.setAuditMan("待签收");
|
||||||
|
}
|
||||||
|
if (leaveApply.getInsuser() != null && !leaveApply.getInsuser().isEmpty()) {
|
||||||
|
User user = this.userService.getUserById(leaveApply.getInsuser());
|
||||||
|
if (user != null) {
|
||||||
|
leaveApply.setInsuserName(user.getCaption());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
leaveApply.setStateName(leaveApply.getState());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void normalizeLeaveApply(LeaveApply leaveApply) {
|
||||||
|
if (leaveApply == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
leaveApply.setStartTime(StringUtils.trimToNull(leaveApply.getStartTime()));
|
||||||
|
leaveApply.setEndTime(StringUtils.trimToNull(leaveApply.getEndTime()));
|
||||||
|
leaveApply.setActualStartTime(this.normalizeDateTimeValue(leaveApply.getActualStartTime()));
|
||||||
|
leaveApply.setActualEndTime(this.normalizeDateTimeValue(leaveApply.getActualEndTime()));
|
||||||
|
leaveApply.setHours(StringUtils.trimToNull(leaveApply.getHours()));
|
||||||
|
leaveApply.setDays(StringUtils.trimToNull(leaveApply.getDays()));
|
||||||
|
leaveApply.setOvertimeHours(StringUtils.trimToNull(leaveApply.getOvertimeHours()));
|
||||||
|
this.calculateDuration(leaveApply);
|
||||||
|
leaveApply.setStartTime(this.normalizeLeaveTimeValue(leaveApply.getStartTime()));
|
||||||
|
leaveApply.setEndTime(this.normalizeLeaveTimeValue(leaveApply.getEndTime()));
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDefaultCandidateUserIds(LeaveApply leaveApply) {
|
||||||
|
return this.getDefaultCandidateUserIds(leaveApply, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDefaultCandidateUserIds(LeaveApply leaveApply, String taskDefinitionKey) {
|
||||||
|
if (leaveApply == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
String resourceId = StringUtils.trimToNull(taskDefinitionKey);
|
||||||
|
if (resourceId == null) {
|
||||||
|
resourceId = BusinessUnit.UNIT_LEAVE_APPLY_SECTION_AUDIT;
|
||||||
|
}
|
||||||
|
String jobIds = StringUtils.trimToNull(this.jobService.getJobs4Activiti(
|
||||||
|
leaveApply.getUnitId(), ProcessType.Administration_Leave.getId(), resourceId));
|
||||||
|
if (StringUtils.isBlank(jobIds) && !BusinessUnit.UNIT_LEAVE_APPLY_SECTION_AUDIT.equals(resourceId)) {
|
||||||
|
jobIds = StringUtils.trimToNull(this.jobService.getJobs4Activiti(
|
||||||
|
leaveApply.getUnitId(), ProcessType.Administration_Leave.getId()));
|
||||||
|
}
|
||||||
|
Set<String> unitUserIds = new LinkedHashSet<String>();
|
||||||
|
List<User> unitUsers = this.unitService.getChildrenUsersById(leaveApply.getUnitId());
|
||||||
|
if (unitUsers != null) {
|
||||||
|
for (User user : unitUsers) {
|
||||||
|
if (user != null && StringUtils.isNotBlank(user.getId())) {
|
||||||
|
unitUserIds.add(user.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Set<String> candidateUserIds = new LinkedHashSet<String>();
|
||||||
|
if (StringUtils.isNotBlank(jobIds)) {
|
||||||
|
List<com.sipai.entity.user.UserJob> userJobs = this.userJobService.selectListByWhere(
|
||||||
|
"where jobid in ('" + jobIds.replace(",", "','") + "')");
|
||||||
|
if (userJobs != null) {
|
||||||
|
for (com.sipai.entity.user.UserJob userJob : userJobs) {
|
||||||
|
if (userJob != null && StringUtils.isNotBlank(userJob.getUserid())
|
||||||
|
&& (unitUserIds.isEmpty() || unitUserIds.contains(userJob.getUserid()))) {
|
||||||
|
candidateUserIds.add(userJob.getUserid());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (candidateUserIds.isEmpty()) {
|
||||||
|
candidateUserIds.addAll(unitUserIds);
|
||||||
|
}
|
||||||
|
return this.joinUserIds(new ArrayList<String>(candidateUserIds));
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDefaultCandidateUserIdsForNextTask(LeaveApply leaveApply, String currentTaskDefinitionKey, Integer routeNum, boolean passStatus) {
|
||||||
|
if (leaveApply == null || StringUtils.isBlank(leaveApply.getProcessdefid()) || StringUtils.isBlank(currentTaskDefinitionKey)) {
|
||||||
|
return this.getDefaultCandidateUserIds(leaveApply);
|
||||||
|
}
|
||||||
|
List<com.sipai.entity.activiti.WorkTask> nextWorkTasks =
|
||||||
|
workflowProcessDefinitionService.getNextWorkTasks(leaveApply.getProcessdefid(), currentTaskDefinitionKey);
|
||||||
|
if (nextWorkTasks == null || nextWorkTasks.isEmpty()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
int expectedRouteNum = routeNum == null ? -1 : routeNum;
|
||||||
|
boolean matchedRoute = false;
|
||||||
|
for (com.sipai.entity.activiti.WorkTask workTask : nextWorkTasks) {
|
||||||
|
if (workTask == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (workTask.isPassFlag() != passStatus) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (expectedRouteNum >= 0 && workTask.getRouteNum() != expectedRouteNum) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
matchedRoute = true;
|
||||||
|
if (!"userTask".equals(workTask.getType())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
return this.getDefaultCandidateUserIds(leaveApply, workTask.getTaskKey());
|
||||||
|
}
|
||||||
|
return matchedRoute ? null : this.getDefaultCandidateUserIds(leaveApply);
|
||||||
|
}
|
||||||
|
|
||||||
|
private String joinUserIds(List<String> userIds) {
|
||||||
|
if (userIds == null || userIds.isEmpty()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
StringBuilder builder = new StringBuilder();
|
||||||
|
for (String userId : userIds) {
|
||||||
|
if (StringUtils.isBlank(userId)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (builder.length() > 0) {
|
||||||
|
builder.append(",");
|
||||||
|
}
|
||||||
|
builder.append(userId.trim());
|
||||||
|
}
|
||||||
|
return builder.length() == 0 ? null : builder.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void calculateDuration(LeaveApply leaveApply) {
|
||||||
|
if (StringUtils.isBlank(leaveApply.getStartTime()) || StringUtils.isBlank(leaveApply.getEndTime())) {
|
||||||
|
leaveApply.setHours(null);
|
||||||
|
leaveApply.setDays(null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
if (this.isHalfDayValue(leaveApply.getStartTime()) && this.isHalfDayValue(leaveApply.getEndTime())) {
|
||||||
|
LeaveTimePoint startPoint = this.parseLeaveTimePoint(leaveApply.getStartTime());
|
||||||
|
LeaveTimePoint endPoint = this.parseLeaveTimePoint(leaveApply.getEndTime());
|
||||||
|
int halfDays = this.calculateHalfDays(startPoint, endPoint);
|
||||||
|
if (halfDays <= 0) {
|
||||||
|
leaveApply.setHours(null);
|
||||||
|
leaveApply.setDays(null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
leaveApply.setHours(this.formatDecimal(BigDecimal.valueOf(halfDays * 4L)));
|
||||||
|
leaveApply.setDays(this.formatDecimal(BigDecimal.valueOf(halfDays).divide(BigDecimal.valueOf(2), 1, RoundingMode.HALF_UP)));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Date startDate = this.parseDateTime(leaveApply.getStartTime());
|
||||||
|
Date endDate = this.parseDateTime(leaveApply.getEndTime());
|
||||||
|
long diffMillis = endDate.getTime() - startDate.getTime();
|
||||||
|
if (diffMillis <= 0) {
|
||||||
|
leaveApply.setHours(null);
|
||||||
|
leaveApply.setDays(null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
BigDecimal hours = BigDecimal.valueOf(diffMillis)
|
||||||
|
.divide(BigDecimal.valueOf(1000L * 60L * 60L), 2, RoundingMode.HALF_UP);
|
||||||
|
BigDecimal days = hours.divide(BigDecimal.valueOf(8), 2, RoundingMode.HALF_UP);
|
||||||
|
if (days.compareTo(BigDecimal.valueOf(0.5)) < 0) {
|
||||||
|
days = BigDecimal.valueOf(0.5);
|
||||||
|
}
|
||||||
|
leaveApply.setHours(this.formatDecimal(hours));
|
||||||
|
leaveApply.setDays(this.formatDecimal(days));
|
||||||
|
} catch (ParseException e) {
|
||||||
|
leaveApply.setHours(null);
|
||||||
|
leaveApply.setDays(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isHalfDayValue(String value) {
|
||||||
|
if (StringUtils.isBlank(value)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
String trimmed = StringUtils.trim(value);
|
||||||
|
if (trimmed.matches("^\\d{4}-\\d{2}-\\d{2}\\s+(上午|下午)$")) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return trimmed.matches("^\\d{4}-\\d{2}-\\d{2}\\s+(00:00(?::00)?|12:00(?::00)?)$");
|
||||||
|
}
|
||||||
|
|
||||||
|
private LeaveTimePoint parseLeaveTimePoint(String value) throws ParseException {
|
||||||
|
String[] parts = StringUtils.trim(value).split("\\s+");
|
||||||
|
if (parts.length != 2) {
|
||||||
|
throw new ParseException("Unsupported leave time format: " + value, 0);
|
||||||
|
}
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
sdf.setLenient(false);
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTime(sdf.parse(parts[0]));
|
||||||
|
return new LeaveTimePoint(calendar, this.parsePeriodIndex(parts[1]));
|
||||||
|
}
|
||||||
|
|
||||||
|
private int calculateHalfDays(LeaveTimePoint startPoint, LeaveTimePoint endPoint) {
|
||||||
|
long diffMillis = endPoint.calendar.getTimeInMillis() - startPoint.calendar.getTimeInMillis();
|
||||||
|
int dayDiff = (int) (diffMillis / (1000 * 60 * 60 * 24));
|
||||||
|
return dayDiff * 2 + (endPoint.periodIndex - startPoint.periodIndex) + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int parsePeriodIndex(String period) throws ParseException {
|
||||||
|
if ("下午".equals(period) || "12:00".equals(period) || "12:00:00".equals(period)) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if ("上午".equals(period) || "00:00".equals(period) || "00:00:00".equals(period)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
throw new ParseException("Unsupported leave period: " + period, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
private String normalizeLeaveTimeValue(String value) {
|
||||||
|
if (StringUtils.isBlank(value)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
String trimmed = StringUtils.trim(value);
|
||||||
|
if (!trimmed.matches("^\\d{4}-\\d{2}-\\d{2}\\s+(上午|下午)$")) {
|
||||||
|
return this.normalizeDateTimeValue(trimmed);
|
||||||
|
}
|
||||||
|
String[] parts = trimmed.split("\\s+");
|
||||||
|
return parts[0] + ("下午".equals(parts[1]) ? " 12:00:00" : " 00:00:00");
|
||||||
|
}
|
||||||
|
|
||||||
|
private String normalizeDateTimeValue(String value) {
|
||||||
|
if (StringUtils.isBlank(value)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
String trimmed = StringUtils.trim(value);
|
||||||
|
String[] patterns = new String[]{"yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM-dd"};
|
||||||
|
for (String pattern : patterns) {
|
||||||
|
try {
|
||||||
|
SimpleDateFormat parser = new SimpleDateFormat(pattern);
|
||||||
|
parser.setLenient(false);
|
||||||
|
Date parsed = parser.parse(trimmed);
|
||||||
|
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
return formatter.format(parsed);
|
||||||
|
} catch (ParseException e) {
|
||||||
|
// try next format
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return trimmed;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Date parseDateTime(String value) throws ParseException {
|
||||||
|
String trimmed = StringUtils.trim(value);
|
||||||
|
String[] patterns = new String[]{"yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM-dd"};
|
||||||
|
for (String pattern : patterns) {
|
||||||
|
try {
|
||||||
|
SimpleDateFormat parser = new SimpleDateFormat(pattern);
|
||||||
|
parser.setLenient(false);
|
||||||
|
return parser.parse(trimmed);
|
||||||
|
} catch (ParseException e) {
|
||||||
|
// try next format
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new ParseException("Unsupported datetime format: " + value, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
private String formatDecimal(BigDecimal value) {
|
||||||
|
return value.stripTrailingZeros().toPlainString();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static class LeaveTimePoint {
|
||||||
|
private final Calendar calendar;
|
||||||
|
private final int periodIndex;
|
||||||
|
|
||||||
|
private LeaveTimePoint(Calendar calendar, int periodIndex) {
|
||||||
|
this.calendar = calendar;
|
||||||
|
this.periodIndex = periodIndex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -20,9 +20,12 @@ import org.slf4j.Logger;
|
|||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.web.context.request.RequestContextHolder;
|
||||||
|
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
@ -351,6 +354,8 @@ public class CommonFileServiceImpl implements CommonFileService {
|
|||||||
String errorMsg = e.getMessage();
|
String errorMsg = e.getMessage();
|
||||||
if (errorMsg != null && errorMsg.contains("NoSuchKey")) {
|
if (errorMsg != null && errorMsg.contains("NoSuchKey")) {
|
||||||
logger.error("MinIO文件不存在: bucketName={}, objectName={}", nameSpace, filePath);
|
logger.error("MinIO文件不存在: bucketName={}, objectName={}", nameSpace, filePath);
|
||||||
|
} else if (errorMsg != null && errorMsg.contains("NoSuchBucket")) {
|
||||||
|
logger.error("MinIO存储桶不存在: bucketName={}, objectName={}", nameSpace, filePath);
|
||||||
} else {
|
} else {
|
||||||
logger.error("获取MinIO文件失败: bucketName={}, objectName={}, 错误: {}", nameSpace, filePath, errorMsg, e);
|
logger.error("获取MinIO文件失败: bucketName={}, objectName={}, 错误: {}", nameSpace, filePath, errorMsg, e);
|
||||||
}
|
}
|
||||||
@ -389,7 +394,7 @@ public class CommonFileServiceImpl implements CommonFileService {
|
|||||||
CommonFile commonFile = new CommonFile();
|
CommonFile commonFile = new CommonFile();
|
||||||
commonFile.setId(CommUtil.getUUID());
|
commonFile.setId(CommUtil.getUUID());
|
||||||
commonFile.setMasterid(masterId);
|
commonFile.setMasterid(masterId);
|
||||||
// 20210105 YYJ 用于文件表绑定资料节点用字段 tb_doc_file内和masterId一样
|
// 20210105 YYJ 用于文件表绑定<EFBFBD><EFBFBD>料节点用字段 tb_doc_file内和masterId一样
|
||||||
// commonFile.setPid(masterId);
|
// commonFile.setPid(masterId);
|
||||||
commonFile.setFilename(fileName); // 保存原始文件名用于显示
|
commonFile.setFilename(fileName); // 保存原始文件名用于显示
|
||||||
commonFile.setType(contentType);
|
commonFile.setType(contentType);
|
||||||
@ -398,6 +403,19 @@ public class CommonFileServiceImpl implements CommonFileService {
|
|||||||
commonFile.setAbspath(filePath); // 保存MinIO对象名称
|
commonFile.setAbspath(filePath); // 保存MinIO对象名称
|
||||||
commonFile.setInsdt(CommUtil.nowDate());
|
commonFile.setInsdt(CommUtil.nowDate());
|
||||||
commonFile.setSize((int) item.getSize());
|
commonFile.setSize((int) item.getSize());
|
||||||
|
// 获取当前用户ID并设置
|
||||||
|
try {
|
||||||
|
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||||
|
if (attributes != null) {
|
||||||
|
HttpServletRequest request = attributes.getRequest();
|
||||||
|
User cu = (User) request.getSession().getAttribute("cu");
|
||||||
|
if (cu != null) {
|
||||||
|
commonFile.setInsuser(cu.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.warn("无法获取当前用户信息: {}", e.getMessage());
|
||||||
|
}
|
||||||
res = this.insertByTable(tableName, commonFile);
|
res = this.insertByTable(tableName, commonFile);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("Failed to update file to MinIO for masterId: {}", masterId, e);
|
logger.error("Failed to update file to MinIO for masterId: {}", masterId, e);
|
||||||
|
|||||||
@ -112,17 +112,24 @@ public class BusinessUnitAuditService implements CommService<BusinessUnitAudit>{
|
|||||||
}
|
}
|
||||||
List<HistoricActivityInstance> list=historyService.createHistoricActivityInstanceQuery().processInstanceId(entity.getProcessid()).activityId(wortTaskId)
|
List<HistoricActivityInstance> list=historyService.createHistoricActivityInstanceQuery().processInstanceId(entity.getProcessid()).activityId(wortTaskId)
|
||||||
.orderByHistoricActivityInstanceStartTime().desc().list();
|
.orderByHistoricActivityInstanceStartTime().desc().list();
|
||||||
if (list != null && list.size()>0) {
|
// 优先取历史记录中的 assignee;若 assignee 为空(候选人任务未签收),则查 BusinessUnitAudit 记录获取实际提交人
|
||||||
variables.put(CommString.ACTI_KEK_Assignee, list.get(0).getAssignee());
|
String targetAssignee = null;
|
||||||
|
if (list != null && list.size() > 0) {
|
||||||
|
targetAssignee = list.get(0).getAssignee();
|
||||||
|
}
|
||||||
|
if (targetAssignee == null && !wortTaskId.isEmpty()) {
|
||||||
|
// 历史 assignee 为空时,从 BusinessUnitAudit 记录中查找该步骤的实际提交人
|
||||||
|
List<BusinessUnitAudit> previousAuditList = this.selectListByWhere(
|
||||||
|
"where businessid='" + entity.getBusinessid() + "' and taskdefinitionkey='" + wortTaskId + "' order by insdt desc");
|
||||||
|
if (previousAuditList != null && previousAuditList.size() > 0) {
|
||||||
|
targetAssignee = previousAuditList.get(0).getInsuser();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 设置退回目标处理人(若仍为空则由流程变量 userIds 确定候选人,不再回退到工单创建人)
|
||||||
|
variables.put(CommString.ACTI_KEK_Assignee, targetAssignee);
|
||||||
if(entity.getAuditopinion()!=null && !entity.getAuditopinion().isEmpty()){
|
if(entity.getAuditopinion()!=null && !entity.getAuditopinion().isEmpty()){
|
||||||
taskService.addComment(entity.getTaskid(), entity.getProcessid(), entity.getAuditopinion());
|
taskService.addComment(entity.getTaskid(), entity.getProcessid(), entity.getAuditopinion());
|
||||||
}
|
}
|
||||||
}else {
|
|
||||||
variables.put(CommString.ACTI_KEK_Assignee, businessUnitAdapter.getInsuser());
|
|
||||||
if(entity.getAuditopinion()!=null && !entity.getAuditopinion().isEmpty()){
|
|
||||||
taskService.addComment(entity.getTaskid(), entity.getProcessid(), entity.getAuditopinion());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
//int res=0;
|
//int res=0;
|
||||||
taskService.complete(entity.getTaskid(), variables);
|
taskService.complete(entity.getTaskid(), variables);
|
||||||
@ -141,17 +148,24 @@ public class BusinessUnitAuditService implements CommService<BusinessUnitAudit>{
|
|||||||
BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(entity);
|
BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(entity);
|
||||||
if(entity.getPassstatus()){
|
if(entity.getPassstatus()){
|
||||||
//通过
|
//通过
|
||||||
if(variables.get(CommString.ACTI_KEK_Candidate_Users)!=null){
|
String candidateUsers = variables.get(CommString.ACTI_KEK_Candidate_Users) != null
|
||||||
businessUnitRecord.sendMessage(variables.get(CommString.ACTI_KEK_Candidate_Users).toString(),"");
|
? variables.get(CommString.ACTI_KEK_Candidate_Users).toString() : null;
|
||||||
|
if(candidateUsers != null && !candidateUsers.isEmpty()){
|
||||||
|
// 有下一步接收人,通知下一步处理人
|
||||||
|
businessUnitRecord.sendMessage(candidateUsers, "");
|
||||||
|
}else if(variables.get(CommString.ACTI_KEK_AssigneeList) != null){
|
||||||
|
// 会签
|
||||||
|
businessUnitRecord.sendMessage(entity.getTargetusers(), "");
|
||||||
}else{
|
}else{
|
||||||
//会签
|
// 最后一步,无下一步处理人,通知当前提交人(完成确认)
|
||||||
if(variables.get(CommString.ACTI_KEK_AssigneeList)!=null){
|
if(entity.getInsuser() != null && !entity.getInsuser().isEmpty()){
|
||||||
businessUnitRecord.sendMessage(entity.getTargetusers(),"");
|
businessUnitRecord.sendMessage(entity.getInsuser(), "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
if(variables.get(CommString.ACTI_KEK_Assignee)!=null){
|
// 退回:通知目标处理人(排除空值,避免错误发送)
|
||||||
businessUnitRecord.sendMessage(variables.get(CommString.ACTI_KEK_Assignee).toString(),"");
|
if(variables.get(CommString.ACTI_KEK_Assignee) != null){
|
||||||
|
businessUnitRecord.sendMessage(variables.get(CommString.ACTI_KEK_Assignee).toString(), "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package com.sipai.service.report;
|
|||||||
|
|
||||||
import com.sipai.entity.business.BusinessUnitAudit;
|
import com.sipai.entity.business.BusinessUnitAudit;
|
||||||
import com.sipai.entity.report.RptCreate;
|
import com.sipai.entity.report.RptCreate;
|
||||||
|
import com.sipai.entity.user.User;
|
||||||
import org.xmlpull.v1.XmlPullParserException;
|
import org.xmlpull.v1.XmlPullParserException;
|
||||||
|
|
||||||
import javax.xml.parsers.ParserConfigurationException;
|
import javax.xml.parsers.ParserConfigurationException;
|
||||||
@ -45,4 +46,11 @@ public interface RptCreateService {
|
|||||||
|
|
||||||
//改变状态
|
//改变状态
|
||||||
public abstract int updateStatus(String id);
|
public abstract int updateStatus(String id);
|
||||||
|
|
||||||
|
/** 检查用户是否有报表生成权限
|
||||||
|
* @param rptInfoSetId 报表配置id
|
||||||
|
* @param user 当前用户
|
||||||
|
* @return true=有权限, false=无权限
|
||||||
|
*/
|
||||||
|
public abstract boolean checkGeneratePermission(String rptInfoSetId, User user);
|
||||||
}
|
}
|
||||||
@ -60,4 +60,11 @@ public interface RptDayLogService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public abstract Result onekeyAudit(String ids ,User cu,String rptdeptId);
|
public abstract Result onekeyAudit(String ids ,User cu,String rptdeptId);
|
||||||
|
|
||||||
|
/** 检查用户是否有填报权限
|
||||||
|
* @param rptdeptId 填报配置id
|
||||||
|
* @param user 当前用户
|
||||||
|
* @return true=有权限, false=无权限
|
||||||
|
*/
|
||||||
|
public abstract boolean checkInputPermission(String rptdeptId, User user);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,6 +13,7 @@ import com.sipai.entity.report.*;
|
|||||||
import com.sipai.entity.scada.MPoint;
|
import com.sipai.entity.scada.MPoint;
|
||||||
import com.sipai.entity.scada.TempReport;
|
import com.sipai.entity.scada.TempReport;
|
||||||
import com.sipai.entity.user.User;
|
import com.sipai.entity.user.User;
|
||||||
|
import com.sipai.entity.user.UserJob;
|
||||||
import com.sipai.entity.work.GroupDetail;
|
import com.sipai.entity.work.GroupDetail;
|
||||||
import com.sipai.entity.work.Scheduling;
|
import com.sipai.entity.work.Scheduling;
|
||||||
import com.sipai.service.activiti.WorkflowProcessDefinitionService;
|
import com.sipai.service.activiti.WorkflowProcessDefinitionService;
|
||||||
@ -24,6 +25,7 @@ import com.sipai.service.report.*;
|
|||||||
import com.sipai.service.scada.MPointService;
|
import com.sipai.service.scada.MPointService;
|
||||||
import com.sipai.service.scada.TempReportService;
|
import com.sipai.service.scada.TempReportService;
|
||||||
import com.sipai.service.user.UserService;
|
import com.sipai.service.user.UserService;
|
||||||
|
import com.sipai.service.user.UserJobService;
|
||||||
import com.sipai.service.work.GroupDetailService;
|
import com.sipai.service.work.GroupDetailService;
|
||||||
import com.sipai.service.work.SchedulingService;
|
import com.sipai.service.work.SchedulingService;
|
||||||
import com.sipai.tools.*;
|
import com.sipai.tools.*;
|
||||||
@ -46,6 +48,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 +74,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
|
||||||
@ -104,6 +109,8 @@ public class RptCreateServiceImpl implements RptCreateService {
|
|||||||
private BusinessUnitHandleDetailService businessUnitHandleDetailService;
|
private BusinessUnitHandleDetailService businessUnitHandleDetailService;
|
||||||
@Resource
|
@Resource
|
||||||
private GroupDetailService groupDetailService;
|
private GroupDetailService groupDetailService;
|
||||||
|
@Resource
|
||||||
|
private UserJobService userJobService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public RptCreate selectById(String id) {
|
public RptCreate selectById(String id) {
|
||||||
@ -393,7 +400,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -830,6 +837,20 @@ public class RptCreateServiceImpl implements RptCreateService {
|
|||||||
// System.out.println("rptdt==============================================================" + rptdt);
|
// System.out.println("rptdt==============================================================" + rptdt);
|
||||||
String rpttype = rptInfoSet.getRpttype();//报表类型
|
String rpttype = rptInfoSet.getRpttype();//报表类型
|
||||||
String bucketName = "rptinfosetfile";
|
String bucketName = "rptinfosetfile";
|
||||||
|
String endtype = ".xls"; // 默认文件扩展名
|
||||||
|
|
||||||
|
// 首先确保report bucket存在
|
||||||
|
try {
|
||||||
|
MinioClient minioClient = new MinioClient(minioProp.getEndPoint(), minioProp.getAccessKey(), minioProp.getSecretKey());
|
||||||
|
boolean isExist = minioClient.bucketExists("report");
|
||||||
|
if (!isExist) {
|
||||||
|
minioClient.makeBucket("report");
|
||||||
|
logger.info("Created MinIO bucket: report");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("Failed to create report bucket", e);
|
||||||
|
}
|
||||||
|
|
||||||
List<RptInfoSetFile> filelist = this.rptInfoSetFileService.selectListByWhere(" where masterid='" + rptInfoSet.getId() + "' ");
|
List<RptInfoSetFile> filelist = this.rptInfoSetFileService.selectListByWhere(" where masterid='" + rptInfoSet.getId() + "' ");
|
||||||
String path = "";
|
String path = "";
|
||||||
try {
|
try {
|
||||||
@ -840,27 +861,37 @@ public class RptCreateServiceImpl implements RptCreateService {
|
|||||||
rptInfoSetFile.setAbspath(obj);
|
rptInfoSetFile.setAbspath(obj);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
System.out.println(e);
|
logger.error("Failed to get template file from MinIO", e);
|
||||||
|
}
|
||||||
|
if (filelist == null || filelist.size() == 0) {
|
||||||
|
logger.error("No template file configured for report: {}", rptInfoSet.getId());
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
if (filelist != null && filelist.size() > 0) {
|
if (filelist != null && filelist.size() > 0) {
|
||||||
// 设定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 template 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";
|
// 更新文件扩展名(根据模板文件)
|
||||||
|
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 +902,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 +914,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 +1021,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 +1057,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 +1086,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 +1122,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 +1162,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 +1314,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) {
|
||||||
@ -1369,6 +1397,10 @@ public class RptCreateServiceImpl implements RptCreateService {
|
|||||||
//删除文件 只保留minio中的文件
|
//删除文件 只保留minio中的文件
|
||||||
File file = new File(file3);//根据指定的文件名创建File对象
|
File file = new File(file3);//根据指定的文件名创建File对象
|
||||||
file.delete();
|
file.delete();
|
||||||
|
|
||||||
|
// 保存文件路径到数据库
|
||||||
|
rptCreate.setAbspath(showname + endtype);
|
||||||
|
rptCreateDao.updateByPrimaryKeySelective(rptCreate);
|
||||||
} catch (NoSuchAlgorithmException e) {
|
} catch (NoSuchAlgorithmException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@ -1907,4 +1939,54 @@ public class RptCreateServiceImpl implements RptCreateService {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查用户是否有报表生成权限
|
||||||
|
* @param rptInfoSetId 报表配置id
|
||||||
|
* @param user 当前用户
|
||||||
|
* @return true=有权限, false=无权限
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean checkGeneratePermission(String rptInfoSetId, User user) {
|
||||||
|
if (user == null || rptInfoSetId == null || rptInfoSetId.isEmpty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 管理员默认有权限
|
||||||
|
if ("emp01".equals(user.getId())) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取报表配置信息
|
||||||
|
RptInfoSet rptInfoSet = rptInfoSetService.selectById4Simple(rptInfoSetId);
|
||||||
|
if (rptInfoSet == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
String userId = user.getId();
|
||||||
|
|
||||||
|
// 检查用户是否在createusers列表中
|
||||||
|
String createusers = rptInfoSet.getCreateusers();
|
||||||
|
if (createusers != null && !createusers.isEmpty()) {
|
||||||
|
if (createusers.contains(userId)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查用户岗位是否在generate_position列表中
|
||||||
|
String generatePosition = rptInfoSet.getGeneratePosition();
|
||||||
|
if (generatePosition != null && !generatePosition.isEmpty()) {
|
||||||
|
// 获取用户的所有岗位
|
||||||
|
List<UserJob> userJobs = userJobService.selectListByWhere(" where userid='" + userId + "'");
|
||||||
|
if (userJobs != null && !userJobs.isEmpty()) {
|
||||||
|
for (UserJob userJob : userJobs) {
|
||||||
|
if (generatePosition.contains(userJob.getJobid())) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import com.sipai.entity.scada.MPoint;
|
|||||||
import com.sipai.entity.scada.MPointExpand;
|
import com.sipai.entity.scada.MPointExpand;
|
||||||
import com.sipai.entity.scada.MPointHistory;
|
import com.sipai.entity.scada.MPointHistory;
|
||||||
import com.sipai.entity.user.User;
|
import com.sipai.entity.user.User;
|
||||||
|
import com.sipai.entity.user.UserJob;
|
||||||
import com.sipai.service.msg.MsgService;
|
import com.sipai.service.msg.MsgService;
|
||||||
import com.sipai.service.msg.MsgServiceImpl;
|
import com.sipai.service.msg.MsgServiceImpl;
|
||||||
import com.sipai.service.msg.MsgTypeService;
|
import com.sipai.service.msg.MsgTypeService;
|
||||||
@ -20,6 +21,7 @@ import com.sipai.service.scada.MPointExpandService;
|
|||||||
import com.sipai.service.scada.MPointHistoryService;
|
import com.sipai.service.scada.MPointHistoryService;
|
||||||
import com.sipai.service.scada.MPointService;
|
import com.sipai.service.scada.MPointService;
|
||||||
import com.sipai.service.user.UserService;
|
import com.sipai.service.user.UserService;
|
||||||
|
import com.sipai.service.user.UserJobService;
|
||||||
import com.sipai.tools.CommUtil;
|
import com.sipai.tools.CommUtil;
|
||||||
import com.sipai.tools.SpringContextUtil;
|
import com.sipai.tools.SpringContextUtil;
|
||||||
import net.sf.json.JSONArray;
|
import net.sf.json.JSONArray;
|
||||||
@ -65,6 +67,8 @@ public class RptDayLogServiceImpl implements RptDayLogService {
|
|||||||
private MsgTypeService msgtypeService;
|
private MsgTypeService msgtypeService;
|
||||||
@Resource
|
@Resource
|
||||||
private MPointExpandService mPointExpandService;
|
private MPointExpandService mPointExpandService;
|
||||||
|
@Resource
|
||||||
|
private UserJobService userJobService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public RptDayLog selectById(String id) {
|
public RptDayLog selectById(String id) {
|
||||||
@ -878,4 +882,68 @@ public class RptDayLogServiceImpl implements RptDayLogService {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean checkInputPermission(String rptdeptId, User user) {
|
||||||
|
if (rptdeptId == null || user == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
RptDeptSet rptDeptSet = this.rptDeptSetService.selectById(rptdeptId);
|
||||||
|
if (rptDeptSet == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
Integer roleType = rptDeptSet.getRoleType();
|
||||||
|
String inputuser = rptDeptSet.getInputuser();
|
||||||
|
String inputjob = rptDeptSet.getInputjob();
|
||||||
|
String userId = user.getId();
|
||||||
|
|
||||||
|
// role_type=2: 不控制权限,所有人都可以填报
|
||||||
|
if (roleType != null && roleType == 2) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// role_type 为 null 或空字符串: 允许所有人
|
||||||
|
if (roleType == null || roleType == 0 && (inputuser == null || inputuser.isEmpty())
|
||||||
|
|| roleType == 1 && (inputjob == null || inputjob.isEmpty())) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// role_type=0: 按用户控制权限
|
||||||
|
if (roleType == 0) {
|
||||||
|
if (inputuser != null && !inputuser.isEmpty()) {
|
||||||
|
// 检查当前用户ID是否在inputuser中
|
||||||
|
String[] userIds = inputuser.split(",");
|
||||||
|
for (String uid : userIds) {
|
||||||
|
if (userId.equals(uid.trim())) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// role_type=1: 按岗位控制权限
|
||||||
|
if (roleType == 1) {
|
||||||
|
if (inputjob != null && !inputjob.isEmpty()) {
|
||||||
|
// 获取当前用户的所有岗位
|
||||||
|
List<UserJob> userJobs = this.userJobService.selectListByWhere("where userid = '" + userId + "'");
|
||||||
|
if (userJobs != null && !userJobs.isEmpty()) {
|
||||||
|
String[] jobIds = inputjob.split(",");
|
||||||
|
for (UserJob userJob : userJobs) {
|
||||||
|
String userJobId = userJob.getJobid();
|
||||||
|
for (String jobId : jobIds) {
|
||||||
|
if (userJobId != null && userJobId.equals(jobId.trim())) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -47,12 +47,22 @@ public class SafetyCheckActivityService {
|
|||||||
if (processDefinitions == null || processDefinitions.size() == 0) {
|
if (processDefinitions == null || processDefinitions.size() == 0) {
|
||||||
return Result.failed(company.getName() + "缺少该流程定义。");
|
return Result.failed(company.getName() + "缺少该流程定义。");
|
||||||
}
|
}
|
||||||
|
// 防止重复发起:若该业务已有运行中的流程实例,则跳过,避免创建双倍待办任务
|
||||||
|
List<org.activiti.engine.runtime.ProcessInstance> existingInstances = workflowService.getRuntimeService()
|
||||||
|
.createProcessInstanceQuery()
|
||||||
|
.processDefinitionKey(processKey)
|
||||||
|
.processInstanceBusinessKey(bizId)
|
||||||
|
.active()
|
||||||
|
.list();
|
||||||
|
if (existingInstances != null && !existingInstances.isEmpty()) {
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
// 启动流程实例
|
// 启动流程实例
|
||||||
// 设置网关条件
|
// 设置网关条件
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
map.put(CommString.ACTI_KEK_Condition, 1);
|
map.put(CommString.ACTI_KEK_Condition, 1);
|
||||||
map.put(CommString.ACTI_KEK_Assignee, applyUserId);
|
map.put(CommString.ACTI_KEK_Assignee, applyUserId);
|
||||||
map.put(CommString.ACTI_KEK_Candidate_Users, applyUserId);
|
map.put(CommString.ACTI_KEK_Candidate_Users, "");
|
||||||
|
|
||||||
// 启动流程
|
// 启动流程
|
||||||
ProcessInstance processInstance = workflowService.startWorkflow(
|
ProcessInstance processInstance = workflowService.startWorkflow(
|
||||||
@ -71,7 +81,7 @@ public class SafetyCheckActivityService {
|
|||||||
Map<String, Object> map2 = new HashMap<>();
|
Map<String, Object> map2 = new HashMap<>();
|
||||||
map2.put(CommString.ACTI_KEK_Condition, 1);
|
map2.put(CommString.ACTI_KEK_Condition, 1);
|
||||||
map2.put(CommString.ACTI_KEK_Assignee, nextUserId);
|
map2.put(CommString.ACTI_KEK_Assignee, nextUserId);
|
||||||
map2.put(CommString.ACTI_KEK_Candidate_Users, nextUserId);
|
map2.put(CommString.ACTI_KEK_Candidate_Users, "");
|
||||||
workflowService.getTaskService().complete(task.getId(), map2);
|
workflowService.getTaskService().complete(task.getId(), map2);
|
||||||
|
|
||||||
return Result.success();
|
return Result.success();
|
||||||
@ -84,13 +94,16 @@ 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, "");
|
||||||
workflowService.getTaskService().complete(task.getId(), map);
|
// 只完成第一个任务,防止多任务场景下指数级创建待办(如因重复发起导致有多个并发任务时)
|
||||||
|
workflowService.getTaskService().complete(tasks.get(0).getId(), map);
|
||||||
return Result.success();
|
return Result.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -101,6 +101,9 @@ public class SafetyFilesService implements CommService<SafetyFiles> {
|
|||||||
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
||||||
List<MultipartFile> files = multipartRequest.getFiles("file");
|
List<MultipartFile> files = multipartRequest.getFiles("file");
|
||||||
for (MultipartFile mfile : files) {
|
for (MultipartFile mfile : files) {
|
||||||
|
if (mfile == null || mfile.getSize() == 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
String suffix = mfile.getOriginalFilename().substring(mfile.getOriginalFilename().lastIndexOf("."));
|
String suffix = mfile.getOriginalFilename().substring(mfile.getOriginalFilename().lastIndexOf("."));
|
||||||
|
|
||||||
//判断保存文件的路径是否存在
|
//判断保存文件的路径是否存在
|
||||||
|
|||||||
@ -100,44 +100,65 @@ public class SafetyFlowTaskService implements CommService<SafetyFlowTask> {
|
|||||||
String copyNames,
|
String copyNames,
|
||||||
String record) throws ServiceException {
|
String record) throws ServiceException {
|
||||||
|
|
||||||
SafetyFlowTask safetyFlowTask;
|
SafetyFlowTask safetyFlowTask = null;
|
||||||
List<SafetyFlowTask> list = selectListByWhere(" where biz_id='" + bizId + "' order by create_time desc");
|
List<SafetyFlowTask> list = selectListByWhere(" where biz_id='" + bizId + "' order by create_time desc");
|
||||||
if (list != null && list.size() != 0 && list.get(0).getTaskName().equals(taskTitle)) {
|
|
||||||
safetyFlowTask = list.get(0);
|
|
||||||
safetyFlowTask.setIsDone(true);
|
|
||||||
safetyFlowTask.setCopy(copyNames);
|
|
||||||
safetyFlowTask.setDoneTime(DateUtil.toStr(null, new Date()));
|
|
||||||
update(safetyFlowTask);
|
|
||||||
} else if (list != null && list.size() != 0 && !list.get(0).getTaskName().equals(taskTitle)) {
|
|
||||||
safetyFlowTask = list.get(0);
|
|
||||||
safetyFlowTask.setIsDone(true);
|
|
||||||
safetyFlowTask.setCopy(copyNames);
|
|
||||||
safetyFlowTask.setDoneTime(DateUtil.toStr(null, new Date()));
|
|
||||||
update(safetyFlowTask);
|
|
||||||
|
|
||||||
safetyFlowTask = new SafetyFlowTask();
|
// 查找是否已存在相同taskTitle的记录
|
||||||
|
SafetyFlowTask existingTask = null;
|
||||||
safetyFlowTask.setId(UUID.randomUUID().toString());
|
if (list != null && !list.isEmpty()) {
|
||||||
safetyFlowTask.setBizId(bizId);
|
for (SafetyFlowTask task : list) {
|
||||||
safetyFlowTask.setTaskName(taskTitle);
|
if (task.getTaskName().equals(taskTitle)) {
|
||||||
safetyFlowTask.setIsDone(isDone);
|
existingTask = task;
|
||||||
safetyFlowTask.setDoneTime(isDone ? DateUtil.toStr(null, new Date()) : null);
|
break;
|
||||||
safetyFlowTask.setAuditor(auditorName);
|
}
|
||||||
safetyFlowTask.setCopy(copyNames);
|
}
|
||||||
save(safetyFlowTask);
|
}
|
||||||
|
|
||||||
|
if (isDone) {
|
||||||
|
// 标记任务为完成
|
||||||
|
if (existingTask != null) {
|
||||||
|
// 更新已存在的记录
|
||||||
|
existingTask.setIsDone(true);
|
||||||
|
existingTask.setCopy(copyNames);
|
||||||
|
existingTask.setDoneTime(DateUtil.toStr(null, new Date()));
|
||||||
|
update(existingTask);
|
||||||
|
safetyFlowTask = existingTask;
|
||||||
} else {
|
} else {
|
||||||
|
// 创建新的完成记录
|
||||||
safetyFlowTask = new SafetyFlowTask();
|
safetyFlowTask = new SafetyFlowTask();
|
||||||
|
|
||||||
safetyFlowTask.setId(UUID.randomUUID().toString());
|
safetyFlowTask.setId(UUID.randomUUID().toString());
|
||||||
safetyFlowTask.setBizId(bizId);
|
safetyFlowTask.setBizId(bizId);
|
||||||
safetyFlowTask.setTaskName(taskTitle);
|
safetyFlowTask.setTaskName(taskTitle);
|
||||||
safetyFlowTask.setIsDone(isDone);
|
safetyFlowTask.setIsDone(true);
|
||||||
safetyFlowTask.setDoneTime(isDone ? DateUtil.toStr(null, new Date()) : null);
|
safetyFlowTask.setDoneTime(DateUtil.toStr(null, new Date()));
|
||||||
safetyFlowTask.setAuditor(auditorName);
|
safetyFlowTask.setAuditor(auditorName);
|
||||||
safetyFlowTask.setCopy(copyNames);
|
safetyFlowTask.setCopy(copyNames);
|
||||||
save(safetyFlowTask);
|
save(safetyFlowTask);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// 创建待处理任务
|
||||||
|
if (existingTask == null) {
|
||||||
|
// 不存在才创建
|
||||||
|
safetyFlowTask = new SafetyFlowTask();
|
||||||
|
safetyFlowTask.setId(UUID.randomUUID().toString());
|
||||||
|
safetyFlowTask.setBizId(bizId);
|
||||||
|
safetyFlowTask.setTaskName(taskTitle);
|
||||||
|
safetyFlowTask.setIsDone(false);
|
||||||
|
safetyFlowTask.setDoneTime(null);
|
||||||
|
safetyFlowTask.setAuditor(auditorName);
|
||||||
|
safetyFlowTask.setCopy(copyNames);
|
||||||
|
save(safetyFlowTask);
|
||||||
|
} else {
|
||||||
|
// 已存在,重置为待处理状态(用于流程回退后重新处理)
|
||||||
|
existingTask.setIsDone(false);
|
||||||
|
existingTask.setDoneTime(null);
|
||||||
|
existingTask.setAuditor(auditorName);
|
||||||
|
existingTask.setCopy(copyNames);
|
||||||
|
update(existingTask);
|
||||||
|
safetyFlowTask = existingTask;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (StringUtils.isNotEmpty(record)) {
|
if (StringUtils.isNotEmpty(record)) {
|
||||||
SafetyFlowTaskDetail safetyFlowTaskDetail = new SafetyFlowTaskDetail();
|
SafetyFlowTaskDetail safetyFlowTaskDetail = new SafetyFlowTaskDetail();
|
||||||
safetyFlowTaskDetail.setId(UUID.randomUUID().toString());
|
safetyFlowTaskDetail.setId(UUID.randomUUID().toString());
|
||||||
|
|||||||
@ -1474,7 +1474,7 @@ public class MPointService {
|
|||||||
if (DateUtil.isCellDateFormatted(cell)) {
|
if (DateUtil.isCellDateFormatted(cell)) {
|
||||||
//用于转化为日期格式
|
//用于转化为日期格式
|
||||||
Date d = cell.getDateCellValue();
|
Date d = cell.getDateCellValue();
|
||||||
SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
|
SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
String cellDate = formater.format(d);
|
String cellDate = formater.format(d);
|
||||||
return cellDate;
|
return cellDate;
|
||||||
} else {
|
} else {
|
||||||
@ -1510,7 +1510,7 @@ public class MPointService {
|
|||||||
if (DateUtil.isCellDateFormatted(cell)) {
|
if (DateUtil.isCellDateFormatted(cell)) {
|
||||||
//用于转化为日期格式
|
//用于转化为日期格式
|
||||||
Date d = cell.getDateCellValue();
|
Date d = cell.getDateCellValue();
|
||||||
SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
|
SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
String cellDate = formater.format(d);
|
String cellDate = formater.format(d);
|
||||||
return cellDate;
|
return cellDate;
|
||||||
} else {
|
} else {
|
||||||
@ -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();
|
||||||
|
|||||||
@ -132,6 +132,7 @@ public class PatrolContentsServiceImpl implements PatrolContentsService {
|
|||||||
jsonObject.put("id", list3.get(j).getId());
|
jsonObject.put("id", list3.get(j).getId());
|
||||||
jsonObject.put("name", list3.get(j).getContents());
|
jsonObject.put("name", list3.get(j).getContents());
|
||||||
jsonObject.put("text", list3.get(j).getContents());
|
jsonObject.put("text", list3.get(j).getContents());
|
||||||
|
jsonObject.put("contentsDetail", list3.get(j).getContentsDetail());
|
||||||
jsonObject.put("type", TimeEfficiencyCommStr.PatrolEquipment_Equipment);
|
jsonObject.put("type", TimeEfficiencyCommStr.PatrolEquipment_Equipment);
|
||||||
jsonObject.put("icon", TimeEfficiencyCommStr.PatrolContents);
|
jsonObject.put("icon", TimeEfficiencyCommStr.PatrolContents);
|
||||||
jsonArrayEqu.add(jsonObject);
|
jsonArrayEqu.add(jsonObject);
|
||||||
|
|||||||
@ -33,4 +33,13 @@ public interface JobService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
String getJobs4Activiti(String unitId, String type);
|
String getJobs4Activiti(String unitId, String type);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取流程指定节点岗位
|
||||||
|
* @param unitId 单位ID
|
||||||
|
* @param type ProcessType中的type
|
||||||
|
* @param resourceId 流程节点resourceId/taskDefinitionKey
|
||||||
|
* @return 逗号分隔的岗位ID
|
||||||
|
*/
|
||||||
|
String getJobs4Activiti(String unitId, String type, String resourceId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,6 +11,7 @@ import com.sipai.entity.user.User;
|
|||||||
import com.sipai.entity.user.UserJob;
|
import com.sipai.entity.user.UserJob;
|
||||||
import com.sipai.tools.CommUtil;
|
import com.sipai.tools.CommUtil;
|
||||||
import org.activiti.engine.RepositoryService;
|
import org.activiti.engine.RepositoryService;
|
||||||
|
import org.activiti.engine.repository.Model;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@ -156,16 +157,50 @@ public class JobServiceImpl implements JobService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getJobs4Activiti(String unitId, String type) {
|
public String getJobs4Activiti(String unitId, String type) {
|
||||||
|
return this.getJobs4Activiti(unitId, type, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getJobs4Activiti(String unitId, String type, String resourceId) {
|
||||||
|
Model model = this.findModel(unitId, type);
|
||||||
|
if (model == null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
return this.findJobIds(model.getId(), resourceId);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Model findModel(String unitId, String type) {
|
||||||
String sql = "select * from [ACT_RE_MODEL] where KEY_ like '%" + unitId + "%' and KEY_ = '" + type + "-" + unitId + "'";
|
String sql = "select * from [ACT_RE_MODEL] where KEY_ like '%" + unitId + "%' and KEY_ = '" + type + "-" + unitId + "'";
|
||||||
|
List<Model> listModel = repositoryService.createNativeModelQuery().sql(sql).list();
|
||||||
|
if (listModel != null && listModel.size() > 0) {
|
||||||
|
return listModel.get(0);
|
||||||
|
}
|
||||||
|
sql = "select * from [ACT_RE_MODEL] where KEY_ = '" + type + "'";
|
||||||
|
listModel = repositoryService.createNativeModelQuery().sql(sql).list();
|
||||||
|
if (listModel != null && listModel.size() > 0) {
|
||||||
|
return listModel.get(0);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String findJobIds(String modelId, String resourceId) {
|
||||||
String jobIds = "";
|
String jobIds = "";
|
||||||
List<org.activiti.engine.repository.Model> list_model = repositoryService.createNativeModelQuery().sql(sql).list();
|
String where = "where model_id = '" + modelId + "'";
|
||||||
if (list_model != null && list_model.size() > 0) {
|
if (resourceId != null && !resourceId.trim().isEmpty()) {
|
||||||
|
where += " and resource_id = '" + resourceId.trim() + "'";
|
||||||
|
}
|
||||||
ModelNodeJob modelNodeJob = new ModelNodeJob();
|
ModelNodeJob modelNodeJob = new ModelNodeJob();
|
||||||
modelNodeJob.setWhere("where model_id = '" + list_model.get(0).getId() + "'");
|
modelNodeJob.setWhere(where);
|
||||||
List<ModelNodeJob> list_model_node = modelNodeJobDao.selectListByWhere(modelNodeJob);
|
List<ModelNodeJob> listModelNode = modelNodeJobDao.selectListByWhere(modelNodeJob);
|
||||||
HashSet<String> hs = new HashSet<String>();
|
HashSet<String> exists = new HashSet<String>();
|
||||||
for (int i = 0; i < list_model_node.size(); i++) {
|
if (listModelNode != null) {
|
||||||
jobIds += "" + list_model_node.get(i).getJobId() + ",";
|
for (ModelNodeJob item : listModelNode) {
|
||||||
|
if (item == null || item.getJobId() == null || item.getJobId().trim().isEmpty()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (exists.add(item.getJobId())) {
|
||||||
|
jobIds += item.getJobId() + ",";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return jobIds;
|
return jobIds;
|
||||||
|
|||||||
138
src/main/resources/diagrams/leave/Administration_Leave.bpmn
Normal file
138
src/main/resources/diagrams/leave/Administration_Leave.bpmn
Normal file
@ -0,0 +1,138 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xmlns:activiti="http://activiti.org/bpmn"
|
||||||
|
xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
|
||||||
|
xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC"
|
||||||
|
xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI"
|
||||||
|
targetNamespace="http://com.sipai.activiti">
|
||||||
|
<process id="Administration_Leave" name="请假补假流程" isExecutable="true">
|
||||||
|
<documentation>请假补假流程</documentation>
|
||||||
|
<startEvent id="startevent1" name="Start" activiti:initiator="applyUserId"/>
|
||||||
|
|
||||||
|
<userTask id="sectionChiefAudit" name="科长/副科长审批" activiti:candidateUsers="#{userIds}">
|
||||||
|
<documentation>leave_apply_section_audit</documentation>
|
||||||
|
</userTask>
|
||||||
|
<exclusiveGateway id="gatewaySection" name="科长审批判断"/>
|
||||||
|
|
||||||
|
<userTask id="managerAudit" name="分管经理审批" activiti:candidateUsers="#{userIds}">
|
||||||
|
<documentation>leave_apply_manager_audit</documentation>
|
||||||
|
</userTask>
|
||||||
|
<exclusiveGateway id="gatewayManager" name="分管经理审批判断"/>
|
||||||
|
|
||||||
|
<userTask id="generalManagerAudit" name="总经理审批" activiti:candidateUsers="#{userIds}">
|
||||||
|
<documentation>leave_apply_general_manager_audit</documentation>
|
||||||
|
</userTask>
|
||||||
|
<exclusiveGateway id="gatewayGeneralManager" name="总经理审批判断"/>
|
||||||
|
|
||||||
|
<userTask id="modifyApply" name="退回修改" activiti:assignee="${applicantId}">
|
||||||
|
<documentation>leave_apply_handle</documentation>
|
||||||
|
</userTask>
|
||||||
|
|
||||||
|
<endEvent id="endevent1" name="End"/>
|
||||||
|
|
||||||
|
<sequenceFlow id="flow1" sourceRef="startevent1" targetRef="sectionChiefAudit"/>
|
||||||
|
<sequenceFlow id="flow2" sourceRef="sectionChiefAudit" targetRef="gatewaySection"/>
|
||||||
|
<sequenceFlow id="flow3" name="通过" sourceRef="gatewaySection" targetRef="managerAudit">
|
||||||
|
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${pass && route==1}]]></conditionExpression>
|
||||||
|
</sequenceFlow>
|
||||||
|
<sequenceFlow id="flow4" name="驳回" sourceRef="gatewaySection" targetRef="modifyApply">
|
||||||
|
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${!pass && route==0}]]></conditionExpression>
|
||||||
|
</sequenceFlow>
|
||||||
|
<sequenceFlow id="flow5" sourceRef="managerAudit" targetRef="gatewayManager"/>
|
||||||
|
<sequenceFlow id="flow6" name="通过" sourceRef="gatewayManager" targetRef="generalManagerAudit">
|
||||||
|
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${pass && route==1}]]></conditionExpression>
|
||||||
|
</sequenceFlow>
|
||||||
|
<sequenceFlow id="flow7" name="驳回" sourceRef="gatewayManager" targetRef="modifyApply">
|
||||||
|
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${!pass && route==0}]]></conditionExpression>
|
||||||
|
</sequenceFlow>
|
||||||
|
<sequenceFlow id="flow8" sourceRef="modifyApply" targetRef="sectionChiefAudit"/>
|
||||||
|
<sequenceFlow id="flow9" sourceRef="generalManagerAudit" targetRef="gatewayGeneralManager"/>
|
||||||
|
<sequenceFlow id="flow10" name="通过" sourceRef="gatewayGeneralManager" targetRef="endevent1">
|
||||||
|
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${pass && route==1}]]></conditionExpression>
|
||||||
|
</sequenceFlow>
|
||||||
|
<sequenceFlow id="flow11" name="驳回" sourceRef="gatewayGeneralManager" targetRef="modifyApply">
|
||||||
|
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${!pass && route==0}]]></conditionExpression>
|
||||||
|
</sequenceFlow>
|
||||||
|
</process>
|
||||||
|
|
||||||
|
<bpmndi:BPMNDiagram id="BPMNDiagram_Administration_Leave">
|
||||||
|
<bpmndi:BPMNPlane bpmnElement="Administration_Leave" id="BPMNPlane_Administration_Leave">
|
||||||
|
<bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
|
||||||
|
<omgdc:Bounds height="35.0" width="35.0" x="40.0" y="110.0"/>
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
<bpmndi:BPMNShape bpmnElement="sectionChiefAudit" id="BPMNShape_sectionChiefAudit">
|
||||||
|
<omgdc:Bounds height="55.0" width="120.0" x="110.0" y="100.0"/>
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
<bpmndi:BPMNShape bpmnElement="gatewaySection" id="BPMNShape_gatewaySection">
|
||||||
|
<omgdc:Bounds height="40.0" width="40.0" x="265.0" y="108.0"/>
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
<bpmndi:BPMNShape bpmnElement="managerAudit" id="BPMNShape_managerAudit">
|
||||||
|
<omgdc:Bounds height="55.0" width="100.0" x="350.0" y="100.0"/>
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
<bpmndi:BPMNShape bpmnElement="gatewayManager" id="BPMNShape_gatewayManager">
|
||||||
|
<omgdc:Bounds height="40.0" width="40.0" x="485.0" y="108.0"/>
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
<bpmndi:BPMNShape bpmnElement="generalManagerAudit" id="BPMNShape_generalManagerAudit">
|
||||||
|
<omgdc:Bounds height="55.0" width="100.0" x="560.0" y="100.0"/>
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
<bpmndi:BPMNShape bpmnElement="gatewayGeneralManager" id="BPMNShape_gatewayGeneralManager">
|
||||||
|
<omgdc:Bounds height="40.0" width="40.0" x="695.0" y="108.0"/>
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
<bpmndi:BPMNShape bpmnElement="modifyApply" id="BPMNShape_modifyApply">
|
||||||
|
<omgdc:Bounds height="55.0" width="100.0" x="430.0" y="220.0"/>
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
<bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
|
||||||
|
<omgdc:Bounds height="35.0" width="35.0" x="800.0" y="110.0"/>
|
||||||
|
</bpmndi:BPMNShape>
|
||||||
|
<bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
|
||||||
|
<omgdi:waypoint x="75.0" y="127.0"/>
|
||||||
|
<omgdi:waypoint x="110.0" y="127.0"/>
|
||||||
|
</bpmndi:BPMNEdge>
|
||||||
|
<bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
|
||||||
|
<omgdi:waypoint x="230.0" y="127.0"/>
|
||||||
|
<omgdi:waypoint x="265.0" y="128.0"/>
|
||||||
|
</bpmndi:BPMNEdge>
|
||||||
|
<bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
|
||||||
|
<omgdi:waypoint x="305.0" y="128.0"/>
|
||||||
|
<omgdi:waypoint x="350.0" y="127.0"/>
|
||||||
|
</bpmndi:BPMNEdge>
|
||||||
|
<bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
|
||||||
|
<omgdi:waypoint x="285.0" y="148.0"/>
|
||||||
|
<omgdi:waypoint x="285.0" y="247.0"/>
|
||||||
|
<omgdi:waypoint x="430.0" y="247.0"/>
|
||||||
|
</bpmndi:BPMNEdge>
|
||||||
|
<bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
|
||||||
|
<omgdi:waypoint x="450.0" y="127.0"/>
|
||||||
|
<omgdi:waypoint x="485.0" y="128.0"/>
|
||||||
|
</bpmndi:BPMNEdge>
|
||||||
|
<bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
|
||||||
|
<omgdi:waypoint x="525.0" y="128.0"/>
|
||||||
|
<omgdi:waypoint x="560.0" y="127.0"/>
|
||||||
|
</bpmndi:BPMNEdge>
|
||||||
|
<bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7">
|
||||||
|
<omgdi:waypoint x="505.0" y="148.0"/>
|
||||||
|
<omgdi:waypoint x="505.0" y="247.0"/>
|
||||||
|
<omgdi:waypoint x="530.0" y="247.0"/>
|
||||||
|
</bpmndi:BPMNEdge>
|
||||||
|
<bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8">
|
||||||
|
<omgdi:waypoint x="430.0" y="247.0"/>
|
||||||
|
<omgdi:waypoint x="170.0" y="247.0"/>
|
||||||
|
<omgdi:waypoint x="170.0" y="155.0"/>
|
||||||
|
</bpmndi:BPMNEdge>
|
||||||
|
<bpmndi:BPMNEdge bpmnElement="flow9" id="BPMNEdge_flow9">
|
||||||
|
<omgdi:waypoint x="660.0" y="127.0"/>
|
||||||
|
<omgdi:waypoint x="695.0" y="128.0"/>
|
||||||
|
</bpmndi:BPMNEdge>
|
||||||
|
<bpmndi:BPMNEdge bpmnElement="flow10" id="BPMNEdge_flow10">
|
||||||
|
<omgdi:waypoint x="735.0" y="128.0"/>
|
||||||
|
<omgdi:waypoint x="800.0" y="127.0"/>
|
||||||
|
</bpmndi:BPMNEdge>
|
||||||
|
<bpmndi:BPMNEdge bpmnElement="flow11" id="BPMNEdge_flow11">
|
||||||
|
<omgdi:waypoint x="715.0" y="148.0"/>
|
||||||
|
<omgdi:waypoint x="715.0" y="247.0"/>
|
||||||
|
<omgdi:waypoint x="530.0" y="247.0"/>
|
||||||
|
</bpmndi:BPMNEdge>
|
||||||
|
</bpmndi:BPMNPlane>
|
||||||
|
</bpmndi:BPMNDiagram>
|
||||||
|
</definitions>
|
||||||
127
src/main/resources/sql/add_leave_apply_module.sql
Normal file
127
src/main/resources/sql/add_leave_apply_module.sql
Normal file
@ -0,0 +1,127 @@
|
|||||||
|
/*
|
||||||
|
请假补假模块初始化脚本
|
||||||
|
1) 建表 tb_administration_leave_apply
|
||||||
|
2) 注册流程节点 tb_business_unit
|
||||||
|
3) 增加菜单并授权 admin
|
||||||
|
*/
|
||||||
|
|
||||||
|
IF OBJECT_ID('dbo.tb_administration_leave_apply', 'U') IS NULL
|
||||||
|
BEGIN
|
||||||
|
CREATE TABLE dbo.tb_administration_leave_apply (
|
||||||
|
id varchar(50) NOT NULL PRIMARY KEY,
|
||||||
|
insdt datetime NULL,
|
||||||
|
insuser varchar(50) NULL,
|
||||||
|
upduser varchar(50) NULL,
|
||||||
|
upddt datetime NULL,
|
||||||
|
unit_id varchar(50) NULL,
|
||||||
|
apply_type varchar(20) NULL,
|
||||||
|
leave_type varchar(20) NULL,
|
||||||
|
start_time datetime NULL,
|
||||||
|
end_time datetime NULL,
|
||||||
|
hours decimal(10,2) NULL,
|
||||||
|
days decimal(10,2) NULL,
|
||||||
|
reason varchar(1000) NULL,
|
||||||
|
handover_desc varchar(1000) NULL,
|
||||||
|
attachment_ids varchar(1000) NULL,
|
||||||
|
overtime_ref_id varchar(50) NULL,
|
||||||
|
overtime_hours decimal(10,2) NULL,
|
||||||
|
actual_start_time datetime NULL,
|
||||||
|
actual_end_time datetime NULL,
|
||||||
|
state varchar(100) NULL,
|
||||||
|
audit_man_id varchar(max) NULL,
|
||||||
|
submission_time datetime NULL,
|
||||||
|
processid varchar(100) NULL,
|
||||||
|
processdefid varchar(100) NULL,
|
||||||
|
remark varchar(1000) NULL,
|
||||||
|
del_flag char(1) NULL DEFAULT '0'
|
||||||
|
);
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
IF OBJECT_ID('dbo.tb_administration_leave_apply', 'U') IS NOT NULL
|
||||||
|
AND EXISTS (
|
||||||
|
SELECT 1
|
||||||
|
FROM sys.columns
|
||||||
|
WHERE object_id = OBJECT_ID('dbo.tb_administration_leave_apply')
|
||||||
|
AND name = 'audit_man_id'
|
||||||
|
AND max_length <> -1
|
||||||
|
)
|
||||||
|
BEGIN
|
||||||
|
ALTER TABLE dbo.tb_administration_leave_apply
|
||||||
|
ALTER COLUMN audit_man_id varchar(max) NULL;
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
IF NOT EXISTS (SELECT 1 FROM tb_business_unit WHERE id = 'leave_apply_section_audit')
|
||||||
|
BEGIN
|
||||||
|
INSERT INTO tb_business_unit (id, name, process_type_id, insdt, insuser, active, url, modal_id)
|
||||||
|
VALUES ('leave_apply_section_audit', N'请假补假-科长/副科长审批', 'Administration_Leave', GETDATE(), 'emp01', '1',
|
||||||
|
'administration/leaveApply/showAudit.do', 'subModal');
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
IF NOT EXISTS (SELECT 1 FROM tb_business_unit WHERE id = 'leave_apply_manager_audit')
|
||||||
|
BEGIN
|
||||||
|
INSERT INTO tb_business_unit (id, name, process_type_id, insdt, insuser, active, url, modal_id)
|
||||||
|
VALUES ('leave_apply_manager_audit', N'请假补假-分管经理审批', 'Administration_Leave', GETDATE(), 'emp01', '1',
|
||||||
|
'administration/leaveApply/showAudit.do', 'subModal');
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
IF NOT EXISTS (SELECT 1 FROM tb_business_unit WHERE id = 'leave_apply_general_manager_audit')
|
||||||
|
BEGIN
|
||||||
|
INSERT INTO tb_business_unit (id, name, process_type_id, insdt, insuser, active, url, modal_id)
|
||||||
|
VALUES ('leave_apply_general_manager_audit', N'请假补假-总经理审批', 'Administration_Leave', GETDATE(), 'emp01', '1',
|
||||||
|
'administration/leaveApply/showAudit.do', 'subModal');
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
IF NOT EXISTS (SELECT 1 FROM tb_business_unit WHERE id = 'leave_apply_handle')
|
||||||
|
BEGIN
|
||||||
|
INSERT INTO tb_business_unit (id, name, process_type_id, insdt, insuser, active, url, modal_id)
|
||||||
|
VALUES ('leave_apply_handle', N'请假补假-退回修改', 'Administration_Leave', GETDATE(), 'emp01', '1',
|
||||||
|
'administration/leaveApply/showHandle.do', 'subModal');
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
DECLARE @menuId VARCHAR(50) = 'leave_apply_menu_001';
|
||||||
|
DECLARE @menuName NVARCHAR(200) = N'请假补假申请';
|
||||||
|
DECLARE @menuLocation VARCHAR(1000) = 'administration/leaveApply/showList.do';
|
||||||
|
DECLARE @parentMenuId VARCHAR(50);
|
||||||
|
DECLARE @nextOrder INT;
|
||||||
|
|
||||||
|
SELECT TOP 1 @parentMenuId = id
|
||||||
|
FROM tb_menuitem
|
||||||
|
WHERE name IN (N'事项管理', N'行政管理')
|
||||||
|
AND type = 'menu'
|
||||||
|
ORDER BY morder;
|
||||||
|
|
||||||
|
IF @parentMenuId IS NULL
|
||||||
|
SET @parentMenuId = '-1';
|
||||||
|
|
||||||
|
SELECT @nextOrder = ISNULL(MAX(CAST(morder AS INT)), -1) + 1
|
||||||
|
FROM tb_menuitem
|
||||||
|
WHERE pid = @parentMenuId
|
||||||
|
AND type = 'menu';
|
||||||
|
|
||||||
|
IF NOT EXISTS (SELECT 1 FROM tb_menuitem WHERE id = @menuId OR location = @menuLocation)
|
||||||
|
BEGIN
|
||||||
|
INSERT INTO tb_menuitem (
|
||||||
|
id, pid, PowerID, caption, name, description, location, target, onclick, onmouseover, onmouseout,
|
||||||
|
image, altImage, tooltip, roles, page, width, height, forward, action, morder, lvl, active, type,
|
||||||
|
mainpage, count, engkey
|
||||||
|
)
|
||||||
|
VALUES (
|
||||||
|
@menuId, @parentMenuId, NULL, NULL, @menuName, NULL, @menuLocation, NULL, NULL, NULL, NULL,
|
||||||
|
'fa-calendar', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, @nextOrder, NULL, N'启用', 'menu',
|
||||||
|
NULL, NULL, NULL
|
||||||
|
);
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
IF OBJECT_ID('dbo.tb_role_menu', 'U') IS NOT NULL
|
||||||
|
AND NOT EXISTS (SELECT 1 FROM tb_role_menu WHERE roleID = 'rol0001' AND menuID = 'leave_apply_menu_001')
|
||||||
|
BEGIN
|
||||||
|
INSERT INTO tb_role_menu (roleID, menuID) VALUES ('rol0001', 'leave_apply_menu_001');
|
||||||
|
END
|
||||||
|
GO
|
||||||
14
src/main/resources/sql/upgrade_leave_apply_audit_man_id.sql
Normal file
14
src/main/resources/sql/upgrade_leave_apply_audit_man_id.sql
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
/*
|
||||||
|
请假补假流程审批人字段扩容脚本
|
||||||
|
场景:
|
||||||
|
1) audit_man_id 保存当前节点候选审批人 ID 列表
|
||||||
|
2) 组织下候选人员较多时,原 varchar(250/500) 可能被截断
|
||||||
|
*/
|
||||||
|
|
||||||
|
IF OBJECT_ID('dbo.tb_administration_leave_apply', 'U') IS NOT NULL
|
||||||
|
AND COL_LENGTH('dbo.tb_administration_leave_apply', 'audit_man_id') IS NOT NULL
|
||||||
|
BEGIN
|
||||||
|
ALTER TABLE dbo.tb_administration_leave_apply
|
||||||
|
ALTER COLUMN audit_man_id varchar(max) NULL;
|
||||||
|
END
|
||||||
|
GO
|
||||||
BIN
src/main/webapp/IMG/loginbp.png
Normal file
BIN
src/main/webapp/IMG/loginbp.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 72 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 80 KiB |
BIN
src/main/webapp/IMG/logo1.png
Normal file
BIN
src/main/webapp/IMG/logo1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 82 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 28 MiB After Width: | Height: | Size: 21 MiB |
@ -346,6 +346,10 @@ var processSelectNodeForHandle = function(taskId){
|
|||||||
//选择下一节点,先选择审核结果,再选择节点
|
//选择下一节点,先选择审核结果,再选择节点
|
||||||
$.post(ext.contextPath + "/activiti/workflow/getRoutesForSelect2.do", {taskId:taskId,passFlag:passFlag}, function(data) {
|
$.post(ext.contextPath + "/activiti/workflow/getRoutesForSelect2.do", {taskId:taskId,passFlag:passFlag}, function(data) {
|
||||||
$("#routeNum").empty();
|
$("#routeNum").empty();
|
||||||
|
if (!data || data.length === 0) {
|
||||||
|
console.warn('getRoutesForSelect2: no routes found for passFlag=' + passFlag);
|
||||||
|
return;
|
||||||
|
}
|
||||||
var selelct = $("#routeNum").select2({
|
var selelct = $("#routeNum").select2({
|
||||||
data: data,
|
data: data,
|
||||||
placeholder:'请先选择审核结果',//默认文字提示
|
placeholder:'请先选择审核结果',//默认文字提示
|
||||||
@ -374,6 +378,10 @@ var processSelectNodeForHandle = function(taskId){
|
|||||||
})
|
})
|
||||||
selectResult.val('').trigger("change");
|
selectResult.val('').trigger("change");
|
||||||
$.post(ext.contextPath + "/activiti/workflow/getRoutesForSelect2.do", {taskId:taskId,passFlag:true}, function(data) {
|
$.post(ext.contextPath + "/activiti/workflow/getRoutesForSelect2.do", {taskId:taskId,passFlag:true}, function(data) {
|
||||||
|
if (!data || data.length === 0) {
|
||||||
|
console.warn('getRoutesForSelect2: no routes found for passFlag=true');
|
||||||
|
return;
|
||||||
|
}
|
||||||
var selelct = $("#routeNum").select2({
|
var selelct = $("#routeNum").select2({
|
||||||
data: data,
|
data: data,
|
||||||
placeholder:'请先选择审核结果',//默认文字提示
|
placeholder:'请先选择审核结果',//默认文字提示
|
||||||
|
|||||||
@ -870,7 +870,7 @@ function openModal(modalId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1060,6 +1060,12 @@ $(function () {
|
|||||||
});
|
});
|
||||||
//FastClick.attach(document.body);
|
//FastClick.attach(document.body);
|
||||||
|
|
||||||
|
// 解决嵌套模态框中输入框无法获得焦点的问题
|
||||||
|
// 禁用Bootstrap模态框的enforceFocus,允许嵌套模态框中的输入框正常工作
|
||||||
|
if ($.fn.modal && $.fn.modal.Constructor) {
|
||||||
|
$.fn.modal.Constructor.prototype.enforceFocus = function() {};
|
||||||
|
}
|
||||||
|
|
||||||
//弹窗关闭触发方法
|
//弹窗关闭触发方法
|
||||||
/*$(".modal").on("hidden.bs.modal", function() {
|
/*$(".modal").on("hidden.bs.modal", function() {
|
||||||
$('.modal').css("overflow","auto");
|
$('.modal').css("overflow","auto");
|
||||||
|
|||||||
@ -116,8 +116,11 @@ var getFileListMinioPic = function (divId, status, entityId, previews, previewCo
|
|||||||
tbName: tbName,
|
tbName: tbName,
|
||||||
bucketName: bucketName
|
bucketName: bucketName
|
||||||
}, function (data) {
|
}, function (data) {
|
||||||
|
// 清空数组而不是重新赋值,这样可以保持引用不变
|
||||||
|
previews.length = 0;
|
||||||
|
previewConfigs.length = 0;
|
||||||
|
|
||||||
if (data.length > 0) {
|
if (data.length > 0) {
|
||||||
previews = new Array();
|
|
||||||
$('#maintenancefile').show();
|
$('#maintenancefile').show();
|
||||||
for (var i = 0; i < data.length; i++) {
|
for (var i = 0; i < data.length; i++) {
|
||||||
var previewConfig = new Object();
|
var previewConfig = new Object();
|
||||||
@ -133,10 +136,9 @@ var getFileListMinioPic = function (divId, status, entityId, previews, previewCo
|
|||||||
}
|
}
|
||||||
previewConfigs.push(previewConfig);
|
previewConfigs.push(previewConfig);
|
||||||
}
|
}
|
||||||
showFileInput_new(divId, previews, previewConfigs);
|
|
||||||
} else {
|
|
||||||
$('#' + divId).hide();
|
|
||||||
}
|
}
|
||||||
|
// 无论是否有数据都重新初始化控件
|
||||||
|
showFileInput_new(divId, previews, previewConfigs);
|
||||||
}, 'json');
|
}, 'json');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
//金山项目首页
|
//金山项目首页
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取点位实时值
|
* 获取点位实时值
|
||||||
* @param unitId
|
* @param unitId
|
||||||
@ -8,30 +7,64 @@
|
|||||||
* @param valueId
|
* @param valueId
|
||||||
* @param textId
|
* @param textId
|
||||||
*/
|
*/
|
||||||
function getValue(unitId, mpointCode, valueId, textId) {
|
function getValue4Es(unitId, mpointCode, valueId, textId) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'GET',
|
type: "GET",
|
||||||
url: ext.contextPath + '/work/mpoint/getValue4Es.do?unitId=' + unitId + '&mpointCode=' + mpointCode,
|
url:
|
||||||
|
ext.contextPath +
|
||||||
|
"/work/mpoint/getValue4Es.do?unitId=" +
|
||||||
|
unitId +
|
||||||
|
"&mpointCode=" +
|
||||||
|
mpointCode,
|
||||||
async: true,
|
async: true,
|
||||||
globle: false,
|
globle: false,
|
||||||
error: function () {
|
error: function () {
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
if (data != null && data != '') {
|
if (data != null && data != "") {
|
||||||
var data = eval('(' + data + ')');
|
var data = eval("(" + data + ")");
|
||||||
//只限制上限为0.8 下限根据设定值自己设
|
//只限制上限为0.8 下限根据设定值自己设
|
||||||
// var maxvalue = data.alarmmax/0.8;
|
// var maxvalue = data.alarmmax/0.8;
|
||||||
// var minvalue = data.alarmmin/maxvalue;
|
// var minvalue = data.alarmmin/maxvalue;
|
||||||
// var acvalue = data.parmvalue/maxvalue*100;
|
// var acvalue = data.parmvalue/maxvalue*100;
|
||||||
$('#' + valueId).html(data.parmvalue);//赋值
|
$("#" + valueId).html(data.parmvalue); //赋值
|
||||||
if (data.unit == undefined) {
|
if (data.unit == undefined) {
|
||||||
$('#' + textId).html(data.parmname);//赋值名称
|
$("#" + textId).html(data.parmname); //赋值名称
|
||||||
} else {
|
} else {
|
||||||
$('#' + textId).html(data.parmname + ' (' + data.unit + ')');//赋值名称+单位
|
$("#" + textId).html(data.parmname + " (" + data.unit + ")"); //赋值名称+单位
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function getValue(unitId, mpointCode, valueId, textId) {
|
||||||
|
$.ajax({
|
||||||
|
type: "GET",
|
||||||
|
url:
|
||||||
|
ext.contextPath +
|
||||||
|
"/work/mpoint/getValue.do?unitId=" +
|
||||||
|
unitId +
|
||||||
|
"&mpointCode=" +
|
||||||
|
mpointCode,
|
||||||
|
async: true,
|
||||||
|
globle: false,
|
||||||
|
error: function () {
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
success: function (data) {
|
||||||
|
if (data != null && data != "") {
|
||||||
|
var data = eval("(" + data + ")");
|
||||||
|
console.log(data);
|
||||||
|
$("#" + valueId).html(data.parmvalue); //赋值
|
||||||
|
if (data.unit == undefined) {
|
||||||
|
$("#" + textId).html(data.parmname); //赋值名称
|
||||||
|
} else {
|
||||||
|
$("#" + textId).html(data.parmname + " (" + data.unit + ")"); //赋值名称+单位
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -41,19 +74,24 @@ function getValue(unitId, mpointCode, valueId, textId) {
|
|||||||
function echartPie(unitId, mpointCode, echartId, textId) {
|
function echartPie(unitId, mpointCode, echartId, textId) {
|
||||||
var myChart = echarts.init(document.getElementById(echartId));
|
var myChart = echarts.init(document.getElementById(echartId));
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'GET',
|
type: "GET",
|
||||||
url: ext.contextPath + '/work/mpoint/getValue4Es.do?unitId=' + unitId + '&mpointCode=' + mpointCode,
|
url:
|
||||||
|
ext.contextPath +
|
||||||
|
"/work/mpoint/getValue4Es.do?unitId=" +
|
||||||
|
unitId +
|
||||||
|
"&mpointCode=" +
|
||||||
|
mpointCode,
|
||||||
async: true,
|
async: true,
|
||||||
globle: false,
|
globle: false,
|
||||||
error: function () {
|
error: function () {
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
if (data != null && data != '') {
|
if (data != null && data != "") {
|
||||||
var echart_minvalue = 0.2;
|
var echart_minvalue = 0.2;
|
||||||
var echart_maxvalue = 0.8;
|
var echart_maxvalue = 0.8;
|
||||||
|
|
||||||
var data = eval('(' + data + ')');
|
var data = eval("(" + data + ")");
|
||||||
//180度的上限
|
//180度的上限
|
||||||
var maxvalue_20 = data.alarmmax * 1.2;
|
var maxvalue_20 = data.alarmmax * 1.2;
|
||||||
//0度的下限
|
//0度的下限
|
||||||
@ -63,7 +101,7 @@ function echartPie(unitId, mpointCode, echartId, textId) {
|
|||||||
var minvalue = data.alarmmin;
|
var minvalue = data.alarmmin;
|
||||||
|
|
||||||
//判断是否需要下限
|
//判断是否需要下限
|
||||||
if (data.alarmmin == null || data.alarmmin == '') {
|
if (data.alarmmin == null || data.alarmmin == "") {
|
||||||
minvalue_20 = 0;
|
minvalue_20 = 0;
|
||||||
minvalue = 0;
|
minvalue = 0;
|
||||||
echart_minvalue = 0;
|
echart_minvalue = 0;
|
||||||
@ -71,12 +109,12 @@ function echartPie(unitId, mpointCode, echartId, textId) {
|
|||||||
|
|
||||||
var parmvalue = data.parmvalue;
|
var parmvalue = data.parmvalue;
|
||||||
var rate = 0;
|
var rate = 0;
|
||||||
var unit = '';
|
var unit = "";
|
||||||
|
|
||||||
$('#' + textId).html(data.parmname);
|
$("#" + textId).html(data.parmname);
|
||||||
|
|
||||||
if (data.unit != undefined && data.unit != null && data.unit != '') {
|
if (data.unit != undefined && data.unit != null && data.unit != "") {
|
||||||
unit = '(' + data.unit + ')';
|
unit = "(" + data.unit + ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
//计算实际值比例
|
//计算实际值比例
|
||||||
@ -87,7 +125,7 @@ function echartPie(unitId, mpointCode, echartId, textId) {
|
|||||||
minvalue = minvalue * 100;
|
minvalue = minvalue * 100;
|
||||||
maxvalue = maxvalue * 100;
|
maxvalue = maxvalue * 100;
|
||||||
if (maxvalue != undefined && minvalue != undefined) {
|
if (maxvalue != undefined && minvalue != undefined) {
|
||||||
rate = parmvalue / (maxvalue_20 - minvalue_20) * 100;
|
rate = (parmvalue / (maxvalue_20 - minvalue_20)) * 100;
|
||||||
} else {
|
} else {
|
||||||
rate = parmvalue;
|
rate = parmvalue;
|
||||||
}
|
}
|
||||||
@ -103,52 +141,92 @@ function echartPie(unitId, mpointCode, echartId, textId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//计算颜色
|
//计算颜色
|
||||||
var colorStr = '#6C6C6C';
|
var colorStr = "#6C6C6C";
|
||||||
if (parmvalue < minvalue) {
|
if (parmvalue < minvalue) {
|
||||||
colorStr = '#6C6C6C';
|
colorStr = "#6C6C6C";
|
||||||
} else if (parmvalue > maxvalue) {
|
} else if (parmvalue > maxvalue) {
|
||||||
colorStr = '#f35a4a';
|
colorStr = "#f35a4a";
|
||||||
} else {
|
} else {
|
||||||
colorStr = '#66d99f';
|
colorStr = "#66d99f";
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(data.parmname + '扩大下限:' + minvalue_20 + '------扩大上限:' + maxvalue_20 + '------实际比率:' + rate + '------实际值:' + parmvalue + '------实际下限:' + minvalue + '------实际上限:' + maxvalue);
|
console.log(
|
||||||
|
data.parmname +
|
||||||
|
"扩大下限:" +
|
||||||
|
minvalue_20 +
|
||||||
|
"------扩大上限:" +
|
||||||
|
maxvalue_20 +
|
||||||
|
"------实际比率:" +
|
||||||
|
rate +
|
||||||
|
"------实际值:" +
|
||||||
|
parmvalue +
|
||||||
|
"------实际下限:" +
|
||||||
|
minvalue +
|
||||||
|
"------实际上限:" +
|
||||||
|
maxvalue,
|
||||||
|
);
|
||||||
|
|
||||||
var option = {
|
var option = {
|
||||||
toolbox: { //可视化的工具箱
|
toolbox: {
|
||||||
show: false, feature: {
|
//可视化的工具箱
|
||||||
restore: { //重置
|
show: false,
|
||||||
show: true
|
feature: {
|
||||||
}, saveAsImage: {//保存图片
|
restore: {
|
||||||
show: true
|
//重置
|
||||||
}
|
show: true,
|
||||||
}
|
},
|
||||||
}, series: [{
|
saveAsImage: {
|
||||||
name: '业务指标', type: 'gauge', startAngle: 180, endAngle: 0, radius: 70, center: ['50%', '80%'],//设置饼图位置
|
//保存图片
|
||||||
|
show: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
name: "业务指标",
|
||||||
|
type: "gauge",
|
||||||
|
startAngle: 180,
|
||||||
|
endAngle: 0,
|
||||||
|
radius: 70,
|
||||||
|
center: ["50%", "80%"], //设置饼图位置
|
||||||
axisLine: {
|
axisLine: {
|
||||||
show: true, // 属性lineStyle控制线条样式
|
show: true, // 属性lineStyle控制线条样式
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
width: 15, // color: [[0.2, '#e2e2e2'], [0.8, '#66d99f'], [maxvalue, '#f35a4a']]
|
width: 15, // color: [[0.2, '#e2e2e2'], [0.8, '#66d99f'], [maxvalue, '#f35a4a']]
|
||||||
color: [[echart_minvalue, '#f35a4a'], [echart_maxvalue, '#66d99f'], [maxvalue_20, '#f35a4a']]
|
color: [
|
||||||
}
|
[echart_minvalue, "#f35a4a"],
|
||||||
}, splitLine: {
|
[echart_maxvalue, "#66d99f"],
|
||||||
|
[maxvalue_20, "#f35a4a"],
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
splitLine: {
|
||||||
show: false,
|
show: false,
|
||||||
}, axisTick: {
|
},
|
||||||
|
axisTick: {
|
||||||
show: false,
|
show: false,
|
||||||
}, axisLabel: {
|
},
|
||||||
|
axisLabel: {
|
||||||
show: false,
|
show: false,
|
||||||
}, pointer: {
|
},
|
||||||
length: '40px', width: '3px',
|
pointer: {
|
||||||
}, detail: {
|
length: "40px",
|
||||||
offsetCenter: [0, '20%'], fontSize: 14, color: colorStr, //formatter: data.parmname,
|
width: "3px",
|
||||||
formatter: data.parmvalue + unit//data.parmvalue为实际值 acvalue为计算后的比例
|
},
|
||||||
}, data: [{value: rate}]
|
detail: {
|
||||||
}]
|
offsetCenter: [0, "20%"],
|
||||||
|
fontSize: 14,
|
||||||
|
color: colorStr, //formatter: data.parmname,
|
||||||
|
formatter: data.parmvalue + unit, //data.parmvalue为实际值 acvalue为计算后的比例
|
||||||
|
},
|
||||||
|
data: [{ value: rate }],
|
||||||
|
},
|
||||||
|
],
|
||||||
};
|
};
|
||||||
myChart.setOption(option);
|
myChart.setOption(option);
|
||||||
myChart.resize();
|
myChart.resize();
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -159,42 +237,97 @@ function echartLine(unitId, mpointCode, echartId) {
|
|||||||
var myChart = echarts.init(document.getElementById(echartId));
|
var myChart = echarts.init(document.getElementById(echartId));
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'GET',
|
type: "GET",
|
||||||
url: ext.contextPath + '/work/mpoint/getValueMonth.do?unitId=' + unitId + '&mpointCode=' + mpointCode,
|
url:
|
||||||
|
ext.contextPath +
|
||||||
|
"/work/mpoint/getValueMonth.do?unitId=" +
|
||||||
|
unitId +
|
||||||
|
"&mpointCode=" +
|
||||||
|
mpointCode,
|
||||||
async: true,
|
async: true,
|
||||||
globle: false,
|
globle: false,
|
||||||
error: function () {
|
error: function () {
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
var data = eval('(' + data + ')');
|
var data = eval("(" + data + ")");
|
||||||
var option = {
|
var option = {
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis'
|
trigger: "axis",
|
||||||
}, title: [{
|
},
|
||||||
left: 'center', text: data.name
|
title: [
|
||||||
}], grid: {
|
{
|
||||||
left: '3%', right: '4%', bottom: '3%', containLabel: true
|
left: "center",
|
||||||
}, xAxis: {
|
text: data.name,
|
||||||
type: 'category',
|
},
|
||||||
|
],
|
||||||
|
grid: {
|
||||||
|
left: "3%",
|
||||||
|
right: "4%",
|
||||||
|
bottom: "3%",
|
||||||
|
containLabel: true,
|
||||||
|
},
|
||||||
|
xAxis: {
|
||||||
|
type: "category",
|
||||||
boundaryGap: false,
|
boundaryGap: false,
|
||||||
data: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31']
|
data: [
|
||||||
}, yAxis: {
|
"1",
|
||||||
type: 'value'
|
"2",
|
||||||
}, series: [{
|
"3",
|
||||||
name: '上限', type: 'line', // stack: '总量',
|
"4",
|
||||||
data: data.maxlist
|
"5",
|
||||||
}, {
|
"6",
|
||||||
name: '下限', type: 'line', // stack: '总量',
|
"7",
|
||||||
data: data.minlist
|
"8",
|
||||||
}, {
|
"9",
|
||||||
name: '实际值', type: 'line', // stack: '总量',
|
"10",
|
||||||
data: data.datalist
|
"11",
|
||||||
}]
|
"12",
|
||||||
|
"13",
|
||||||
|
"14",
|
||||||
|
"15",
|
||||||
|
"16",
|
||||||
|
"17",
|
||||||
|
"18",
|
||||||
|
"19",
|
||||||
|
"20",
|
||||||
|
"21",
|
||||||
|
"22",
|
||||||
|
"23",
|
||||||
|
"24",
|
||||||
|
"25",
|
||||||
|
"26",
|
||||||
|
"27",
|
||||||
|
"28",
|
||||||
|
"29",
|
||||||
|
"30",
|
||||||
|
"31",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
type: "value",
|
||||||
|
},
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
name: "上限",
|
||||||
|
type: "line", // stack: '总量',
|
||||||
|
data: data.maxlist,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "下限",
|
||||||
|
type: "line", // stack: '总量',
|
||||||
|
data: data.minlist,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "实际值",
|
||||||
|
type: "line", // stack: '总量',
|
||||||
|
data: data.datalist,
|
||||||
|
},
|
||||||
|
],
|
||||||
};
|
};
|
||||||
myChart.setOption(option);
|
myChart.setOption(option);
|
||||||
myChart.resize();
|
myChart.resize();
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -205,76 +338,381 @@ function echartColumnar(unitId, mpointCode, echartId) {
|
|||||||
var myChart = echarts.init(document.getElementById(echartId));
|
var myChart = echarts.init(document.getElementById(echartId));
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'GET',
|
type: "GET",
|
||||||
url: ext.contextPath + '/work/mpoint/getValueMonth.do?unitId=' + unitId + '&mpointCode=' + mpointCode,
|
url:
|
||||||
|
ext.contextPath +
|
||||||
|
"/work/mpoint/getValueMonth.do?unitId=" +
|
||||||
|
unitId +
|
||||||
|
"&mpointCode=" +
|
||||||
|
mpointCode,
|
||||||
async: true,
|
async: true,
|
||||||
globle: false,
|
globle: false,
|
||||||
error: function () {
|
error: function () {
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
var data = eval('(' + data + ')');
|
var data = eval("(" + data + ")");
|
||||||
var option = {
|
var option = {
|
||||||
color: '#62AEDF', tooltip: {
|
color: "#62AEDF",
|
||||||
trigger: 'axis', axisPointer: { // 坐标轴指示器,坐标轴触发有效
|
tooltip: {
|
||||||
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
|
trigger: "axis",
|
||||||
}
|
axisPointer: {
|
||||||
}, xAxis: {
|
// 坐标轴指示器,坐标轴触发有效
|
||||||
type: 'category',
|
type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
|
||||||
data: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31']
|
},
|
||||||
}, yAxis: {
|
},
|
||||||
type: 'value'
|
xAxis: {
|
||||||
}, title: [{
|
type: "category",
|
||||||
left: 'center', text: data.name
|
data: [
|
||||||
}], grid: {
|
"1",
|
||||||
left: '3%', right: '4%', bottom: '3%', containLabel: true
|
"2",
|
||||||
}, series: [{
|
"3",
|
||||||
data: data.datalist, type: 'bar', showBackground: true
|
"4",
|
||||||
|
"5",
|
||||||
|
"6",
|
||||||
|
"7",
|
||||||
|
"8",
|
||||||
|
"9",
|
||||||
|
"10",
|
||||||
|
"11",
|
||||||
|
"12",
|
||||||
|
"13",
|
||||||
|
"14",
|
||||||
|
"15",
|
||||||
|
"16",
|
||||||
|
"17",
|
||||||
|
"18",
|
||||||
|
"19",
|
||||||
|
"20",
|
||||||
|
"21",
|
||||||
|
"22",
|
||||||
|
"23",
|
||||||
|
"24",
|
||||||
|
"25",
|
||||||
|
"26",
|
||||||
|
"27",
|
||||||
|
"28",
|
||||||
|
"29",
|
||||||
|
"30",
|
||||||
|
"31",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
type: "value",
|
||||||
|
},
|
||||||
|
title: [
|
||||||
|
{
|
||||||
|
left: "center",
|
||||||
|
text: data.name,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
grid: {
|
||||||
|
left: "3%",
|
||||||
|
right: "4%",
|
||||||
|
bottom: "3%",
|
||||||
|
containLabel: true,
|
||||||
|
},
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
data: data.datalist,
|
||||||
|
type: "bar",
|
||||||
|
showBackground: true,
|
||||||
// backgroundStyle: {
|
// backgroundStyle: {
|
||||||
// //color: '#62AEDF'
|
// //color: '#62AEDF'
|
||||||
// }
|
// }
|
||||||
}]
|
},
|
||||||
|
],
|
||||||
};
|
};
|
||||||
myChart.setOption(option);
|
myChart.setOption(option);
|
||||||
myChart.resize();
|
myChart.resize();
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* echart柱状图--多点
|
* echart柱状图--多点 (原有)
|
||||||
*/
|
*/
|
||||||
function echartColumnar2(unitId, mpointCode, echartId) {
|
function echartColumnar2_1(unitId, mpointCode, echartId) {
|
||||||
var myChart = echarts.init(document.getElementById(echartId));
|
var myChart = echarts.init(document.getElementById(echartId));
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'GET',
|
type: "GET",
|
||||||
url: ext.contextPath + '/work/mpoint/getValueWeekS.do?unitId=' + unitId + '&mpointCode=' + mpointCode,
|
url:
|
||||||
|
ext.contextPath +
|
||||||
|
"/work/mpoint/getValueWeekS.do?unitId=" +
|
||||||
|
unitId +
|
||||||
|
"&mpointCode=" +
|
||||||
|
mpointCode,
|
||||||
async: true,
|
async: true,
|
||||||
globle: false,
|
globle: false,
|
||||||
error: function () {
|
error: function () {
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
var datastr = eval('(' + data + ')');
|
var datastr = eval("(" + data + ")");
|
||||||
|
|
||||||
var data1 = datastr.dataJson;
|
var data1 = datastr.dataJson;
|
||||||
var data2 = datastr.timeJson;
|
var data2 = datastr.timeJson;
|
||||||
|
|
||||||
var option = {
|
var option = {
|
||||||
color: ['#67D89F', '#FFBB00'], legend: {}, calculable: true, xAxis: [{
|
color: ["#67D89F", "#FFBB00"],
|
||||||
type: 'category', axisLabel: {
|
legend: {},
|
||||||
interval: 0,//代表显示所有x轴标签显示
|
calculable: true,
|
||||||
}, data: data2
|
xAxis: [
|
||||||
}], yAxis: [{
|
{
|
||||||
type: 'value'
|
type: "category",
|
||||||
}], grid: {
|
axisLabel: {
|
||||||
left: '2%', right: '5%', bottom: '3%', containLabel: true
|
interval: 0, //代表显示所有x轴标签显示
|
||||||
}, series: data1
|
},
|
||||||
|
data: data2,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
yAxis: [
|
||||||
|
{
|
||||||
|
type: "value",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
grid: {
|
||||||
|
left: "2%",
|
||||||
|
right: "5%",
|
||||||
|
bottom: "3%",
|
||||||
|
containLabel: true,
|
||||||
|
},
|
||||||
|
series: data1,
|
||||||
};
|
};
|
||||||
myChart.setOption(option);
|
myChart.setOption(option);
|
||||||
myChart.resize();
|
myChart.resize();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function initEchartColumnar2() {
|
||||||
|
var chart = echarts.init(document.getElementById('myChartProduce8'));
|
||||||
|
var option = {
|
||||||
|
tooltip: {
|
||||||
|
trigger: 'axis',
|
||||||
|
axisPointer: {
|
||||||
|
type: 'shadow'
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
data: ['工业进水', '工业出水', '生活进水', '生活出水'],
|
||||||
|
top: 5,
|
||||||
|
textStyle: {
|
||||||
|
fontSize: 12
|
||||||
|
}
|
||||||
|
},
|
||||||
|
grid: {
|
||||||
|
left: '5%',
|
||||||
|
right: '5%',
|
||||||
|
bottom: '8%',
|
||||||
|
top: '18%',
|
||||||
|
containLabel: true
|
||||||
|
},
|
||||||
|
xAxis: {
|
||||||
|
type: 'category',
|
||||||
|
data: ['3/16', '3/17', '3/18', '3/19', '3/20', '3/21', '3/22'],
|
||||||
|
axisLine: {
|
||||||
|
lineStyle: {
|
||||||
|
color: '#e8e8e8'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
axisLabel: {
|
||||||
|
color: '#666',
|
||||||
|
fontSize: 12
|
||||||
|
}
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
type: 'value',
|
||||||
|
name: 'm³/D',
|
||||||
|
nameTextStyle: {
|
||||||
|
fontSize: 12
|
||||||
|
},
|
||||||
|
axisLine: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
axisTick: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
axisLabel: {
|
||||||
|
color: '#666',
|
||||||
|
fontSize: 12
|
||||||
|
},
|
||||||
|
splitLine: {
|
||||||
|
lineStyle: {
|
||||||
|
color: '#f0f0f0'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
name: '工业进水',
|
||||||
|
type: 'bar',
|
||||||
|
barWidth: '20%',
|
||||||
|
itemStyle: {
|
||||||
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||||
|
{offset: 0, color: '#378dcc'},
|
||||||
|
{offset: 1, color: '#5ba3d9'}
|
||||||
|
])
|
||||||
|
},
|
||||||
|
data: [0, 0, 0, 0, 0, 0, 0]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '工业出水',
|
||||||
|
type: 'bar',
|
||||||
|
barWidth: '20%',
|
||||||
|
itemStyle: {
|
||||||
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||||
|
{offset: 0, color: '#5b8def'},
|
||||||
|
{offset: 1, color: '#40a9ff'}
|
||||||
|
])
|
||||||
|
},
|
||||||
|
data: [0, 0, 0, 0, 0, 0, 0]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '生活进水',
|
||||||
|
type: 'bar',
|
||||||
|
barWidth: '20%',
|
||||||
|
itemStyle: {
|
||||||
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||||
|
{offset: 0, color: '#52c41a'},
|
||||||
|
{offset: 1, color: '#73d13d'}
|
||||||
|
])
|
||||||
|
},
|
||||||
|
data: [0, 0, 0, 0, 0, 0, 0]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '生活出水',
|
||||||
|
type: 'bar',
|
||||||
|
barWidth: '20%',
|
||||||
|
itemStyle: {
|
||||||
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||||
|
{offset: 0, color: '#2ecc71'},
|
||||||
|
{offset: 1, color: '#58d68d'}
|
||||||
|
])
|
||||||
|
},
|
||||||
|
data: [0, 0, 0, 0, 0, 0, 0]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
chart.setOption(option);
|
||||||
|
chart.resize();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* echart柱状图--多点 (TGLW新版)- (工业生活污水流量7天日趋势)
|
||||||
|
*/
|
||||||
|
function echartColumnar2(unitId, mpointCode, echartId) {
|
||||||
|
var myChart = echarts.init(document.getElementById(echartId));
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
type: "GET",
|
||||||
|
// url: ext.contextPath + '/work/mpoint/getValueWeekS.do?unitId=' + unitId + '&mpointCode=' + mpointCode,
|
||||||
|
url:
|
||||||
|
ext.contextPath +
|
||||||
|
"/work/mpoint/getValueWeekS.do?unitId=" +
|
||||||
|
unitId +
|
||||||
|
"&mpointCode=" +
|
||||||
|
"C_GYJsssll,C_GYCsssll,C_SHJsssll,C_SHCsssll",
|
||||||
|
async: true,
|
||||||
|
globle: false,
|
||||||
|
error: function () {
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
success: function (data) {
|
||||||
|
var datastr = eval("(" + data + ")");
|
||||||
|
|
||||||
|
var data1 = datastr.dataJson;
|
||||||
|
var data2 = datastr.timeJson;
|
||||||
|
var series = [];
|
||||||
|
var legendData = [];
|
||||||
|
|
||||||
|
if (data1) {
|
||||||
|
data1.forEach(function(item, index) {
|
||||||
|
legendData.push(item.name);
|
||||||
|
var colors = [
|
||||||
|
[{offset: 0, color: '#378dcc'}, {offset: 1, color: '#5ba3d9'}],
|
||||||
|
[{offset: 0, color: '#5b8def'}, {offset: 1, color: '#40a9ff'}],
|
||||||
|
[{offset: 0, color: '#52c41a'}, {offset: 1, color: '#73d13d'}],
|
||||||
|
[{offset: 0, color: '#2ecc71'}, {offset: 1, color: '#58d68d'}]
|
||||||
|
];
|
||||||
|
series.push({
|
||||||
|
name: item.name,
|
||||||
|
type: item.type || 'bar',
|
||||||
|
barWidth: '20%',
|
||||||
|
itemStyle: {
|
||||||
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, colors[index % colors.length])
|
||||||
|
},
|
||||||
|
data: item.data
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
var option = {
|
||||||
|
tooltip: {
|
||||||
|
trigger: "axis",
|
||||||
|
axisPointer: {
|
||||||
|
type: "shadow",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
data: legendData,
|
||||||
|
top: 5,
|
||||||
|
textStyle: {
|
||||||
|
fontSize: 12,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
grid: {
|
||||||
|
left: "5%",
|
||||||
|
right: "5%",
|
||||||
|
bottom: "8%",
|
||||||
|
top: "18%",
|
||||||
|
containLabel: true,
|
||||||
|
},
|
||||||
|
xAxis: [
|
||||||
|
{
|
||||||
|
type: "category",
|
||||||
|
data: data2,
|
||||||
|
axisLine: {
|
||||||
|
lineStyle: {
|
||||||
|
color: "#e8e8e8",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
axisLabel: {
|
||||||
|
color: "#666",
|
||||||
|
fontSize: 12,
|
||||||
|
interval: 0, //代表显示所有x轴标签显示
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
yAxis: {
|
||||||
|
type: "value",
|
||||||
|
name: "m³/D",
|
||||||
|
nameTextStyle: {
|
||||||
|
fontSize: 12,
|
||||||
|
},
|
||||||
|
axisLine: {
|
||||||
|
show: false,
|
||||||
|
},
|
||||||
|
axisTick: {
|
||||||
|
show: false,
|
||||||
|
},
|
||||||
|
axisLabel: {
|
||||||
|
color: "#666",
|
||||||
|
fontSize: 12,
|
||||||
|
},
|
||||||
|
splitLine: {
|
||||||
|
lineStyle: {
|
||||||
|
color: "#f0f0f0",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
series: series,
|
||||||
|
};
|
||||||
|
myChart.setOption(option);
|
||||||
|
myChart.resize();
|
||||||
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -283,7 +721,10 @@ function echartColumnar2(unitId, mpointCode, echartId) {
|
|||||||
* @param unitId
|
* @param unitId
|
||||||
*/
|
*/
|
||||||
function getPic(unitId) {
|
function getPic(unitId) {
|
||||||
$("#mainImg").attr("src", ext.contextPath + "/IMG/main/main_" + unitId + ".jpg");
|
$("#mainImg").attr(
|
||||||
|
"src",
|
||||||
|
ext.contextPath + "/IMG/main/main_" + unitId + ".jpg",
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -294,21 +735,37 @@ function getPic(unitId, unit, proDatavisualFrame) {
|
|||||||
//$("#mainImg").attr("src", ext.contextPath + "/IMG/main/main_" + unitId + ".jpg");
|
//$("#mainImg").attr("src", ext.contextPath + "/IMG/main/main_" + unitId + ".jpg");
|
||||||
var unitIds = JSON.parse(unit);
|
var unitIds = JSON.parse(unit);
|
||||||
var proDatavisualFrames = JSON.parse(proDatavisualFrame);
|
var proDatavisualFrames = JSON.parse(proDatavisualFrame);
|
||||||
var active = '';
|
var active = "";
|
||||||
var item = '';
|
var item = "";
|
||||||
var proDatavisualFrames_i = 0;
|
var proDatavisualFrames_i = 0;
|
||||||
if (unitIds != null && unitIds.length > 0) {
|
if (unitIds != null && unitIds.length > 0) {
|
||||||
for (var i = 0; i < unitIds.length; i++) {
|
for (var i = 0; i < unitIds.length; i++) {
|
||||||
if (unitIds[i].type == 'B' || unitIds[i].type == 'C') {
|
if (unitIds[i].type == "B" || unitIds[i].type == "C") {
|
||||||
var proDatavisualFrameId = proDatavisualFrames[proDatavisualFrames_i];
|
var proDatavisualFrameId = proDatavisualFrames[proDatavisualFrames_i];
|
||||||
proDatavisualFrames_i++;
|
proDatavisualFrames_i++;
|
||||||
if (unitId == unitIds[i].id) {
|
if (unitId == unitIds[i].id) {
|
||||||
active = 'active';
|
active = "active";
|
||||||
} else {
|
} else {
|
||||||
active = '';
|
active = "";
|
||||||
}
|
}
|
||||||
var src = ext.contextPath + "/IMG/main/main_" + unitIds[i].id + ".jpg";
|
var src = ext.contextPath + "/IMG/main/main_" + unitIds[i].id + ".jpg";
|
||||||
item += '<div class="item ' + active + ' ">' + '<img src="' + src + '" class="mainImg">' + '<div class="carousel-caption" onclick="proDatavisualFrame(\'' + unitIds[i].id + '\',\'' + proDatavisualFrameId + '\')">' + '<h4>' + unitIds[i].text + '</h4>' + '</div>' + '</div>';
|
item +=
|
||||||
|
'<div class="item ' +
|
||||||
|
active +
|
||||||
|
' ">' +
|
||||||
|
'<img src="' +
|
||||||
|
src +
|
||||||
|
'" class="mainImg">' +
|
||||||
|
'<div class="carousel-caption" onclick="proDatavisualFrame(\'' +
|
||||||
|
unitIds[i].id +
|
||||||
|
"','" +
|
||||||
|
proDatavisualFrameId +
|
||||||
|
"')\">" +
|
||||||
|
"<h4>" +
|
||||||
|
unitIds[i].text +
|
||||||
|
"</h4>" +
|
||||||
|
"</div>" +
|
||||||
|
"</div>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -316,15 +773,39 @@ function getPic(unitId, unit, proDatavisualFrame) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getUnitsByUnitId4Select(id, funname, proDatavisualFrame) {
|
function getUnitsByUnitId4Select(id, funname, proDatavisualFrame) {
|
||||||
$.post(ext.contextPath + "/user/getUnitsByUnitId4Select.do", {id: id}, function (data) {
|
$.post(
|
||||||
|
ext.contextPath + "/user/getUnitsByUnitId4Select.do",
|
||||||
|
{ id: id },
|
||||||
|
function (data) {
|
||||||
//console.log(data);
|
//console.log(data);
|
||||||
var unitIds = data;
|
var unitIds = data;
|
||||||
eval(funname + "('" + id + "','" + unitIds + "','" + proDatavisualFrame + "')")
|
eval(
|
||||||
});
|
funname +
|
||||||
|
"('" +
|
||||||
|
id +
|
||||||
|
"','" +
|
||||||
|
unitIds +
|
||||||
|
"','" +
|
||||||
|
proDatavisualFrame +
|
||||||
|
"')",
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function proDatavisualFrame(unitId, proDatavisualFrameId) {
|
function proDatavisualFrame(unitId, proDatavisualFrameId) {
|
||||||
if (proDatavisualFrameId != null && proDatavisualFrameId != undefined && proDatavisualFrameId != '') {
|
if (
|
||||||
parent.addTab(proDatavisualFrameId, '工艺可视化', 'process/dataVisualFrame/view.do?frameId=' + proDatavisualFrameId + '&unitId=' + unitId);
|
proDatavisualFrameId != null &&
|
||||||
|
proDatavisualFrameId != undefined &&
|
||||||
|
proDatavisualFrameId != ""
|
||||||
|
) {
|
||||||
|
parent.addTab(
|
||||||
|
proDatavisualFrameId,
|
||||||
|
"工艺可视化",
|
||||||
|
"process/dataVisualFrame/view.do?frameId=" +
|
||||||
|
proDatavisualFrameId +
|
||||||
|
"&unitId=" +
|
||||||
|
unitId,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -174,7 +174,7 @@
|
|||||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||||
sort: params.sort, // 要排序的字段
|
sort: params.sort, // 要排序的字段
|
||||||
order: params.order,
|
order: params.order,
|
||||||
search_name: $('#search_name').val(),
|
// search_name: $('#search_name').val(),
|
||||||
search_code: $('#search_code').val()
|
search_code: $('#search_code').val()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -301,14 +301,14 @@
|
|||||||
<label class="form-label" id="companylabel">公司</label>
|
<label class="form-label" id="companylabel">公司</label>
|
||||||
<select class="form-control select2 " id="search_code" name ="search_code" style="width: 220px;"></select>
|
<select class="form-control select2 " id="search_code" name ="search_code" style="width: 220px;"></select>
|
||||||
<span class="select2-selection select2-selection--single" id="company" style="width:220px;border: none;background: transparent;" ></span>
|
<span class="select2-selection select2-selection--single" id="company" style="width:220px;border: none;background: transparent;" ></span>
|
||||||
<div class="form-group pull-right" >
|
<!-- <div class="form-group pull-right" >
|
||||||
<div class="input-group input-group-sm" style="width: 250px;">
|
<div class="input-group input-group-sm" style="width: 250px;">
|
||||||
<input type="text" id="search_name" name="search_name" class="form-control pull-right" placeholder="名称">
|
<input type="text" id="search_name" name="search_name" class="form-control pull-right" placeholder="名称">
|
||||||
<div class="input-group-btn">
|
<div class="input-group-btn">
|
||||||
<button class="btn btn-default" onclick="dosearch();"><i class="fa fa-search"></i></button>
|
<button class="btn btn-default" onclick="dosearch();"><i class="fa fa-search"></i></button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
<table id="table"></table>
|
<table id="table"></table>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -161,6 +161,11 @@
|
|||||||
<% request.setAttribute("Administration_Temporary", ProcessType.Administration_Temporary.getId());%>
|
<% request.setAttribute("Administration_Temporary", ProcessType.Administration_Temporary.getId());%>
|
||||||
<% request.setAttribute("UNIT_Temporary_AUDIT", BusinessUnit.UNIT_Temporary_AUDIT);%>
|
<% request.setAttribute("UNIT_Temporary_AUDIT", BusinessUnit.UNIT_Temporary_AUDIT);%>
|
||||||
<% request.setAttribute("UNIT_Temporary_HANDLE", BusinessUnit.UNIT_Temporary_HANDLE);%>
|
<% request.setAttribute("UNIT_Temporary_HANDLE", BusinessUnit.UNIT_Temporary_HANDLE);%>
|
||||||
|
<% request.setAttribute("Administration_Leave", ProcessType.Administration_Leave.getId());%>
|
||||||
|
<% request.setAttribute("UNIT_LEAVE_APPLY_SECTION_AUDIT", BusinessUnit.UNIT_LEAVE_APPLY_SECTION_AUDIT);%>
|
||||||
|
<% request.setAttribute("UNIT_LEAVE_APPLY_MANAGER_AUDIT", BusinessUnit.UNIT_LEAVE_APPLY_MANAGER_AUDIT);%>
|
||||||
|
<% request.setAttribute("UNIT_LEAVE_APPLY_GENERAL_MANAGER_AUDIT", BusinessUnit.UNIT_LEAVE_APPLY_GENERAL_MANAGER_AUDIT);%>
|
||||||
|
<% request.setAttribute("UNIT_LEAVE_APPLY_HANDLE", BusinessUnit.UNIT_LEAVE_APPLY_HANDLE);%>
|
||||||
<%--报表--%>
|
<%--报表--%>
|
||||||
<% request.setAttribute("Report_Check", ProcessType.Report_Check.getId());%>
|
<% request.setAttribute("Report_Check", ProcessType.Report_Check.getId());%>
|
||||||
<% request.setAttribute("UNIT_REPORT_CREATE", BusinessUnit.UNIT_REPORT_CREATE);%>
|
<% request.setAttribute("UNIT_REPORT_CREATE", BusinessUnit.UNIT_REPORT_CREATE);%>
|
||||||
@ -346,6 +351,11 @@
|
|||||||
$("#subDiv").html(data);
|
$("#subDiv").html(data);
|
||||||
openModal('contractExcuteModal');
|
openModal('contractExcuteModal');
|
||||||
});
|
});
|
||||||
|
} else if (type.indexOf('${Administration_Leave}') != -1) {
|
||||||
|
$.post(ext.contextPath + '/administration/leaveApply/showExecuteView.do', {id: id}, function (data) {
|
||||||
|
$("#subDiv").html(data);
|
||||||
|
openModal('contractExcuteModal');
|
||||||
|
});
|
||||||
} else if (type.indexOf('${Administration_Reserve}') != -1) {
|
} else if (type.indexOf('${Administration_Reserve}') != -1) {
|
||||||
$.post(ext.contextPath + '/administration/organization/showProcessOrganizationView.do', {id: id}, function (data) {
|
$.post(ext.contextPath + '/administration/organization/showProcessOrganizationView.do', {id: id}, function (data) {
|
||||||
$("#subDiv").html(data);
|
$("#subDiv").html(data);
|
||||||
@ -533,6 +543,14 @@
|
|||||||
$("#subDiv").html(data);
|
$("#subDiv").html(data);
|
||||||
openModal('subModal');
|
openModal('subModal');
|
||||||
});
|
});
|
||||||
|
} else if (type.indexOf('${SAFETY_JOB_INSIDE}') != -1) {
|
||||||
|
$.post(ext.contextPath + '/safety/SafetyJobInside/view.do', {id: id}, function (data) {
|
||||||
|
$("#subDiv").html(data);
|
||||||
|
openModal('subModal');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
showAlert('w', `未查询到任务模块!${type}`, 'mainAlertdiv');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var deleteFun = function (id) {
|
var deleteFun = function (id) {
|
||||||
@ -871,6 +889,31 @@
|
|||||||
default:
|
default:
|
||||||
showAlert('w', '未查询到任务模块!', 'mainAlertdiv');
|
showAlert('w', '未查询到任务模块!', 'mainAlertdiv');
|
||||||
}
|
}
|
||||||
|
} else if (type.indexOf('${Administration_Leave}') != -1) {
|
||||||
|
switch (status) {
|
||||||
|
case '${UNIT_LEAVE_APPLY_SECTION_AUDIT}':
|
||||||
|
case '${UNIT_LEAVE_APPLY_MANAGER_AUDIT}':
|
||||||
|
case '${UNIT_LEAVE_APPLY_GENERAL_MANAGER_AUDIT}':
|
||||||
|
$.post(ext.contextPath + '/administration/leaveApply/showAudit.do', {
|
||||||
|
processInstanceId: processInstanceId, taskId: taskId, businessKey: businessKey,
|
||||||
|
unitId: status
|
||||||
|
}, function (data) {
|
||||||
|
$("#subDiv").html(data);
|
||||||
|
openModal('subModal');
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case '${UNIT_LEAVE_APPLY_HANDLE}':
|
||||||
|
$.post(ext.contextPath + '/administration/leaveApply/showHandle.do', {
|
||||||
|
processInstanceId: processInstanceId, taskId: taskId, businessKey: businessKey,
|
||||||
|
unitId: status
|
||||||
|
}, function (data) {
|
||||||
|
$("#subDiv").html(data);
|
||||||
|
openModal('subModal');
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
showAlert('w', '未查询到任务模块!', 'mainAlertdiv');
|
||||||
|
}
|
||||||
} else if (type.indexOf('${Process_Adjustment}') > -1) {
|
} else if (type.indexOf('${Process_Adjustment}') > -1) {
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case '${UNIT_PROCESSADJUSTMENT_EDIT}'://工艺申请
|
case '${UNIT_PROCESSADJUSTMENT_EDIT}'://工艺申请
|
||||||
|
|||||||
200
src/main/webapp/jsp/administration/leaveApplyAdd.jsp
Normal file
200
src/main/webapp/jsp/administration/leaveApplyAdd.jsp
Normal file
@ -0,0 +1,200 @@
|
|||||||
|
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||||
|
<style type="text/css">
|
||||||
|
.select2-container .select2-selection--single{height:34px;line-height:34px;}
|
||||||
|
.select2-selection__arrow{margin-top:3px;}
|
||||||
|
</style>
|
||||||
|
<script type="text/javascript">
|
||||||
|
function padNumber(num) {
|
||||||
|
return num < 10 ? "0" + num : "" + num;
|
||||||
|
}
|
||||||
|
function formatDateValue(date) {
|
||||||
|
return date.getFullYear() + "-" + padNumber(date.getMonth() + 1) + "-" + padNumber(date.getDate());
|
||||||
|
}
|
||||||
|
function normalizeDateValue(value) {
|
||||||
|
if (!value) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
var match = value.match(/^(\d{4}-\d{2}-\d{2})/);
|
||||||
|
return match ? match[1] : value;
|
||||||
|
}
|
||||||
|
function getHalfDayIndex(period) {
|
||||||
|
return period === "下午" ? 1 : 0;
|
||||||
|
}
|
||||||
|
function getDayNumber(dateText) {
|
||||||
|
var parts = dateText.split("-");
|
||||||
|
if (parts.length !== 3) {
|
||||||
|
return NaN;
|
||||||
|
}
|
||||||
|
return Math.floor(new Date(parseInt(parts[0], 10), parseInt(parts[1], 10) - 1, parseInt(parts[2], 10)).getTime() / (24 * 60 * 60 * 1000));
|
||||||
|
}
|
||||||
|
function syncLeaveTimeFields() {
|
||||||
|
var startDate = normalizeDateValue($("#startDate").val());
|
||||||
|
var endDate = normalizeDateValue($("#endDate").val());
|
||||||
|
var startPeriod = $("#startPeriod").val();
|
||||||
|
var endPeriod = $("#endPeriod").val();
|
||||||
|
$("#startDate").val(startDate);
|
||||||
|
$("#endDate").val(endDate);
|
||||||
|
$("#startTime").val(startDate && startPeriod ? (startDate + " " + startPeriod) : "");
|
||||||
|
$("#endTime").val(endDate && endPeriod ? (endDate + " " + endPeriod) : "");
|
||||||
|
}
|
||||||
|
function calculateLeaveDays() {
|
||||||
|
syncLeaveTimeFields();
|
||||||
|
var startDate = $("#startDate").val();
|
||||||
|
var endDate = $("#endDate").val();
|
||||||
|
var startPeriod = $("#startPeriod").val();
|
||||||
|
var endPeriod = $("#endPeriod").val();
|
||||||
|
if (!startDate || !endDate || !startPeriod || !endPeriod) {
|
||||||
|
$("#hours").val("");
|
||||||
|
$("#days").val("");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
var startUnit = getDayNumber(startDate) * 2 + getHalfDayIndex(startPeriod);
|
||||||
|
var endUnit = getDayNumber(endDate) * 2 + getHalfDayIndex(endPeriod);
|
||||||
|
if (isNaN(startUnit) || isNaN(endUnit) || endUnit < startUnit) {
|
||||||
|
$("#hours").val("");
|
||||||
|
$("#days").val("");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
var halfDays = endUnit - startUnit + 1;
|
||||||
|
var hours = halfDays * 4;
|
||||||
|
var days = halfDays / 2;
|
||||||
|
$("#hours").val(hours.toString());
|
||||||
|
$("#days").val(days % 1 === 0 ? days.toString() : days.toFixed(1));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
function doSaveLeaveApply(startProcess) {
|
||||||
|
$("#subForm").bootstrapValidator('validate');
|
||||||
|
if ($("#subForm").data('bootstrapValidator').isValid()) {
|
||||||
|
if (!calculateLeaveDays()) {
|
||||||
|
showAlert('d', '结束日期时段不能早于开始日期时段');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var url = startProcess ? "/administration/leaveApply/startProcess.do" : "/administration/leaveApply/save.do";
|
||||||
|
$.post(ext.contextPath + url, $("#subForm").serialize(), function(data) {
|
||||||
|
if (data.res == 1) {
|
||||||
|
closeModal('subModal');
|
||||||
|
$("#table").bootstrapTable('refresh');
|
||||||
|
} else if (data.res == 0) {
|
||||||
|
showAlert('d', '操作失败');
|
||||||
|
} else {
|
||||||
|
showAlert('d', data.res);
|
||||||
|
}
|
||||||
|
}, 'json');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$(function(){
|
||||||
|
$("#subForm").bootstrapValidator({
|
||||||
|
live: 'disabled',
|
||||||
|
fields: {
|
||||||
|
applyType: {validators: {notEmpty: {message: '请选择申请类型'}}},
|
||||||
|
leaveType: {validators: {notEmpty: {message: '请选择假别'}}},
|
||||||
|
startDate: {validators: {notEmpty: {message: '请选择开始日期'}}},
|
||||||
|
startPeriod: {validators: {notEmpty: {message: '请选择开始时段'}}},
|
||||||
|
endDate: {validators: {notEmpty: {message: '请选择结束日期'}}},
|
||||||
|
endPeriod: {validators: {notEmpty: {message: '请选择结束时段'}}},
|
||||||
|
reason: {validators: {notEmpty: {message: '请填写申请事由'}}}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$('#startDate,#endDate').datetimepicker({
|
||||||
|
language: 'zh-CN',
|
||||||
|
format: 'yyyy-mm-dd',
|
||||||
|
startView: 'month',
|
||||||
|
minView: 2,
|
||||||
|
maxView: 'year',
|
||||||
|
autoclose: true,
|
||||||
|
todayBtn: true,
|
||||||
|
todayHighlight: true
|
||||||
|
}).on('changeDate', function() {
|
||||||
|
calculateLeaveDays();
|
||||||
|
});
|
||||||
|
$('#startDate,#endDate,#startPeriod,#endPeriod').on('change', function() {
|
||||||
|
calculateLeaveDays();
|
||||||
|
});
|
||||||
|
var today = formatDateValue(new Date());
|
||||||
|
$("#startDate").val(today);
|
||||||
|
$("#endDate").val(today);
|
||||||
|
calculateLeaveDays();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<div class="modal fade" id="subModal">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal"><span>×</span></button>
|
||||||
|
<h4 class="modal-title">新增请假补假申请</h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<form class="form-horizontal" id="subForm">
|
||||||
|
<input type="hidden" name="unitId" value="${param.companyId}">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">申请类型</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<select class="form-control" name="applyType">
|
||||||
|
<option value="leave">请假</option>
|
||||||
|
<option value="compensatory">补假</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">假别</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<select class="form-control" name="leaveType">
|
||||||
|
<option value="annual">年假</option>
|
||||||
|
<option value="personal">事假</option>
|
||||||
|
<option value="sick">病假</option>
|
||||||
|
<option value="marriage">婚假</option>
|
||||||
|
<option value="maternity">产假</option>
|
||||||
|
<option value="funeral">丧假</option>
|
||||||
|
<option value="adjustment">调休</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">开始日期</label>
|
||||||
|
<div class="col-sm-5"><input type="text" class="form-control" id="startDate" name="startDate" autocomplete="off" placeholder="请选择日期"></div>
|
||||||
|
<div class="col-sm-3">
|
||||||
|
<select class="form-control" id="startPeriod" name="startPeriod">
|
||||||
|
<option value="上午">上午</option>
|
||||||
|
<option value="下午">下午</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">结束日期</label>
|
||||||
|
<div class="col-sm-5"><input type="text" class="form-control" id="endDate" name="endDate" autocomplete="off" placeholder="请选择日期"></div>
|
||||||
|
<div class="col-sm-3">
|
||||||
|
<select class="form-control" id="endPeriod" name="endPeriod">
|
||||||
|
<option value="上午">上午</option>
|
||||||
|
<option value="下午">下午</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<input type="hidden" id="startTime" name="startTime">
|
||||||
|
<input type="hidden" id="endTime" name="endTime">
|
||||||
|
<input type="hidden" id="hours" name="hours">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">天数</label>
|
||||||
|
<div class="col-sm-8"><input type="text" class="form-control" id="days" name="days" readonly placeholder="自动计算"></div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">申请事由</label>
|
||||||
|
<div class="col-sm-8"><textarea class="form-control" rows="3" name="reason"></textarea></div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">工作交接</label>
|
||||||
|
<div class="col-sm-8"><textarea class="form-control" rows="2" name="handoverDesc"></textarea></div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">备注</label>
|
||||||
|
<div class="col-sm-8"><textarea class="form-control" rows="2" name="remark"></textarea></div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||||
|
<button type="button" class="btn btn-primary" onclick="doSaveLeaveApply(false)">保存</button>
|
||||||
|
<button type="button" class="btn btn-primary" onclick="doSaveLeaveApply(true)">发起审批</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
94
src/main/webapp/jsp/administration/leaveApplyAudit.jsp
Normal file
94
src/main/webapp/jsp/administration/leaveApplyAudit.jsp
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||||
|
<script type="text/javascript">
|
||||||
|
function formatLeaveHalfDay(value) {
|
||||||
|
if (!value) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
var text = $.trim(value);
|
||||||
|
var halfDayMatch = text.match(/^(\d{4}-\d{2}-\d{2})\s+(上午|下午)$/);
|
||||||
|
if (halfDayMatch) {
|
||||||
|
return halfDayMatch[1] + " " + halfDayMatch[2];
|
||||||
|
}
|
||||||
|
var dateTimeMatch = text.match(/^(\d{4}-\d{2}-\d{2})(?:\s+(\d{1,2})(?::\d{1,2}(?::\d{1,2})?)?(?:\.\d+)?)?$/);
|
||||||
|
if (dateTimeMatch) {
|
||||||
|
var hour = dateTimeMatch[2] ? parseInt(dateTimeMatch[2], 10) : 0;
|
||||||
|
return dateTimeMatch[1] + " " + (hour >= 12 ? "下午" : "上午");
|
||||||
|
}
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
function showUser4SelectsFun() {
|
||||||
|
var userIds= $("#targetusers").val();
|
||||||
|
var jobIds= $("#targetjobs").val();
|
||||||
|
$.post(ext.contextPath + '/user/userForSelectByCompany.do', {formId:"subForm",hiddenId:"targetusers",textId:"targetUsersName",userIds:userIds,jobIds:jobIds}, function(data) {
|
||||||
|
$("#user4SelectDiv").html(data);
|
||||||
|
openModal("user4SelectModal");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function doSubmit() {
|
||||||
|
$("#subForm").bootstrapValidator('validate');
|
||||||
|
if ($("#subForm").data('bootstrapValidator').isValid()) {
|
||||||
|
$.post(ext.contextPath + "/administration/leaveApply/doAudit.do", $("#subForm").serialize(), function(data) {
|
||||||
|
if (data.res == 1) {
|
||||||
|
closeModal('subModal');
|
||||||
|
$("#table").bootstrapTable('refresh');
|
||||||
|
} else {
|
||||||
|
showAlert('d', data.res == 0 ? '操作执行失败,请重试' : data.res);
|
||||||
|
}
|
||||||
|
}, 'json');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$(function(){
|
||||||
|
processSelectNode("${businessUnitAudit.taskid}");
|
||||||
|
$("#subForm").bootstrapValidator({live:'disabled'});
|
||||||
|
$("#startTimeText").text(formatLeaveHalfDay("${leaveApply.startTime}"));
|
||||||
|
$("#endTimeText").text(formatLeaveHalfDay("${leaveApply.endTime}"));
|
||||||
|
$.post(ext.contextPath + '/administration/leaveApply/showExecuteView.do', {id:'${leaveApply.id}',inModal:'inModal'}, function(data) {
|
||||||
|
$("#showView").html(data);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<div class="modal fade" id="subModal">
|
||||||
|
<div class="modal-dialog modal-xlg">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal"><span>×</span></button>
|
||||||
|
<h4 class="modal-title">审批(${taskName})</h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-7 col-xs-12">
|
||||||
|
<form class="form-horizontal" id="subForm">
|
||||||
|
<div class="form-group"><label class="col-sm-3 control-label">申请类型</label><div class="col-sm-8"><p class="form-control-static">${leaveApply.applyType}</p></div></div>
|
||||||
|
<div class="form-group"><label class="col-sm-3 control-label">假别</label><div class="col-sm-8"><p class="form-control-static">${leaveApply.leaveType}</p></div></div>
|
||||||
|
<div class="form-group"><label class="col-sm-3 control-label">开始时间</label><div class="col-sm-8"><p class="form-control-static" id="startTimeText"></p></div></div>
|
||||||
|
<div class="form-group"><label class="col-sm-3 control-label">结束时间</label><div class="col-sm-8"><p class="form-control-static" id="endTimeText"></p></div></div>
|
||||||
|
<div class="form-group"><label class="col-sm-3 control-label">申请事由</label><div class="col-sm-8"><p class="form-control-static">${leaveApply.reason}</p></div></div>
|
||||||
|
<input type="hidden" name="id" value="${businessUnitAudit.id}">
|
||||||
|
<input type="hidden" name="processid" value="${businessUnitAudit.processid}">
|
||||||
|
<input type="hidden" name="taskid" value="${businessUnitAudit.taskid}">
|
||||||
|
<input type="hidden" name="businessid" value="${businessUnitAudit.businessid}">
|
||||||
|
<input type="hidden" name="unitid" value="${param.unitId}">
|
||||||
|
<input type="hidden" name="taskdefinitionkey" value="${businessUnitAudit.taskdefinitionkey}">
|
||||||
|
<div class="form-group"><label class="col-sm-3 control-label">审核结果</label><div class="col-sm-6"><select class="form-control select2" id="passstatus" name="passstatus"><option value=true>通过</option><option value=false>驳回</option></select></div></div>
|
||||||
|
<div class="form-group"><label class="col-sm-3 control-label">下一节点</label><div class="col-sm-6"><select class="form-control select2" id="routeNum" name="routeNum"></select></div></div>
|
||||||
|
<div class="form-group"><label class="col-sm-3 control-label">审核意见</label><div class="col-sm-6"><textarea class="form-control" rows="2" id="auditopinion" name="auditopinion">通过</textarea></div></div>
|
||||||
|
<div id="selectUsers" class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">转至</label>
|
||||||
|
<div class="col-sm-9">
|
||||||
|
<input type="text" class="form-control" id="targetUsersName" name="targetUsersName" onclick="showUser4SelectsFun();" placeholder="可不选;不选时谁签收谁审批">
|
||||||
|
<input id="targetusers" name="targetusers" type="hidden" value="">
|
||||||
|
<input id="targetjobs" name="targetjobs" type="hidden" value="">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-5 col-xs-12" id="showView"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||||
|
<button type="button" class="btn btn-primary" onclick="doSubmit()">审核</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
195
src/main/webapp/jsp/administration/leaveApplyEdit.jsp
Normal file
195
src/main/webapp/jsp/administration/leaveApplyEdit.jsp
Normal file
@ -0,0 +1,195 @@
|
|||||||
|
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||||
|
<script type="text/javascript">
|
||||||
|
function normalizeDateValue(value) {
|
||||||
|
if (!value) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
var match = value.match(/^(\d{4}-\d{2}-\d{2})/);
|
||||||
|
return match ? match[1] : value;
|
||||||
|
}
|
||||||
|
function getHalfDayIndex(period) {
|
||||||
|
return period === "下午" ? 1 : 0;
|
||||||
|
}
|
||||||
|
function getDayNumber(dateText) {
|
||||||
|
var parts = dateText.split("-");
|
||||||
|
if (parts.length !== 3) {
|
||||||
|
return NaN;
|
||||||
|
}
|
||||||
|
return Math.floor(new Date(parseInt(parts[0], 10), parseInt(parts[1], 10) - 1, parseInt(parts[2], 10)).getTime() / (24 * 60 * 60 * 1000));
|
||||||
|
}
|
||||||
|
function parseLeaveTimeValue(value) {
|
||||||
|
if (!value) {
|
||||||
|
return {date: "", period: "上午"};
|
||||||
|
}
|
||||||
|
var match = value.match(/^(\d{4}-\d{2}-\d{2})\s*(上午|下午)$/);
|
||||||
|
if (match) {
|
||||||
|
return {date: match[1], period: match[2]};
|
||||||
|
}
|
||||||
|
var datetimeMatch = value.match(/^(\d{4}-\d{2}-\d{2})(?:\s+(\d{1,2})(?::\d{1,2}(?::\d{1,2})?)?(?:\.\d+)?)?$/);
|
||||||
|
if (datetimeMatch) {
|
||||||
|
var hour = datetimeMatch[2] ? parseInt(datetimeMatch[2], 10) : 0;
|
||||||
|
return {date: datetimeMatch[1], period: hour >= 12 ? "下午" : "上午"};
|
||||||
|
}
|
||||||
|
return {date: "", period: "上午"};
|
||||||
|
}
|
||||||
|
function syncLeaveTimeFields() {
|
||||||
|
var startDate = normalizeDateValue($("#startDate").val());
|
||||||
|
var endDate = normalizeDateValue($("#endDate").val());
|
||||||
|
var startPeriod = $("#startPeriod").val();
|
||||||
|
var endPeriod = $("#endPeriod").val();
|
||||||
|
$("#startDate").val(startDate);
|
||||||
|
$("#endDate").val(endDate);
|
||||||
|
$("#startTime").val(startDate && startPeriod ? (startDate + " " + startPeriod) : "");
|
||||||
|
$("#endTime").val(endDate && endPeriod ? (endDate + " " + endPeriod) : "");
|
||||||
|
}
|
||||||
|
function calculateLeaveDays() {
|
||||||
|
syncLeaveTimeFields();
|
||||||
|
var startDate = $("#startDate").val();
|
||||||
|
var endDate = $("#endDate").val();
|
||||||
|
var startPeriod = $("#startPeriod").val();
|
||||||
|
var endPeriod = $("#endPeriod").val();
|
||||||
|
if (!startDate || !endDate || !startPeriod || !endPeriod) {
|
||||||
|
$("#hours").val("");
|
||||||
|
$("#days").val("");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
var startUnit = getDayNumber(startDate) * 2 + getHalfDayIndex(startPeriod);
|
||||||
|
var endUnit = getDayNumber(endDate) * 2 + getHalfDayIndex(endPeriod);
|
||||||
|
if (isNaN(startUnit) || isNaN(endUnit) || endUnit < startUnit) {
|
||||||
|
$("#hours").val("");
|
||||||
|
$("#days").val("");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
var halfDays = endUnit - startUnit + 1;
|
||||||
|
var hours = halfDays * 4;
|
||||||
|
var days = halfDays / 2;
|
||||||
|
$("#hours").val(hours.toString());
|
||||||
|
$("#days").val(days % 1 === 0 ? days.toString() : days.toFixed(1));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
function doUpdateLeaveApply(startProcess) {
|
||||||
|
$("#subForm").bootstrapValidator('validate');
|
||||||
|
if ($("#subForm").data('bootstrapValidator').isValid()) {
|
||||||
|
if (!calculateLeaveDays()) {
|
||||||
|
showAlert('d', '结束日期时段不能早于开始日期时段');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var url = startProcess ? "/administration/leaveApply/startProcess.do" : "/administration/leaveApply/update.do";
|
||||||
|
$.post(ext.contextPath + url, $("#subForm").serialize(), function(data) {
|
||||||
|
if (data.res == 1) {
|
||||||
|
closeModal('subModal');
|
||||||
|
$("#table").bootstrapTable('refresh');
|
||||||
|
} else {
|
||||||
|
showAlert('d', data.res == 0 ? '操作失败' : data.res);
|
||||||
|
}
|
||||||
|
}, 'json');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$(function(){
|
||||||
|
$("#subForm").bootstrapValidator({
|
||||||
|
live: 'disabled',
|
||||||
|
fields: {
|
||||||
|
startDate: {validators: {notEmpty: {message: '请选择开始日期'}}},
|
||||||
|
startPeriod: {validators: {notEmpty: {message: '请选择开始时段'}}},
|
||||||
|
endDate: {validators: {notEmpty: {message: '请选择结束日期'}}},
|
||||||
|
endPeriod: {validators: {notEmpty: {message: '请选择结束时段'}}},
|
||||||
|
reason: {validators: {notEmpty: {message: '请填写申请事由'}}}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$('#startDate,#endDate').datetimepicker({
|
||||||
|
language: 'zh-CN',
|
||||||
|
format: 'yyyy-mm-dd',
|
||||||
|
startView: 'month',
|
||||||
|
minView: 2,
|
||||||
|
maxView: 'year',
|
||||||
|
autoclose: true,
|
||||||
|
todayBtn: true,
|
||||||
|
todayHighlight: true
|
||||||
|
}).on('changeDate', function() {
|
||||||
|
calculateLeaveDays();
|
||||||
|
});
|
||||||
|
$('#startDate,#endDate,#startPeriod,#endPeriod').on('change', function() {
|
||||||
|
calculateLeaveDays();
|
||||||
|
});
|
||||||
|
var startInfo = parseLeaveTimeValue("${leaveApply.startTime}");
|
||||||
|
var endInfo = parseLeaveTimeValue("${leaveApply.endTime}");
|
||||||
|
$("#applyType").val("${leaveApply.applyType}");
|
||||||
|
$("#leaveType").val("${leaveApply.leaveType}");
|
||||||
|
$("#startDate").val(startInfo.date);
|
||||||
|
$("#startPeriod").val(startInfo.period);
|
||||||
|
$("#endDate").val(endInfo.date);
|
||||||
|
$("#endPeriod").val(endInfo.period);
|
||||||
|
calculateLeaveDays();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<div class="modal fade" id="subModal">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal"><span>×</span></button>
|
||||||
|
<h4 class="modal-title">编辑请假补假申请</h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<form class="form-horizontal" id="subForm">
|
||||||
|
<input type="hidden" name="id" value="${leaveApply.id}">
|
||||||
|
<input type="hidden" name="unitId" value="${leaveApply.unitId}">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">申请类型</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<select class="form-control" id="applyType" name="applyType">
|
||||||
|
<option value="leave">请假</option>
|
||||||
|
<option value="compensatory">补假</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">假别</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<select class="form-control" id="leaveType" name="leaveType">
|
||||||
|
<option value="annual">年假</option>
|
||||||
|
<option value="personal">事假</option>
|
||||||
|
<option value="sick">病假</option>
|
||||||
|
<option value="marriage">婚假</option>
|
||||||
|
<option value="maternity">产假</option>
|
||||||
|
<option value="funeral">丧假</option>
|
||||||
|
<option value="adjustment">调休</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">开始日期</label>
|
||||||
|
<div class="col-sm-5"><input class="form-control" id="startDate" name="startDate" autocomplete="off" placeholder="请选择日期"></div>
|
||||||
|
<div class="col-sm-3">
|
||||||
|
<select class="form-control" id="startPeriod" name="startPeriod">
|
||||||
|
<option value="上午">上午</option>
|
||||||
|
<option value="下午">下午</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">结束日期</label>
|
||||||
|
<div class="col-sm-5"><input class="form-control" id="endDate" name="endDate" autocomplete="off" placeholder="请选择日期"></div>
|
||||||
|
<div class="col-sm-3">
|
||||||
|
<select class="form-control" id="endPeriod" name="endPeriod">
|
||||||
|
<option value="上午">上午</option>
|
||||||
|
<option value="下午">下午</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<input type="hidden" id="startTime" name="startTime" value="${leaveApply.startTime}">
|
||||||
|
<input type="hidden" id="endTime" name="endTime" value="${leaveApply.endTime}">
|
||||||
|
<input type="hidden" id="hours" name="hours" value="${leaveApply.hours}">
|
||||||
|
<div class="form-group"><label class="col-sm-3 control-label">天数</label><div class="col-sm-8"><input class="form-control" id="days" name="days" value="${leaveApply.days}" readonly placeholder="自动计算"></div></div>
|
||||||
|
<div class="form-group"><label class="col-sm-3 control-label">申请事由</label><div class="col-sm-8"><textarea class="form-control" rows="3" name="reason">${leaveApply.reason}</textarea></div></div>
|
||||||
|
<div class="form-group"><label class="col-sm-3 control-label">工作交接</label><div class="col-sm-8"><textarea class="form-control" rows="2" name="handoverDesc">${leaveApply.handoverDesc}</textarea></div></div>
|
||||||
|
<div class="form-group"><label class="col-sm-3 control-label">备注</label><div class="col-sm-8"><textarea class="form-control" rows="2" name="remark">${leaveApply.remark}</textarea></div></div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||||
|
<button type="button" class="btn btn-primary" onclick="doUpdateLeaveApply(false)">保存</button>
|
||||||
|
<button type="button" class="btn btn-primary" onclick="doUpdateLeaveApply(true)">发起审批</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
24
src/main/webapp/jsp/administration/leaveApplyExecuteView.jsp
Normal file
24
src/main/webapp/jsp/administration/leaveApplyExecuteView.jsp
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||||
|
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||||
|
<div class="modal fade" id="leaveApplyExcuteModal">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
|
<h4 class="modal-title">流程详情</h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body" style="padding-left:0;padding-right:0;">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<jsp:include page="/jsp/administration/leaveApplyExecuteViewInModal.jsp"></jsp:include>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@ -0,0 +1,24 @@
|
|||||||
|
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||||
|
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||||
|
<c:if test="${not empty processMessage}">
|
||||||
|
<div class="alert alert-info" style="margin-bottom:10px;">${processMessage}</div>
|
||||||
|
</c:if>
|
||||||
|
<ul class="timeline">
|
||||||
|
<c:forEach items="${businessUnitRecords}" var="item" varStatus="status">
|
||||||
|
<li>
|
||||||
|
<c:choose>
|
||||||
|
<c:when test='${finishFlag && status.last}'>
|
||||||
|
<i class="fa fa-check bg-blue"></i>
|
||||||
|
</c:when>
|
||||||
|
<c:otherwise>
|
||||||
|
<i class="fa fa-clock-o bg-grey"></i>
|
||||||
|
</c:otherwise>
|
||||||
|
</c:choose>
|
||||||
|
<div class="timeline-item">
|
||||||
|
<span class="time"><i class="fa fa-clock-o"></i> ${item.insdt.substring(0,16)}</span>
|
||||||
|
<h3 class="timeline-header"><a href="#">${item.taskName}</a> ${item.user.caption}</h3>
|
||||||
|
<div class="timeline-body">${item.record}</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</c:forEach>
|
||||||
|
</ul>
|
||||||
196
src/main/webapp/jsp/administration/leaveApplyHandle.jsp
Normal file
196
src/main/webapp/jsp/administration/leaveApplyHandle.jsp
Normal file
@ -0,0 +1,196 @@
|
|||||||
|
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||||
|
<script type="text/javascript">
|
||||||
|
function normalizeDateValue(value) {
|
||||||
|
if (!value) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
var match = value.match(/^(\d{4}-\d{2}-\d{2})/);
|
||||||
|
return match ? match[1] : value;
|
||||||
|
}
|
||||||
|
function getHalfDayIndex(period) {
|
||||||
|
return period === "下午" ? 1 : 0;
|
||||||
|
}
|
||||||
|
function getDayNumber(dateText) {
|
||||||
|
var parts = dateText.split("-");
|
||||||
|
if (parts.length !== 3) {
|
||||||
|
return NaN;
|
||||||
|
}
|
||||||
|
return Math.floor(new Date(parseInt(parts[0], 10), parseInt(parts[1], 10) - 1, parseInt(parts[2], 10)).getTime() / (24 * 60 * 60 * 1000));
|
||||||
|
}
|
||||||
|
function parseLeaveTimeValue(value) {
|
||||||
|
if (!value) {
|
||||||
|
return {date: "", period: "上午"};
|
||||||
|
}
|
||||||
|
var match = value.match(/^(\d{4}-\d{2}-\d{2})\s*(上午|下午)$/);
|
||||||
|
if (match) {
|
||||||
|
return {date: match[1], period: match[2]};
|
||||||
|
}
|
||||||
|
var datetimeMatch = value.match(/^(\d{4}-\d{2}-\d{2})(?:\s+(\d{1,2})(?::\d{1,2}(?::\d{1,2})?)?(?:\.\d+)?)?$/);
|
||||||
|
if (datetimeMatch) {
|
||||||
|
var hour = datetimeMatch[2] ? parseInt(datetimeMatch[2], 10) : 0;
|
||||||
|
return {date: datetimeMatch[1], period: hour >= 12 ? "下午" : "上午"};
|
||||||
|
}
|
||||||
|
return {date: "", period: "上午"};
|
||||||
|
}
|
||||||
|
function syncLeaveTimeFields() {
|
||||||
|
var startDate = normalizeDateValue($("#startDate").val());
|
||||||
|
var endDate = normalizeDateValue($("#endDate").val());
|
||||||
|
var startPeriod = $("#startPeriod").val();
|
||||||
|
var endPeriod = $("#endPeriod").val();
|
||||||
|
$("#startDate").val(startDate);
|
||||||
|
$("#endDate").val(endDate);
|
||||||
|
$("#startTime").val(startDate && startPeriod ? (startDate + " " + startPeriod) : "");
|
||||||
|
$("#endTime").val(endDate && endPeriod ? (endDate + " " + endPeriod) : "");
|
||||||
|
}
|
||||||
|
function calculateLeaveDays() {
|
||||||
|
syncLeaveTimeFields();
|
||||||
|
var startDate = $("#startDate").val();
|
||||||
|
var endDate = $("#endDate").val();
|
||||||
|
var startPeriod = $("#startPeriod").val();
|
||||||
|
var endPeriod = $("#endPeriod").val();
|
||||||
|
if (!startDate || !endDate || !startPeriod || !endPeriod) {
|
||||||
|
$("#hours").val("");
|
||||||
|
$("#days").val("");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
var startUnit = getDayNumber(startDate) * 2 + getHalfDayIndex(startPeriod);
|
||||||
|
var endUnit = getDayNumber(endDate) * 2 + getHalfDayIndex(endPeriod);
|
||||||
|
if (isNaN(startUnit) || isNaN(endUnit) || endUnit < startUnit) {
|
||||||
|
$("#hours").val("");
|
||||||
|
$("#days").val("");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
var halfDays = endUnit - startUnit + 1;
|
||||||
|
var hours = halfDays * 4;
|
||||||
|
var days = halfDays / 2;
|
||||||
|
$("#hours").val(hours.toString());
|
||||||
|
$("#days").val(days % 1 === 0 ? days.toString() : days.toFixed(1));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
function showUser4AuditSelectsFun() {
|
||||||
|
var userIds= $("#targetusers").val();
|
||||||
|
var jobIds= $("#targetjobs").val();
|
||||||
|
$.post(ext.contextPath + '/user/userForSelectByCompany.do', {formId:"subUnitForm",hiddenId:"targetusers",textId:"targetUsersName",userIds:userIds,jobIds:jobIds}, function(data) {
|
||||||
|
$("#user4SelectDiv").html(data);
|
||||||
|
openModal("user4SelectModal");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function dosubmit() {
|
||||||
|
$("#subForm").bootstrapValidator('validate');
|
||||||
|
if ($("#subForm").data('bootstrapValidator').isValid()) {
|
||||||
|
if (!calculateLeaveDays()) {
|
||||||
|
showAlert('d', '结束时间必须大于开始时间');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var routeNum = $("#routeNum").val();
|
||||||
|
$.post(ext.contextPath + "/administration/leaveApply/doHandle.do", $("#subForm").serialize() + "&" + $("#subUnitForm").serialize() + "&routeNum=" + routeNum, function(data) {
|
||||||
|
if (data.res == 1) {
|
||||||
|
closeModal('subModal');
|
||||||
|
$("#table").bootstrapTable('refresh');
|
||||||
|
} else {
|
||||||
|
showAlert('d', data.res == 0 ? '保存失败' : data.res);
|
||||||
|
}
|
||||||
|
}, 'json');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$(function(){
|
||||||
|
processSelectNodeForHandle("${businessUnitHandle.taskid}");
|
||||||
|
$("#subForm").bootstrapValidator({live:'disabled',fields:{
|
||||||
|
startDate:{validators:{notEmpty:{message:'请选择开始日期'}}},
|
||||||
|
startPeriod:{validators:{notEmpty:{message:'请选择开始时段'}}},
|
||||||
|
endDate:{validators:{notEmpty:{message:'请选择结束日期'}}},
|
||||||
|
endPeriod:{validators:{notEmpty:{message:'请选择结束时段'}}},
|
||||||
|
reason:{validators:{notEmpty:{message:'请填写申请事由'}}}
|
||||||
|
}});
|
||||||
|
$('#startDate,#endDate').datetimepicker({
|
||||||
|
language: 'zh-CN',
|
||||||
|
format: 'yyyy-mm-dd',
|
||||||
|
startView: 'month',
|
||||||
|
minView: 2,
|
||||||
|
maxView: 'year',
|
||||||
|
autoclose: true,
|
||||||
|
todayBtn: true,
|
||||||
|
todayHighlight: true
|
||||||
|
}).on('changeDate', function() {
|
||||||
|
calculateLeaveDays();
|
||||||
|
});
|
||||||
|
$('#startDate,#endDate,#startPeriod,#endPeriod').on('change', function() {
|
||||||
|
calculateLeaveDays();
|
||||||
|
});
|
||||||
|
$.post(ext.contextPath + '/administration/leaveApply/showExecuteView.do', {id:'${leaveApply.id}',inModal:'inModal'}, function(data) {
|
||||||
|
$("#showView").html(data);
|
||||||
|
});
|
||||||
|
var startInfo = parseLeaveTimeValue("${leaveApply.startTime}");
|
||||||
|
var endInfo = parseLeaveTimeValue("${leaveApply.endTime}");
|
||||||
|
$("#startDate").val(startInfo.date);
|
||||||
|
$("#startPeriod").val(startInfo.period);
|
||||||
|
$("#endDate").val(endInfo.date);
|
||||||
|
$("#endPeriod").val(endInfo.period);
|
||||||
|
calculateLeaveDays();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<div class="modal fade" id="subModal">
|
||||||
|
<div class="modal-dialog modal-xlg">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal"><span>×</span></button>
|
||||||
|
<h4 class="modal-title">退回修改(${taskName})</h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-7 col-xs-12">
|
||||||
|
<form class="form-horizontal" id="subForm">
|
||||||
|
<input type="hidden" name="id" value="${leaveApply.id}">
|
||||||
|
<input type="hidden" name="unitId" value="${leaveApply.unitId}">
|
||||||
|
<div class="form-group"><label class="col-sm-3 control-label">申请类型</label><div class="col-sm-8"><input class="form-control" name="applyType" value="${leaveApply.applyType}"></div></div>
|
||||||
|
<div class="form-group"><label class="col-sm-3 control-label">假别</label><div class="col-sm-8"><input class="form-control" name="leaveType" value="${leaveApply.leaveType}"></div></div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">开始日期</label>
|
||||||
|
<div class="col-sm-5"><input class="form-control" id="startDate" name="startDate" autocomplete="off" placeholder="请选择日期"></div>
|
||||||
|
<div class="col-sm-3">
|
||||||
|
<select class="form-control" id="startPeriod" name="startPeriod">
|
||||||
|
<option value="上午">上午</option>
|
||||||
|
<option value="下午">下午</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">结束日期</label>
|
||||||
|
<div class="col-sm-5"><input class="form-control" id="endDate" name="endDate" autocomplete="off" placeholder="请选择日期"></div>
|
||||||
|
<div class="col-sm-3">
|
||||||
|
<select class="form-control" id="endPeriod" name="endPeriod">
|
||||||
|
<option value="上午">上午</option>
|
||||||
|
<option value="下午">下午</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<input type="hidden" id="startTime" name="startTime" value="${leaveApply.startTime}">
|
||||||
|
<input type="hidden" id="endTime" name="endTime" value="${leaveApply.endTime}">
|
||||||
|
<input type="hidden" id="hours" name="hours" value="${leaveApply.hours}">
|
||||||
|
<div class="form-group"><label class="col-sm-3 control-label">天数</label><div class="col-sm-8"><input class="form-control" id="days" name="days" value="${leaveApply.days}" readonly placeholder="自动计算"></div></div>
|
||||||
|
<div class="form-group"><label class="col-sm-3 control-label">申请事由</label><div class="col-sm-8"><textarea class="form-control" rows="3" name="reason">${leaveApply.reason}</textarea></div></div>
|
||||||
|
<div class="form-group"><label class="col-sm-3 control-label">工作交接</label><div class="col-sm-8"><textarea class="form-control" rows="2" name="handoverDesc">${leaveApply.handoverDesc}</textarea></div></div>
|
||||||
|
<div class="form-group"><label class="col-sm-3 control-label">备注</label><div class="col-sm-8"><textarea class="form-control" rows="2" name="remark">${leaveApply.remark}</textarea></div></div>
|
||||||
|
</form>
|
||||||
|
<form class="form-horizontal" id="subUnitForm">
|
||||||
|
<input type="hidden" name="id" value="${businessUnitHandle.id}">
|
||||||
|
<input type="hidden" name="processid" value="${businessUnitHandle.processid}">
|
||||||
|
<input type="hidden" name="taskid" value="${businessUnitHandle.taskid}">
|
||||||
|
<input type="hidden" name="businessid" value="${businessUnitHandle.businessid}">
|
||||||
|
<input type="hidden" name="taskdefinitionkey" value="${businessUnitHandle.taskdefinitionkey}">
|
||||||
|
<input type="hidden" name="unitid" value="${businessUnitHandle.unitid}">
|
||||||
|
<div class="form-group"><label class="col-sm-3 control-label">驳回意见</label><div class="col-sm-8"><textarea class="form-control" rows="2" readonly>${rejectReason}</textarea></div></div>
|
||||||
|
<div class="form-group"><label class="col-sm-3 control-label">下一节点</label><div class="col-sm-6"><select class="form-control select2" id="routeNum" name="routeNum"></select></div></div>
|
||||||
|
<div id="selectUsers" class="form-group"><label class="col-sm-3 control-label">提交至</label><div class="col-sm-9"><input type="text" class="form-control" id="targetUsersName" name="targetUsersName" onclick="showUser4AuditSelectsFun();" placeholder="可不选;不选时谁签收谁审批"><input id="targetusers" name="targetusers" type="hidden" value="${businessUnitHandle.targetusers}"><input id="targetjobs" name="targetjobs" type="hidden" value=""></div></div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-5 col-xs-12" id="showView"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||||
|
<button type="button" class="btn btn-primary" onclick="dosubmit()">提交</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
161
src/main/webapp/jsp/administration/leaveApplyList.jsp
Normal file
161
src/main/webapp/jsp/administration/leaveApplyList.jsp
Normal file
@ -0,0 +1,161 @@
|
|||||||
|
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||||
|
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||||
|
<%@ page import="com.sipai.entity.base.ServerObject" %>
|
||||||
|
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||||
|
<style type="text/css">
|
||||||
|
.main-header,.content-header,.main-footer{display:none;}
|
||||||
|
.table-hover>tbody>tr:hover{cursor:pointer;}
|
||||||
|
</style>
|
||||||
|
<script type="text/javascript">
|
||||||
|
var companyId = "";
|
||||||
|
var addFun = function() {
|
||||||
|
$.post(ext.contextPath + '/administration/leaveApply/add.do', {companyId: companyId}, function(data) {
|
||||||
|
$("#subDiv").html(data);
|
||||||
|
openModal('subModal');
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var editFun = function(id) {
|
||||||
|
$.post(ext.contextPath + '/administration/leaveApply/edit.do', {id:id}, function(data) {
|
||||||
|
$("#subDiv").html(data);
|
||||||
|
openModal('subModal');
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var viewFun = function(id) {
|
||||||
|
$.post(ext.contextPath + '/administration/leaveApply/view.do', {id:id}, function(data) {
|
||||||
|
$("#subDiv").html(data);
|
||||||
|
openModal('subModal');
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var processFun = function(id) {
|
||||||
|
$.post(ext.contextPath + '/administration/leaveApply/showExecuteView.do', {id:id}, function(data) {
|
||||||
|
$("#subDiv").html(data);
|
||||||
|
openModal('leaveApplyExcuteModal');
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var showNotStartedProcessTip = function() {
|
||||||
|
showAlert('i', '该请假单尚未发起审批流程');
|
||||||
|
};
|
||||||
|
var formatLeaveHalfDay = function(value) {
|
||||||
|
if (!value) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
var text = $.trim(value);
|
||||||
|
var halfDayMatch = text.match(/^(\d{4}-\d{2}-\d{2})\s+(上午|下午)$/);
|
||||||
|
if (halfDayMatch) {
|
||||||
|
return halfDayMatch[1] + " " + halfDayMatch[2];
|
||||||
|
}
|
||||||
|
var dateTimeMatch = text.match(/^(\d{4}-\d{2}-\d{2})(?:\s+(\d{1,2})(?::\d{1,2}(?::\d{1,2})?)?(?:\.\d+)?)?$/);
|
||||||
|
if (dateTimeMatch) {
|
||||||
|
var hour = dateTimeMatch[2] ? parseInt(dateTimeMatch[2], 10) : 0;
|
||||||
|
return dateTimeMatch[1] + " " + (hour >= 12 ? "下午" : "上午");
|
||||||
|
}
|
||||||
|
return text;
|
||||||
|
};
|
||||||
|
var applyTypeTextMap = {
|
||||||
|
"leave": "请假",
|
||||||
|
"compensatory": "补假"
|
||||||
|
};
|
||||||
|
var leaveTypeTextMap = {
|
||||||
|
"annual": "年假",
|
||||||
|
"personal": "事假",
|
||||||
|
"sick": "病假",
|
||||||
|
"marriage": "婚假",
|
||||||
|
"maternity": "产假",
|
||||||
|
"funeral": "丧假",
|
||||||
|
"adjustment": "调休"
|
||||||
|
};
|
||||||
|
var formatApplyType = function(value) {
|
||||||
|
return applyTypeTextMap[value] || value || "";
|
||||||
|
};
|
||||||
|
var formatLeaveType = function(value) {
|
||||||
|
return leaveTypeTextMap[value] || value || "";
|
||||||
|
};
|
||||||
|
var formatProcessStarted = function(row) {
|
||||||
|
return row.processdefid ? "已发起" : "未发起";
|
||||||
|
};
|
||||||
|
var deleteFun = function(id) {
|
||||||
|
$.post(ext.contextPath + '/administration/leaveApply/delete.do', {id:id}, function(data) {
|
||||||
|
if (data == 1) { $("#table").bootstrapTable('refresh'); } else { showAlert('d','删除失败','mainAlertdiv'); }
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var dosearch = function(){ $("#table").bootstrapTable('refresh'); };
|
||||||
|
$(function(){
|
||||||
|
$.post(ext.contextPath + '/user/getUnitForTree.do', {ng:''}, function(data){
|
||||||
|
if (data.length > 0) {
|
||||||
|
companyId = data[0].id;
|
||||||
|
$("#search_pid").val(companyId);
|
||||||
|
$("#cname_input").val(data[0].text);
|
||||||
|
initFun();
|
||||||
|
}
|
||||||
|
}, 'json');
|
||||||
|
});
|
||||||
|
var initFun = function() {
|
||||||
|
$("#table").bootstrapTable({
|
||||||
|
url: ext.contextPath + '/administration/leaveApply/getList.do',
|
||||||
|
cache: false,
|
||||||
|
striped: true,
|
||||||
|
pagination: true,
|
||||||
|
pageList: [10,20,50],
|
||||||
|
pageSize: 10,
|
||||||
|
pageNumber: 1,
|
||||||
|
sidePagination: 'server',
|
||||||
|
queryParams: function(params) {
|
||||||
|
return {rows: params.limit,page: params.offset/params.limit+1,sort: params.sort,order: params.order,search_code: companyId,search_name: $("#search_name").val(),applyType: $("#applyType").val()};
|
||||||
|
},
|
||||||
|
sortName: 'insdt',
|
||||||
|
sortOrder: 'desc',
|
||||||
|
columns: [
|
||||||
|
{checkbox: true},
|
||||||
|
{field: 'applyType', title: '申请类型', align: 'center', formatter: function(value){ return formatApplyType(value); }},
|
||||||
|
{field: 'leaveType', title: '假别', align: 'center', formatter: function(value){ return formatLeaveType(value); }},
|
||||||
|
{field: 'startTime', title: '开始时间', align: 'center', formatter: function(value){ return formatLeaveHalfDay(value); }},
|
||||||
|
{field: 'endTime', title: '结束时间', align: 'center', formatter: function(value){ return formatLeaveHalfDay(value); }},
|
||||||
|
{field: 'days', title: '天数', align: 'center'},
|
||||||
|
{field: 'auditMan', title: '审批人', align: 'center'},
|
||||||
|
{field: 'processdefid', title: '流程状态', align: 'center', formatter: function(value,row){ return formatProcessStarted(row); }},
|
||||||
|
{field: 'stateName', title: '状态', align: 'center'},
|
||||||
|
{field: 'id', title: '操作', align: 'center', formatter: function(value,row,index){
|
||||||
|
var processLink = row.processdefid
|
||||||
|
? "<a href='javascript:processFun(\""+row.id+"\")'>流程</a>"
|
||||||
|
: "<a href='javascript:showNotStartedProcessTip()'>未发起</a>";
|
||||||
|
return "<a href='javascript:editFun(\""+row.id+"\")'>编辑</a> | "
|
||||||
|
+ processLink + " | "
|
||||||
|
+ "<a href='javascript:deleteFun(\""+row.id+"\")'>删除</a>";
|
||||||
|
}}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<head>
|
||||||
|
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<section class="content">
|
||||||
|
<div id="mainAlertdiv"></div>
|
||||||
|
<div id="subDiv"></div>
|
||||||
|
<div id="user4SelectDiv"></div>
|
||||||
|
<div class="box box-primary">
|
||||||
|
<div class="box-header with-border">
|
||||||
|
<h3 class="box-title">请假补假申请</h3>
|
||||||
|
<div class="box-tools pull-right">
|
||||||
|
<button type="button" class="btn btn-primary btn-sm" onclick="addFun()">新增</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="box-body">
|
||||||
|
<form id="searchForm" class="form-inline" style="margin-bottom:10px;">
|
||||||
|
<input type="hidden" id="search_pid">
|
||||||
|
<input type="text" id="cname_input" class="form-control" placeholder="厂区" readonly>
|
||||||
|
<input type="text" id="search_name" class="form-control" placeholder="事由关键字">
|
||||||
|
<select id="applyType" class="form-control">
|
||||||
|
<option value="">全部类型</option>
|
||||||
|
<option value="leave">请假</option>
|
||||||
|
<option value="compensatory">补假</option>
|
||||||
|
</select>
|
||||||
|
<button type="button" class="btn btn-default" onclick="dosearch()">查询</button>
|
||||||
|
</form>
|
||||||
|
<table id="table" class="table table-hover"></table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</body>
|
||||||
47
src/main/webapp/jsp/administration/leaveApplyView.jsp
Normal file
47
src/main/webapp/jsp/administration/leaveApplyView.jsp
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||||
|
<script type="text/javascript">
|
||||||
|
function formatLeaveHalfDay(value) {
|
||||||
|
if (!value) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
var text = $.trim(value);
|
||||||
|
var halfDayMatch = text.match(/^(\d{4}-\d{2}-\d{2})\s+(上午|下午)$/);
|
||||||
|
if (halfDayMatch) {
|
||||||
|
return halfDayMatch[1] + " " + halfDayMatch[2];
|
||||||
|
}
|
||||||
|
var dateTimeMatch = text.match(/^(\d{4}-\d{2}-\d{2})(?:\s+(\d{1,2})(?::\d{1,2}(?::\d{1,2})?)?(?:\.\d+)?)?$/);
|
||||||
|
if (dateTimeMatch) {
|
||||||
|
var hour = dateTimeMatch[2] ? parseInt(dateTimeMatch[2], 10) : 0;
|
||||||
|
return dateTimeMatch[1] + " " + (hour >= 12 ? "下午" : "上午");
|
||||||
|
}
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
$(function(){
|
||||||
|
$("#viewStartTimeText").text(formatLeaveHalfDay("${leaveApply.startTime}"));
|
||||||
|
$("#viewEndTimeText").text(formatLeaveHalfDay("${leaveApply.endTime}"));
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<div class="modal fade" id="subModal">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal"><span>×</span></button>
|
||||||
|
<h4 class="modal-title">查看申请</h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<table class="table table-bordered">
|
||||||
|
<tr><th>申请类型</th><td>${leaveApply.applyType}</td><th>假别</th><td>${leaveApply.leaveType}</td></tr>
|
||||||
|
<tr><th>开始时间</th><td id="viewStartTimeText"></td><th>结束时间</th><td id="viewEndTimeText"></td></tr>
|
||||||
|
<tr><th>天数</th><td>${leaveApply.days}</td><th>审批人</th><td>${leaveApply.auditMan}</td></tr>
|
||||||
|
<tr><th>状态</th><td colspan="3">${leaveApply.stateName}</td></tr>
|
||||||
|
<tr><th>申请事由</th><td colspan="3">${leaveApply.reason}</td></tr>
|
||||||
|
<tr><th>工作交接</th><td colspan="3">${leaveApply.handoverDesc}</td></tr>
|
||||||
|
<tr><th>备注</th><td colspan="3">${leaveApply.remark}</td></tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@ -1,9 +1,10 @@
|
|||||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
var previews = new Array();
|
// 不重新定义这些变量,直接使用主页面的全局变量
|
||||||
var previewConfigs = new Array();
|
// var previews = new Array();
|
||||||
var filelist = new Array();
|
// var previewConfigs = new Array();
|
||||||
|
// var filelist = new Array();
|
||||||
|
|
||||||
//初始化fileinput控件(第一次初始化)
|
//初始化fileinput控件(第一次初始化)
|
||||||
function initFileInput(ctrlName, uploadUrl) {
|
function initFileInput(ctrlName, uploadUrl) {
|
||||||
@ -55,9 +56,10 @@
|
|||||||
//导入文件上传完成之后的事件
|
//导入文件上传完成之后的事件
|
||||||
control.on("fileuploaded", function (event, data, previewId, index) {
|
control.on("fileuploaded", function (event, data, previewId, index) {
|
||||||
if (data.response.suc) {
|
if (data.response.suc) {
|
||||||
<%--getFileListMinioPic('${param.divId}','edit');--%>
|
// 直接使用主页面的全局变量重新加载文件列表
|
||||||
// getFileListMinioPic('abnormityFileId', 'edit', '', previews, previewConfigs);
|
|
||||||
getFileListMinioPic('${param.divId}', 'edit', '', previews, previewConfigs);
|
getFileListMinioPic('${param.divId}', 'edit', '', previews, previewConfigs);
|
||||||
|
// 关闭上传弹窗,返回主页面
|
||||||
|
closeModal('fileInputModal');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -191,10 +191,109 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.Middle3 {
|
.Middle3 {
|
||||||
width: 2100px;
|
width: 2800px;
|
||||||
|
height: 1600px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 300px;
|
top: 206px;
|
||||||
left: 2700px;
|
left: 2376px;
|
||||||
|
}
|
||||||
|
.Middle3 img,
|
||||||
|
.Middle3 .monitor-img {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
z-index: 1;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
/* 绿色圆点样式 */
|
||||||
|
.green-dot {
|
||||||
|
position: absolute;
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
background: #00ff00;
|
||||||
|
border-radius: 50%;
|
||||||
|
cursor: pointer;
|
||||||
|
box-shadow: 0 0 20px #00ff00, 0 0 40px #00ff00;
|
||||||
|
z-index: 10000;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
pointer-events: auto;
|
||||||
|
}
|
||||||
|
.green-dot:hover {
|
||||||
|
transform: scale(1.3);
|
||||||
|
box-shadow: 0 0 15px #00ff00, 0 0 30px #00ff00;
|
||||||
|
}
|
||||||
|
/* 数据弹窗样式 */
|
||||||
|
.dot-popup {
|
||||||
|
position: absolute;
|
||||||
|
background: rgba(0, 30, 60, 0.98);
|
||||||
|
border: 3px solid #00ff00;
|
||||||
|
border-radius: 15px;
|
||||||
|
padding: 30px 40px;
|
||||||
|
z-index: 99999;
|
||||||
|
min-width: 400px;
|
||||||
|
max-width: 600px;
|
||||||
|
display: none;
|
||||||
|
box-shadow: 0 0 30px rgba(0, 255, 0, 0.5);
|
||||||
|
}
|
||||||
|
.dot-popup.show {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.dot-popup-title {
|
||||||
|
color: #00ff00;
|
||||||
|
font-size: 32px;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
text-align: center;
|
||||||
|
border-bottom: 2px solid rgba(0, 255, 0, 0.5);
|
||||||
|
padding-bottom: 15px;
|
||||||
|
}
|
||||||
|
.dot-popup-content {
|
||||||
|
color: #fff;
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
.dot-popup-item {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 12px 0;
|
||||||
|
border-bottom: 1px solid rgba(255, 255, 255, 0.2);
|
||||||
|
}
|
||||||
|
.dot-popup-item:last-child {
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
.dot-popup-label {
|
||||||
|
color: #7ef3ff;
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
.dot-popup-value {
|
||||||
|
color: #fff;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
.dot-popup-close {
|
||||||
|
position: absolute;
|
||||||
|
top: 15px;
|
||||||
|
right: 20px;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 36px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.dot-popup-close:hover {
|
||||||
|
color: #00ff00;
|
||||||
|
}
|
||||||
|
.popup-overlay {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
/*background: rgba(0, 0, 0, 0.5);*/
|
||||||
|
z-index: 99998;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.popup-overlay.show {
|
||||||
|
display: block;
|
||||||
}
|
}
|
||||||
/* 全屏提示遮罩 */
|
/* 全屏提示遮罩 */
|
||||||
.fullscreen-overlay {
|
.fullscreen-overlay {
|
||||||
@ -422,6 +521,7 @@
|
|||||||
<div class="Middle">
|
<div class="Middle">
|
||||||
<div class="Middle1">
|
<div class="Middle1">
|
||||||
<!-- 药耗 -->
|
<!-- 药耗 -->
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<div class="yaohao D_PACDSYH"></div>
|
<div class="yaohao D_PACDSYH"></div>
|
||||||
<div class="yaohao D_YiSNDSYH"></div>
|
<div class="yaohao D_YiSNDSYH"></div>
|
||||||
@ -507,111 +607,76 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="Middle2">
|
<!-- 隐藏的数据容器,由JS动态生成 -->
|
||||||
<div>
|
<div id="hiddenDataContainer" style="display: none;"></div>
|
||||||
<span class="Middle2-value" id="D_YanYCORP"></span>
|
|
||||||
<span class="Middle2-value" id="D_QueYCRJY1"></span>
|
|
||||||
<span class="Middle2-value" id="D_HaoYCRJY"></span>
|
|
||||||
<span class="Middle2-value" id="D_HaoYCRJY2"></span>
|
|
||||||
<span class="Middle2-value" id="D_HaoYCWNND"></span>
|
|
||||||
<span class="Middle2-value" id="D_MoCWNND"></span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<span class="Middle2-value" id="D_BengZYW"></span>
|
|
||||||
<span class="Middle2-value" id="D_TiSB101DL"></span>
|
|
||||||
<span class="Middle2-value" id="D_TiSB102DL"></span>
|
|
||||||
<span class="Middle2-value" id="D_TiSB103DL"></span>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<span class="Middle2-value" id="D_NingMSJYLL"></span>
|
|
||||||
<span class="Middle2-value" id="D_YaLSQNLL"></span>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<span class="Middle2-value" id="D_NingMSCGYW"></span>
|
|
||||||
<span class="Middle2-value" id="D_YaLSQNLL"></span>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<span class="Middle2-value" id="D_CiLSNJYLL"></span>
|
|
||||||
<span class="Middle2-value" id="D_PACJYLL"></span>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<span class="Middle2-value" id="D_CiLSNCGYW"></span>
|
|
||||||
<span class="Middle2-value" id="D_PACCGYW"></span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 中间图表 -->
|
<!-- 中间图表 -->
|
||||||
<div class="Middle3">
|
<div class="Middle3">
|
||||||
<!-- <img src="../../IMG/monitor.png" style="width: 100%; height: 100%" /> -->
|
<img class="monitor-img" src="<%=request.getContextPath()%>/IMG/monitor.png" />
|
||||||
<img
|
<!-- 10个绿色圆点 -->
|
||||||
src="<%=request.getContextPath()%>/IMG/monitor.png"
|
<div class="green-dot" data-index="0" style="top: 431px; left: 200px;"></div>
|
||||||
style="width: 100%; height: 100%"
|
<div class="green-dot" data-index="1" style="top: 150px; left: 600px;"></div>
|
||||||
/>
|
<div class="green-dot" data-index="2" style="top: 174px; left: 1112px;"></div>
|
||||||
|
<div class="green-dot" data-index="3" style="top: 280px; left: 1800px;"></div>
|
||||||
|
<div class="green-dot" data-index="4" style="top: 150px; left: 2550px;"></div>
|
||||||
|
<div class="green-dot" data-index="5" style="top: 1130px; left: 200px;"></div>
|
||||||
|
<div class="green-dot" data-index="6" style="top: 800px; left: 600px;"></div>
|
||||||
|
<div class="green-dot" data-index="7" style="top: 900px; left: 1000px;"></div>
|
||||||
|
<div class="green-dot" data-index="8" style="top: 1000px; left: 2530px;"></div>
|
||||||
|
<div class="green-dot" data-index="9" style="top: 800px; left: 1800px;"></div>
|
||||||
|
<!-- 数据弹窗 -->
|
||||||
|
<div class="dot-popup" id="dotPopup">
|
||||||
|
<span class="dot-popup-close" onclick="closePopup()">×</span>
|
||||||
|
<div class="dot-popup-title" id="popupTitle">设备数据</div>
|
||||||
|
<div class="dot-popup-content" id="popupContent"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="Middle4">
|
|
||||||
<!-- 进水 -->
|
|
||||||
<div>
|
|
||||||
<div class="Middle4_val" id="D_JSLL">100</div>
|
|
||||||
<div class="Middle4_val" id="D_JinSPH">100</div>
|
|
||||||
<div class="Middle4_val" id="D_JinSCOD">100</div>
|
|
||||||
<div class="Middle4_val" id="D_JinSAL">100</div>
|
|
||||||
<div class="Middle4_val" id="D_JinSWD">100</div>
|
|
||||||
<div class="Middle4_val" id="D_JinSLJLL">100</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 出水 -->
|
|
||||||
<div>
|
|
||||||
<div class="Middle4_val" id="D_ChuSLL">100</div>
|
|
||||||
<div class="Middle4_val" id="D_ChuSPH">100</div>
|
|
||||||
<div class="Middle4_val" id="D_ChuSCOD">100</div>
|
|
||||||
<div class="Middle4_val" id="D_ChuSAL">100</div>
|
|
||||||
<div class="Middle4_val" id="D_ChuSWD">100</div>
|
|
||||||
<div class="Middle4_val" id="D_ChuSZL">100</div>
|
|
||||||
<div class="Middle4_val" id="D_ChuSZLv">100</div>
|
|
||||||
<div class="Middle4_val" id="D_ChuSLJLL">100</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<div class="Middle4_val" id="D_FanXBCKLL">200</div>
|
|
||||||
<div class="Middle4_val" id="D_FanXBCKYL">200</div>
|
|
||||||
<div class="Middle4_val" id="D_ShengYWNCKLL">200</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<div class="Middle4_val" id="D_QingSCYW">200</div>
|
|
||||||
<div class="Middle4_val" id="D_FeiYCYW">200</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 视频 -->
|
<!-- 视频 -->
|
||||||
<div class="right"></div>
|
<div class="right"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- 弹窗遮罩 -->
|
||||||
|
<div class="popup-overlay" id="popupOverlay"></div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
// 定义 ext 变量供 main_js.js 使用
|
||||||
|
var ext = {
|
||||||
|
contextPath: '<%=request.getContextPath()%>'
|
||||||
|
};
|
||||||
|
|
||||||
// ==================== 数据统一管理 ====================
|
// ==================== 数据统一管理 ====================
|
||||||
var pageData = {
|
var pageData = {
|
||||||
// 水量数据 (slqs)
|
// 水量数据 (slqs)
|
||||||
slqs: {
|
slqs: {
|
||||||
todayTotal: 6040, // 今日水量
|
todayTotal: 0, // 今日水量
|
||||||
yesterdayTotal: 4197, // 昨日水量
|
yesterdayTotal: 0, // 昨日水量
|
||||||
monthTotal: 12356, // 本月水量
|
monthTotal: 0, // 本月水量
|
||||||
},
|
},
|
||||||
|
|
||||||
// 泥处理指标 (ncl)
|
// 泥处理指标 (ncl)
|
||||||
ncl: {
|
ncl: {
|
||||||
val1: 0, // 泥处理指标1
|
val1: 0, // 泥处理指标1
|
||||||
val2: 200, // 泥处理指标2
|
val2: 0, // 泥处理指标2
|
||||||
val3: 4.89, // 泥处理指标3
|
val3: 0, // 泥处理指标3
|
||||||
|
},
|
||||||
|
|
||||||
|
// 泥处理点位编码配置
|
||||||
|
nclMPointKeys: {
|
||||||
|
val1: "D_NiCL", // 泥处理指标1点位编码
|
||||||
|
val2: "D_NiCL", // 泥处理指标2点位编码
|
||||||
|
val3: "D_NiCL", // 泥处理指标3点位编码
|
||||||
|
chart: "D_NiCL", // 泥处理图表点位编码
|
||||||
},
|
},
|
||||||
|
|
||||||
// 药耗数据 (yaohao)
|
// 药耗数据 (yaohao)
|
||||||
yaohao: {
|
yaohao: {
|
||||||
D_PACDSYH: 19800,
|
D_PACDSYH: 0,
|
||||||
D_YiSNDSYH: 2090,
|
D_YiSNDSYH: 0,
|
||||||
D_CiLSNDSYH: 1092,
|
D_CiLSNDSYH: 0,
|
||||||
},
|
},
|
||||||
|
|
||||||
// 质量指标表格数据
|
// 质量指标表格数据
|
||||||
@ -676,43 +741,102 @@
|
|||||||
|
|
||||||
// 七日水量图表数据
|
// 七日水量图表数据
|
||||||
sevenDaysChart: {
|
sevenDaysChart: {
|
||||||
xAxis: [
|
xAxis: [],
|
||||||
"11-10",
|
data: [],
|
||||||
"11-11",
|
|
||||||
"11-12",
|
|
||||||
"11-13",
|
|
||||||
"11-14",
|
|
||||||
"11-15",
|
|
||||||
"11-16",
|
|
||||||
"11-17",
|
|
||||||
],
|
|
||||||
data: [5200, 4300, 4200, 4300, 6800, 5200, 7400, 5600],
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 泥处理图表数据
|
// 泥处理图表数据
|
||||||
nclChart: {
|
nclChart: {
|
||||||
xAxis: [
|
xAxis: [],
|
||||||
"2:00",
|
|
||||||
"4:00",
|
|
||||||
"6:00",
|
|
||||||
"8:00",
|
|
||||||
"10:00",
|
|
||||||
"12:00",
|
|
||||||
"14:00",
|
|
||||||
"16:00",
|
|
||||||
"18:00",
|
|
||||||
"20:00",
|
|
||||||
],
|
|
||||||
data: [120, 160, 90, 250, 170, 340, 280, 330, 80, 260],
|
data: [120, 160, 90, 250, 170, 340, 280, 330, 80, 260],
|
||||||
},
|
},
|
||||||
|
|
||||||
// 质量图表数据
|
// 质量图表数据
|
||||||
qualityChart: {
|
qualityChart: {
|
||||||
xAxis: ["11", "12", "13", "14", "15", "16", "17"],
|
xAxis: [],
|
||||||
data: [8, 13, 9, 14, 21, 14, 18],
|
data: [],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// ==================== 统一点位配置管理 ====================
|
||||||
|
// 所有点位配置:ID + 名称 + 分组
|
||||||
|
var pointConfig = {
|
||||||
|
// 工艺参数 (middle2)
|
||||||
|
D_YanYCORP: { name: "厌氧池ORP", group: "middle2" },
|
||||||
|
D_QueYCRJY1: { name: "缺氧池入口溶解氧1", group: "middle2" },
|
||||||
|
D_HaoYCRJY: { name: "好氧池溶解氧", group: "middle2" },
|
||||||
|
D_HaoYCRJY2: { name: "好氧池溶解氧2", group: "middle2" },
|
||||||
|
D_HaoYCWNND: { name: "好氧池污泥浓度", group: "middle2" },
|
||||||
|
D_MoCWNND: { name: "膜池污泥浓度", group: "middle2" },
|
||||||
|
D_BengZYW: { name: "泵站液位", group: "middle2" },
|
||||||
|
D_TiSB101DL: { name: "提升泵101电流", group: "middle2" },
|
||||||
|
D_TiSB102DL: { name: "提升泵102电流", group: "middle2" },
|
||||||
|
D_TiSB103DL: { name: "提升泵103电流", group: "middle2" },
|
||||||
|
D_NingMSJYLL: { name: "混凝沉淀进水流量", group: "middle2" },
|
||||||
|
D_YaLSQNLL: { name: "压力气流量", group: "middle2" },
|
||||||
|
D_NingMSCGYW: { name: "混凝沉淀出水液位", group: "middle2" },
|
||||||
|
D_CiLSNJYLL: { name: "次氯酸钠加药流量", group: "middle2" },
|
||||||
|
D_PACJYLL: { name: "PAC加药流量", group: "middle2" },
|
||||||
|
D_CiLSNCGYW: { name: "次氯酸钠储罐液位", group: "middle2" },
|
||||||
|
D_PACCGYW: { name: "PAC储罐液位", group: "middle2" },
|
||||||
|
// 进出水指标 (middle4)
|
||||||
|
D_JSLL: { name: "进水流量", group: "middle4" },
|
||||||
|
D_JinSPH: { name: "进水PH", group: "middle4" },
|
||||||
|
D_JinSCOD: { name: "进水COD", group: "middle4" },
|
||||||
|
D_JinSAL: { name: "进水氨氮", group: "middle4" },
|
||||||
|
D_JinSWD: { name: "进水温度", group: "middle4" },
|
||||||
|
D_JinSLJLL: { name: "进水累计流量", group: "middle4" },
|
||||||
|
D_ChuSLL: { name: "出水流量", group: "middle4" },
|
||||||
|
D_ChuSPH: { name: "出水PH", group: "middle4" },
|
||||||
|
D_ChuSCOD: { name: "出水COD", group: "middle4" },
|
||||||
|
D_ChuSAL: { name: "出水氨氮", group: "middle4" },
|
||||||
|
D_ChuSWD: { name: "出水温度", group: "middle4" },
|
||||||
|
D_ChuSZL: { name: "出水浊度", group: "middle4" },
|
||||||
|
D_ChuSZLv: { name: "出水浊度值", group: "middle4" },
|
||||||
|
D_ChuSLJLL: { name: "出水累计流量", group: "middle4" },
|
||||||
|
D_FanXBCKLL: { name: "反洗泵出口流量", group: "middle4" },
|
||||||
|
D_FanXBCKYL: { name: "反洗泵出口压力", group: "middle4" },
|
||||||
|
D_ShengYWNCKLL: { name: "剩余污泥浓度流量", group: "middle4" },
|
||||||
|
D_QingSCYW: { name: "清水池液位", group: "middle4" },
|
||||||
|
D_FeiYCYW: { name: "废液池液位", group: "middle4" }
|
||||||
|
};
|
||||||
|
|
||||||
|
// 圆点数据配置:每个圆点对应的数据点ID
|
||||||
|
var dotDataConfig = [
|
||||||
|
{ name: "进水口", points: ["D_JSLL", "D_JinSPH", "D_JinSCOD", "D_JinSAL", "D_JinSWD", "D_JinSLJLL"] },
|
||||||
|
{ name: "泵房", points: ["D_BengZYW", "D_TiSB101DL", "D_TiSB102DL", "D_TiSB103DL"] },
|
||||||
|
{ name: "厌氧池", points: ["D_YanYCORP"] },
|
||||||
|
{ name: "缺氧池", points: ["D_QueYCRJY1", "D_HaoYCRJY"] },
|
||||||
|
{ name: "好氧池", points: ["D_HaoYCRJY2", "D_HaoYCWNND", "D_MoCWNND"] },
|
||||||
|
{ name: "污泥处理", points: ["D_QingSCYW", "D_FeiYCYW"] },
|
||||||
|
{ name: "混凝沉淀", points: ["D_NingMSJYLL", "D_YaLSQNLL", "D_NingMSCGYW"] },
|
||||||
|
{ name: "加药间", points: ["D_CiLSNJYLL", "D_PACJYLL", "D_CiLSNCGYW", "D_PACCGYW"] },
|
||||||
|
{ name: "出水口", points: ["D_ChuSLL", "D_ChuSPH", "D_ChuSCOD", "D_ChuSAL", "D_ChuSWD", "D_ChuSZL", "D_ChuSZLv", "D_ChuSLJLL"] },
|
||||||
|
{ name: "反洗泵房", points: ["D_FanXBCKLL", "D_FanXBCKYL", "D_ShengYWNCKLL"] }
|
||||||
|
];
|
||||||
|
|
||||||
|
// 获取所有点位ID列表
|
||||||
|
function getAllPointIds() {
|
||||||
|
return Object.keys(pointConfig);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据分组获取点位ID列表
|
||||||
|
function getPointIdsByGroup(group) {
|
||||||
|
return Object.keys(pointConfig).filter(function(id) {
|
||||||
|
return pointConfig[id].group === group;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 动态生成隐藏的数据容器元素
|
||||||
|
function initHiddenDataContainer() {
|
||||||
|
var container = document.getElementById('hiddenDataContainer');
|
||||||
|
var html = '';
|
||||||
|
Object.keys(pointConfig).forEach(function(pointId) {
|
||||||
|
html += '<span id="' + pointId + '"></span>';
|
||||||
|
});
|
||||||
|
container.innerHTML = html;
|
||||||
|
}
|
||||||
|
|
||||||
// 更新水量显示
|
// 更新水量显示
|
||||||
function updateSlqs() {
|
function updateSlqs() {
|
||||||
$(".slqs-todayTotal").text(pageData.slqs.todayTotal);
|
$(".slqs-todayTotal").text(pageData.slqs.todayTotal);
|
||||||
@ -764,44 +888,6 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 从接口获取数据并更新页面(示例方法,供后期调用)
|
|
||||||
function fetchDataFromApi(apiUrl) {
|
|
||||||
$.ajax({
|
|
||||||
url: apiUrl,
|
|
||||||
type: "GET",
|
|
||||||
dataType: "json",
|
|
||||||
success: function (response) {
|
|
||||||
// 假设接口返回的数据格式如下:
|
|
||||||
// {
|
|
||||||
// slqs: { todayTotal: xxx, yesterdayTotal: xxx, monthTotal: xxx },
|
|
||||||
// ncl: { val1: xxx, val2: xxx, val3: xxx },
|
|
||||||
// yaohao: { val1: xxx, val2: xxx, val3: xxx },
|
|
||||||
// qualityTable: [...],
|
|
||||||
// sevenDaysChart: { xAxis: [...], data: [...] },
|
|
||||||
// nclChart: { xAxis: [...], data: [...] },
|
|
||||||
// qualityChart: { xAxis: [...], data: [...] }
|
|
||||||
// }
|
|
||||||
if (response) {
|
|
||||||
if (response.slqs) pageData.slqs = response.slqs;
|
|
||||||
if (response.ncl) pageData.ncl = response.ncl;
|
|
||||||
if (response.yaohao) pageData.yaohao = response.yaohao;
|
|
||||||
if (response.qualityTable)
|
|
||||||
pageData.qualityTable = response.qualityTable;
|
|
||||||
if (response.sevenDaysChart)
|
|
||||||
pageData.sevenDaysChart = response.sevenDaysChart;
|
|
||||||
if (response.nclChart) pageData.nclChart = response.nclChart;
|
|
||||||
if (response.qualityChart)
|
|
||||||
pageData.qualityChart = response.qualityChart;
|
|
||||||
|
|
||||||
refreshPage();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
error: function (xhr, status, error) {
|
|
||||||
console.error("获取数据失败:", error);
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 刷新页面所有数据
|
// 刷新页面所有数据
|
||||||
function refreshPage() {
|
function refreshPage() {
|
||||||
updateSlqs();
|
updateSlqs();
|
||||||
@ -813,6 +899,14 @@
|
|||||||
initQualityChart();
|
initQualityChart();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 格式化日期为 YYYY-MM-DD 格式
|
||||||
|
function formatDate(date) {
|
||||||
|
var year = date.getFullYear();
|
||||||
|
var month = (date.getMonth() + 1).toString().padStart(2, "0");
|
||||||
|
var day = date.getDate().toString().padStart(2, "0");
|
||||||
|
return year + "-" + month + "-" + day;
|
||||||
|
}
|
||||||
|
|
||||||
// 进入全屏函数
|
// 进入全屏函数
|
||||||
function enterFullscreen() {
|
function enterFullscreen() {
|
||||||
var elem = document.documentElement;
|
var elem = document.documentElement;
|
||||||
@ -825,23 +919,31 @@
|
|||||||
/* IE11 */
|
/* IE11 */
|
||||||
elem.msRequestFullscreen();
|
elem.msRequestFullscreen();
|
||||||
}
|
}
|
||||||
// 隐藏提示遮罩
|
|
||||||
document.getElementById("fullscreenOverlay").style.display = "none";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 监听全屏状态变化
|
// 退出全屏函数
|
||||||
document.addEventListener("fullscreenchange", function () {
|
function exitFullscreen() {
|
||||||
var overlay = document.getElementById("fullscreenOverlay");
|
if (document.exitFullscreen) {
|
||||||
if (!document.fullscreenElement) {
|
document.exitFullscreen();
|
||||||
// 退出全屏时显示提示
|
} else if (document.webkitExitFullscreen) {
|
||||||
overlay.style.display = "flex";
|
document.webkitExitFullscreen();
|
||||||
|
} else if (document.msExitFullscreen) {
|
||||||
|
document.msExitFullscreen();
|
||||||
}
|
}
|
||||||
});
|
|
||||||
document.addEventListener("webkitfullscreenchange", function () {
|
|
||||||
var overlay = document.getElementById("fullscreenOverlay");
|
|
||||||
if (!document.webkitFullscreenElement) {
|
|
||||||
overlay.style.display = "flex";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 切换全屏状态
|
||||||
|
function toggleFullscreen() {
|
||||||
|
if (document.fullscreenElement || document.webkitFullscreenElement) {
|
||||||
|
exitFullscreen();
|
||||||
|
} else {
|
||||||
|
enterFullscreen();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 双击全屏功能(只进入全屏,不退出)
|
||||||
|
document.addEventListener('dblclick', function(e) {
|
||||||
|
enterFullscreen();
|
||||||
});
|
});
|
||||||
|
|
||||||
// 获取水量统计数据
|
// 获取水量统计数据
|
||||||
@ -953,54 +1055,52 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取点位信息数据
|
// 获取泥处理数据(每日汇总)
|
||||||
// mpcode: 点位编码
|
function fetchNclData() {
|
||||||
// sdt: 开始时间 (可选,默认7天前)
|
var mPointKey = pageData.nclMPointKeys.chart;
|
||||||
// edt: 结束时间 (可选,默认当前时间)
|
|
||||||
// 返回: Promise对象
|
|
||||||
function fetchPointData(mpcode, sdt, edt) {
|
|
||||||
// 默认时间范围:近7天
|
|
||||||
if (!edt) {
|
|
||||||
var now = new Date();
|
var now = new Date();
|
||||||
edt = formatDate(now);
|
var endTime = formatDate(now) + " 23:59:59";
|
||||||
}
|
var startTime = formatDate(new Date(now.getTime() - 10 * 24 * 60 * 60 * 1000)) + " 00:00:00"; // 最近10天
|
||||||
if (!sdt) {
|
|
||||||
var sevenDaysAgo = new Date();
|
|
||||||
sevenDaysAgo.setDate(sevenDaysAgo.getDate() - 7);
|
|
||||||
sdt = formatDate(sevenDaysAgo);
|
|
||||||
}
|
|
||||||
|
|
||||||
return new Promise(function(resolve, reject) {
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '<%=request.getContextPath()%>/data/getDetailData.do',
|
url: "<%=request.getContextPath()%>/mpoint/data/getDailyAggregation.do",
|
||||||
type: 'GET',
|
type: "GET",
|
||||||
data: {
|
data: {
|
||||||
mpcode: mpcode,
|
mPointKey: mPointKey,
|
||||||
sdt: sdt,
|
startTime: startTime,
|
||||||
edt: edt
|
endTime: endTime
|
||||||
},
|
},
|
||||||
dataType: 'json',
|
dataType: "json",
|
||||||
success: function(response) {
|
success: function (response) {
|
||||||
console.log('点位数据[' + mpcode + ']:', response);
|
console.log("泥处理数据:", response);
|
||||||
resolve(response);
|
if (response && response.success && response.dailyData) {
|
||||||
|
var xAxis = [];
|
||||||
|
var data = [];
|
||||||
|
response.dailyData.forEach(function (item) {
|
||||||
|
// 日期格式: "2026-03-07" -> "03-07"
|
||||||
|
var dateStr = item.dateStr || "";
|
||||||
|
if (dateStr.length >= 10) {
|
||||||
|
xAxis.push(dateStr.substring(5)); // 取 "MM-DD" 部分
|
||||||
|
} else {
|
||||||
|
xAxis.push(dateStr);
|
||||||
|
}
|
||||||
|
data.push(parseFloat(item.totalValue) || 0);
|
||||||
|
});
|
||||||
|
pageData.nclChart.xAxis = xAxis;
|
||||||
|
pageData.nclChart.data = data;
|
||||||
|
initNclChart(); // 重新渲染图表
|
||||||
|
}
|
||||||
},
|
},
|
||||||
error: function(xhr, status, error) {
|
error: function (xhr, status, error) {
|
||||||
console.error('获取点位数据失败:', mpcode, error);
|
console.error("获取泥处理数据失败:", error);
|
||||||
reject(error);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 格式化日期为 YYYY-MM-DD 格式
|
|
||||||
function formatDate(date) {
|
|
||||||
var year = date.getFullYear();
|
|
||||||
var month = (date.getMonth() + 1).toString().padStart(2, "0");
|
|
||||||
var day = date.getDate().toString().padStart(2, "0");
|
|
||||||
return year + "-" + month + "-" + day;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
|
// 初始化隐藏数据容器
|
||||||
|
initHiddenDataContainer();
|
||||||
|
|
||||||
// 初始化数据显示
|
// 初始化数据显示
|
||||||
updateSlqs();
|
updateSlqs();
|
||||||
updateNcl();
|
updateNcl();
|
||||||
@ -1018,73 +1118,121 @@
|
|||||||
// 获取质量指标表格数据
|
// 获取质量指标表格数据
|
||||||
fetchQualityTableData();
|
fetchQualityTableData();
|
||||||
|
|
||||||
<%--// 定时刷新所有数据(每分钟刷新一次)--%>
|
// 获取泥处理数据
|
||||||
<%--setInterval(function() {--%>
|
fetchNclData();
|
||||||
<%-- console.log('定时刷新数据...');--%>
|
|
||||||
<%-- fetchSlqsData();--%>
|
|
||||||
<%-- fetchQualityTableData();--%>
|
|
||||||
<%-- // 批量刷新点位数据--%>
|
|
||||||
<%-- pointList.forEach(function (mpcode) {--%>
|
|
||||||
<%-- getValue('0533JS', mpcode, mpcode, `${mpcode}_name`, '<%=request.getContextPath()%>');--%>
|
|
||||||
<%-- });--%>
|
|
||||||
<%--}, 60000); // 60000毫秒 = 1分钟--%>
|
|
||||||
|
|
||||||
<%--// 批量获取点位数据并更新显示--%>
|
|
||||||
var pointList = [
|
|
||||||
"D_PACDSYH", // PAC吨水药耗
|
|
||||||
"D_YiSNDSYH", // 乙酸钠吨水药耗
|
|
||||||
"D_CiLSNDSYH", // 次氯酸钠吨水药耗
|
|
||||||
"D_YanYCORP",
|
|
||||||
"D_QueYCRJY1",
|
|
||||||
"D_HaoYCRJY",
|
|
||||||
"D_HaoYCRJY2",
|
|
||||||
"D_HaoYCWNND",
|
|
||||||
"D_MoCWNND",
|
|
||||||
"D_BengZYW",
|
|
||||||
"D_TiSB101DL",
|
|
||||||
"D_TiSB102DL",
|
|
||||||
"D_TiSB103DL",
|
|
||||||
"D_NingMSJYLL",
|
|
||||||
"D_YaLSQNLL",
|
|
||||||
"D_NingMSCGYW",
|
|
||||||
"D_CiLSNJYLL",
|
|
||||||
"D_PACJYLL",
|
|
||||||
"D_CiLSNCGYW",
|
|
||||||
"D_PACCGYW",
|
|
||||||
"D_JSLL",
|
|
||||||
"D_JinSPH",
|
|
||||||
"D_JinSCOD",
|
|
||||||
"D_JinSAL",
|
|
||||||
"D_JinSWD",
|
|
||||||
"D_JinSLJLL",
|
|
||||||
"D_ChuSLL",
|
|
||||||
"D_ChuSPH",
|
|
||||||
"D_ChuSCOD",
|
|
||||||
"D_ChuSAL",
|
|
||||||
"D_ChuSWD",
|
|
||||||
"D_ChuSZL",
|
|
||||||
"D_ChuSZLv",
|
|
||||||
"D_ChuSLJLL",
|
|
||||||
"D_FanXBCKLL",
|
|
||||||
"D_FanXBCKYL",
|
|
||||||
"D_ShengYWNCKLL",
|
|
||||||
"D_QingSCYW",
|
|
||||||
"D_FeiYCYW",
|
|
||||||
];
|
|
||||||
|
|
||||||
|
// 批量获取点位数据并更新显示
|
||||||
|
var pointList = getAllPointIds();
|
||||||
pointList.forEach(function (mpcode) {
|
pointList.forEach(function (mpcode) {
|
||||||
// fetchPointData(mpcode).then(function(res) {
|
|
||||||
// $('#' + mpcode).text(1000 || 0);
|
|
||||||
// // if (res && res[0] && res[0].data && res[0].data.length > 0) {
|
|
||||||
// // var lastData = res[0].data[res[0].data.length - 1];
|
|
||||||
// // var value = lastData[1]; // 取最后一个数据点的值
|
|
||||||
// // $('#' + mpcode).text(1000 || 0);
|
|
||||||
// // }
|
|
||||||
// }).catch(function(error) {
|
|
||||||
// console.error('点位数据获取失败:', mpcode, error);
|
|
||||||
// });
|
|
||||||
getValue('0533JS', mpcode, mpcode, `${mpcode}_name`, '<%=request.getContextPath()%>');
|
getValue('0533JS', mpcode, mpcode, `${mpcode}_name`, '<%=request.getContextPath()%>');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 定时刷新所有数据(每分钟刷新一次)
|
||||||
|
setInterval(function() {
|
||||||
|
console.log('定时刷新数据...');
|
||||||
|
fetchSlqsData();
|
||||||
|
fetchQualityTableData();
|
||||||
|
fetchNclData();
|
||||||
|
// 批量刷新点位数据
|
||||||
|
pointList.forEach(function (mpcode) {
|
||||||
|
getValue('0533JS', mpcode, mpcode, `${mpcode}_name`, '<%=request.getContextPath()%>');
|
||||||
|
});
|
||||||
|
}, 60000); // 60000毫秒 = 1分钟
|
||||||
|
|
||||||
|
// 初始化绿色圆点点击事件
|
||||||
|
initGreenDots();
|
||||||
|
});
|
||||||
|
|
||||||
|
// 初始化绿色圆点点击事件
|
||||||
|
function initGreenDots() {
|
||||||
|
var dots = document.querySelectorAll('.green-dot');
|
||||||
|
console.log('初始化绿色圆点,数量:', dots.length);
|
||||||
|
dots.forEach(function(dot) {
|
||||||
|
dot.addEventListener('click', function(e) {
|
||||||
|
e.stopPropagation();
|
||||||
|
e.preventDefault();
|
||||||
|
var index = parseInt(this.getAttribute('data-index'));
|
||||||
|
console.log('点击圆点,索引:', index);
|
||||||
|
showDotPopup(index, this);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 显示弹窗
|
||||||
|
function showDotPopup(index, dotElement) {
|
||||||
|
var config = dotDataConfig[index];
|
||||||
|
if (!config) return;
|
||||||
|
|
||||||
|
var title = document.getElementById('popupTitle');
|
||||||
|
var content = document.getElementById('popupContent');
|
||||||
|
var overlay = document.getElementById('popupOverlay');
|
||||||
|
var popup = document.getElementById('dotPopup');
|
||||||
|
|
||||||
|
title.textContent = config.name;
|
||||||
|
|
||||||
|
var html = '';
|
||||||
|
|
||||||
|
// 遍历所有点位
|
||||||
|
config.points.forEach(function(pointId) {
|
||||||
|
var pointInfo = pointConfig[pointId];
|
||||||
|
var value = document.getElementById(pointId);
|
||||||
|
var val = value ? value.textContent : '--';
|
||||||
|
var pointName = pointInfo ? pointInfo.name : pointId;
|
||||||
|
|
||||||
|
html += '<div class="dot-popup-item">';
|
||||||
|
html += '<span class="dot-popup-label">' + pointName + '</span>';
|
||||||
|
html += '<span class="dot-popup-value">' + val + '</span>';
|
||||||
|
html += '</div>';
|
||||||
|
});
|
||||||
|
|
||||||
|
content.innerHTML = html;
|
||||||
|
|
||||||
|
// 计算弹窗位置,显示在绿点右侧
|
||||||
|
var dotRect = dotElement.getBoundingClientRect();
|
||||||
|
var container = document.querySelector('.screen-container');
|
||||||
|
var containerRect = container.getBoundingClientRect();
|
||||||
|
|
||||||
|
// 获取绿点相对于容器的位置
|
||||||
|
var dotTop = parseInt(dotElement.style.top) || 0;
|
||||||
|
var dotLeft = parseInt(dotElement.style.left) || 0;
|
||||||
|
|
||||||
|
// 弹窗定位在绿点右侧,稍微偏上
|
||||||
|
var popupLeft = dotLeft + 60; // 绿点右侧60px
|
||||||
|
var popupTop = dotTop - 50; // 绿点上方50px
|
||||||
|
|
||||||
|
// 确保弹窗不超出容器右边界
|
||||||
|
if (popupLeft + 450 > 2800) {
|
||||||
|
popupLeft = dotLeft - 470; // 显示在左侧
|
||||||
|
}
|
||||||
|
|
||||||
|
// 确保弹窗不超出容器上边界
|
||||||
|
if (popupTop < 20) {
|
||||||
|
popupTop = 20;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 确保弹窗不超出容器下边界
|
||||||
|
if (popupTop + 400 > 1600) {
|
||||||
|
popupTop = 1600 - 400;
|
||||||
|
}
|
||||||
|
|
||||||
|
popup.style.left = popupLeft + 'px';
|
||||||
|
popup.style.top = popupTop + 'px';
|
||||||
|
|
||||||
|
overlay.classList.add('show');
|
||||||
|
popup.classList.add('show');
|
||||||
|
}
|
||||||
|
|
||||||
|
// 关闭弹窗
|
||||||
|
function closePopup() {
|
||||||
|
document.getElementById('popupOverlay').classList.remove('show');
|
||||||
|
document.getElementById('dotPopup').classList.remove('show');
|
||||||
|
}
|
||||||
|
|
||||||
|
// 点击遮罩关闭弹窗
|
||||||
|
document.addEventListener('click', function(e) {
|
||||||
|
if (e.target.id === 'popupOverlay') {
|
||||||
|
closePopup();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// 七日水量图表
|
// 七日水量图表
|
||||||
|
|||||||
@ -7,6 +7,8 @@ pageEncoding="UTF-8"%>
|
|||||||
<title>区域管线大屏展示</title>
|
<title>区域管线大屏展示</title>
|
||||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/jquery/dist/jquery.min.js"></script>
|
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/jquery/dist/jquery.min.js"></script>
|
||||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/echarts3.0.js"></script>
|
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/echarts3.0.js"></script>
|
||||||
|
<!-- 天地图 API -->
|
||||||
|
<script type="text/javascript" src="http://api.tianditu.gov.cn/api?v=4.0&tk=f423193014cde7bf44b224c6ab2b1210"></script>
|
||||||
<!-- <script
|
<!-- <script
|
||||||
type="text/javascript"
|
type="text/javascript"
|
||||||
src="../../node_modules/jquery/dist/jquery.min.js"
|
src="../../node_modules/jquery/dist/jquery.min.js"
|
||||||
@ -162,6 +164,7 @@ pageEncoding="UTF-8"%>
|
|||||||
<%-- </div>--%>
|
<%-- </div>--%>
|
||||||
<%-- </div>--%>
|
<%-- </div>--%>
|
||||||
<div class="screen-container">
|
<div class="screen-container">
|
||||||
|
<div id="map-container" style="position: absolute; top: 280px; left: 70px; width: 1760px; height: 1470px; background-color: white;"></div>
|
||||||
<div class="stat-card card-1">53829.5</div>
|
<div class="stat-card card-1">53829.5</div>
|
||||||
<div class="stat-card card-2">2495</div>
|
<div class="stat-card card-2">2495</div>
|
||||||
<div class="stat-card card-3">2460</div>
|
<div class="stat-card card-3">2460</div>
|
||||||
@ -198,6 +201,138 @@ pageEncoding="UTF-8"%>
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
// ==================== 天地图初始化 ====================
|
||||||
|
var contextPath = "<%=request.getContextPath()%>";
|
||||||
|
var map = null;
|
||||||
|
var pipelineOverlays = [];
|
||||||
|
|
||||||
|
// 初始化天地图
|
||||||
|
function initTiandituMap() {
|
||||||
|
// 创建地图实例
|
||||||
|
map = new T.Map("map-container");
|
||||||
|
|
||||||
|
// 放大地图级别 (15比13更放大)
|
||||||
|
map.centerAndZoom(new T.LngLat(121.34, 30.74), 15);
|
||||||
|
map.enableScrollWheelZoom();
|
||||||
|
|
||||||
|
// 设置暗色主题 - 切换为卫星影像底图
|
||||||
|
map.setMapType(TMAP_SATELLITE_MAP);
|
||||||
|
|
||||||
|
// 添加控件
|
||||||
|
var scale = new T.Control.Scale();
|
||||||
|
map.addControl(scale);
|
||||||
|
var zoom = new T.Control.Zoom();
|
||||||
|
map.addControl(zoom);
|
||||||
|
|
||||||
|
// 隐藏地图类型切换控件,保持暗色主题
|
||||||
|
setTimeout(function() {
|
||||||
|
var mapTypeCtrl = document.querySelector(".TMAP_maptype");
|
||||||
|
if (mapTypeCtrl) {
|
||||||
|
mapTypeCtrl.style.display = "none";
|
||||||
|
}
|
||||||
|
}, 500);
|
||||||
|
|
||||||
|
console.log("[天地图] 初始化完成 - 暗色主题,缩放级别15");
|
||||||
|
|
||||||
|
// 加载管道数据
|
||||||
|
loadPipelineData();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 加载管道数据
|
||||||
|
function loadPipelineData() {
|
||||||
|
$.ajax({
|
||||||
|
url: contextPath + '/jsp/z_bigScreen/geo.json',
|
||||||
|
type: 'GET',
|
||||||
|
dataType: 'json',
|
||||||
|
success: function(data) {
|
||||||
|
if (data && data.features) {
|
||||||
|
var pipelines = data.features.map(function(feature) {
|
||||||
|
var attr = feature.attributes || {};
|
||||||
|
var geom = feature.geometry || {};
|
||||||
|
var paths = geom.paths || null;
|
||||||
|
var lengthM = attr.Shape_Leng ? (attr.Shape_Leng * 111000).toFixed(2) : '-';
|
||||||
|
|
||||||
|
return {
|
||||||
|
id: attr.FID,
|
||||||
|
name: '管线-' + attr.FID,
|
||||||
|
length: lengthM,
|
||||||
|
elevation: attr.Elevation || 0,
|
||||||
|
color: attr.Color || 6,
|
||||||
|
layer: attr.Layer || 'WS_LINE',
|
||||||
|
paths: paths
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
renderPipelines(pipelines);
|
||||||
|
console.log("[管道数据] 加载完成,共", pipelines.length, "条");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function(xhr, status, error) {
|
||||||
|
console.error("[管道数据] 加载失败:", error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 渲染管道到地图
|
||||||
|
function renderPipelines(pipelines) {
|
||||||
|
// 先清除之前的管线
|
||||||
|
clearPipelines();
|
||||||
|
|
||||||
|
pipelines.forEach(function(item) {
|
||||||
|
if (!item.paths || !item.paths.length) return;
|
||||||
|
|
||||||
|
var pathsArray = item.paths;
|
||||||
|
|
||||||
|
// 如果 paths 的第一个元素不是数组,说明是单路径格式,需要包装
|
||||||
|
if (!Array.isArray(pathsArray[0]) || !Array.isArray(pathsArray[0][0])) {
|
||||||
|
pathsArray = [pathsArray];
|
||||||
|
}
|
||||||
|
|
||||||
|
// 按颜色区分管线 (Color === 6 为深蓝色,其他为深红色)
|
||||||
|
var lineColor = item.color === 6 ? '#0066cc' : '#0ea6c1';
|
||||||
|
|
||||||
|
// 渲染每条路径
|
||||||
|
pathsArray.forEach(function(pathCoords) {
|
||||||
|
if (!pathCoords || pathCoords.length < 2) return;
|
||||||
|
|
||||||
|
var points = pathCoords.map(function(p) {
|
||||||
|
return new T.LngLat(p[0], p[1]);
|
||||||
|
});
|
||||||
|
|
||||||
|
var polyline = new T.Polyline(points, {
|
||||||
|
color: lineColor,
|
||||||
|
weight: 8,
|
||||||
|
opacity: 1
|
||||||
|
});
|
||||||
|
map.addOverLay(polyline);
|
||||||
|
pipelineOverlays.push(polyline);
|
||||||
|
|
||||||
|
// 信息窗口
|
||||||
|
var infoHtml = '<div style="font-size:13px;line-height:1.5;">' +
|
||||||
|
'<strong style="color:#007bff;">管线 #' + item.id + '</strong><br>' +
|
||||||
|
'名称: ' + (item.name || '-') + '<br>' +
|
||||||
|
'管长: ' + (item.length || '-') + ' m<br>' +
|
||||||
|
'高程: ' + (item.elevation || 0).toFixed(2) + ' m' +
|
||||||
|
'</div>';
|
||||||
|
|
||||||
|
var infoWindow = new T.InfoWindow(infoHtml, { offset: new T.Point(0, 0) });
|
||||||
|
polyline.addEventListener('click', function(e) {
|
||||||
|
map.openInfoWindow(infoWindow, e.lnglat);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log("[管线渲染] 完成,共渲染", pipelineOverlays.length, "条管线段");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 清除管道覆盖物
|
||||||
|
function clearPipelines() {
|
||||||
|
pipelineOverlays.forEach(function(overlay) {
|
||||||
|
map.removeOverLay(overlay);
|
||||||
|
});
|
||||||
|
pipelineOverlays = [];
|
||||||
|
}
|
||||||
|
|
||||||
// ==================== 数据统一管理 ====================
|
// ==================== 数据统一管理 ====================
|
||||||
var pageData = {
|
var pageData = {
|
||||||
// 统计卡片数据
|
// 统计卡片数据
|
||||||
@ -246,17 +381,19 @@ pageEncoding="UTF-8"%>
|
|||||||
// 柱状图数据
|
// 柱状图数据
|
||||||
barCharts: {
|
barCharts: {
|
||||||
bar5: [
|
bar5: [
|
||||||
3000, 4500, 1500, 5000, 23000, 1500, 15000, 3000, 4000, 5000, 2000,
|
// 3000, 4500, 1500, 5000, 23000, 1500, 15000, 3000, 4000, 5000, 2000,
|
||||||
1000, 500, 2563, 4000
|
// 1000, 500, 2563, 4000
|
||||||
],
|
],
|
||||||
bar6: [
|
bar6: [
|
||||||
2000, 3000, 1000, 4000, 18000, 1000, 12000, 2000, 3000, 4000, 1500,
|
// 2000, 3000, 1000, 4000, 18000, 1000, 12000, 2000, 3000, 4000, 1500,
|
||||||
800, 400, 2000, 3000
|
// 800, 400, 2000, 3000
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
// 柱状图X轴数据
|
// 柱状图X轴数据
|
||||||
barXAxis: ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15"]
|
barXAxis: [
|
||||||
|
// "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15"
|
||||||
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
// 更新统计卡片显示
|
// 更新统计卡片显示
|
||||||
@ -338,7 +475,83 @@ pageEncoding="UTF-8"%>
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 获取管道统计数据
|
||||||
|
function fetchPipelineStats() {
|
||||||
|
$.ajax({
|
||||||
|
url: "<%=request.getContextPath()%>/pipeline/pipelineData/getStatistics.do",
|
||||||
|
type: "GET",
|
||||||
|
dataType: "json",
|
||||||
|
success: function(response) {
|
||||||
|
console.log("管道统计数据:", response);
|
||||||
|
if (response && response.success) {
|
||||||
|
// 更新统计卡片
|
||||||
|
$(".card-1").text(response.totalLength || 0);
|
||||||
|
$(".card-2").text(response.totalCount || 0);
|
||||||
|
$(".card-3").text(response.totalCount || 0);
|
||||||
|
|
||||||
|
// 更新仪表盘数据
|
||||||
|
pageData.gaugeCharts.gauge3 = response.totalLength || 0;
|
||||||
|
pageData.gaugeCharts.gauge4 = response.totalLength || 0;
|
||||||
|
|
||||||
|
// 更新饼图数据 - 材质长度比例
|
||||||
|
if (response.materialLengthRatio && response.materialLengthRatio.length > 0) {
|
||||||
|
pageData.pieChart1 = response.materialLengthRatio.map(function(item) {
|
||||||
|
return {
|
||||||
|
name: item.material,
|
||||||
|
value: item.length
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新饼图数据 - 材质数量比例
|
||||||
|
if (response.materialCountRatio && response.materialCountRatio.length > 0) {
|
||||||
|
pageData.pieChart2 = response.materialCountRatio.map(function(item) {
|
||||||
|
return {
|
||||||
|
name: item.material,
|
||||||
|
value: item.count
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新柱状图数据 - 管径长度分布
|
||||||
|
if (response.diameterLengthRatio && response.diameterLengthRatio.length > 0) {
|
||||||
|
// 取前15个数据
|
||||||
|
var topData = response.diameterLengthRatio.slice(0, 15);
|
||||||
|
pageData.barCharts.bar5 = topData.map(function(item) {
|
||||||
|
return item.length;
|
||||||
|
});
|
||||||
|
pageData.barXAxis = topData.map(function(item) {
|
||||||
|
return item.diameter;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新柱状图数据 - 管径数量分布
|
||||||
|
if (response.diameterCountRatio && response.diameterCountRatio.length > 0) {
|
||||||
|
var topData = response.diameterCountRatio.slice(0, 15);
|
||||||
|
pageData.barCharts.bar6 = topData.map(function(item) {
|
||||||
|
return item.count;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 重新渲染图表
|
||||||
|
initPieChart();
|
||||||
|
initPieChart2();
|
||||||
|
initGaugeChart("gauge-chart-content-3", pageData.gaugeCharts.gauge3);
|
||||||
|
initGaugeChart("gauge-chart-content-4", pageData.gaugeCharts.gauge4);
|
||||||
|
initBarChart("bar-chart-content-5", pageData.barCharts.bar5);
|
||||||
|
initBarChart("bar-chart-content-6", pageData.barCharts.bar6);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function(xhr, status, error) {
|
||||||
|
console.error("获取管道统计数据失败:", error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
|
// 初始化天地图
|
||||||
|
initTiandituMap();
|
||||||
|
|
||||||
// 初始化统计数据
|
// 初始化统计数据
|
||||||
updateStatCards();
|
updateStatCards();
|
||||||
|
|
||||||
@ -350,6 +563,9 @@ pageEncoding="UTF-8"%>
|
|||||||
initBarChart("bar-chart-content-5", pageData.barCharts.bar5);
|
initBarChart("bar-chart-content-5", pageData.barCharts.bar5);
|
||||||
initBarChart("bar-chart-content-6", pageData.barCharts.bar6);
|
initBarChart("bar-chart-content-6", pageData.barCharts.bar6);
|
||||||
|
|
||||||
|
// 获取管道统计数据
|
||||||
|
fetchPipelineStats();
|
||||||
|
|
||||||
// Double click to toggle fullscreen
|
// Double click to toggle fullscreen
|
||||||
$("body").on("dblclick", function () {
|
$("body").on("dblclick", function () {
|
||||||
launchIntoFullscreen(document.documentElement);
|
launchIntoFullscreen(document.documentElement);
|
||||||
@ -376,6 +592,10 @@ pageEncoding="UTF-8"%>
|
|||||||
"#915eff",
|
"#915eff",
|
||||||
"#ff7f00",
|
"#ff7f00",
|
||||||
],
|
],
|
||||||
|
tooltip: {
|
||||||
|
trigger: "item",
|
||||||
|
formatter: "{b}: {c}m ({d}%)"
|
||||||
|
},
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: "管线类型统计",
|
name: "管线类型统计",
|
||||||
@ -386,17 +606,20 @@ pageEncoding="UTF-8"%>
|
|||||||
label: {
|
label: {
|
||||||
show: true,
|
show: true,
|
||||||
position: "outside",
|
position: "outside",
|
||||||
formatter: "{b}",
|
formatter: "{b}\n{d}%",
|
||||||
fontSize: 14,
|
fontSize: 32,
|
||||||
lineHeight: 20,
|
lineHeight: 40,
|
||||||
align: "left",
|
align: "left",
|
||||||
|
color: "#fff",
|
||||||
|
fontWeight: "bold",
|
||||||
},
|
},
|
||||||
labelLine: {
|
labelLine: {
|
||||||
show: true,
|
show: true,
|
||||||
length: 20,
|
length: 30,
|
||||||
length2: 30,
|
length2: 40,
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
type: "solid",
|
type: "solid",
|
||||||
|
width: 2,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
data: pageData.pieChart1,
|
data: pageData.pieChart1,
|
||||||
@ -426,6 +649,10 @@ pageEncoding="UTF-8"%>
|
|||||||
"#915eff",
|
"#915eff",
|
||||||
"#ff7f00",
|
"#ff7f00",
|
||||||
],
|
],
|
||||||
|
tooltip: {
|
||||||
|
trigger: "item",
|
||||||
|
formatter: "{b}: {c}条 ({d}%)"
|
||||||
|
},
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: "管线类型统计2",
|
name: "管线类型统计2",
|
||||||
@ -436,17 +663,20 @@ pageEncoding="UTF-8"%>
|
|||||||
label: {
|
label: {
|
||||||
show: true,
|
show: true,
|
||||||
position: "outside",
|
position: "outside",
|
||||||
formatter: "{b}",
|
formatter: "{b}\n{d}%",
|
||||||
fontSize: 14,
|
fontSize: 32,
|
||||||
lineHeight: 20,
|
lineHeight: 40,
|
||||||
align: "left",
|
align: "left",
|
||||||
|
color: "#fff",
|
||||||
|
fontWeight: "bold",
|
||||||
},
|
},
|
||||||
labelLine: {
|
labelLine: {
|
||||||
show: true,
|
show: true,
|
||||||
length: 20,
|
length: 30,
|
||||||
length2: 30,
|
length2: 40,
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
type: "solid",
|
type: "solid",
|
||||||
|
width: 2,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
data: pageData.pieChart2,
|
data: pageData.pieChart2,
|
||||||
@ -500,8 +730,8 @@ pageEncoding="UTF-8"%>
|
|||||||
},
|
},
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
color: "#00d4ff",
|
color: "#00d4ff",
|
||||||
fontSize: 14,
|
fontSize: 20,
|
||||||
distance: -60,
|
distance: -80,
|
||||||
formatter: function (value) {
|
formatter: function (value) {
|
||||||
return value;
|
return value;
|
||||||
},
|
},
|
||||||
@ -567,7 +797,7 @@ pageEncoding="UTF-8"%>
|
|||||||
},
|
},
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
color: "#B7C9E2",
|
color: "#B7C9E2",
|
||||||
fontSize: 25,
|
fontSize: 40,
|
||||||
},
|
},
|
||||||
// axisTick: {
|
// axisTick: {
|
||||||
// show: false
|
// show: false
|
||||||
@ -575,27 +805,18 @@ pageEncoding="UTF-8"%>
|
|||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
type: "value",
|
type: "value",
|
||||||
name: "长度(m)",
|
// name: "长度(m)",
|
||||||
// nameTextStyle: {
|
// nameTextStyle: {
|
||||||
// color: '#fff',
|
// color: '#B7C9E2',
|
||||||
// padding: [0, 0, 0, 20]
|
// padding: [0, 0, 40, 2300],
|
||||||
// },
|
// fontSize: 40,
|
||||||
// axisLabel: {
|
|
||||||
// color: '#fff',
|
|
||||||
// fontSize: 14
|
|
||||||
// },
|
|
||||||
// splitLine: {
|
|
||||||
// show: true,
|
|
||||||
// lineStyle: {
|
|
||||||
// color: 'rgba(255, 255, 255, 0.1)'
|
|
||||||
// }
|
|
||||||
// },
|
// },
|
||||||
splitNumber: 5,
|
splitNumber: 5,
|
||||||
axisLine: { show: false },
|
axisLine: { show: false },
|
||||||
axisTick: { show: false },
|
axisTick: { show: false },
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
color: "#B7C9E2",
|
color: "#B7C9E2",
|
||||||
fontSize: 18,
|
fontSize: 40,
|
||||||
},
|
},
|
||||||
splitLine: {
|
splitLine: {
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
@ -610,11 +831,6 @@ pageEncoding="UTF-8"%>
|
|||||||
data: data,
|
data: data,
|
||||||
type: "bar",
|
type: "bar",
|
||||||
barWidth: "40%",
|
barWidth: "40%",
|
||||||
// itemStyle: {
|
|
||||||
// color: '#FF9900',
|
|
||||||
// borderColor: '#FF9900',
|
|
||||||
// borderWidth: 1
|
|
||||||
// },
|
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
normal: {
|
normal: {
|
||||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||||
@ -633,46 +849,7 @@ pageEncoding="UTF-8"%>
|
|||||||
]),
|
]),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// markPoint: {
|
|
||||||
// symbol: 'pin',
|
|
||||||
// symbolSize: 50,
|
|
||||||
// label: {
|
|
||||||
// show: true,
|
|
||||||
// color: '#fff',
|
|
||||||
// fontSize: 12
|
|
||||||
// },
|
|
||||||
// itemStyle: {
|
|
||||||
// color: '#FF9900'
|
|
||||||
// },
|
|
||||||
// data: [
|
|
||||||
// { type: 'max', name: 'Max' },
|
|
||||||
// { type: 'min', name: 'Min' }
|
|
||||||
// ]
|
|
||||||
// },
|
|
||||||
// markLine: {
|
|
||||||
// symbol: 'none',
|
|
||||||
// data: [
|
|
||||||
// { yAxis: 2563.31, name: 'Average' }
|
|
||||||
// ],
|
|
||||||
// label: {
|
|
||||||
// show: true,
|
|
||||||
// position: 'end',
|
|
||||||
// formatter: '{c}',
|
|
||||||
// color: '#FF9900'
|
|
||||||
// },
|
|
||||||
// lineStyle: {
|
|
||||||
// type: 'dotted',
|
|
||||||
// color: '#FF9900'
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
},
|
},
|
||||||
// {
|
|
||||||
// type: 'bar',
|
|
||||||
// barGap: '-100%',
|
|
||||||
// data: (function(){ var yMax = 10000; var shadow=[]; for (var i=0;i<data.length;i++){shadow.push(yMax);} return shadow; })(),
|
|
||||||
// itemStyle: { normal: { color: 'rgba(0,0,0,0.05)' } },
|
|
||||||
// silent: true
|
|
||||||
// }
|
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
myChart.setOption(option);
|
myChart.setOption(option);
|
||||||
|
|||||||
@ -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">
|
||||||
|
|||||||
@ -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">
|
||||||
|
|||||||
@ -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: '业务单元名称',
|
||||||
|
|||||||
@ -19,6 +19,10 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var dosearchBelong = function() {
|
||||||
|
$("#equipmentBelongTable").bootstrapTable('refresh');
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
//显示已经勾选的数据
|
//显示已经勾选的数据
|
||||||
function stateFormatter(value, row, index) {
|
function stateFormatter(value, row, index) {
|
||||||
@ -53,6 +57,7 @@
|
|||||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||||
sort: params.sort, // 要排序的字段
|
sort: params.sort, // 要排序的字段
|
||||||
order: params.order,
|
order: params.order,
|
||||||
|
search_name: $('#search_belongname').val()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
queryParamsType: "limit",
|
queryParamsType: "limit",
|
||||||
@ -110,6 +115,12 @@
|
|||||||
<div id="mainAlertdiv"></div>
|
<div id="mainAlertdiv"></div>
|
||||||
<div id="menu4SelectDiv"></div>
|
<div id="menu4SelectDiv"></div>
|
||||||
<div id="modal-body">
|
<div id="modal-body">
|
||||||
|
<div class="input-group input-group-sm" style="width: 250px;float: right;margin-bottom: 15px;">
|
||||||
|
<input type="text" id="search_belongname" name="search_belongname" class="form-control pull-right" placeholder="归属名称/编码">
|
||||||
|
<div class="input-group-btn">
|
||||||
|
<button class="btn btn-default" onclick="dosearchBelong();"><i class="fa fa-search"></i></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="table-scrollable">
|
<div class="table-scrollable">
|
||||||
<table class="table table-bordered table-striped" style="overflow:auto;width:100%" id="equipmentBelongTable"></table>
|
<table class="table table-bordered table-striped" style="overflow:auto;width:100%" id="equipmentBelongTable"></table>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -141,9 +141,9 @@
|
|||||||
formatter: function (value, row, index) {
|
formatter: function (value, row, index) {
|
||||||
var buts = "";
|
var buts = "";
|
||||||
|
|
||||||
buts += '<security:authorize buttonUrl="equipment/location.do">';
|
// buts += '<security:authorize buttonUrl="equipment/location.do">';
|
||||||
buts += '<button class="btn btn-default btn-sm" title="定位" onclick="locationFun(\'' + row.id + '\')"><i class="fa fa-map-marker"></i><span class="hidden-md hidden-lg"> 定位</span></button>';
|
// buts += '<button class="btn btn-default btn-sm" title="定位" onclick="locationFun(\'' + row.id + '\')"><i class="fa fa-map-marker"></i><span class="hidden-md hidden-lg"> 定位</span></button>';
|
||||||
buts += '</security:authorize>';
|
// buts += '</security:authorize>';
|
||||||
|
|
||||||
buts += '<security:authorize buttonUrl="equipment/edit.do">';
|
buts += '<security:authorize buttonUrl="equipment/edit.do">';
|
||||||
buts += '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
buts += '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||||
|
|||||||
@ -105,16 +105,15 @@
|
|||||||
masterId: id,
|
masterId: id,
|
||||||
tbName: tbName
|
tbName: tbName
|
||||||
}, function (data) {
|
}, function (data) {
|
||||||
//console.info(data)
|
// 清空之前的配置
|
||||||
|
previews = [];
|
||||||
|
previewConfigs = [];
|
||||||
if (data.length > 0) {
|
if (data.length > 0) {
|
||||||
previews = new Array();
|
|
||||||
$('#maintenancefile').show();
|
$('#maintenancefile').show();
|
||||||
for (var i = 0; i < data.length; i++) {
|
for (var i = 0; i < data.length; i++) {
|
||||||
var previewConfig = new Object();
|
var previewConfig = new Object();
|
||||||
var path = data[i].abspath;
|
// 预览地址:添加preview=true参数,让浏览器内嵌显示
|
||||||
path = path.substring(path.indexOf('webapps') + 7, path.length);
|
var path = ext.contextPath + "/report/rptInfoSetFile/downloadFile4minio.do?id=" + data[i].id + "&tbName=" + tbName + "&preview=true";
|
||||||
path = ext.basePath.replace(ext.contextPath, '') + path.replace(/\\/g, "\/");
|
|
||||||
;
|
|
||||||
previews.push(path);
|
previews.push(path);
|
||||||
previewConfig['width'] = '2500px';
|
previewConfig['width'] = '2500px';
|
||||||
previewConfig['caption'] = data[i].filename;
|
previewConfig['caption'] = data[i].filename;
|
||||||
|
|||||||
@ -47,7 +47,7 @@
|
|||||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||||
//setTimeout(function(){
|
//setTimeout(function(){
|
||||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||||
$.post(ext.contextPath + "/equipment/maintenancePlan/doupdate.do", $("#subForm").serialize(), function(data) {
|
$.post(ext.contextPath + "/maintenance/equipmentPlan/doupdate.do", $("#subForm").serialize(), function(data) {
|
||||||
if (data.res == 1){
|
if (data.res == 1){
|
||||||
$("#table").bootstrapTable('refresh');
|
$("#table").bootstrapTable('refresh');
|
||||||
closeModal("subModal");
|
closeModal("subModal");
|
||||||
@ -70,7 +70,7 @@
|
|||||||
$("#subUnitForm").bootstrapValidator('validate');//提交验证
|
$("#subUnitForm").bootstrapValidator('validate');//提交验证
|
||||||
//setTimeout(function(){
|
//setTimeout(function(){
|
||||||
if ($("#subForm").data('bootstrapValidator').isValid() && $("#subUnitForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
if ($("#subForm").data('bootstrapValidator').isValid() && $("#subUnitForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||||
$.post(ext.contextPath + "/equipment/maintenancePlan/doupdate.do", $("#subForm").serialize(), function(data) {
|
$.post(ext.contextPath + "/maintenance/equipmentPlan/doupdate.do", $("#subForm").serialize(), function(data) {
|
||||||
var routeNum = $("#routeNum").val();
|
var routeNum = $("#routeNum").val();
|
||||||
if (data.res == 1){
|
if (data.res == 1){
|
||||||
$.post(ext.contextPath + "/equipment/maintenancePlan/submitAuditAgain.do", $("#subUnitForm").serialize()+"&routeNum="+routeNum, function(unitdata) {
|
$.post(ext.contextPath + "/equipment/maintenancePlan/submitAuditAgain.do", $("#subUnitForm").serialize()+"&routeNum="+routeNum, function(unitdata) {
|
||||||
@ -425,6 +425,43 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div id="fileArea"></div>--%>
|
<div id="fileArea"></div>--%>
|
||||||
|
</form>
|
||||||
|
<!--流程审核退回后显示-->
|
||||||
|
<form class="form-horizontal" id="subUnitForm" enctype="multipart/form-data">
|
||||||
|
<input type="hidden" class="form-control" name="id" value="${businessUnitHandle.id}">
|
||||||
|
<input type="hidden" class="form-control" name="processid" value="${businessUnitHandle.processid}">
|
||||||
|
<input type="hidden" class="form-control" name="taskid" value="${businessUnitHandle.taskid}">
|
||||||
|
<input type="hidden" class="form-control" name="businessid" value="${businessUnitHandle.businessid}">
|
||||||
|
<input type="hidden" class="form-control" name="taskdefinitionkey" value="${businessUnitHandle.taskdefinitionkey}">
|
||||||
|
<input type="hidden" class="form-control" name="unitid" value="${businessUnitHandle.unitid}">
|
||||||
|
<c:if test='${not empty businessUnitAudit.auditopinion}'>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-2 control-label">审核意见:</label>
|
||||||
|
<div class="col-sm-10">
|
||||||
|
<textarea class="form-control" id="auditopinion" name="auditopinion" rows="2" placeholder="审核意见">${businessUnitAudit.auditopinion}</textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</c:if>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-2 control-label">*下一节点</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<select class="form-control select2" id="routeNum" name="routeNum" style="width: 270px;">
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="selectUsers" class="form-group">
|
||||||
|
<label class="col-sm-2 control-label">提交至:</label>
|
||||||
|
<div class="col-sm-10">
|
||||||
|
<input type="text" class="form-control" id="targetUsersName" name="targetUsersName" placeholder="下一级人员" onclick="showUser4AuditSelectsFun();">
|
||||||
|
<input id="targetusers" name="targetusers" type="hidden" value="${businessUnitHandle.targetusers}"/>
|
||||||
|
<input class="form-control" id="targetjobs" name="targetjobs" type="hidden" value=""/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- 文件上传,显示 -->
|
||||||
|
<div class="form-group" style="margin:8px">
|
||||||
|
<button type="button" class="btn btn-default btn-file" onclick="fileinput_process()"><i class="fa fa-paperclip"></i>上传文件</button>
|
||||||
|
</div>
|
||||||
|
<div class="file-border" id="fileArea"></div>
|
||||||
</form>
|
</form>
|
||||||
<div class="box box-primary">
|
<div class="box box-primary">
|
||||||
<div class="box-header with-border">
|
<div class="box-header with-border">
|
||||||
|
|||||||
@ -166,9 +166,8 @@
|
|||||||
$.widget.bridge('uibutton', $.ui.button);
|
$.widget.bridge('uibutton', $.ui.button);
|
||||||
</script>
|
</script>
|
||||||
<!-- END 布局样式 -->
|
<!-- END 布局样式 -->
|
||||||
<LINK href="<%=contextPath%>/IMG/sipai.ico" type="image/x-icon" rel="shortcut icon"></LINK>
|
<LINK href="<%=contextPath%>/IMG/logo.png" type="image/png" rel="shortcut icon"></LINK>
|
||||||
<!-- END HEAD -->
|
<LINK href="<%=contextPath%>/IMG/logo.png" type="image/png" rel="icon"></LINK>
|
||||||
<LINK href="<%=contextPath%>/IMG/logo.ico" type="image/x-icon" rel="shortcut icon"></LINK>
|
|
||||||
|
|
||||||
<script type="text/javascript" src="<%=contextPath%>/node_modules/bootstrap/layer/layer.js" charset="utf-8"></script>
|
<script type="text/javascript" src="<%=contextPath%>/node_modules/bootstrap/layer/layer.js" charset="utf-8"></script>
|
||||||
|
|
||||||
|
|||||||
@ -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">
|
||||||
|
|||||||
@ -135,7 +135,7 @@
|
|||||||
//配置logo
|
//配置logo
|
||||||
var array = eval(${jsonArray});
|
var array = eval(${jsonArray});
|
||||||
var verCode = true;
|
var verCode = true;
|
||||||
var bgpath = ["IMG/login/bg1.png"];
|
var bgpath = ["IMG/loginbp.png"];
|
||||||
if(array!=null && array!=undefined && array.length>0){
|
if(array!=null && array!=undefined && array.length>0){
|
||||||
for(var i =0;i<array.length;i++){
|
for(var i =0;i<array.length;i++){
|
||||||
var img = null;
|
var img = null;
|
||||||
@ -325,15 +325,9 @@
|
|||||||
<div class="content" style="height:100%;vertical-align: middle;" id="login-content">
|
<div class="content" style="height:100%;vertical-align: middle;" id="login-content">
|
||||||
<!-- BEGIN 登录 FORM -->
|
<!-- BEGIN 登录 FORM -->
|
||||||
<form class="login-form " id="loginForm">
|
<form class="login-form " id="loginForm">
|
||||||
<div class="logo row">
|
<!-- <div class="logo row">
|
||||||
<img src="IMG/login/title.png" style="width:100%;" alt="" id="login-title" />
|
<img src="IMG/login/title.png" style="width:100%;" alt="" id="login-title" />
|
||||||
<!-- <div class="col-lg-8 col-sm-8 col-md-8 col-xs-8">
|
|
||||||
<h5 style="color:black" class="form-title">西派埃智能</h4>
|
|
||||||
<h2 style="margin:0px">南康智慧水厂运管平台</h2>
|
|
||||||
<h4 style="color:black;margin-top:4px" >精益运行工业互联网平台</h4>
|
|
||||||
|
|
||||||
</div> -->
|
</div> -->
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div id="alertDiv"></div>
|
<div id="alertDiv"></div>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
839
src/main/webapp/jsp/main_JS_Company2.jsp
Normal file
839
src/main/webapp/jsp/main_JS_Company2.jsp
Normal file
@ -0,0 +1,839 @@
|
|||||||
|
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||||
|
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||||
|
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
|
||||||
|
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
||||||
|
<%@ page import="com.sipai.entity.base.ServerObject" %>
|
||||||
|
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security" %>
|
||||||
|
|
||||||
|
<%@ page import="com.sipai.entity.base.MainConfig" %>
|
||||||
|
<% request.setAttribute("type_pro", MainConfig.type_pro); %>
|
||||||
|
<% request.setAttribute("type_safe", MainConfig.type_safe); %>
|
||||||
|
<% request.setAttribute("type_eff", MainConfig.type_eff); %>
|
||||||
|
<% request.setAttribute("type_pic", MainConfig.type_pic); %>
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||||
|
</title>
|
||||||
|
|
||||||
|
<!-- 引用页头及CSS页-->
|
||||||
|
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||||
|
<!-- echarts-->
|
||||||
|
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/echarts/echarts.4.1.0.min.js"
|
||||||
|
charset="utf-8"></script>
|
||||||
|
|
||||||
|
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/main/main_js.js" charset="utf-8"></script>
|
||||||
|
<style>
|
||||||
|
/*
|
||||||
|
根据不同分辨率显示不同px的文字大小
|
||||||
|
*/
|
||||||
|
@media (min-width: 1080px) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 1550px) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.fontValue {
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 20px;
|
||||||
|
margin-left: 70px;
|
||||||
|
font-size: 20px;
|
||||||
|
color: #ffffff;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fontText {
|
||||||
|
margin: 20px;
|
||||||
|
font-size: 18px;
|
||||||
|
color: #ffffff;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.carousel-inner,
|
||||||
|
.carousel-inner >.item,
|
||||||
|
.carousel-inner >.item >img{
|
||||||
|
width:100%;height:100%;
|
||||||
|
}
|
||||||
|
.carousel-caption{
|
||||||
|
cursor: pointer;
|
||||||
|
padding: 0;
|
||||||
|
background-color: RGBA(55,141,204,0.5);
|
||||||
|
bottom: 10px;
|
||||||
|
}
|
||||||
|
.section-header {
|
||||||
|
width: 100%;
|
||||||
|
height: 48px;
|
||||||
|
float: left;
|
||||||
|
border-bottom: 2px solid #67aad7;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 16px;
|
||||||
|
color: #0c4377;
|
||||||
|
padding-left: 15px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
background: linear-gradient(to right, rgba(103, 170, 215, 0.1), transparent);
|
||||||
|
}
|
||||||
|
.section-header::before {
|
||||||
|
content: "";
|
||||||
|
display: block;
|
||||||
|
width: 4px;
|
||||||
|
height: 60%;
|
||||||
|
background-color: #0c4377;
|
||||||
|
margin-right: 10px;
|
||||||
|
border-radius: 2px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
|
||||||
|
$(function () {
|
||||||
|
firstFun();
|
||||||
|
});
|
||||||
|
|
||||||
|
window.onresize = function () {
|
||||||
|
firstFun();
|
||||||
|
}
|
||||||
|
|
||||||
|
function firstFun() {
|
||||||
|
// 不再设置固定高度,让页面自然滚动
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
type: 'GET',
|
||||||
|
url: ext.contextPath + '/base/mainConfig/getJson.do',
|
||||||
|
async: true,
|
||||||
|
data: {unitId: unitId},
|
||||||
|
globle: false,
|
||||||
|
error: function () {
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
success: function (data1) {
|
||||||
|
// var data = eval('(' + data + ')');
|
||||||
|
|
||||||
|
console.log(data);
|
||||||
|
var data = {
|
||||||
|
"status": "pass",
|
||||||
|
"mpcode": [
|
||||||
|
{
|
||||||
|
"divId": "valueProduce1_js",
|
||||||
|
"funName": "getValue",
|
||||||
|
"id": "9A46F4D7-3C49-42DD-9603-BC55890F6829",
|
||||||
|
"memo": "AUTO_HOME_PRO_VAL_1",
|
||||||
|
"morder": 1,
|
||||||
|
"mpointId": "C_Jsssll",
|
||||||
|
"sql": "",
|
||||||
|
"testId": "textProduce1_js",
|
||||||
|
"type": "pro",
|
||||||
|
"unitId": "0533JS",
|
||||||
|
"where": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"divId": "",
|
||||||
|
"funName": "getPic",
|
||||||
|
"id": "D071B1E9-EADC-466A-86E8-300EE5ED35B2",
|
||||||
|
"memo": "AUTO_HOME_PIC",
|
||||||
|
"morder": 1,
|
||||||
|
"mpointId": "",
|
||||||
|
"sql": "",
|
||||||
|
"testId": "",
|
||||||
|
"type": "pic",
|
||||||
|
"unitId": "0533JS",
|
||||||
|
"where": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"divId": "valueProduce2_js",
|
||||||
|
"funName": "getValue",
|
||||||
|
"id": "7A212EF9-6A0D-415D-BEA5-5A1B23250069",
|
||||||
|
"memo": "AUTO_HOME_PRO_VAL_2",
|
||||||
|
"morder": 2,
|
||||||
|
"mpointId": "C_Csssll",
|
||||||
|
"sql": "",
|
||||||
|
"testId": "textProduce2_js",
|
||||||
|
"type": "pro",
|
||||||
|
"unitId": "0533JS",
|
||||||
|
"where": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"divId": "valueProduce3_js",
|
||||||
|
"funName": "getValue",
|
||||||
|
"id": "37D4878E-82D5-4A06-A7FC-3D1D9298D5F7",
|
||||||
|
"memo": "AUTO_HOME_PRO_VAL_3",
|
||||||
|
"morder": 3,
|
||||||
|
"mpointId": "C_Mrddh",
|
||||||
|
"sql": "",
|
||||||
|
"testId": "textProduce3_js",
|
||||||
|
"type": "pro",
|
||||||
|
"unitId": "0533JS",
|
||||||
|
"where": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"divId": "myChartProduce1_js",
|
||||||
|
"funName": "echartPie",
|
||||||
|
"id": "D88301BC-ACF7-48F5-A1B1-6672CB686786",
|
||||||
|
"memo": "AUTO_HOME_PRO_PIE_1",
|
||||||
|
"morder": 14,
|
||||||
|
"mpointId": "D_JinSCOD",
|
||||||
|
"sql": "",
|
||||||
|
"testId": "myChartProduceText1_js",
|
||||||
|
"type": "pro",
|
||||||
|
"unitId": "0533JS",
|
||||||
|
"where": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"divId": "myChartProduce2_js",
|
||||||
|
"funName": "echartPie",
|
||||||
|
"id": "D90B7C5B-76F4-4B70-9C65-58AD3F70C127",
|
||||||
|
"memo": "AUTO_HOME_PRO_PIE_2",
|
||||||
|
"morder": 15,
|
||||||
|
"mpointId": "D_JinSPH",
|
||||||
|
"sql": "",
|
||||||
|
"testId": "myChartProduceText2_js",
|
||||||
|
"type": "pro",
|
||||||
|
"unitId": "0533JS",
|
||||||
|
"where": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"divId": "myChartProduce3_js",
|
||||||
|
"funName": "echartPie",
|
||||||
|
"id": "B2309C35-5F47-402C-A7C3-F710F67A0AE3",
|
||||||
|
"memo": "AUTO_HOME_PRO_PIE_3",
|
||||||
|
"morder": 16,
|
||||||
|
"mpointId": "C_Jstp",
|
||||||
|
"sql": "",
|
||||||
|
"testId": "myChartProduceText3_js",
|
||||||
|
"type": "pro",
|
||||||
|
"unitId": "0533JS",
|
||||||
|
"where": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"divId": "myChartProduce4_js",
|
||||||
|
"funName": "echartPie",
|
||||||
|
"id": "B054F2EA-CF10-4976-B308-EE6A929468A3",
|
||||||
|
"memo": "AUTO_HOME_PRO_PIE_4",
|
||||||
|
"morder": 17,
|
||||||
|
"mpointId": "C_Jstn",
|
||||||
|
"sql": "",
|
||||||
|
"testId": "myChartProduceText4_js",
|
||||||
|
"type": "pro",
|
||||||
|
"unitId": "0533JS",
|
||||||
|
"where": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"divId": "myChartProduce5_js",
|
||||||
|
"funName": "echartPie",
|
||||||
|
"id": "0DDD5D71-2D8F-400D-A99E-0D19C3D8DADF",
|
||||||
|
"memo": "AUTO_HOME_PRO_PIE_5",
|
||||||
|
"morder": 18,
|
||||||
|
"mpointId": "C_Jsnh4n",
|
||||||
|
"sql": "",
|
||||||
|
"testId": "myChartProduceText5_js",
|
||||||
|
"type": "pro",
|
||||||
|
"unitId": "0533JS",
|
||||||
|
"where": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"divId": "myChartProduce6_js",
|
||||||
|
"funName": "echartPie",
|
||||||
|
"id": "DAB3ABF7-5135-462F-80FC-E717A09391C0",
|
||||||
|
"memo": "AUTO_HOME_PRO_PIE_6",
|
||||||
|
"morder": 19,
|
||||||
|
"mpointId": "D_ChuSCOD",
|
||||||
|
"sql": "",
|
||||||
|
"testId": "myChartProduceText6_js",
|
||||||
|
"type": "pro",
|
||||||
|
"unitId": "0533JS",
|
||||||
|
"where": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"divId": "myChartProduce7_js",
|
||||||
|
"funName": "echartPie",
|
||||||
|
"id": "9864A8F9-6362-49F9-8F10-812E45F22FFB",
|
||||||
|
"memo": "AUTO_HOME_PRO_PIE_7",
|
||||||
|
"morder": 20,
|
||||||
|
"mpointId": "D_ChuSPH",
|
||||||
|
"sql": "",
|
||||||
|
"testId": "myChartProduceText7_js",
|
||||||
|
"type": "pro",
|
||||||
|
"unitId": "0533JS",
|
||||||
|
"where": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"divId": "myChartProduce8_js",
|
||||||
|
"funName": "echartPie",
|
||||||
|
"id": "B989F914-9883-47BA-B261-F12DC2CA1365",
|
||||||
|
"memo": "AUTO_HOME_PRO_PIE_8",
|
||||||
|
"morder": 21,
|
||||||
|
"mpointId": "C_Cstp",
|
||||||
|
"sql": "",
|
||||||
|
"testId": "myChartProduceText8_js",
|
||||||
|
"type": "pro",
|
||||||
|
"unitId": "0533JS",
|
||||||
|
"where": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"divId": "myChartProduce9_js",
|
||||||
|
"funName": "echartPie",
|
||||||
|
"id": "BBA7F23F-197F-4FF0-AD42-426DE4569907",
|
||||||
|
"memo": "AUTO_HOME_PRO_PIE_9",
|
||||||
|
"morder": 22,
|
||||||
|
"mpointId": "C_Cstn",
|
||||||
|
"sql": "",
|
||||||
|
"testId": "myChartProduceText9_js",
|
||||||
|
"type": "pro",
|
||||||
|
"unitId": "0533JS",
|
||||||
|
"where": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"divId": "myChartProduce10_js",
|
||||||
|
"funName": "echartPie",
|
||||||
|
"id": "E179A4CE-D159-4B11-A517-7CC760C27E70",
|
||||||
|
"memo": "AUTO_HOME_PRO_PIE_10",
|
||||||
|
"morder": 23,
|
||||||
|
"mpointId": "C_Csnh4n",
|
||||||
|
"sql": "",
|
||||||
|
"testId": "myChartProduceText10_js",
|
||||||
|
"type": "pro",
|
||||||
|
"unitId": "0533JS",
|
||||||
|
"where": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"divId": "myChartProduce11_js",
|
||||||
|
"funName": "echartPie",
|
||||||
|
"id": "E179A4CE-D159-4B11-A517-7CC760C27E70",
|
||||||
|
"memo": "AUTO_HOME_PRO_PIE_10",
|
||||||
|
"morder": 23,
|
||||||
|
"mpointId": "C_Csnh4n",
|
||||||
|
"sql": "",
|
||||||
|
"testId": "myChartProduceText11_js",
|
||||||
|
"type": "pro",
|
||||||
|
"unitId": "0533JS",
|
||||||
|
"where": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"divId": "myChartProduce12_js",
|
||||||
|
"funName": "echartPie",
|
||||||
|
"id": "E179A4CE-D159-4B11-A517-7CC760C27E70",
|
||||||
|
"memo": "AUTO_HOME_PRO_PIE_10",
|
||||||
|
"morder": 23,
|
||||||
|
"mpointId": "C_Csnh4n",
|
||||||
|
"sql": "",
|
||||||
|
"testId": "myChartProduceText12_js",
|
||||||
|
"type": "pro",
|
||||||
|
"unitId": "0533JS",
|
||||||
|
"where": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"divId": "myChartProduce13_js",
|
||||||
|
"funName": "echartPie",
|
||||||
|
"id": "E179A4CE-D159-4B11-A517-7CC760C27E70",
|
||||||
|
"memo": "AUTO_HOME_PRO_PIE_10",
|
||||||
|
"morder": 23,
|
||||||
|
"mpointId": "C_Csnh4n",
|
||||||
|
"sql": "",
|
||||||
|
"testId": "myChartProduceText13_js",
|
||||||
|
"type": "pro",
|
||||||
|
"unitId": "0533JS",
|
||||||
|
"where": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"divId": "myChartProduce14_js",
|
||||||
|
"funName": "echartPie",
|
||||||
|
"id": "E179A4CE-D159-4B11-A517-7CC760C27E70",
|
||||||
|
"memo": "AUTO_HOME_PRO_PIE_10",
|
||||||
|
"morder": 23,
|
||||||
|
"mpointId": "C_Csnh4n",
|
||||||
|
"sql": "",
|
||||||
|
"testId": "myChartProduceText14_js",
|
||||||
|
"type": "pro",
|
||||||
|
"unitId": "0533JS",
|
||||||
|
"where": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"divId": "myChartProduce15_js",
|
||||||
|
"funName": "echartPie",
|
||||||
|
"id": "E179A4CE-D159-4B11-A517-7CC760C27E70",
|
||||||
|
"memo": "AUTO_HOME_PRO_PIE_10",
|
||||||
|
"morder": 23,
|
||||||
|
"mpointId": "C_Csnh4n",
|
||||||
|
"sql": "",
|
||||||
|
"testId": "myChartProduceText15_js",
|
||||||
|
"type": "pro",
|
||||||
|
"unitId": "0533JS",
|
||||||
|
"where": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"divId": "myChartProduce16_js",
|
||||||
|
"funName": "echartPie",
|
||||||
|
"id": "E179A4CE-D159-4B11-A517-7CC760C27E70",
|
||||||
|
"memo": "AUTO_HOME_PRO_PIE_10",
|
||||||
|
"morder": 23,
|
||||||
|
"mpointId": "C_Csnh4n",
|
||||||
|
"sql": "",
|
||||||
|
"testId": "myChartProduceText16_js",
|
||||||
|
"type": "pro",
|
||||||
|
"unitId": "0533JS",
|
||||||
|
"where": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"divId": "myChartProduce17_js",
|
||||||
|
"funName": "echartPie",
|
||||||
|
"id": "E179A4CE-D159-4B11-A517-7CC760C27E70",
|
||||||
|
"memo": "AUTO_HOME_PRO_PIE_10",
|
||||||
|
"morder": 23,
|
||||||
|
"mpointId": "C_Csnh4n",
|
||||||
|
"sql": "",
|
||||||
|
"testId": "myChartProduceText17_js",
|
||||||
|
"type": "pro",
|
||||||
|
"unitId": "0533JS",
|
||||||
|
"where": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"divId": "myChartProduce18_js",
|
||||||
|
"funName": "echartPie",
|
||||||
|
"id": "E179A4CE-D159-4B11-A517-7CC760C27E70",
|
||||||
|
"memo": "AUTO_HOME_PRO_PIE_10",
|
||||||
|
"morder": 23,
|
||||||
|
"mpointId": "C_Csnh4n",
|
||||||
|
"sql": "",
|
||||||
|
"testId": "myChartProduceText18_js",
|
||||||
|
"type": "pro",
|
||||||
|
"unitId": "0533JS",
|
||||||
|
"where": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"divId": "myChartProduce19_js",
|
||||||
|
"funName": "echartPie",
|
||||||
|
"id": "E179A4CE-D159-4B11-A517-7CC760C27E70",
|
||||||
|
"memo": "AUTO_HOME_PRO_PIE_10",
|
||||||
|
"morder": 23,
|
||||||
|
"mpointId": "C_Csnh4n",
|
||||||
|
"sql": "",
|
||||||
|
"testId": "myChartProduceText19_js",
|
||||||
|
"type": "pro",
|
||||||
|
"unitId": "0533JS",
|
||||||
|
"where": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"divId": "myChartProduce20_js",
|
||||||
|
"funName": "echartPie",
|
||||||
|
"id": "E179A4CE-D159-4B11-A517-7CC760C27E70",
|
||||||
|
"memo": "AUTO_HOME_PRO_PIE_10",
|
||||||
|
"morder": 23,
|
||||||
|
"mpointId": "C_Csnh4n",
|
||||||
|
"sql": "",
|
||||||
|
"testId": "myChartProduceText20_js",
|
||||||
|
"type": "pro",
|
||||||
|
"unitId": "0533JS",
|
||||||
|
"where": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"divId": "safe_value_1",
|
||||||
|
"funName": "getValue",
|
||||||
|
"id": "E39427C5-3120-46CB-B94B-53B76190ED39",
|
||||||
|
"memo": "AUTO_HOME_SAFE_VAL_1",
|
||||||
|
"morder": 44,
|
||||||
|
"mpointId": "C_Ydrjjs",
|
||||||
|
"sql": "",
|
||||||
|
"testId": "safe_text_1",
|
||||||
|
"type": "safe",
|
||||||
|
"unitId": "0533JS",
|
||||||
|
"where": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"divId": "safe_value_2",
|
||||||
|
"funName": "getValue",
|
||||||
|
"id": "541399E8-7413-444F-85A9-22D746E4A3A2",
|
||||||
|
"memo": "AUTO_HOME_SAFE_VAL_2",
|
||||||
|
"morder": 45,
|
||||||
|
"mpointId": "C_Ndzjs",
|
||||||
|
"sql": "",
|
||||||
|
"testId": "safe_text_2",
|
||||||
|
"type": "safe",
|
||||||
|
"unitId": "0533JS",
|
||||||
|
"where": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"divId": "safe_value_3",
|
||||||
|
"funName": "getValue",
|
||||||
|
"id": "E109D0CB-4458-4A63-B714-A6AC7B6979F1",
|
||||||
|
"memo": "AUTO_HOME_SAFE_VAL_3",
|
||||||
|
"morder": 46,
|
||||||
|
"mpointId": "C_Sbwhl",
|
||||||
|
"sql": "",
|
||||||
|
"testId": "safe_text_3",
|
||||||
|
"type": "safe",
|
||||||
|
"unitId": "0533JS",
|
||||||
|
"where": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"divId": "safe_value_4",
|
||||||
|
"funName": "getValue",
|
||||||
|
"id": "024F849A-E7F3-4665-862A-49B2944277B7",
|
||||||
|
"memo": "AUTO_HOME_SAFE_VAL_4",
|
||||||
|
"morder": 47,
|
||||||
|
"mpointId": "C_Mrddh",
|
||||||
|
"sql": "",
|
||||||
|
"testId": "safe_text_4",
|
||||||
|
"type": "safe",
|
||||||
|
"unitId": "0533JS",
|
||||||
|
"where": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"divId": "myChartProduce8",
|
||||||
|
"funName": "echartMixed",
|
||||||
|
"id": "B414A41C-DC87-47A0-BB07-5BC64E5E61CB",
|
||||||
|
"memo": "AUTO_HOME_SAFE_BAR",
|
||||||
|
"morder": 100,
|
||||||
|
"mpointId": "C_Mrjsy,C_Mrjse",
|
||||||
|
"sql": "",
|
||||||
|
"testId": "",
|
||||||
|
"type": "safe",
|
||||||
|
"unitId": "0533JS",
|
||||||
|
"where": ""
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// "divId": "myChartProduce9",
|
||||||
|
// "funName": "echartColumnar2",
|
||||||
|
// "id": "B414A41C-DC87-47A0-BB07-5BC64E5E61CB",
|
||||||
|
// "memo": "AUTO_HOME_SAFE_BAR",
|
||||||
|
// "morder": 100,
|
||||||
|
// "mpointId": "C_Mrjsy,C_Mrjse",
|
||||||
|
// "sql": "",
|
||||||
|
// "testId": "",
|
||||||
|
// "type": "safe",
|
||||||
|
// "unitId": "0533JS",
|
||||||
|
// "where": ""
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// "divId": "myChartProduce10",
|
||||||
|
// "funName": "echartLine2",
|
||||||
|
// "id": "B414A41C-DC87-47A0-BB07-5BC64E5E61CB",
|
||||||
|
// "memo": "AUTO_HOME_SAFE_BAR",
|
||||||
|
// "morder": 100,
|
||||||
|
// "mpointId": "C_Mrjsy,C_Mrjse",
|
||||||
|
// "sql": "",
|
||||||
|
// "testId": "",
|
||||||
|
// "type": "safe",
|
||||||
|
// "unitId": "0533JS",
|
||||||
|
// "where": ""
|
||||||
|
// }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
for (var i = 0; i < data.mpcode.length; i++) {
|
||||||
|
var code = data.mpcode[i].mpointId;
|
||||||
|
var funname = data.mpcode[i].funName;
|
||||||
|
var divid = data.mpcode[i].divId;
|
||||||
|
var testid = data.mpcode[i].testId;
|
||||||
|
var mpointId = data.mpcode[i].mpointId;
|
||||||
|
if (data.mpcode[i].type == '${type_pro}') {//生产
|
||||||
|
eval(funname + "('" + unitId + "','" + code + "','" + divid + "','" + testid + "')")
|
||||||
|
}
|
||||||
|
if (data.mpcode[i].type == '${type_safe}') {//安全
|
||||||
|
eval(funname + "('" + unitId + "','" + code + "','" + divid + "','" + testid + "')")
|
||||||
|
}
|
||||||
|
if (data.mpcode[i].type == '${type_eff}') {//效率
|
||||||
|
eval(funname + "('" + unitId + "','" + code + "','" + divid + "','" + testid + "')")
|
||||||
|
}
|
||||||
|
if (data.mpcode[i].type == '${type_pic}') {//左上角图片
|
||||||
|
//eval(funname + "('" + unitId + "')")
|
||||||
|
getUnitsByUnitId4Select(unitId,funname,mpointId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//安全
|
||||||
|
// echartColumnar2(unitId, 'TH_03_FIT040001D_FLOW_C', 'myChartsafe1');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//优良差
|
||||||
|
$(".evaluateIcon").attr("src", ext.contextPath + "/IMG/main/evaluate.png");
|
||||||
|
|
||||||
|
//左上角图片
|
||||||
|
// $("#mainImg").attr("src", ext.contextPath + "/IMG/main/main.jpg");
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div id="mainDiv" style="background:#f1f1f1;min-height:100vh; width:100%;">
|
||||||
|
|
||||||
|
<div style="float:left;width:100%;">
|
||||||
|
<!-- 水质指标区域 -->
|
||||||
|
<div style="float:left;width:100%;padding:5px;">
|
||||||
|
<div style="width:100%;background-color:#ffffff;border-radius:5px;">
|
||||||
|
<div class="section-header">
|
||||||
|
金山卫污水厂
|
||||||
|
</div>
|
||||||
|
<div style="display:flex;width:100%;">
|
||||||
|
<!-- 左侧卡片 -->
|
||||||
|
<div style="width:300px;min-width:300px;display:flex;flex-direction:column;justify-content:space-evenly;padding:10px;gap:10px;">
|
||||||
|
<div></div>
|
||||||
|
<div style="width:100%;height:120px;background-color:#cbe3f9;border-radius:5px;">
|
||||||
|
<div class="fontText" style="color: #0c4377;" id="textProduce1_js">进水瞬时流量(m³/h)</div>
|
||||||
|
<div class="fontValue" style="color: #0c4377;" id="valueProduce1_js">3551</div>
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:120px;background-color:#badaf8;border-radius:5px;">
|
||||||
|
<div class="fontText" style="color: #0c4377;" id="textProduce2_js">出水瞬时流量(m³/h)</div>
|
||||||
|
<div class="fontValue" style="color: #0c4377;" id="valueProduce2_js">3551</div>
|
||||||
|
</div>
|
||||||
|
<div></div>
|
||||||
|
<div style="width:100%;height:120px;background-color:#73afd8;border-radius:5px;">
|
||||||
|
<div class="fontText" style="color: #0c4377;" id="textProduce3_js">进水瞬时流量(m³/h)</div>
|
||||||
|
<div class="fontValue" style="color: #0c4377;" id="valueProduce3_js">3551</div>
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:120px;background-color:#378dcc;border-radius:5px;">
|
||||||
|
<div class="fontText" style="color: #0c4377;" id="textProduce4_js">出水瞬时流量(m³/h)</div>
|
||||||
|
<div class="fontValue" style="color: #0c4377;" id="valueProduce4_js">3551</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- 右侧图表区域 -->
|
||||||
|
<div style="flex:1;padding:10px;">
|
||||||
|
<!-- 工业污水质量指标 标题 -->
|
||||||
|
<div style="width:100%;height:30px;font-weight:bold;color:#0c4377;padding-left:10px;border-bottom:2px solid #67aad7;display:flex;align-items:center;">
|
||||||
|
工业污水质量指标
|
||||||
|
</div>
|
||||||
|
<!-- 工业污水质量指标 第一行 (1-5) -->
|
||||||
|
<div style="width:100%;height:180px;display:flex;padding:5px 0;">
|
||||||
|
<div style="width:20%;height:100%;padding:0 5px;">
|
||||||
|
<div style="width:100%;height:30px;text-align:center; line-height: 40px;" id="myChartProduceText1_js">-</div>
|
||||||
|
<div style="width:100%;height:110px;" id="myChartProduce1_js"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;padding:0 5px;">
|
||||||
|
<div style="width:100%;height:30px;text-align:center; line-height: 40px" id="myChartProduceText2_js">-</div>
|
||||||
|
<div style="width:100%;height:110px;" id="myChartProduce2_js"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;padding:0 5px;">
|
||||||
|
<div style="width:100%;height:25px;text-align:center; line-height: 40px" id="myChartProduceText3_js">-</div>
|
||||||
|
<div style="width:100%;height:110px;" id="myChartProduce3_js"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;padding:0 5px;">
|
||||||
|
<div style="width:100%;height:25px;text-align:center; line-height: 40px" id="myChartProduceText4_js">-</div>
|
||||||
|
<div style="width:100%;height:110px;" id="myChartProduce4_js"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;padding:0 5px;">
|
||||||
|
<div style="width:100%;height:25px;text-align:center; line-height: 40px" id="myChartProduceText5_js">-</div>
|
||||||
|
<div style="width:100%;height:110px;" id="myChartProduce5_js"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- 工业污水质量指标 第二行 (6-10) -->
|
||||||
|
<div style="width:100%;height:180px;display:flex;padding:5px 0;">
|
||||||
|
<div style="width:20%;height:100%;padding:0 5px;">
|
||||||
|
<div style="width:100%;height:25px;text-align:center; line-height: 40px" id="myChartProduceText6_js">-</div>
|
||||||
|
<div style="width:100%;height:110px;" id="myChartProduce6_js"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;padding:0 5px;">
|
||||||
|
<div style="width:100%;height:25px;text-align:center; line-height: 40px" id="myChartProduceText7_js">-</div>
|
||||||
|
<div style="width:100%;height:110px;" id="myChartProduce7_js"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;padding:0 5px;">
|
||||||
|
<div style="width:100%;height:25px;text-align:center; line-height: 40px" id="myChartProduceText8_js">-</div>
|
||||||
|
<div style="width:100%;height:110px;" id="myChartProduce8_js"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;padding:0 5px;">
|
||||||
|
<div style="width:100%;height:25px;text-align:center; line-height: 40px" id="myChartProduceText9_js">-</div>
|
||||||
|
<div style="width:100%;height:110px;" id="myChartProduce9_js"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;padding:0 5px;">
|
||||||
|
<div style="width:100%;height:25px;text-align:center; line-height: 40px" id="myChartProduceText10_js">-</div>
|
||||||
|
<div style="width:100%;height:110px;" id="myChartProduce10_js"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- 生活污水质量指标 标题 -->
|
||||||
|
<div style="width:100%;height:30px;font-weight:bold;color:#0c4377;padding-left:10px;border-bottom:2px solid #67aad7;display:flex;align-items:center;margin-top:10px;">
|
||||||
|
生活污水质量指标
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!-- 生活污水质量指标 第一行 (11-15) -->
|
||||||
|
<div style="width:100%;height:180px;display:flex;padding:5px 0;">
|
||||||
|
<div style="width:20%;height:100%;padding:0 5px;">
|
||||||
|
<div style="width:100%;height:25px;text-align:center; line-height: 40px" id="myChartProduceText11_js">-</div>
|
||||||
|
<div style="width:100%;height:110px;" id="myChartProduce11_js"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;padding:0 5px;">
|
||||||
|
<div style="width:100%;height:25px;text-align:center; line-height: 40px" id="myChartProduceText12_js">-</div>
|
||||||
|
<div style="width:100%;height:110px;" id="myChartProduce12_js"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;padding:0 5px;">
|
||||||
|
<div style="width:100%;height:25px;text-align:center; line-height: 40px" id="myChartProduceText13_js">-</div>
|
||||||
|
<div style="width:100%;height:110px;" id="myChartProduce13_js"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;padding:0 5px;">
|
||||||
|
<div style="width:100%;height:25px;text-align:center; line-height: 40px" id="myChartProduceText14_js">-</div>
|
||||||
|
<div style="width:100%;height:110px;" id="myChartProduce14_js"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;padding:0 5px;">
|
||||||
|
<div style="width:100%;height:25px;text-align:center; line-height: 40px" id="myChartProduceText15_js">-</div>
|
||||||
|
<div style="width:100%;height:110px;" id="myChartProduce15_js"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- 生活污水质量指标 第二行 (16-20) -->
|
||||||
|
<div style="width:100%;height:180px;display:flex;padding:5px 0;">
|
||||||
|
<div style="width:20%;height:100%;padding:0 5px;">
|
||||||
|
<div style="width:100%;height:25px;text-align:center; line-height: 40px" id="myChartProduceText16_js">-</div>
|
||||||
|
<div style="width:100%;height:110px;" id="myChartProduce16_js"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;padding:0 5px;">
|
||||||
|
<div style="width:100%;height:25px;text-align:center; line-height: 40px" id="myChartProduceText17_js">-</div>
|
||||||
|
<div style="width:100%;height:110px;" id="myChartProduce17_js"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;padding:0 5px;">
|
||||||
|
<div style="width:100%;height:25px;text-align:center; line-height: 40px" id="myChartProduceText18_js">-</div>
|
||||||
|
<div style="width:100%;height:110px;" id="myChartProduce18_js"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;padding:0 5px;">
|
||||||
|
<div style="width:100%;height:25px;text-align:center; line-height: 40px" id="myChartProduceText19_js">-</div>
|
||||||
|
<div style="width:100%;height:110px;" id="myChartProduce19_js"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;padding:0 5px;">
|
||||||
|
<div style="width:100%;height:25px;text-align:center; line-height: 40px" id="myChartProduceText20_js">-</div>
|
||||||
|
<div style="width:100%;height:110px;" id="myChartProduce20_js"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- 水量及电耗区域 -->
|
||||||
|
<div style="float:left;width:100%;padding:5px;">
|
||||||
|
<div style="width:100%;background-color:#ffffff;border-radius:5px;">
|
||||||
|
<div class="section-header">
|
||||||
|
水量及电耗
|
||||||
|
</div>
|
||||||
|
<div style="display:flex;width:100%;padding:10px;gap:10px;">
|
||||||
|
<div style="flex:1;height:100px;background-color:#378dcc;border-radius:5px;">
|
||||||
|
<div class="fontValue" id="safe_value_1">16532</div>
|
||||||
|
<div class="fontText" id="safe_text_1">工业进水量 (m3)</div>
|
||||||
|
</div>
|
||||||
|
<div style="flex:1;height:100px;background-color:#67aad7;border-radius:5px;">
|
||||||
|
<div class="fontValue" id="safe_value_2">16532</div>
|
||||||
|
<div class="fontText" id="safe_text_2">工业出水量 (m3)</div>
|
||||||
|
</div>
|
||||||
|
<div style="flex:1;height:100px;background-color:#FACA00;border-radius:5px;">
|
||||||
|
<div class="fontValue" id="safe_value_3">16532</div>
|
||||||
|
<div class="fontText" id="safe_text_3">生活进水量 (m3)</div>
|
||||||
|
</div>
|
||||||
|
<div style="flex:1;height:100px;background-color:#66D97C;border-radius:5px;">
|
||||||
|
<div class="fontValue" id="safe_value_4">16532</div>
|
||||||
|
<div class="fontText" id="safe_text_4">生活出水量 (m3)</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:300px;padding:10px;">
|
||||||
|
<div style="width:100%;height:100%;" id="myChartProduce8"></div>
|
||||||
|
<%-- <div style="width:100%;height:100%;" id="myChartProduce9"></div>--%>
|
||||||
|
<%-- <div style="width:100%;height:100%;" id="myChartProduce10"></div>--%>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!--
|
||||||
|
<div style="float:left;height:50%;width:100%;padding:5px 5px 5px 5px;">
|
||||||
|
<div style="height:100%;width:100%;background-color:#ffffff;">
|
||||||
|
<div style="width:100%;height:5%;float:left;border-bottom:2px solid #67aad7;font-weight: bold;">
|
||||||
|
二车间
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:96%;float:left;">
|
||||||
|
<div style="width:100%;height:25%;float:left;background-color:#cbe3f9;margin:6%;">
|
||||||
|
<div class="fontValue" style="color: #0c4377;" id="valueProduce1_cs"></div>
|
||||||
|
<div class="fontText" style="color: #0c4377;" id="textProduce1_cs"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:25%;float:left;background-color:#badaf8;margin:6%;">
|
||||||
|
<div class="fontValue" style="color: #0c4377;" id="valueProduce2_cs"></div>
|
||||||
|
<div class="fontText" style="color: #0c4377;" id="textProduce2_cs"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:25%;float:left;background-color:#73afd8;margin:6%;">
|
||||||
|
<div class="fontValue" style="color: #0c4377;" id="valueProduce3_cs"></div>
|
||||||
|
<div class="fontText" style="color: #0c4377;" id="textProduce3_cs"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="width:80%;height:96%;float:left;padding: 5px 10px 30px 10px;">
|
||||||
|
<div style="width:100%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:3%;float:left;"></div>
|
||||||
|
<div style="width:100%;height:40%;float:left;">
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText1_cs">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce1_cs"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText2_cs">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce2_cs"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText3_cs">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce3_cs"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText4_cs">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce4_cs"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText5_cs">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce5_cs"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:4%;float:left;"></div>
|
||||||
|
<div style="width:100%;height:40%;float:left;">
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText6_cs">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce6_cs"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText7_cs">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce7_cs"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText8_cs">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce8_cs"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText9_cs">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce9_cs"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText10_cs">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce10_cs"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:3%;float:left;"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
-->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
398
src/main/webapp/jsp/main_JS_Company2_init.jsp
Normal file
398
src/main/webapp/jsp/main_JS_Company2_init.jsp
Normal file
@ -0,0 +1,398 @@
|
|||||||
|
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||||
|
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||||
|
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
|
||||||
|
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
||||||
|
<%@ page import="com.sipai.entity.base.ServerObject" %>
|
||||||
|
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security" %>
|
||||||
|
|
||||||
|
<%@ page import="com.sipai.entity.base.MainConfig" %>
|
||||||
|
<% request.setAttribute("type_pro", MainConfig.type_pro); %>
|
||||||
|
<% request.setAttribute("type_safe", MainConfig.type_safe); %>
|
||||||
|
<% request.setAttribute("type_eff", MainConfig.type_eff); %>
|
||||||
|
<% request.setAttribute("type_pic", MainConfig.type_pic); %>
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||||
|
</title>
|
||||||
|
|
||||||
|
<!-- 引用页头及CSS页-->
|
||||||
|
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||||
|
<!-- echarts-->
|
||||||
|
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/echarts/echarts.4.1.0.min.js"
|
||||||
|
charset="utf-8"></script>
|
||||||
|
|
||||||
|
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/main/main_js.js" charset="utf-8"></script>
|
||||||
|
<style>
|
||||||
|
/*
|
||||||
|
根据不同分辨率显示不同px的文字大小
|
||||||
|
*/
|
||||||
|
@media (min-width: 1080px) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 1550px) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.fontValue {
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 20px;
|
||||||
|
margin-left: 70px;
|
||||||
|
font-size: 20px;
|
||||||
|
color: #ffffff;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fontText {
|
||||||
|
margin-left: 20px;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #ffffff;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.carousel-inner,
|
||||||
|
.carousel-inner >.item,
|
||||||
|
.carousel-inner >.item >img{
|
||||||
|
width:100%;height:100%;
|
||||||
|
}
|
||||||
|
.carousel-caption{
|
||||||
|
cursor: pointer;
|
||||||
|
padding: 0;
|
||||||
|
background-color: RGBA(55,141,204,0.5);
|
||||||
|
bottom: 10px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
|
||||||
|
$(function () {
|
||||||
|
firstFun();
|
||||||
|
});
|
||||||
|
|
||||||
|
window.onresize = function () {
|
||||||
|
firstFun();
|
||||||
|
}
|
||||||
|
|
||||||
|
function firstFun() {
|
||||||
|
//var height = document.documentElement.clientHeight;
|
||||||
|
var height = $(window).height();
|
||||||
|
$('#mainDiv').css('height', height);//页面加载先给高度
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
type: 'GET',
|
||||||
|
url: ext.contextPath + '/base/mainConfig/getJson.do',
|
||||||
|
async: true,
|
||||||
|
data: {unitId: unitId},
|
||||||
|
globle: false,
|
||||||
|
error: function () {
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
success: function (data) {
|
||||||
|
var data = eval('(' + data + ')');
|
||||||
|
for (var i = 0; i < data.mpcode.length; i++) {
|
||||||
|
var code = data.mpcode[i].mpointId;
|
||||||
|
var funname = data.mpcode[i].funName;
|
||||||
|
var divid = data.mpcode[i].divId;
|
||||||
|
var testid = data.mpcode[i].testId;
|
||||||
|
var mpointId = data.mpcode[i].mpointId;
|
||||||
|
if (data.mpcode[i].type == '${type_pro}') {//生产
|
||||||
|
eval(funname + "('" + unitId + "','" + code + "','" + divid + "','" + testid + "')")
|
||||||
|
}
|
||||||
|
if (data.mpcode[i].type == '${type_safe}') {//安全
|
||||||
|
eval(funname + "('" + unitId + "','" + code + "','" + divid + "','" + testid + "')")
|
||||||
|
}
|
||||||
|
if (data.mpcode[i].type == '${type_eff}') {//效率
|
||||||
|
eval(funname + "('" + unitId + "','" + code + "','" + divid + "','" + testid + "')")
|
||||||
|
}
|
||||||
|
if (data.mpcode[i].type == '${type_pic}') {//左上角图片
|
||||||
|
//eval(funname + "('" + unitId + "')")
|
||||||
|
getUnitsByUnitId4Select(unitId,funname,mpointId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//安全
|
||||||
|
// echartColumnar2(unitId, 'TH_03_FIT040001D_FLOW_C', 'myChartsafe1');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//优良差
|
||||||
|
$(".evaluateIcon").attr("src", ext.contextPath + "/IMG/main/evaluate.png");
|
||||||
|
|
||||||
|
//左上角图片
|
||||||
|
// $("#mainImg").attr("src", ext.contextPath + "/IMG/main/main.jpg");
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div id="mainDiv" style="background:#f1f1f1;">
|
||||||
|
|
||||||
|
<div style="float:left;height:100%;width:35%;">
|
||||||
|
<div style="float:left;height:45%;width:100%;padding:5px 5px 5px 5px;">
|
||||||
|
<div style="height:100%;width:100%;background-color:#ffffff;">
|
||||||
|
<%--图片--%>
|
||||||
|
<!-- <img src="" id="mainImg" style="width:100%;height:100%;"> -->
|
||||||
|
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel" style="width:100%;height:100%;">
|
||||||
|
|
||||||
|
<!-- Wrapper for slides -->
|
||||||
|
<div class="carousel-inner" role="listbox" id="carousel-items">
|
||||||
|
</div>
|
||||||
|
<!-- Controls -->
|
||||||
|
<a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
|
||||||
|
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
|
||||||
|
<span class="sr-only">Previous</span>
|
||||||
|
</a>
|
||||||
|
<a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
|
||||||
|
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
|
||||||
|
<span class="sr-only">Next</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="float:left;height:55%;width:100%;padding:5px 5px 5px 5px;">
|
||||||
|
<div style="height:100%;width:100%;background-color:#ffffff;">
|
||||||
|
<div style="width:100%;height:5%;float:left;border-bottom:2px solid #67aad7;font-weight: bold;">
|
||||||
|
水量及电耗
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:40%;float:left;">
|
||||||
|
|
||||||
|
<div style="width:48%;height:45%;float:left;background-color:#378dcc;margin:1%;">
|
||||||
|
<div class="fontValue" id="safe_value_1">-</div>
|
||||||
|
<div class="fontText" id="safe_text_1">-</div>
|
||||||
|
</div>
|
||||||
|
<div style="width:48%;height:45%;float:right;background-color:#67aad7;margin:1%;">
|
||||||
|
<div class="fontValue" id="safe_value_2">-</div>
|
||||||
|
<div class="fontText" id="safe_text_2">-</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style="width:48%;height:45%;float:left;background-color:#FACA00;margin:1%;">
|
||||||
|
<div class="fontValue" id="safe_value_3">-</div>
|
||||||
|
<div class="fontText" id="safe_text_3">-</div>
|
||||||
|
</div>
|
||||||
|
<div style="width:48%;height:45%;float:right;background-color:#66D97C;margin:1%;">
|
||||||
|
<div class="fontValue" id="safe_value_4">-</div>
|
||||||
|
<div class="fontText" id="safe_text_4">-</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:55%;float:left;padding: 5px 5px 5px 5px;">
|
||||||
|
<div style="width:100%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:100%;float:left;" id="myChartProduce8"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style="float:left;height:100%;width:65%;">
|
||||||
|
<div style="float:left;height:50%;width:100%;padding:5px 5px 5px 5px;">
|
||||||
|
<div style="height:100%;width:100%;background-color:#ffffff;">
|
||||||
|
<div style="width:100%;height:5%;float:left;border-bottom:2px solid #67aad7;font-weight: bold;">
|
||||||
|
一车间
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:25%;float:left;background-color:#cbe3f9;margin:6%;">
|
||||||
|
<div class="fontValue" style="color: #0c4377;" id="valueProduce1_js"></div>
|
||||||
|
<div class="fontText" style="color: #0c4377;" id="textProduce1_js"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:25%;float:left;background-color:#badaf8;margin:6%;">
|
||||||
|
<div class="fontValue" style="color: #0c4377;" id="valueProduce2_js"></div>
|
||||||
|
<div class="fontText" style="color: #0c4377;" id="textProduce2_js"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:25%;float:left;background-color:#73afd8;margin:6%;">
|
||||||
|
<div class="fontValue" style="color: #0c4377;" id="valueProduce3_js"></div>
|
||||||
|
<div class="fontText" style="color: #0c4377;" id="textProduce3_js"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="width:80%;height:100%;float:left;padding: 5px 10px 30px 10px;">
|
||||||
|
<div style="width:100%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:3%;float:left;"></div>
|
||||||
|
<div style="width:100%;height:40%;float:left;">
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText1_js">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce1_js"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText2_js">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce2_js"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText3_js">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce3_js"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText4_js">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce4_js"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText5_js">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce5_js"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:4%;float:left;"></div>
|
||||||
|
<div style="width:100%;height:40%;float:left;">
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText6_js">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce6_js"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText7_js">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce7_js"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText8_js">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce8_js"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText9_js">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce9_js"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText10_js">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce10_js"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:3%;float:left;"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="float:left;height:50%;width:100%;padding:5px 5px 5px 5px;">
|
||||||
|
<div style="height:100%;width:100%;background-color:#ffffff;">
|
||||||
|
<div style="width:100%;height:5%;float:left;border-bottom:2px solid #67aad7;font-weight: bold;">
|
||||||
|
二车间
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:96%;float:left;">
|
||||||
|
<div style="width:100%;height:25%;float:left;background-color:#cbe3f9;margin:6%;">
|
||||||
|
<div class="fontValue" style="color: #0c4377;" id="valueProduce1_cs"></div>
|
||||||
|
<div class="fontText" style="color: #0c4377;" id="textProduce1_cs"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:25%;float:left;background-color:#badaf8;margin:6%;">
|
||||||
|
<div class="fontValue" style="color: #0c4377;" id="valueProduce2_cs"></div>
|
||||||
|
<div class="fontText" style="color: #0c4377;" id="textProduce2_cs"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:25%;float:left;background-color:#73afd8;margin:6%;">
|
||||||
|
<div class="fontValue" style="color: #0c4377;" id="valueProduce3_cs"></div>
|
||||||
|
<div class="fontText" style="color: #0c4377;" id="textProduce3_cs"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="width:80%;height:96%;float:left;padding: 5px 10px 30px 10px;">
|
||||||
|
<div style="width:100%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:3%;float:left;"></div>
|
||||||
|
<div style="width:100%;height:40%;float:left;">
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText1_cs">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce1_cs"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText2_cs">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce2_cs"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText3_cs">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce3_cs"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText4_cs">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce4_cs"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText5_cs">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce5_cs"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:4%;float:left;"></div>
|
||||||
|
<div style="width:100%;height:40%;float:left;">
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText6_cs">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce6_cs"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText7_cs">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce7_cs"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText8_cs">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce8_cs"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText9_cs">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce9_cs"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText10_cs">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce10_cs"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:3%;float:left;"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
@ -354,7 +354,7 @@
|
|||||||
</div>--%>
|
</div>--%>
|
||||||
|
|
||||||
<div class="form-group" style="margin:8px">
|
<div class="form-group" style="margin:8px">
|
||||||
<button type="button" class="btn btn-default btn-file" onclick="fileinputPic('maintenanceDetailFile')"
|
<button type="button" class="btn btn-default btn-file" onclick="fileinputPic('abnormityFileId')"
|
||||||
id="btn_save"><i
|
id="btn_save"><i
|
||||||
class="fa fa-paperclip"></i>上传图片
|
class="fa fa-paperclip"></i>上传图片
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@ -88,7 +88,10 @@
|
|||||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||||
var datas = "";
|
var datas = "";
|
||||||
$.each(checkedItems, function(index, item) {
|
$.each(checkedItems, function(index, item) {
|
||||||
datas += item.id + ",";
|
if (datas != "") {
|
||||||
|
datas += ",";
|
||||||
|
}
|
||||||
|
datas += item.id;
|
||||||
});
|
});
|
||||||
if (datas == "") {
|
if (datas == "") {
|
||||||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||||
|
|||||||
@ -263,7 +263,8 @@
|
|||||||
field: 'name', // 返回json数据中的name
|
field: 'name', // 返回json数据中的name
|
||||||
title: '姓名', // 表格表头显示文字
|
title: '姓名', // 表格表头显示文字
|
||||||
align: 'center', // 左右居中
|
align: 'center', // 左右居中
|
||||||
valign: 'middle' // 上下居中
|
valign: 'middle', // 上下居中
|
||||||
|
width: 200,
|
||||||
}, {
|
}, {
|
||||||
/* field: 'gender', // 返回json数据中的name
|
/* field: 'gender', // 返回json数据中的name
|
||||||
title: '性别', // 表格表头显示文字
|
title: '性别', // 表格表头显示文字
|
||||||
|
|||||||
@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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");
|
||||||
|
|||||||
@ -115,7 +115,7 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD
|
|||||||
var fileinput = function () {
|
var fileinput = function () {
|
||||||
$('#file').click();
|
$('#file').click();
|
||||||
};
|
};
|
||||||
var filedel = function () {
|
var filedel = function (index) {
|
||||||
fileList.splice(index,1)
|
fileList.splice(index,1)
|
||||||
$('#test').html(initFileInputView())
|
$('#test').html(initFileInputView())
|
||||||
};
|
};
|
||||||
|
|||||||
@ -72,7 +72,7 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD
|
|||||||
var fileinput = function () {
|
var fileinput = function () {
|
||||||
$('#file').click();
|
$('#file').click();
|
||||||
};
|
};
|
||||||
var filedel = function () {
|
var filedel = function (index) {
|
||||||
fileList.splice(index, 1)
|
fileList.splice(index, 1)
|
||||||
$('#test').html(initFileInputView())
|
$('#test').html(initFileInputView())
|
||||||
};
|
};
|
||||||
@ -234,7 +234,8 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD
|
|||||||
{
|
{
|
||||||
formId: "addForm",
|
formId: "addForm",
|
||||||
hiddenId: "userId",
|
hiddenId: "userId",
|
||||||
textId: "userName"
|
textId: "userName",
|
||||||
|
displayDept: "true"
|
||||||
}, function (data) {
|
}, function (data) {
|
||||||
$("#user4SelectDiv").html(data);
|
$("#user4SelectDiv").html(data);
|
||||||
openModal("user4SelectModal");
|
openModal("user4SelectModal");
|
||||||
|
|||||||
@ -47,6 +47,11 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD
|
|||||||
display: inline-block;
|
display: inline-block;
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
|
width: 140px;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
.detail-row {
|
||||||
|
clear: both;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
@ -253,7 +258,7 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD
|
|||||||
function initdeTail(list) {
|
function initdeTail(list) {
|
||||||
let temp = `<div >`
|
let temp = `<div >`
|
||||||
list.forEach((item, index) => {
|
list.forEach((item, index) => {
|
||||||
temp += `<div><div class="AAA">` + item.deptName + `</div>`
|
temp += `<div class="detail-row"><div class="AAA">` + item.deptName + `</div>`
|
||||||
temp += `<div class="AAA">` + item.userName + `</div>`
|
temp += `<div class="AAA">` + item.userName + `</div>`
|
||||||
temp += `<div class="AAA">` + item.pass + `</div>`
|
temp += `<div class="AAA">` + item.pass + `</div>`
|
||||||
temp += `<div class="AAA">` + item.time + `</div></div>`
|
temp += `<div class="AAA">` + item.time + `</div></div>`
|
||||||
@ -426,8 +431,10 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD
|
|||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-2 control-label ">查看其它会签意见</label>
|
<label class="col-sm-2 control-label ">查看其它会签意见</label>
|
||||||
|
<div class="col-sm-10">
|
||||||
<div id="deTail"></div>
|
<div id="deTail"></div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<div class="form-group" style="margin-left: 39px">
|
<div class="form-group" style="margin-left: 39px">
|
||||||
<div id="fileList"></div>
|
<div id="fileList"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -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>
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user