Compare commits

...

18 Commits

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -8424,7 +8424,13 @@ public class EquipmentCardService implements CommService<EquipmentCard> {
} }
} }
if (childlist.size() > 0) { if (childlist.size() > 0) {
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); getTreeList4ProcessSection(childlist, list);
} }
} }
@ -8491,7 +8497,13 @@ public class EquipmentCardService implements CommService<EquipmentCard> {
} }
} }
if (childlist.size() > 0) { 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); getTreeList4EquipmentClass(childlist, list);
} }
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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