Compare commits
18 Commits
7048001c0c
...
1cd6750710
| Author | SHA1 | Date | |
|---|---|---|---|
| 1cd6750710 | |||
| b745bb8482 | |||
| 9a9dc780e4 | |||
| 3208f2b8a3 | |||
| 44b6bf04d5 | |||
| 75f33e37d7 | |||
| 17751bd0ab | |||
| 82d68ed669 | |||
| 09fce43c98 | |||
| 9895757c92 | |||
| bce9cc42e8 | |||
| 6de1aabe80 | |||
| 3ea3e0a9af | |||
| 56da3dc9ff | |||
| 2bfa643373 | |||
| 5e52e1db7c | |||
| 1c8f1f98d5 | |||
| 3da9c9afb5 |
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -93,11 +93,7 @@ public class BusinessUnitController {
|
||||
public String dosave(HttpServletRequest request,Model model,
|
||||
@ModelAttribute BusinessUnit businessUnit){
|
||||
User cu= (User)request.getSession().getAttribute("cu");
|
||||
// Use custom ID if provided, otherwise generate UUID
|
||||
String id = businessUnit.getId();
|
||||
if(id == null || id.trim().isEmpty()) {
|
||||
id = CommUtil.getUUID();
|
||||
}
|
||||
String id = CommUtil.getUUID();
|
||||
businessUnit.setId(id);
|
||||
businessUnit.setInsuser(cu.getId());
|
||||
businessUnit.setInsdt(CommUtil.nowDate());
|
||||
|
||||
@ -327,13 +327,13 @@ public class DataController {
|
||||
fileIds = fileIds.replace(",","','");
|
||||
wherestr += " and (id in ('"+fileIds+"') or filename like '%"+fileName+"%') ";
|
||||
}
|
||||
if(request.getParameter("masterId")!=null && !request.getParameter("masterId").isEmpty()){
|
||||
String masterId = request.getParameter("masterId");
|
||||
masterId = masterId.replace(",","','");
|
||||
wherestr += " and masterid in ('"+masterId+"')";
|
||||
}else if(request.getParameter("equipmentId") == null){
|
||||
wherestr += " and masterid in ('')";
|
||||
}
|
||||
// if(request.getParameter("masterId")!=null && !request.getParameter("masterId").isEmpty()){
|
||||
// String masterId = request.getParameter("masterId");
|
||||
// masterId = masterId.replace(",","','");
|
||||
// wherestr += " and masterid in ('"+masterId+"')";
|
||||
// }else if(request.getParameter("equipmentId") == null){
|
||||
// wherestr += " and masterid in ('')";
|
||||
// }
|
||||
if(request.getParameter("equipmentId")!=null && !request.getParameter("equipmentId").isEmpty()){
|
||||
String fileIds = this.equipmentFileService.getFileIds(request.getParameter("equipmentId"));
|
||||
fileIds = fileIds.replace(",","','");
|
||||
|
||||
@ -5696,6 +5696,14 @@ public class EquipmentCardController {
|
||||
* @param model
|
||||
* @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")
|
||||
public String getProcessSection4EquipmentCardTree(HttpServletRequest request, Model model) {
|
||||
String unitId = request.getParameter("unitId");
|
||||
|
||||
@ -36,6 +36,7 @@ import java.util.UUID;
|
||||
|
||||
/**
|
||||
* 综合检查
|
||||
*
|
||||
* @author lt
|
||||
*/
|
||||
@Controller
|
||||
@ -125,11 +126,13 @@ public class SafetyCheckComprehensiveController {
|
||||
@RequestMapping("/save.do")
|
||||
@ResponseBody
|
||||
@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");
|
||||
bean.setId(UUID.randomUUID().toString());
|
||||
if (file.getSize() > 0) {
|
||||
safetyFilesService.upload(request, null, SafetyFunctionEnum.SAFETY_CHECK_COMPREHENSIVE.getId(), SafetyCheckStatusEnum.APPLY.getId(), bean.getId());
|
||||
if (multipartFiles != null) {
|
||||
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));
|
||||
if (bean.getCheckResult() == SafetyCheckResultEnum.OK.getId()) {
|
||||
@ -153,8 +156,8 @@ public class SafetyCheckComprehensiveController {
|
||||
@RequestMapping("/saveApply.do")
|
||||
@ResponseBody
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Result saveApply(HttpServletRequest request, SafetyCheckComprehensive bean, MultipartFile file) throws Exception {
|
||||
if(StringUtils.isEmpty(bean.getDutyUserId())){
|
||||
public Result saveApply(HttpServletRequest request, SafetyCheckComprehensive bean, MultipartFile[] file) throws Exception {
|
||||
if (StringUtils.isEmpty(bean.getDutyUserId())) {
|
||||
return Result.failed("整改负责人不能为空!");
|
||||
}
|
||||
|
||||
@ -232,7 +235,7 @@ public class SafetyCheckComprehensiveController {
|
||||
@ResponseBody
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Result apply(HttpServletRequest request, SafetyCheckComprehensive bean) throws IOException, ServiceException {
|
||||
if(StringUtils.isEmpty(bean.getDutyUserId())){
|
||||
if (StringUtils.isEmpty(bean.getDutyUserId())) {
|
||||
return Result.failed("整改负责人不能为空!");
|
||||
}
|
||||
update(request, bean);
|
||||
@ -336,7 +339,7 @@ public class SafetyCheckComprehensiveController {
|
||||
@ResponseBody
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
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("验证人不能为空!");
|
||||
}
|
||||
|
||||
@ -388,7 +391,7 @@ public class SafetyCheckComprehensiveController {
|
||||
bean.getConfirmUserName(),
|
||||
bean.getCopyUserId(),
|
||||
bean.getCopyUserName(),
|
||||
SafetyCheckStatusEnum.COMPLETE.getTaskRecordPass( bean.getConfirmUserName()));
|
||||
SafetyCheckStatusEnum.COMPLETE.getTaskRecordPass(bean.getConfirmUserName()));
|
||||
safetyFlowTaskService.saveWorkFlowRecord(true,
|
||||
bean.getId(),
|
||||
"结束",
|
||||
|
||||
@ -211,7 +211,8 @@ public class SafetyCheckDaylyController {
|
||||
@ResponseBody
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
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("整改负责人不能为空!");
|
||||
}
|
||||
|
||||
|
||||
@ -66,7 +66,7 @@ public class SafetyEducationTraineeController {
|
||||
**/
|
||||
@RequestMapping("/add.do")
|
||||
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);
|
||||
return "safety/EducationTraineeAdd";
|
||||
}
|
||||
@ -82,9 +82,10 @@ public class SafetyEducationTraineeController {
|
||||
SafetyEducationTrainee educationTrainee = safetyEducationTraineeService.selectById(id);
|
||||
SafetyFiles file = safetyFilesService.selectById(educationTrainee.getFileId());
|
||||
model.addAttribute("bean", educationTrainee);
|
||||
model.addAttribute("fileName", file==null?"":file.getOriginalFileName());
|
||||
model.addAttribute("fileName", file == null ? "" : file.getOriginalFileName());
|
||||
return "safety/EducationTraineeEdit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳转至编辑弹窗
|
||||
*
|
||||
@ -96,9 +97,10 @@ public class SafetyEducationTraineeController {
|
||||
SafetyEducationTrainee educationTrainee = safetyEducationTraineeService.selectById(id);
|
||||
SafetyFiles file = safetyFilesService.selectById(educationTrainee.getFileId());
|
||||
model.addAttribute("bean", educationTrainee);
|
||||
model.addAttribute("fileName",file==null?"":file.getOriginalFileName());
|
||||
model.addAttribute("fileName", file == null ? "" : file.getOriginalFileName());
|
||||
return "safety/EducationTraineeView";
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分页列表信息
|
||||
*
|
||||
@ -169,24 +171,24 @@ public class SafetyEducationTraineeController {
|
||||
@RequestMapping("/update.do")
|
||||
@ResponseBody
|
||||
@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)) {
|
||||
return Result.failed("培训有效期早于培训日期!");
|
||||
}
|
||||
SafetyEducationTrainee oldBean = safetyEducationTraineeService.selectById(bean.getId());
|
||||
//如果文件id是空的,代表用户重新上传的文件,先删除原来的文件,然后再上传新文件。
|
||||
if (StringUtils.isEmpty(bean.getFileId())&&file.getSize()>0) {
|
||||
List<SafetyFiles> fileBeanList = safetyFilesService.upload(request,file, SafetyFunctionEnum.EDUCATION_TRAINEE.getId(), null, bean.getId());
|
||||
if (StringUtils.isEmpty(bean.getFileId()) && file.getSize() > 0) {
|
||||
List<SafetyFiles> fileBeanList = safetyFilesService.upload(request, file, SafetyFunctionEnum.EDUCATION_TRAINEE.getId(), null, bean.getId());
|
||||
bean.setFileId(fileBeanList.get(0).getId());
|
||||
safetyEducationTraineeService.update(bean);
|
||||
// 删除原来的附件记录
|
||||
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);
|
||||
safetyEducationTraineeService.update(bean);
|
||||
safetyFilesService.deleteById(oldBean.getFileId());
|
||||
}else {
|
||||
// safetyFilesService.deleteById(oldBean.getFileId());
|
||||
} else {
|
||||
safetyEducationTraineeService.update(bean);
|
||||
}
|
||||
return Result.success();
|
||||
@ -210,6 +212,7 @@ public class SafetyEducationTraineeController {
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除附件
|
||||
*
|
||||
@ -223,8 +226,8 @@ public class SafetyEducationTraineeController {
|
||||
SafetyEducationTrainee bean = safetyEducationTraineeService.selectById(id);
|
||||
safetyFilesService.deleteById(bean.getFileId());
|
||||
bean.setFileId("");
|
||||
int row = safetyEducationTraineeService.update(bean);
|
||||
if (row!=0) {
|
||||
int row = safetyEducationTraineeService.update(bean);
|
||||
if (row != 0) {
|
||||
return Result.success();
|
||||
}
|
||||
return Result.failed("删除失败!");
|
||||
|
||||
@ -170,6 +170,16 @@ public class StaffArchivesController {
|
||||
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);
|
||||
model.addAttribute("result", CommUtil.toJson(Result.success()));
|
||||
return "result";
|
||||
@ -195,6 +205,16 @@ public class StaffArchivesController {
|
||||
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);
|
||||
model.addAttribute("result", CommUtil.toJson(Result.success()));
|
||||
return "result";
|
||||
|
||||
@ -1607,7 +1607,7 @@ public class MPointController {
|
||||
mPointExpandService.update(mPoint.getBizid(), mPointExpand);
|
||||
} else {
|
||||
MPointExpand mPointExpand2 = new MPointExpand();
|
||||
mPointExpand2.setId(CommUtil.getUUID());
|
||||
// mPointExpand2.setId(CommUtil.getUUID());
|
||||
mPointExpand2.setInsdt(CommUtil.nowDate());
|
||||
mPointExpand2.setExplain(explain);
|
||||
mPointExpand2.setMeasurePointId(mPoint.getId());
|
||||
|
||||
@ -22,6 +22,10 @@ public class SafetyStaffArchivesVo extends SafetyStaffArchives {
|
||||
* 性别翻译
|
||||
*/
|
||||
private String sexText;
|
||||
/**
|
||||
* 所属部门ID
|
||||
*/
|
||||
private String pid;
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
|
||||
@ -28,6 +28,7 @@
|
||||
<result column="caption" property="caption" jdbcType="VARCHAR"/>
|
||||
<result column="sex" property="sex" jdbcType="VARCHAR"/>
|
||||
<result column="sexText" property="sexText" jdbcType="VARCHAR"/>
|
||||
<result column="pid" property="pid" jdbcType="VARCHAR"/>
|
||||
<result column="deptName" property="deptName" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
@ -164,6 +165,7 @@
|
||||
u.caption,
|
||||
u.sex,
|
||||
(case when u.sex='0' then '女' else '男' end) as sexText,
|
||||
u.pid,
|
||||
uu.name as deptName
|
||||
from tb_safety_staff_archives ssa
|
||||
INNER JOIN tb_user u ON ssa.userid = u.id
|
||||
@ -178,6 +180,7 @@
|
||||
u.caption,
|
||||
u.sex,
|
||||
(case when u.sex='0' then '女' else '男' end) as sexText,
|
||||
u.pid,
|
||||
uu.name as deptName
|
||||
from tb_safety_staff_archives ssa
|
||||
INNER JOIN tb_user u ON ssa.userid = u.id
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?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="com.sipai.mapper.scada.MPointDataMapper">
|
||||
<mapper namespace="scada.MPointDataMapper">
|
||||
<resultMap id="BaseResultMap" type="com.sipai.entity.scada.MPointData" >
|
||||
<id column="ItemID" property="itemId" jdbcType="BIGINT" />
|
||||
<result column="ParmValue" property="parmValue" jdbcType="DECIMAL" />
|
||||
|
||||
@ -22,17 +22,14 @@
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</delete>
|
||||
<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)
|
||||
values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR},
|
||||
values (#{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR},
|
||||
#{measurePointId,jdbcType=VARCHAR}, #{explain,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.sipai.entity.scada.MPointExpand" >
|
||||
insert into TB_MeasurePoint_Expand
|
||||
<trim prefix="(" suffix=")" suffixOverrides="," >
|
||||
<if test="id != null" >
|
||||
id,
|
||||
</if>
|
||||
<if test="insdt != null" >
|
||||
insdt,
|
||||
</if>
|
||||
@ -47,9 +44,6 @@
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
||||
<if test="id != null" >
|
||||
#{id,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="insdt != null" >
|
||||
#{insdt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?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="com.sipai.mapper.scada.WaterVolumeLJLLMapper">
|
||||
<mapper namespace="scada.WaterVolumeLJLLMapper">
|
||||
<resultMap id="BaseResultMap" type="com.sipai.entity.scada.WaterVolumeLJLL" >
|
||||
<id column="ItemID" property="itemId" jdbcType="BIGINT" />
|
||||
<result column="ParmValue" property="parmValue" jdbcType="DECIMAL" />
|
||||
|
||||
@ -8424,7 +8424,13 @@ public class EquipmentCardService implements CommService<EquipmentCard> {
|
||||
}
|
||||
}
|
||||
if (childlist.size() > 0) {
|
||||
mp.put("nodes", childlist);
|
||||
// 保留已有的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);
|
||||
}
|
||||
getTreeList4ProcessSection(childlist, list);
|
||||
}
|
||||
}
|
||||
@ -8491,7 +8497,13 @@ public class EquipmentCardService implements CommService<EquipmentCard> {
|
||||
}
|
||||
}
|
||||
if (childlist.size() > 0) {
|
||||
mp.put("nodes", childlist);
|
||||
// 保留已有的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);
|
||||
}
|
||||
getTreeList4EquipmentClass(childlist, list);
|
||||
}
|
||||
}
|
||||
|
||||
@ -46,6 +46,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.xmlpull.v1.XmlPullParserException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
@ -70,6 +72,7 @@ import static org.apache.poi.ss.usermodel.CellType.FORMULA;
|
||||
@Service("rptCreateService")
|
||||
//@Service
|
||||
public class RptCreateServiceImpl implements RptCreateService {
|
||||
private static final Logger logger = LoggerFactory.getLogger(RptCreateServiceImpl.class);
|
||||
@Resource
|
||||
private RptCreateDao rptCreateDao;
|
||||
@Resource
|
||||
@ -393,7 +396,7 @@ public class RptCreateServiceImpl implements RptCreateService {
|
||||
}
|
||||
}
|
||||
Row row2 = sheet.getRow(row);
|
||||
HSSFCell cell = (HSSFCell) row2.getCell(column);
|
||||
Cell cell = row2.getCell(column);
|
||||
return list;
|
||||
}
|
||||
|
||||
@ -846,46 +849,48 @@ public class RptCreateServiceImpl implements RptCreateService {
|
||||
// 设定Excel文件所在路径
|
||||
String excelFileName = filelist.get(0).getAbspath();
|
||||
// 读取Excel文件内容
|
||||
HSSFWorkbook workbook = null;
|
||||
Workbook workbook = null;
|
||||
FileInputStream inputStream = null;
|
||||
byte[] bytes_m = commonFileService.getInputStreamBytes(FileNameSpaceEnum.RptInfoSetFile.getNameSpace(), path);
|
||||
// Check if bytes_m is null or empty
|
||||
if (bytes_m == null || bytes_m.length == 0) {
|
||||
logger.error("Excel file is empty or not found: " + path);
|
||||
return null;
|
||||
}
|
||||
// 直接从本地文件创建Workbook, 从输入流创建Workbook
|
||||
InputStream ins = new ByteArrayInputStream(bytes_m);
|
||||
// 构建Workbook对象, 只读Workbook对象
|
||||
// 构建Workbook对象, 只读Workbook对象 - use WorkbookFactory to support both .xls and .xlsx
|
||||
try {
|
||||
workbook = new HSSFWorkbook(ins);
|
||||
workbook = WorkbookFactory.create(ins);
|
||||
} catch (IOException e) {
|
||||
logger.error("Failed to create workbook from file: " + path, e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
String endtype = ".xls";
|
||||
String endtype = path.toLowerCase().endsWith(".xlsx") ? ".xlsx" : ".xls";
|
||||
// 生成一个样式,用在表格数据
|
||||
HSSFCellStyle listStyle = null;
|
||||
if (endtype.equals(".xls")) {
|
||||
listStyle = workbook.createCellStyle();
|
||||
// 设置这些样式
|
||||
listStyle.setBorderBottom(BorderStyle.THIN);
|
||||
listStyle.setBorderLeft(BorderStyle.THIN);
|
||||
listStyle.setBorderRight(BorderStyle.THIN);
|
||||
listStyle.setBorderTop(BorderStyle.THIN);
|
||||
listStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中
|
||||
listStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中
|
||||
//listStyle.setWrapText(false);//不自动换行
|
||||
//listStyle.setDataFormat(HSSFDataFormat.getBuiltinFormat("0.00"));//设置格式
|
||||
}
|
||||
CellStyle listStyle = null;
|
||||
listStyle = workbook.createCellStyle();
|
||||
// 设置这些样式
|
||||
listStyle.setBorderBottom(BorderStyle.THIN);
|
||||
listStyle.setBorderLeft(BorderStyle.THIN);
|
||||
listStyle.setBorderRight(BorderStyle.THIN);
|
||||
listStyle.setBorderTop(BorderStyle.THIN);
|
||||
listStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中
|
||||
listStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中
|
||||
//listStyle.setWrapText(false);//不自动换行
|
||||
//listStyle.setDataFormat(HSSFDataFormat.getBuiltinFormat("0.00"));//设置格式
|
||||
// 生成一个样式,用在表格数据 修改过的数据
|
||||
HSSFCellStyle listStyle2 = null;
|
||||
if (endtype.equals(".xls")) {
|
||||
listStyle2 = workbook.createCellStyle();
|
||||
// 设置这些样式
|
||||
listStyle2.setBorderBottom(BorderStyle.THIN);
|
||||
listStyle2.setBorderLeft(BorderStyle.THIN);
|
||||
listStyle2.setBorderRight(BorderStyle.THIN);
|
||||
listStyle2.setBorderTop(BorderStyle.THIN);
|
||||
listStyle2.setAlignment(HorizontalAlignment.CENTER);//水平居中
|
||||
listStyle2.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中
|
||||
listStyle2.setFillPattern(FillPatternType.SOLID_FOREGROUND);
|
||||
listStyle2.setFillForegroundColor(IndexedColors.GREEN.getIndex());
|
||||
}
|
||||
CellStyle listStyle2 = null;
|
||||
listStyle2 = workbook.createCellStyle();
|
||||
// 设置这些样式
|
||||
listStyle2.setBorderBottom(BorderStyle.THIN);
|
||||
listStyle2.setBorderLeft(BorderStyle.THIN);
|
||||
listStyle2.setBorderRight(BorderStyle.THIN);
|
||||
listStyle2.setBorderTop(BorderStyle.THIN);
|
||||
listStyle2.setAlignment(HorizontalAlignment.CENTER);//水平居中
|
||||
listStyle2.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中
|
||||
listStyle2.setFillPattern(FillPatternType.SOLID_FOREGROUND);
|
||||
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");
|
||||
if (rptSpSetlist != null && rptSpSetlist.size() > 0) {
|
||||
for (int s = 0; s < rptSpSetlist.size(); s++) {
|
||||
@ -993,10 +998,10 @@ public class RptCreateServiceImpl implements RptCreateService {
|
||||
if (spname != null && spname.equals(RptSpSet.RptSpSet_Type_Confirm)) { //接班人 类型
|
||||
for (int ws = 0; ws < workbook.getNumberOfSheets(); ws++) {//获取每个Sheet表
|
||||
if (workbook.getSheetName(ws).equals(rptSpSetlist.get(s).getSheet())) {
|
||||
HSSFSheet sheet = workbook.getSheetAt(ws);
|
||||
HSSFRow row = sheet.getRow(posy - 1);
|
||||
Sheet sheet = workbook.getSheetAt(ws);
|
||||
Row row = sheet.getRow(posy - 1);
|
||||
if (row != null) {
|
||||
HSSFCell cell_d = row.getCell(posx - 1);
|
||||
Cell cell_d = row.getCell(posx - 1);
|
||||
if (cell_d != null) {
|
||||
//插入日志表
|
||||
RptLog rptLog = new RptLog();
|
||||
@ -1029,10 +1034,10 @@ public class RptCreateServiceImpl implements RptCreateService {
|
||||
} else if (spname != null && spname.equals(RptSpSet.RptSpSet_Type_Rptdt)) {//日期 类型
|
||||
for (int ws = 0; ws < workbook.getNumberOfSheets(); ws++) {//获取每个Sheet表
|
||||
if (workbook.getSheetName(ws).equals(rptSpSetlist.get(s).getSheet())) {
|
||||
HSSFSheet sheet = workbook.getSheetAt(ws);
|
||||
HSSFRow row = sheet.getRow(posy - 1);
|
||||
Sheet sheet = workbook.getSheetAt(ws);
|
||||
Row row = sheet.getRow(posy - 1);
|
||||
if (row != null) {
|
||||
HSSFCell cell_d = row.getCell(posx - 1);
|
||||
Cell cell_d = row.getCell(posx - 1);
|
||||
if (cell_d != null) {
|
||||
try {
|
||||
cell_d.setCellStyle(cell_d.getCellStyle());
|
||||
@ -1058,10 +1063,10 @@ public class RptCreateServiceImpl implements RptCreateService {
|
||||
} else if (spname != null && spname.equals(RptSpSet.RptSpSet_Type_BanZhang)) {//值班班长 类型
|
||||
for (int ws = 0; ws < workbook.getNumberOfSheets(); ws++) {//获取每个Sheet表
|
||||
if (workbook.getSheetName(ws).equals(rptSpSetlist.get(s).getSheet())) {
|
||||
HSSFSheet sheet = workbook.getSheetAt(ws);
|
||||
HSSFRow row = sheet.getRow(posy - 1);
|
||||
Sheet sheet = workbook.getSheetAt(ws);
|
||||
Row row = sheet.getRow(posy - 1);
|
||||
if (row != null) {
|
||||
HSSFCell cell_d = row.getCell(posx - 1);
|
||||
Cell cell_d = row.getCell(posx - 1);
|
||||
if (cell_d != null) {
|
||||
//插入日志表
|
||||
RptLog rptLog = new RptLog();
|
||||
@ -1094,10 +1099,10 @@ public class RptCreateServiceImpl implements RptCreateService {
|
||||
} else if (spname != null && spname.equals(RptSpSet.RptSpSet_Type_ZuYuan)) { //值班组员 类型
|
||||
for (int ws = 0; ws < workbook.getNumberOfSheets(); ws++) {//获取每个Sheet表
|
||||
if (workbook.getSheetName(ws).equals(rptSpSetlist.get(s).getSheet())) {
|
||||
HSSFSheet sheet = workbook.getSheetAt(ws);
|
||||
HSSFRow row = sheet.getRow(posy - 1);
|
||||
Sheet sheet = workbook.getSheetAt(ws);
|
||||
Row row = sheet.getRow(posy - 1);
|
||||
if (row != null) {
|
||||
HSSFCell cell_d = row.getCell(posx - 1);
|
||||
Cell cell_d = row.getCell(posx - 1);
|
||||
if (cell_d != null) {
|
||||
//插入日志表
|
||||
RptLog rptLog = new RptLog();
|
||||
@ -1134,12 +1139,12 @@ public class RptCreateServiceImpl implements RptCreateService {
|
||||
for (int r = 0; r < rpttemplist.size(); r++) {
|
||||
for (int ws = 0; ws < workbook.getNumberOfSheets(); ws++) {//获取每个Sheet表
|
||||
if (workbook.getSheetName(ws).equals(rptSpSetlist.get(s).getSheet())) {
|
||||
HSSFSheet sheet = workbook.getSheetAt(ws);
|
||||
HSSFRow row = sheet.getRow(rpttemplist.get(r).getColposy() - 1);
|
||||
Sheet sheet = workbook.getSheetAt(ws);
|
||||
Row row = sheet.getRow(rpttemplist.get(r).getColposy() - 1);
|
||||
if (row != null) {
|
||||
Cell cell_d = row.getCell(rpttemplist.get(r).getColposx() - 1);
|
||||
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();
|
||||
try {
|
||||
/**
|
||||
@ -1286,9 +1291,9 @@ public class RptCreateServiceImpl implements RptCreateService {
|
||||
*/
|
||||
List<RptLog> list = rptLogService.selectListByWhere("where creat_id = '" + rptCreate.getId() + "'");
|
||||
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) {
|
||||
HSSFRow row = sheet.getRow(Integer.parseInt(rptLog.getPosyE()) - 1);
|
||||
Row row = sheet.getRow(Integer.parseInt(rptLog.getPosyE()) - 1);
|
||||
if (row != null) {
|
||||
Cell cell_d = row.getCell(Integer.parseInt(rptLog.getPosxE()) - 1);
|
||||
if (cell_d != null) {
|
||||
|
||||
@ -84,13 +84,17 @@ public class SafetyCheckActivityService {
|
||||
* @Date: 2022/10/10
|
||||
**/
|
||||
public Result audit(String nextUserId, String processInstanceId, int pass) {
|
||||
Task task =
|
||||
workflowService.getTaskService().createTaskQuery().processInstanceId(processInstanceId).singleResult();
|
||||
List<Task> tasks = workflowService.getTaskService().createTaskQuery().processInstanceId(processInstanceId).active().list();
|
||||
if (tasks == null || tasks.isEmpty()) {
|
||||
return Result.failed("No active task found for process instance: " + processInstanceId);
|
||||
}
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put(CommString.ACTI_KEK_Condition, pass);
|
||||
map.put(CommString.ACTI_KEK_Assignee, nextUserId);
|
||||
map.put(CommString.ACTI_KEK_Candidate_Users, nextUserId);
|
||||
workflowService.getTaskService().complete(task.getId(), map);
|
||||
for (Task task : tasks) {
|
||||
workflowService.getTaskService().complete(task.getId(), map);
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
@ -1661,7 +1661,7 @@ public class MPointService {
|
||||
for (int i = minCellNum; i < maxCellNum; i++) {
|
||||
HSSFCell mpidCell = mpidRow.getCell(i);
|
||||
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) {
|
||||
String mpid = mPoint.getMpointcode();
|
||||
MPointHistory mPointHistory = new MPointHistory();
|
||||
|
||||
@ -75,12 +75,6 @@
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<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">
|
||||
<label class="col-sm-3 control-label">*业务单元名称</label>
|
||||
<div class="col-sm-9">
|
||||
|
||||
@ -53,12 +53,6 @@
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<div id="alertDiv"></div>
|
||||
<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">
|
||||
<label class="col-sm-3 control-label">*业务单元名称</label>
|
||||
<div class="col-sm-9">
|
||||
|
||||
@ -110,6 +110,11 @@
|
||||
url: ext.contextPath +"/activiti/workflow/getProcessTypes4Combo.do",
|
||||
dataType: 'json',
|
||||
delay: 250,
|
||||
data: function (params) {
|
||||
return {
|
||||
term: params.term
|
||||
};
|
||||
},
|
||||
processResults: function (data) {
|
||||
return {
|
||||
results: data
|
||||
@ -123,8 +128,8 @@
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,
|
||||
formatResult: function formatRepo(repo){return repo.text;},
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;}
|
||||
templateResult: function formatRepo(repo){return repo.text;},
|
||||
templateSelection: function formatRepoSelection(repo){return repo.text;}
|
||||
});
|
||||
fixSelect2ToTool("search_processType");
|
||||
$("#table").bootstrapTable({
|
||||
@ -151,11 +156,6 @@
|
||||
columns: [
|
||||
{
|
||||
checkbox: true,
|
||||
}, {
|
||||
field: 'id',
|
||||
title: '业务单元ID',
|
||||
align: 'center',
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'name',
|
||||
title: '业务单元名称',
|
||||
|
||||
@ -62,7 +62,8 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD
|
||||
selelct_4.val('').trigger("change");
|
||||
|
||||
|
||||
//TODO 代码有冲突
|
||||
// Initialize job dropdown with all jobs
|
||||
onValueChange();
|
||||
key = setInterval(() => {
|
||||
// console.log(document.getElementById('objUserName'))
|
||||
if ($('#objUserId').val() != old) {
|
||||
@ -140,7 +141,14 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD
|
||||
jobId: {
|
||||
validators: {
|
||||
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() {
|
||||
// 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({
|
||||
data: data,
|
||||
data: transformedData,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
// 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>
|
||||
</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">
|
||||
<label class="col-sm-3 control-label">* 周期类型:</label>
|
||||
<div class="col-sm-9">
|
||||
|
||||
@ -17,17 +17,11 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD
|
||||
display: flex;
|
||||
padding-left: 50px;
|
||||
}
|
||||
|
||||
/*.layout{*/
|
||||
/ display: flex;*/
|
||||
/ padding-left: 15px;*/
|
||||
/*}*/
|
||||
.form-horizontal {
|
||||
padding-top: 20px;
|
||||
padding-left: 60px;
|
||||
|
||||
}
|
||||
|
||||
.right {
|
||||
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) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||||
|
||||
select_3.val('${bean.educationType}').trigger("change");
|
||||
|
||||
@ -147,6 +147,7 @@
|
||||
hiddenId: "userid",
|
||||
textId: "username",
|
||||
deptNameDom: "deptName",
|
||||
deptIdDom: "pid",
|
||||
sexDom: "sex",
|
||||
userCardIdDom: "userCardId",
|
||||
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>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog" style="width: 53%">
|
||||
@ -239,8 +252,9 @@
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*所属部门:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="deptName" name="deptName" placeholder="所属部门"
|
||||
value="" disabled>
|
||||
<input type="text" class="form-control" id="deptName" name="deptName" placeholder="点击选择所属部门"
|
||||
value="" onclick="showDept4SelectFun();" readonly>
|
||||
<input type="hidden" id="pid" name="pid" value="">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -274,3 +288,4 @@
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
<div id="deptSelectDiv"></div>
|
||||
|
||||
@ -152,6 +152,7 @@
|
||||
hiddenId: "userid",
|
||||
textId: "username",
|
||||
deptNameDom: "deptName",
|
||||
deptIdDom: "pid",
|
||||
sexDom: "sex",
|
||||
userCardIdDom: "userCardId",
|
||||
userId: userId
|
||||
@ -161,6 +162,18 @@
|
||||
});
|
||||
}
|
||||
|
||||
//选择所属部门
|
||||
function showDept4SelectFun() {
|
||||
$.post(ext.contextPath + '/user/showUnit4Select_Limited.do', {
|
||||
formId: "subForm",
|
||||
hiddenId: "pid",
|
||||
textId: "deptName"
|
||||
}, function (data) {
|
||||
$("#deptSelectDiv").html(data);
|
||||
openModal('unit4SelectModal_Limited');
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog modal-lg">
|
||||
@ -245,8 +258,9 @@
|
||||
|
||||
<label class="col-sm-2 control-label">*所属部门:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="deptName" name="deptName" placeholder="所属部门"
|
||||
value="${safetyStaffArchives.deptName}" disabled>
|
||||
<input type="text" class="form-control" id="deptName" name="deptName" placeholder="点击选择所属部门"
|
||||
value="${safetyStaffArchives.deptName}" onclick="showDept4SelectFun();" readonly>
|
||||
<input type="hidden" id="pid" name="pid" value="${safetyStaffArchives.pid}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -282,3 +296,4 @@
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
<div id="deptSelectDiv"></div>
|
||||
|
||||
@ -26,6 +26,9 @@
|
||||
if(`${param.deptNameDom}` != ""){
|
||||
$('#${param.formId} #${param.deptNameDom}').val(resp[0]._pname);
|
||||
}
|
||||
if(`${param.deptIdDom}` != ""){
|
||||
$('#${param.formId} #${param.deptIdDom}').val(resp[0].pid);
|
||||
}
|
||||
if(`${param.sexDom}` != ""){
|
||||
$('#${param.formId} #${param.sexDom}').val(resp[0].sex);
|
||||
}
|
||||
|
||||
@ -0,0 +1,180 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
|
||||
<style type="text/css">
|
||||
#map_canvas {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#result {
|
||||
width: 100%
|
||||
}
|
||||
|
||||
#btns {
|
||||
z-index: 999;
|
||||
position: fixed;
|
||||
bottom: 3.5rem;
|
||||
margin-left: 2.5rem;
|
||||
padding-left: 0;
|
||||
border-radius: .25rem;
|
||||
display: flex;
|
||||
box-shadow: 0 2px 6px 0 rgba(27, 142, 236, 0.5);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#btns li {
|
||||
border-right: 1px solid #d2d2d2;
|
||||
padding: 10px 10px;
|
||||
height: 100%;
|
||||
background-color: #fff;
|
||||
cursor: pointer;
|
||||
color: #3a79b5;
|
||||
}
|
||||
|
||||
/*.modal-body {
|
||||
position: relative;
|
||||
padding: 15px;
|
||||
}*/
|
||||
</style>
|
||||
|
||||
<script>
|
||||
window.BMAP_AUTHENTIC_KEY = '7Cc5Kmn672miPzG4qQhvlOrERcXMMinq';
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var lushuArray = [];//多人巡检轨迹数
|
||||
|
||||
// var map = new BMapGL.Map('map_canvas');
|
||||
var map = new BMapGL.Map('map_canvas', {
|
||||
minZoom: 19,
|
||||
maxZoom: 19
|
||||
});
|
||||
map.enableScrollWheelZoom();
|
||||
// 113.044283, 23.028002 沙口
|
||||
// 112.911564,23.370377 北江
|
||||
// 121.374879,30.73846 金山一厂
|
||||
// 121.363482,30.807332 金山二厂
|
||||
var x1 = '121.363482';
|
||||
var y1 = '30.807332';
|
||||
map.centerAndZoom(new BMapGL.Point(x1, y1), 19);
|
||||
map.enableScrollWheelZoom(true);//禁止鼠标滚动
|
||||
map.setMapType(BMAP_EARTH_MAP);// 设置地图类型为地球模式
|
||||
// var lushu;
|
||||
//实例化一个轨迹用来生成路线
|
||||
var drv = new BMapGL.DrivingRoute('佛山', {
|
||||
onSearchComplete: function (res) {
|
||||
// if (drv.getStatus() == BMAP_STATUS_SUCCESS) {
|
||||
|
||||
var userName = '';//人员名称
|
||||
var userIcon = '';//人员头像
|
||||
|
||||
$.post(ext.contextPath + "/timeEfficiency/patrolRecord/getGPS.do", {patrolRecordId: '${patrolRecord.id}'}, function (data) {
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
var gpsStr = [];//gps数组
|
||||
|
||||
var str = data[i].data;
|
||||
for (let j = 0; j < str.length; j++) {
|
||||
gpsStr.push(str[j])
|
||||
}
|
||||
|
||||
userName = data[i].userName;
|
||||
|
||||
if (data[i].icon != null && data[i].icon != '') {
|
||||
userIcon = data[i].icon;
|
||||
} else {
|
||||
userIcon = ext.contextPath + '/IMG/sy/headportrait.png';
|
||||
}
|
||||
|
||||
creatGPSLine(gpsStr, userName, userIcon);
|
||||
}
|
||||
|
||||
}, 'json');
|
||||
|
||||
// }
|
||||
}
|
||||
});
|
||||
|
||||
//调用不同人员的巡检路线
|
||||
function creatGPSLine(gpsStr, userName, userIcon) {
|
||||
if (gpsStr != null && gpsStr != '') {
|
||||
map.addOverlay(new BMapGL.Marker(gpsStr[0]));
|
||||
map.addOverlay(new BMapGL.Marker(gpsStr[gpsStr.length - 1]));
|
||||
map.addOverlay(new BMapGL.Polyline(gpsStr, {strokeColor: 'blue'}));
|
||||
map.setViewport(gpsStr);
|
||||
var lushu = new BMapGLLib.LuShu(map, gpsStr, {
|
||||
defaultContent: userName, // "信息窗口文案"
|
||||
autoView: true, // 是否开启自动视野调整,如果开启那么路书在运动过程中会根据视野自动调整
|
||||
speed: 50,
|
||||
icon: new BMapGL.Icon(userIcon, new BMapGL.Size(40, 40), {anchor: new BMapGL.Size(20, 40)}),
|
||||
enableRotation: false, // 是否设置marker随着道路的走向进行旋转
|
||||
});
|
||||
lushuArray.push(lushu);
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
var start = new BMapGL.Point(116.404844, 40);
|
||||
var end = new BMapGL.Point(116.308102, 40.056057);
|
||||
drv.search(start, end);
|
||||
|
||||
//开始
|
||||
function run() {
|
||||
// lushu.start();
|
||||
for (var i = 0; i < lushuArray.length; i++) {
|
||||
// console.log(lushuArray[i]);
|
||||
lushuArray[i].start();//多人轨迹演示
|
||||
}
|
||||
}
|
||||
|
||||
//停止
|
||||
function stop() {
|
||||
// lushu.stop();
|
||||
for (var i = 0; i < lushuArray.length; i++) {
|
||||
// console.log(lushuArray[i]);
|
||||
lushuArray[i].stop();//多人轨迹演示
|
||||
}
|
||||
}
|
||||
|
||||
//暂停
|
||||
function pause() {
|
||||
// lushu.pause();
|
||||
for (var i = 0; i < lushuArray.length; i++) {
|
||||
// console.log(lushuArray[i]);
|
||||
lushuArray[i].pause();//多人轨迹演示
|
||||
}
|
||||
}
|
||||
|
||||
/*$("hide").onclick = function () {
|
||||
//隐藏信息窗口
|
||||
lushu.hideInfoWindow();
|
||||
}
|
||||
$("show").onclick = function () {
|
||||
//展示信息窗口
|
||||
lushu.showInfoWindow();
|
||||
}*/
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal_recordMap">
|
||||
<div class="modal-dialog modal-xlg" style="width: 1800px;height: 700px;">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">巡检轨迹</h4>
|
||||
</div>
|
||||
<div class="modal-body" style="width: 1800px;height: 700px;padding: 0px;">
|
||||
<div id="map_canvas"></div>
|
||||
<div id="result"></div>
|
||||
<ul id='btns'>
|
||||
<li id="run" onclick="run();">开始</li>
|
||||
<li id="stop" onclick="stop();">停止</li>
|
||||
<li id="pause" onclick="pause();">暂停</li>
|
||||
<%--<li id="hide" onclick="hide();">隐藏信息窗口</li>
|
||||
<li id="show" onclick="show();">展示信息窗口</li>--%>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user