包头bug修改
This commit is contained in:
parent
89a60c4576
commit
63bc825eb5
@ -190,7 +190,7 @@ public class NondestructiveTestOrderTicketController {
|
||||
if (CollUtil.isNotEmpty(cl)) {
|
||||
for (Object o : cl) {
|
||||
Map m = (Map) o;
|
||||
Long id = FlowUtil.getPullDownLong(m, "field5496713710010");
|
||||
Long id = FlowUtil.getPullDownLong(m, "field8549574409494");
|
||||
Integer qualified = FlowUtil.getPullDownInteger(m, "field8817951200764");
|
||||
PipelineWeldingRecord weldingRecord = new PipelineWeldingRecord();
|
||||
weldingRecord.setId(id);
|
||||
@ -326,7 +326,7 @@ public class NondestructiveTestOrderTicketController {
|
||||
JSONObject jo = detailJa.getJSONObject(i);
|
||||
Map<String, Object> m = new HashMap<>();
|
||||
m.put("d0", i + 1);
|
||||
m.put("d1", FlowUtil.getPullDownString(jo, "field5496713710010"));
|
||||
m.put("d1", FlowUtil.getPullDownString(jo, "field8549574409494"));
|
||||
m.put("d2", jo.getString("field4898340503658"));
|
||||
m.put("d3", jo.getString("field8195640514474"));
|
||||
m.put("d4", jo.getString("field8807940520346"));
|
||||
|
||||
@ -0,0 +1,148 @@
|
||||
package com.zhgd.xmgl.modules.baotou.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.zhgd.annotation.OperLog;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import java.util.HashMap;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||
import com.zhgd.jeecg.common.util.oConvertUtils;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import com.zhgd.xmgl.modules.baotou.entity.PiecemealImplementation;
|
||||
import com.zhgd.xmgl.modules.baotou.service.IPiecemealImplementationService;
|
||||
|
||||
import org.simpleframework.xml.core.Validate;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* @Title: Controller
|
||||
* @Description: 零星工程实施
|
||||
* @author: pds
|
||||
* @date: 2025-01-10
|
||||
* @version: V1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/xmgl/piecemealImplementation")
|
||||
@Slf4j
|
||||
@Api(tags = "零星工程实施相关Api")
|
||||
public class PiecemealImplementationController {
|
||||
@Autowired
|
||||
private IPiecemealImplementationService piecemealImplementationService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "零星工程实施管理", operType = "分页查询", operDesc = "分页列表查询零星工程实施信息")
|
||||
@ApiOperation(value = "分页列表查询零星工程实施信息", notes = "分页列表查询零星工程实施信息", httpMethod="GET")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "query", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "query", required = true, dataType = "Integer"),
|
||||
})
|
||||
@GetMapping(value = "/page")
|
||||
public Result<IPage<PiecemealImplementation>> queryPageList(@ApiIgnore @RequestParam HashMap<String, Object> param) {
|
||||
return Result.success(piecemealImplementationService.queryPageList(param));
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "零星工程实施管理", operType = "列表查询", operDesc = "列表查询零星工程实施信息")
|
||||
@ApiOperation(value = "列表查询零星工程实施信息", notes = "列表查询零星工程实施信息", httpMethod="GET")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<PiecemealImplementation>> queryList(@ApiIgnore @RequestParam HashMap<String, Object> param) {
|
||||
return Result.success(piecemealImplementationService.queryList(param));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
* @param piecemealImplementation
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "零星工程实施管理", operType = "添加", operDesc = "添加零星工程实施信息")
|
||||
@ApiOperation(value = "添加零星工程实施信息", notes = "添加零星工程实施信息" , httpMethod="POST")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<PiecemealImplementation> add(@RequestBody @Validate PiecemealImplementation piecemealImplementation) {
|
||||
piecemealImplementationService.add(piecemealImplementation);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param piecemealImplementation
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "零星工程实施管理", operType = "编辑", operDesc = "编辑零星工程实施信息")
|
||||
@ApiOperation(value = "编辑零星工程实施信息", notes = "编辑零星工程实施信息" , httpMethod="POST")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<PiecemealImplementation> edit(@RequestBody PiecemealImplementation piecemealImplementation) {
|
||||
piecemealImplementationService.edit(piecemealImplementation);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "零星工程实施管理", operType = "删除", operDesc = "删除零星工程实施信息")
|
||||
@ApiOperation(value = "删除零星工程实施信息", notes = "删除零星工程实施信息" , httpMethod="POST")
|
||||
@ApiImplicitParam(name = "id", value = "零星工程实施ID", paramType = "body", required = true, dataType = "String", example = "{\"id\":\"1\"}")
|
||||
@PostMapping(value = "/delete")
|
||||
public Result<PiecemealImplementation> delete(@ApiIgnore @RequestBody HashMap<String ,Object> map) {
|
||||
piecemealImplementationService.delete(MapUtils.getString(map, "id"));
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "零星工程实施管理", operType = "通过id查询", operDesc = "通过id查询零星工程实施信息")
|
||||
@ApiOperation(value = "通过id查询零星工程实施信息", notes = "通过id查询零星工程实施信息" , httpMethod="GET")
|
||||
@ApiImplicitParam(name = "id", value = "零星工程实施ID", paramType = "query", required = true, dataType = "Integer")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<PiecemealImplementation> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
return Result.success(piecemealImplementationService.queryById(id));
|
||||
}
|
||||
|
||||
@OperLog(operModul = "零星工程实施管理", operType = "", operDesc = "统计预估金额总数和实际金额总数")
|
||||
@ApiOperation(value = "统计预估金额总数和实际金额总数", notes = "统计预估金额总数和实际金额总数", httpMethod="GET")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "query", required = true, dataType = "String"),
|
||||
})
|
||||
@GetMapping(value = "/countAmount")
|
||||
public Result<PiecemealImplementation> countAmount(@ApiIgnore @RequestParam HashMap<String, Object> param) {
|
||||
return Result.success(piecemealImplementationService.countAmount(param));
|
||||
}
|
||||
}
|
||||
@ -111,7 +111,7 @@ public class SceneExposeSpecialController {
|
||||
@ApiOperation(value = "添加文明施工亮点、曝光栏、专题活动信息", notes = "添加文明施工亮点、曝光栏、专题活动信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<SceneExposeSpecial> add(@RequestBody SceneExposeSpecial sceneExposeSpecial) {
|
||||
sceneExposeSpecialService.save(sceneExposeSpecial);
|
||||
sceneExposeSpecialService.add(sceneExposeSpecial);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,59 @@
|
||||
package com.zhgd.xmgl.modules.baotou.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
/**
|
||||
* @Description: 零星工程实施
|
||||
* @author: pds
|
||||
* @date: 2025-01-10
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("piecemeal_implementation")
|
||||
@ApiModel(value="PiecemealImplementation实体类",description="PiecemealImplementation")
|
||||
public class PiecemealImplementation implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value="id")
|
||||
private java.lang.Long id ;
|
||||
/**所属项目SN*/
|
||||
@ApiModelProperty(value="所属项目SN")
|
||||
private java.lang.String projectSn ;
|
||||
/**任务名称*/
|
||||
@ApiModelProperty(value="任务名称")
|
||||
private java.lang.String taskName ;
|
||||
/**任务单*/
|
||||
@ApiModelProperty(value="任务单")
|
||||
private java.lang.String taskOrder ;
|
||||
/**验收单*/
|
||||
@ApiModelProperty(value="验收单")
|
||||
private java.lang.String acceptanceForm ;
|
||||
/**预估金额*/
|
||||
@ApiModelProperty(value="预估金额")
|
||||
private java.math.BigDecimal estimatedAmount ;
|
||||
/**实际金额*/
|
||||
@ApiModelProperty(value="实际金额")
|
||||
private java.math.BigDecimal actualAmount ;
|
||||
/**上传时间*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value="上传时间")
|
||||
private java.util.Date uploadTime ;
|
||||
/**创建时间*/
|
||||
@ApiModelProperty(value="创建时间")
|
||||
private java.util.Date createTime ;
|
||||
/**更新时间*/
|
||||
@ApiModelProperty(value="更新时间")
|
||||
private java.util.Date updateTime ;
|
||||
}
|
||||
@ -5,9 +5,16 @@ import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class CountFlowVO {
|
||||
@ApiModelProperty("我的待办")
|
||||
private Integer total;
|
||||
@ApiModelProperty("质量待办")
|
||||
private Integer quality;
|
||||
@ApiModelProperty("安全待办")
|
||||
private Integer safe;
|
||||
@ApiModelProperty("抄送我的")
|
||||
private Integer csMe;
|
||||
@ApiModelProperty("待催办")
|
||||
private Integer needCall;
|
||||
@ApiModelProperty("已办结")
|
||||
private Integer done;
|
||||
}
|
||||
|
||||
@ -26,4 +26,6 @@ public interface DeviceUnitMapper extends BaseMapper<DeviceUnit> {
|
||||
List<DeviceUnit> queryList(@Param(Constants.WRAPPER) QueryWrapper<DeviceUnit> queryWrapper,@Param("param") HashMap<String, Object> param);
|
||||
|
||||
IPage<DeviceUnit> queryList(Page<DeviceUnit> page, @Param(Constants.WRAPPER) QueryWrapper<DeviceUnit> queryWrapper,@Param("param") HashMap<String, Object> param);
|
||||
|
||||
List<Long> getEpcUserIds(@Param("list") List<Long> eids);
|
||||
}
|
||||
|
||||
@ -0,0 +1,50 @@
|
||||
package com.zhgd.xmgl.modules.baotou.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.HashMap;
|
||||
import com.zhgd.xmgl.modules.baotou.entity.PiecemealImplementation;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 零星工程实施
|
||||
* @author: pds
|
||||
* @date: 2025-01-10
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface PiecemealImplementationMapper extends BaseMapper<PiecemealImplementation> {
|
||||
|
||||
/**
|
||||
* 分页列表查询零星工程实施信息
|
||||
*
|
||||
* @param page
|
||||
* @param queryWrapper
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
IPage<PiecemealImplementation> queryList(Page<PiecemealImplementation> page, @Param(Constants.WRAPPER) QueryWrapper<PiecemealImplementation> queryWrapper, @Param("param") HashMap<String, Object> param);
|
||||
|
||||
/**
|
||||
* 列表查询零星工程实施信息
|
||||
*
|
||||
* @param queryWrapper
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<PiecemealImplementation> queryList(@Param(Constants.WRAPPER) QueryWrapper<PiecemealImplementation> queryWrapper, @Param("param") HashMap<String, Object> param);
|
||||
|
||||
|
||||
/**
|
||||
* 通过id查询零星工程实施信息
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
PiecemealImplementation queryById(String id);
|
||||
}
|
||||
@ -45,4 +45,22 @@
|
||||
order by t.sort)t
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="getEpcUserIds" resultType="java.lang.Long">
|
||||
select
|
||||
distinct su.user_id
|
||||
from
|
||||
project_group_unit pgu
|
||||
join worker_info wi on wi.enterprise_id = pgu.epc_contractor_id
|
||||
join system_user su on su.worker_id=wi.id
|
||||
join base_role_user bru on bru.user_id=su.user_id
|
||||
join base_role br on br.role_id=bru.role_id
|
||||
where 1=1
|
||||
and (br.role_name = 'EPC安全经理' or br.role_name = 'EPC项目经理')
|
||||
and
|
||||
<foreach item="item" index="index" collection="list"
|
||||
open="(" separator=" or " close=")">
|
||||
find_in_set(#{item},pgu.construction_unit_ids)
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -0,0 +1,19 @@
|
||||
<?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.zhgd.xmgl.modules.baotou.mapper.PiecemealImplementationMapper">
|
||||
|
||||
<select id="queryList" resultType="com.zhgd.xmgl.modules.baotou.entity.PiecemealImplementation">
|
||||
select * from (
|
||||
select t.*
|
||||
from piecemeal_implementation t
|
||||
)t
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
<select id="queryById" resultType="com.zhgd.xmgl.modules.baotou.entity.PiecemealImplementation">
|
||||
select * from (
|
||||
select t.*
|
||||
from piecemeal_implementation t
|
||||
)t
|
||||
where t.id = #{id}
|
||||
</select>
|
||||
</mapper>
|
||||
@ -50,4 +50,6 @@ public interface IDeviceUnitService extends IService<DeviceUnit> {
|
||||
*/
|
||||
DeviceUnit queryById(String id);
|
||||
|
||||
List<Long> getEpcUserIds(List<Long> constructUserIds);
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,55 @@
|
||||
package com.zhgd.xmgl.modules.baotou.service;
|
||||
|
||||
import com.zhgd.xmgl.modules.baotou.entity.PiecemealImplementation;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 零星工程实施
|
||||
* @author: pds
|
||||
* @date: 2025-01-10
|
||||
* @version: V1.0
|
||||
*/
|
||||
public interface IPiecemealImplementationService extends IService<PiecemealImplementation> {
|
||||
/**
|
||||
* 分页列表查询零星工程实施信息
|
||||
* @param param 参数map
|
||||
* @return
|
||||
*/
|
||||
IPage<PiecemealImplementation> queryPageList(HashMap<String, Object> param);
|
||||
/**
|
||||
* 列表查询零星工程实施信息
|
||||
* @param param 参数map
|
||||
* @return
|
||||
*/
|
||||
List<PiecemealImplementation> queryList(HashMap<String, Object> param);
|
||||
/**
|
||||
* 添加零星工程实施信息
|
||||
* @param piecemealImplementation 零星工程实施
|
||||
* @return
|
||||
*/
|
||||
void add(PiecemealImplementation piecemealImplementation);
|
||||
/**
|
||||
* 编辑零星工程实施信息
|
||||
* @param piecemealImplementation 零星工程实施
|
||||
* @return
|
||||
*/
|
||||
void edit(PiecemealImplementation piecemealImplementation);
|
||||
/**
|
||||
* 根据id删除零星工程实施信息
|
||||
* @param id 零星工程实施的id
|
||||
* @return
|
||||
*/
|
||||
void delete(String id);
|
||||
/**
|
||||
* 根据id查询零星工程实施信息
|
||||
* @param id 零星工程实施的id
|
||||
* @return
|
||||
*/
|
||||
PiecemealImplementation queryById(String id);
|
||||
|
||||
PiecemealImplementation countAmount(HashMap<String, Object> param);
|
||||
|
||||
}
|
||||
@ -23,4 +23,6 @@ public interface ISceneExposeSpecialService extends IService<SceneExposeSpecial>
|
||||
List<TrendOneVo> countConstruct(Map<String, Object> map);
|
||||
|
||||
SceneExposeSpecial queryById(String id);
|
||||
|
||||
void add(SceneExposeSpecial sceneExposeSpecial);
|
||||
}
|
||||
|
||||
@ -13,6 +13,8 @@ import com.zhgd.xmgl.modules.baotou.entity.UserDevGroup;
|
||||
import com.zhgd.xmgl.modules.baotou.mapper.DeviceUnitMapper;
|
||||
import com.zhgd.xmgl.modules.baotou.service.IDeviceUnitService;
|
||||
import com.zhgd.xmgl.modules.baotou.service.IUserDevGroupService;
|
||||
import com.zhgd.xmgl.modules.worker.entity.WorkerInfo;
|
||||
import com.zhgd.xmgl.modules.worker.service.impl.WorkerInfoServiceImpl;
|
||||
import com.zhgd.xmgl.security.entity.UserInfo;
|
||||
import com.zhgd.xmgl.security.util.SecurityUtils;
|
||||
import com.zhgd.xmgl.util.PageUtil;
|
||||
@ -36,6 +38,9 @@ public class DeviceUnitServiceImpl extends ServiceImpl<DeviceUnitMapper, DeviceU
|
||||
@Lazy
|
||||
@Autowired
|
||||
private IUserDevGroupService userDevGroupService;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private WorkerInfoServiceImpl workerInfoService;
|
||||
|
||||
@Override
|
||||
public IPage<DeviceUnit> queryPageList(HashMap<String, Object> param) {
|
||||
@ -125,4 +130,14 @@ public class DeviceUnitServiceImpl extends ServiceImpl<DeviceUnitMapper, DeviceU
|
||||
return entity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Long> getEpcUserIds(List<Long> constructUserIds) {
|
||||
if (CollUtil.isEmpty(constructUserIds)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
List<Long> eids = workerInfoService.list(new LambdaQueryWrapper<WorkerInfo>()
|
||||
.in(WorkerInfo::getId, constructUserIds)).stream().map(WorkerInfo::getEnterpriseId).collect(Collectors.toList());
|
||||
return baseMapper.getEpcUserIds(eids);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,102 @@
|
||||
package com.zhgd.xmgl.modules.baotou.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||
import com.zhgd.xmgl.modules.baotou.entity.PiecemealImplementation;
|
||||
import com.zhgd.xmgl.modules.baotou.mapper.PiecemealImplementationMapper;
|
||||
import com.zhgd.xmgl.modules.baotou.service.IPiecemealImplementationService;
|
||||
import com.zhgd.xmgl.util.PageUtil;
|
||||
import com.zhgd.xmgl.util.RefUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @Description: 零星工程实施
|
||||
* @author: pds
|
||||
* @date: 2025-01-10
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class PiecemealImplementationServiceImpl extends ServiceImpl<PiecemealImplementationMapper, PiecemealImplementation> implements IPiecemealImplementationService {
|
||||
@Autowired
|
||||
private PiecemealImplementationMapper piecemealImplementationMapper;
|
||||
|
||||
@Override
|
||||
public IPage<PiecemealImplementation> queryPageList(HashMap<String, Object> param) {
|
||||
QueryWrapper<PiecemealImplementation> queryWrapper = this.getQueryWrapper(param);
|
||||
Page<PiecemealImplementation> page = PageUtil.getPage(param);
|
||||
IPage<PiecemealImplementation> pageList = baseMapper.queryList(page, queryWrapper, param);
|
||||
pageList.setRecords(this.dealList(pageList.getRecords()));
|
||||
return pageList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PiecemealImplementation> queryList(HashMap<String, Object> param) {
|
||||
QueryWrapper<PiecemealImplementation> queryWrapper = getQueryWrapper(param);
|
||||
return dealList(baseMapper.queryList(queryWrapper, param));
|
||||
}
|
||||
|
||||
private QueryWrapper<PiecemealImplementation> getQueryWrapper(HashMap<String, Object> param) {
|
||||
QueryWrapper<PiecemealImplementation> queryWrapper = QueryGenerator.initPageQueryWrapper(PiecemealImplementation.class, param, true);
|
||||
queryWrapper.orderByDesc(RefUtil.fieldNameUlc(PiecemealImplementation::getId));
|
||||
return queryWrapper;
|
||||
}
|
||||
|
||||
private List<PiecemealImplementation> dealList(List<PiecemealImplementation> list) {
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(PiecemealImplementation piecemealImplementation) {
|
||||
piecemealImplementation.setId(null);
|
||||
baseMapper.insert(piecemealImplementation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void edit(PiecemealImplementation piecemealImplementation) {
|
||||
PiecemealImplementation oldPiecemealImplementation = baseMapper.selectById(piecemealImplementation.getId());
|
||||
if (oldPiecemealImplementation == null) {
|
||||
throw new OpenAlertException("未找到对应实体");
|
||||
}
|
||||
baseMapper.updateById(piecemealImplementation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(String id) {
|
||||
PiecemealImplementation piecemealImplementation = baseMapper.selectById(id);
|
||||
if (piecemealImplementation == null) {
|
||||
throw new OpenAlertException("未找到对应实体");
|
||||
}
|
||||
baseMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PiecemealImplementation queryById(String id) {
|
||||
PiecemealImplementation entity = baseMapper.queryById(id);
|
||||
if (entity == null) {
|
||||
throw new OpenAlertException("未找到对应实体");
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PiecemealImplementation countAmount(HashMap<String, Object> param) {
|
||||
List<PiecemealImplementation> list = this.queryList(param);
|
||||
PiecemealImplementation e = new PiecemealImplementation();
|
||||
BigDecimal actualAmount = list.stream().map(PiecemealImplementation::getActualAmount).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
BigDecimal estimatedAmount = list.stream().map(PiecemealImplementation::getEstimatedAmount).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
e.setEstimatedAmount(estimatedAmount);
|
||||
e.setActualAmount(actualAmount);
|
||||
return e;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,16 +1,29 @@
|
||||
package com.zhgd.xmgl.modules.baotou.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.zhgd.xmgl.base.entity.vo.TrendOneVo;
|
||||
import com.zhgd.xmgl.modules.baotou.entity.SceneExposeSpecial;
|
||||
import com.zhgd.xmgl.modules.baotou.mapper.SceneExposeSpecialMapper;
|
||||
import com.zhgd.xmgl.modules.baotou.service.ISceneExposeSpecialService;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.IBaseRoleService;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.IBaseRoleUserService;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.ISystemUserService;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.impl.NoticeServiceImpl;
|
||||
import com.zhgd.xmgl.modules.worker.entity.EnterpriseInfo;
|
||||
import com.zhgd.xmgl.modules.worker.service.impl.EnterpriseInfoServiceImpl;
|
||||
import com.zhgd.xmgl.modules.worker.service.impl.WorkerInfoServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -23,6 +36,22 @@ import java.util.Map;
|
||||
@Service
|
||||
public class SceneExposeSpecialServiceImpl extends ServiceImpl<SceneExposeSpecialMapper, SceneExposeSpecial> implements ISceneExposeSpecialService {
|
||||
|
||||
@Lazy
|
||||
@Resource
|
||||
NoticeServiceImpl noticeService;
|
||||
@Lazy
|
||||
@Autowired
|
||||
WorkerInfoServiceImpl workerInfoService;
|
||||
@Autowired
|
||||
private EnterpriseInfoServiceImpl enterpriseInfoService;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private ISystemUserService systemUserService;
|
||||
@Autowired
|
||||
private IBaseRoleUserService baseRoleUserService;
|
||||
@Autowired
|
||||
private IBaseRoleService baseRoleService;
|
||||
|
||||
@Override
|
||||
public IPage<SceneExposeSpecial> queryPageList(Page page, QueryWrapper<SceneExposeSpecial> queryWrapper) {
|
||||
return baseMapper.queryPageList(page, queryWrapper);
|
||||
@ -37,4 +66,22 @@ public class SceneExposeSpecialServiceImpl extends ServiceImpl<SceneExposeSpecia
|
||||
public SceneExposeSpecial queryById(String id) {
|
||||
return baseMapper.queryById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(SceneExposeSpecial special) {
|
||||
baseMapper.insert(special);
|
||||
if (special.getType() == 2) {
|
||||
//曝光栏新增需要通知给项目组、监理、EPC、施工单位(施工经理,监理的通知给总监)
|
||||
//标题:文明施工曝光
|
||||
//内容:(XXX单位,这里指的是施工单位)发生文明施工曝光,请及时整改。
|
||||
//发送时间:2025-01-10 16:00:00
|
||||
List<Long> eids = Arrays.asList(special.getEpcContractor(), special.getSupervisingUnit(), special.getConstructionUnit());
|
||||
EnterpriseInfo enterpriseInfo = enterpriseInfoService.getOne(new LambdaQueryWrapper<EnterpriseInfo>()
|
||||
.eq(EnterpriseInfo::getId, special.getConstructionUnit()));
|
||||
List<Long> userIds = noticeService.getUserIdBySceneExposeSpecial(special);
|
||||
noticeService.addUsersNotice(userIds, "文明施工曝光",
|
||||
StrUtil.format("标题:文明施工曝光,内容:{}发生文明施工曝光,请及时整改。发送时间:{}",
|
||||
enterpriseInfo.getEnterpriseName(), DateUtil.now()), "10");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ package com.zhgd.xmgl.modules.basicdata.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zhgd.xmgl.modules.baotou.entity.SceneExposeSpecial;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.Notice;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@ -25,4 +26,8 @@ public interface NoticeMapper extends BaseMapper<Notice> {
|
||||
* @return
|
||||
*/
|
||||
List<Notice> selectNoticePageList(Page<Notice> page, @Param("param") Map<String, Object> map);
|
||||
|
||||
List<Long> getUserIdBySceneExposeSpecial1(SceneExposeSpecial special);
|
||||
|
||||
List<Long> getUserIdBySceneExposeSpecial2(SceneExposeSpecial special);
|
||||
}
|
||||
|
||||
@ -31,4 +31,27 @@
|
||||
</if>
|
||||
ORDER BY send_time DESC,id desc
|
||||
</select>
|
||||
|
||||
<select id="getUserIdBySceneExposeSpecial1" resultType="java.lang.Long">
|
||||
select
|
||||
distinct su.user_id
|
||||
from system_user su
|
||||
join worker_info wi on wi.id=su.worker_id
|
||||
join enterprise_info ei on ei.id=wi.enterprise_id
|
||||
where wi.project_sn=#{projectSn}
|
||||
and (ei.id=#{constructionUnit} or ei.id=#{epcContractor})
|
||||
and su.user_id = (select r.user_id from base_role_user r join base_role br on br.role_id=r.role_id where br.role_name='施工经理')
|
||||
</select>
|
||||
|
||||
<select id="getUserIdBySceneExposeSpecial2" resultType="java.lang.Long">
|
||||
select
|
||||
distinct su.user_id
|
||||
from system_user su
|
||||
join worker_info wi on wi.id=su.worker_id
|
||||
join enterprise_info ei on ei.id=wi.enterprise_id
|
||||
where wi.project_sn=#{projectSn}
|
||||
and ei.id=#{supervisingUnit}
|
||||
and su.user_id = (select r.user_id from base_role_user r join base_role br on br.role_id=r.role_id where br.role_name='监理')
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@ -2,6 +2,7 @@ package com.zhgd.xmgl.modules.basicdata.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.zhgd.xmgl.modules.baotou.entity.SceneExposeSpecial;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.Notice;
|
||||
|
||||
import java.util.List;
|
||||
@ -142,4 +143,13 @@ public interface INoticeService extends IService<Notice> {
|
||||
* @param subTopic
|
||||
*/
|
||||
void sendMqttMessage(Notice notice, String subTopic);
|
||||
|
||||
/**
|
||||
* 通过施工人员ids查询epc账号ids(对应EPC的安全、项目经理角色名)
|
||||
* @param constructUserIds
|
||||
* @return
|
||||
*/
|
||||
List<Long> getEpcUserIdsByConstruWorkerIds(List<Long> constructUserIds);
|
||||
|
||||
List<Long> getUserIdBySceneExposeSpecial(SceneExposeSpecial special);
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.zhgd.xmgl.modules.basicdata.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson.serializer.SerializeConfig;
|
||||
@ -13,6 +14,8 @@ import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||
import com.zhgd.mqtt.bean.PushPayload;
|
||||
import com.zhgd.mqtt.server.IMqttSender;
|
||||
import com.zhgd.xmgl.constant.Cts;
|
||||
import com.zhgd.xmgl.modules.baotou.entity.SceneExposeSpecial;
|
||||
import com.zhgd.xmgl.modules.baotou.service.IDeviceUnitService;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.Notice;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.SystemUser;
|
||||
import com.zhgd.xmgl.modules.basicdata.mapper.NoticeMapper;
|
||||
@ -60,6 +63,8 @@ public class NoticeServiceImpl extends ServiceImpl<NoticeMapper, Notice> impleme
|
||||
@Lazy
|
||||
@Autowired
|
||||
private UniPushService uniPushService;
|
||||
@Autowired
|
||||
private IDeviceUnitService deviceUnitService;
|
||||
|
||||
@Override
|
||||
public IPage<Notice> selectNoticePageList(Map<String, Object> map) {
|
||||
@ -108,6 +113,9 @@ public class NoticeServiceImpl extends ServiceImpl<NoticeMapper, Notice> impleme
|
||||
|
||||
@Override
|
||||
public void addUsersNotice(List<Long> accountIds, String title, String msg, String type) {
|
||||
if (CollUtil.isEmpty(accountIds)) {
|
||||
return;
|
||||
}
|
||||
ArrayList<Notice> notices = new ArrayList<>();
|
||||
for (Long accountId : accountIds) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
@ -223,5 +231,18 @@ public class NoticeServiceImpl extends ServiceImpl<NoticeMapper, Notice> impleme
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Long> getEpcUserIdsByConstruWorkerIds(List<Long> constructUserIds) {
|
||||
return deviceUnitService.getEpcUserIds(constructUserIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Long> getUserIdBySceneExposeSpecial(SceneExposeSpecial special) {
|
||||
List<Long> special1 = baseMapper.getUserIdBySceneExposeSpecial1(special);
|
||||
List<Long> special2 = baseMapper.getUserIdBySceneExposeSpecial2(special);
|
||||
special1.addAll(special2);
|
||||
return special1;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -2,23 +2,25 @@ package com.zhgd.xmgl.modules.exam.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.core.util.ZipUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zhgd.annotation.OperLog;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.xmgl.modules.exam.entity.*;
|
||||
import com.zhgd.xmgl.modules.exam.service.IExamCourseService;
|
||||
import com.zhgd.xmgl.modules.exam.service.IExamPaperService;
|
||||
import com.zhgd.xmgl.modules.exam.service.IExamTrainRecordService;
|
||||
import com.zhgd.xmgl.modules.exam.service.IExamTrainService;
|
||||
import com.zhgd.xmgl.modules.exam.service.*;
|
||||
import com.zhgd.xmgl.modules.exam.vo.ExamQuestionBankVo;
|
||||
import com.zhgd.xmgl.modules.exam.vo.ExamTrainRecordVo;
|
||||
import com.zhgd.xmgl.util.EasyPoiUtil;
|
||||
import com.zhgd.xmgl.util.Fileutils;
|
||||
import com.zhgd.xmgl.util.JoBuilder;
|
||||
import com.zhgd.xmgl.util.PathUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
@ -31,10 +33,11 @@ import org.springframework.web.bind.annotation.*;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@ -57,6 +60,8 @@ public class ExamWorkerController {
|
||||
private IExamCourseService examCourseService;
|
||||
@Autowired
|
||||
private IExamTrainRecordService examTrainRecordService;
|
||||
@Autowired
|
||||
private IExamQuestionBankService examQuestionBankService;
|
||||
|
||||
/**
|
||||
* 查询我的教育培训记录
|
||||
@ -171,10 +176,11 @@ public class ExamWorkerController {
|
||||
@GetMapping(value = "/downloadPaper")
|
||||
public void downloadPaper(@RequestParam Map<String, Object> param, HttpServletResponse response) {
|
||||
try {
|
||||
String recordId = MapUtils.getString(param, "recordId");
|
||||
List<ExamQuestionBankVo> questionBankVos = examTrainRecordService.getAnswerDetail(param);
|
||||
Map<Integer, List<ExamQuestionBankVo>> typeMap = questionBankVos.stream().collect(Collectors.groupingBy(ExamQuestionBankVo::getType));
|
||||
HashMap<String, Object> imageMap = new HashMap<>();
|
||||
String[] typeArr = {"一", "二", "三"};
|
||||
int typeIndex = -1;
|
||||
//封装数据
|
||||
Map<String, Object> params = new HashMap<String, Object>();
|
||||
for (Map.Entry<Integer, List<ExamQuestionBankVo>> entry : typeMap.entrySet()) {
|
||||
@ -187,16 +193,16 @@ public class ExamWorkerController {
|
||||
StringBuilder content = new StringBuilder();
|
||||
BigDecimal total = NumberUtil.mul(list.size(), score);
|
||||
if (key == 1) {
|
||||
params.put("t1", "一、单选题:(每题" + score + "分,共计" + total + "分)");
|
||||
params.put("t1", typeArr[++typeIndex] + "、单选题:(每题" + score + "分,共计" + total + "分)");
|
||||
addOption(list, content, i, imageMap);
|
||||
params.put("c1", content.toString());
|
||||
} else if (key == 2) {
|
||||
params.put("t2", "二、多选题:(每题" + one.getScore() + "分,共计" + total + "分、漏选少选得" + NumberUtil.div(one.getScore(), 2, 2) + "分,错选不得分。)");
|
||||
params.put("t2", typeArr[++typeIndex] + "、多选题:(每题" + one.getScore() + "分,共计" + total + "分、漏选少选得" + NumberUtil.div(one.getScore(), 2, 2) + "分,错选不得分。)");
|
||||
//遍历题目
|
||||
addOption(list, content, i, imageMap);
|
||||
params.put("c2", content.toString());
|
||||
} else {
|
||||
params.put("t3", "三、判断题(每题" + one.getScore() + "分,共" + total + "分,正确:打√,错误:打×)");
|
||||
params.put("t3", typeArr[++typeIndex] + "、判断题(每题" + one.getScore() + "分,共" + total + "分,正确:打√,错误:打×)");
|
||||
//遍历题目
|
||||
addOption(list, content, i, imageMap);
|
||||
params.put("c3", content.toString());
|
||||
@ -214,6 +220,121 @@ public class ExamWorkerController {
|
||||
}
|
||||
}
|
||||
|
||||
@OperLog(operModul = "考试记录管理", operType = "", operDesc = "批量下载试卷")
|
||||
@ApiOperation(value = "批量下载试卷", notes = "批量下载试卷", httpMethod = "GET")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "recordIds", value = "记录ID(多个,分割)", paramType = "body", required = true, dataType = "String"),
|
||||
})
|
||||
@GetMapping(value = "/batch/downloadPaper")
|
||||
public Result batchDownloadPaper(@RequestParam Map<String, Object> param) {
|
||||
List<String> recordIds = StrUtil.split(MapUtils.getString(param, "recordIds"), ",");
|
||||
if (CollUtil.isEmpty(recordIds)) {
|
||||
return Result.ok();
|
||||
}
|
||||
List<ExamTrainRecord> trainRecords = examTrainRecordService.list(new LambdaQueryWrapper<ExamTrainRecord>()
|
||||
.in(ExamTrainRecord::getId, recordIds));
|
||||
List<Long> pids = trainRecords.stream().map(ExamTrainRecord::getExamPaperId).collect(Collectors.toList());
|
||||
if (CollUtil.isEmpty(pids)) {
|
||||
return Result.ok();
|
||||
}
|
||||
Map<Long, ExamPaper> pidMap = examPaperService.list(new LambdaQueryWrapper<ExamPaper>()
|
||||
.in(ExamPaper::getId, pids)).stream().collect(Collectors.toMap(ExamPaper::getId, Function.identity()));
|
||||
File foldFile = new File(PathUtil.getBasePath() + "/temp/" + IdUtil.randomUUID() + "/");
|
||||
FileUtil.mkdir(foldFile);
|
||||
HashMap<String, Integer> nameMap = new HashMap<String, Integer>();
|
||||
for (ExamTrainRecord record : trainRecords) {
|
||||
ExamPaper examPaper = pidMap.get(record.getExamPaperId());
|
||||
if (examPaper != null) {
|
||||
String questions;
|
||||
if (Objects.equals(examPaper.getCheckQuestionType(), 2)) {
|
||||
ExamTrainRecord trainRecord = examTrainRecordService.getOne(new LambdaQueryWrapper<ExamTrainRecord>()
|
||||
.eq(ExamTrainRecord::getWorkerCard, record.getWorkerCard())
|
||||
.eq(ExamTrainRecord::getExamPaperId, examPaper.getId())
|
||||
.last("limit 1")
|
||||
);
|
||||
questions = trainRecord.getQuestions();
|
||||
} else {
|
||||
questions = examPaper.getQuestions();
|
||||
}
|
||||
if (StringUtils.isNotBlank(questions)) {
|
||||
List<Long> list = Arrays.asList(questions.split(",")).stream().map(Long::new).collect(Collectors.toList());
|
||||
List<ExamQuestionBankVo> vos = examQuestionBankService.queryByBatchId(list);
|
||||
if (Objects.equals(examPaper.getCheckQuestionType(), 2)) {
|
||||
vos = vos.stream().sorted(Comparator.comparing(ExamQuestionBankVo::getType)).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
//构造题目和选择答案map
|
||||
String selectOptions = record.getSelectOptions();
|
||||
HashMap<Long, String> questionIdMap = new HashMap<>();
|
||||
List<String> options = StrUtil.split(selectOptions, ",");
|
||||
List<String> questionIds = StrUtil.split(questions, ",");
|
||||
for (int i = 0; i < questionIds.size(); i++) {
|
||||
questionIdMap.put(Long.valueOf(questionIds.get(i)), options.size() > i ? options.get(i) : "");
|
||||
}
|
||||
vos.forEach(o -> {
|
||||
o.setSelectOption(questionIdMap.get(o.getId()));
|
||||
});
|
||||
|
||||
//下载试卷
|
||||
Map<Integer, List<ExamQuestionBankVo>> typeMap = vos.stream().collect(Collectors.groupingBy(ExamQuestionBankVo::getType));
|
||||
HashMap<String, Object> imageMap = new HashMap<>();
|
||||
String[] typeArr = {"一", "二", "三"};
|
||||
int typeIndex = -1;
|
||||
//封装数据
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
for (Map.Entry<Integer, List<ExamQuestionBankVo>> entry : typeMap.entrySet()) {
|
||||
Integer key = entry.getKey();
|
||||
int[] i = {1};
|
||||
List<ExamQuestionBankVo> volist = entry.getValue();
|
||||
if (CollUtil.isNotEmpty(volist)) {
|
||||
ExamQuestionBankVo one = volist.get(0);
|
||||
BigDecimal score = one.getScore();
|
||||
StringBuilder content = new StringBuilder();
|
||||
BigDecimal total = NumberUtil.mul(volist.size(), score);
|
||||
if (key == 1) {
|
||||
params.put("t1", typeArr[++typeIndex] + "、单选题:(每题" + score + "分,共计" + total + "分)");
|
||||
addOption(volist, content, i, imageMap);
|
||||
params.put("c1", content.toString());
|
||||
} else if (key == 2) {
|
||||
params.put("t2", typeArr[++typeIndex] + "、多选题:(每题" + one.getScore() + "分,共计" + total + "分、漏选少选得" + NumberUtil.div(one.getScore(), 2, 2) + "分,错选不得分。)");
|
||||
//遍历题目
|
||||
addOption(volist, content, i, imageMap);
|
||||
params.put("c2", content.toString());
|
||||
} else {
|
||||
params.put("t3", typeArr[++typeIndex] + "、判断题(每题" + one.getScore() + "分,共" + total + "分,正确:打√,错误:打×)");
|
||||
//遍历题目
|
||||
addOption(volist, content, i, imageMap);
|
||||
params.put("c3", content.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
try {
|
||||
String tempUrl = Fileutils.getExportTemplateFile("template/下载试卷模板.docx").getAbsolutePath();
|
||||
String wn = null;
|
||||
String paperName = record.getWorkerName() + "试卷";
|
||||
Integer integer = nameMap.get(paperName);
|
||||
if (integer == null) {
|
||||
wn = paperName;
|
||||
nameMap.put(wn, 1);
|
||||
} else {
|
||||
int value = integer + 1;
|
||||
wn = paperName + value;
|
||||
nameMap.put(wn, value);
|
||||
}
|
||||
File tempFile = new File(foldFile, wn + ".docx");
|
||||
//生成word文档流
|
||||
EasyPoiUtil.exportNewLineWord(params, tempUrl, tempFile);
|
||||
|
||||
} catch (IOException e) {
|
||||
log.error("", e);
|
||||
}
|
||||
ZipUtil.zip(foldFile.getAbsolutePath());
|
||||
return Result.success(new JoBuilder().put("file", foldFile.getName() + ".zip").build());
|
||||
}
|
||||
}
|
||||
}
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出word添加题目和选项
|
||||
@ -241,7 +362,11 @@ public class ExamWorkerController {
|
||||
}*/
|
||||
}
|
||||
}
|
||||
content.append(question.getQuestionName()).append("\n").append(" ");
|
||||
content.append(question.getQuestionName()).append("\n");
|
||||
if (question.getType() == 3) {
|
||||
continue;
|
||||
}
|
||||
content.append(" ");
|
||||
List<ExamQuestionOption> optionList = question.getOptionList();
|
||||
//遍历选项
|
||||
for (ExamQuestionOption option : optionList) {
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.zhgd.xmgl.modules.exam.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@ -86,7 +87,7 @@ public class ExamAnswerQuestion implements Serializable {
|
||||
*/
|
||||
@Excel(name = "得分", width = 15)
|
||||
@ApiModelProperty(value = "得分")
|
||||
private Integer score;
|
||||
private BigDecimal score;
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
|
||||
@ -59,7 +59,7 @@ public class ExamPaper implements Serializable {
|
||||
*/
|
||||
@Excel(name = "及格分数线", width = 15)
|
||||
@ApiModelProperty(value = "及格分数线")
|
||||
private Integer passLine;
|
||||
private BigDecimal passLine;
|
||||
/**
|
||||
* 开始时间范围
|
||||
*/
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.zhgd.xmgl.modules.exam.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
@ -78,7 +79,7 @@ public class ExamRecord implements Serializable {
|
||||
*/
|
||||
@Excel(name = "考试得分", width = 15)
|
||||
@ApiModelProperty(value = "考试得分")
|
||||
private java.lang.Integer score;
|
||||
private BigDecimal score;
|
||||
/**
|
||||
* 是否合格(0:不合格;1:合格)
|
||||
*/
|
||||
|
||||
@ -118,7 +118,7 @@ public class ExamTrain implements Serializable {
|
||||
*/
|
||||
@Excel(name = "合格分数", width = 15)
|
||||
@ApiModelProperty(value = "合格分数")
|
||||
private Integer passLine;
|
||||
private BigDecimal passLine;
|
||||
/**
|
||||
* 考试次数
|
||||
*/
|
||||
|
||||
@ -11,6 +11,7 @@ import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
@ -80,13 +81,13 @@ public class ExamTrainRecord implements Serializable {
|
||||
*/
|
||||
@Excel(name = "考试成绩", width = 15)
|
||||
@ApiModelProperty(value = "考试成绩")
|
||||
private Integer score;
|
||||
private BigDecimal score;
|
||||
/**
|
||||
* 总分
|
||||
*/
|
||||
@Excel(name = "总分", width = 15)
|
||||
@ApiModelProperty(value = "总分")
|
||||
private Integer totalScore;
|
||||
private BigDecimal totalScore;
|
||||
/**
|
||||
* 考试次数(考试一次加1)
|
||||
*/
|
||||
@ -109,7 +110,7 @@ public class ExamTrainRecord implements Serializable {
|
||||
* 是否合格
|
||||
*/
|
||||
@Excel(name = "是否合格", width = 15)
|
||||
@ApiModelProperty(value = "是否合格")
|
||||
@ApiModelProperty(value = "是否合格:1合格0不合格")
|
||||
private Integer isPass;
|
||||
/**
|
||||
* 项目SN
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.zhgd.xmgl.modules.exam.service.impl;
|
||||
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.zhgd.xmgl.modules.exam.entity.*;
|
||||
import com.zhgd.xmgl.modules.exam.mapper.ExamRecordMapper;
|
||||
@ -12,6 +13,7 @@ import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
@ -46,7 +48,7 @@ public class ExamRecordServiceImpl extends ServiceImpl<ExamRecordMapper, ExamRec
|
||||
throw new RuntimeException("考试不存在");
|
||||
}
|
||||
List<ExamAnswerOption> optionList = new ArrayList<>();
|
||||
int score = 0;
|
||||
BigDecimal score = BigDecimal.ZERO;
|
||||
for (ExamAnswerQuestion examAnswerQuestion : examAnswerQuestionList) {
|
||||
boolean flag = examAnswerQuestionService.save(examAnswerQuestion);
|
||||
if (flag) {
|
||||
@ -57,13 +59,13 @@ public class ExamRecordServiceImpl extends ServiceImpl<ExamRecordMapper, ExamRec
|
||||
optionList.addAll(answerOptionList);
|
||||
}
|
||||
if (examAnswerQuestion.getAnswer().equals(examAnswerQuestion.getOptions())) {
|
||||
score = score + examAnswerQuestion.getScore();
|
||||
score = NumberUtil.add(score , examAnswerQuestion.getScore());
|
||||
}
|
||||
}
|
||||
examAnswerOptionService.saveBatch(optionList);
|
||||
examRecord.setEndTime(new Date());
|
||||
examRecord.setScore(score);
|
||||
examRecord.setPassFlag(score > examPaperService.getById(examRecord.getExamId()).getPassLine() ? 1 : 0);
|
||||
examRecord.setPassFlag(NumberUtil.isGreater(score , examPaperService.getById(examRecord.getExamId()).getPassLine()) ? 1 : 0);
|
||||
//TODO 积分管理
|
||||
examPointDetailService.saveInfo("exam_complete", examRecord.getProjectSn());
|
||||
return this.updateById(examRecord);
|
||||
|
||||
@ -4,6 +4,8 @@ import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUnit;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson.TypeReference;
|
||||
@ -39,8 +41,11 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.lang.reflect.Array;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
/**
|
||||
* @Description: 教育培训记录信息
|
||||
@ -118,18 +123,22 @@ public class ExamTrainRecordServiceImpl extends ServiceImpl<ExamTrainRecordMappe
|
||||
Long paperId = examAnswerQuestionList.get(0).getTrainRecordId();
|
||||
ExamTrainRecord r = this.getOne(new LambdaQueryWrapper<ExamTrainRecord>().eq(ExamTrainRecord::getWorkerCard, card).eq(ExamTrainRecord::getExamPaperId, paperId));
|
||||
ExamPaper examPaper = examPaperService.getById(paperId);
|
||||
int score = 0;
|
||||
int totalScore = 0;
|
||||
for (ExamAnswerQuestion examAnswerQuestion : examAnswerQuestionList) {
|
||||
totalScore = totalScore + examAnswerQuestion.getScore();
|
||||
if (StringUtils.isNotBlank(examAnswerQuestion.getAnswer()) && examAnswerQuestion.getAnswer().equals(examAnswerQuestion.getOptions())) {
|
||||
score = score + examAnswerQuestion.getScore();
|
||||
BigDecimal score = BigDecimal.ZERO;
|
||||
BigDecimal totalScore = BigDecimal.ZERO;
|
||||
for (ExamAnswerQuestion question : examAnswerQuestionList) {
|
||||
totalScore = NumberUtil.add(totalScore, question.getScore());
|
||||
if (StringUtils.isNotBlank(question.getAnswer()) && question.getAnswer().equals(question.getOptions())) {
|
||||
//全对
|
||||
score = NumberUtil.add(score, question.getScore());
|
||||
} else if (question.getType() == 2 && StringUtils.isNotBlank(question.getAnswer()) && question.getAnswer().chars().allMatch(o -> question.getOptions().contains(((char)o) + ""))) {
|
||||
//多选漏选得一半分
|
||||
score = NumberUtil.add(score, NumberUtil.div(question.getScore(), 2, 2));
|
||||
}
|
||||
}
|
||||
r.setSelectOptions(StrUtil.join(",", examAnswerQuestionList.stream().map(ExamAnswerQuestion::getAnswer).collect(Collectors.toList())));
|
||||
r.setExamNum(1);
|
||||
r.setScore(score);
|
||||
r.setIsPass(score >= examPaper.getPassLine() ? 1 : 0);
|
||||
r.setIsPass(NumberUtil.isGreaterOrEqual(score, examPaper.getPassLine()) ? 1 : 0);
|
||||
long duration = DateUtil.between(r.getStartExamTime(), new Date(), DateUnit.SECOND) * 1000;
|
||||
r.setDuration(DateUtil.formatBetween(duration));
|
||||
r.setTotalScore(totalScore);
|
||||
@ -208,7 +217,7 @@ public class ExamTrainRecordServiceImpl extends ServiceImpl<ExamTrainRecordMappe
|
||||
.eq(ExamTrainRecord::getTrainId, courseRecord.getTrainId())
|
||||
.eq(ExamTrainRecord::getWorkerId, courseRecord.getWorkerId()));
|
||||
examTrainRecord.setIsPass(1);
|
||||
examTrainRecord.setScore(0);
|
||||
examTrainRecord.setScore(BigDecimal.ZERO);
|
||||
this.updateById(examTrainRecord);
|
||||
}
|
||||
}
|
||||
|
||||
@ -157,6 +157,7 @@ public class AiAnalyseHardWareAlarmRecord implements Serializable {
|
||||
private Boolean isPushed;
|
||||
@ApiModelProperty(value = "区域id")
|
||||
private java.lang.Long qualityRegionId;
|
||||
/**处置方式:1:违章再教育;2:加入黑名单;**/
|
||||
@ApiModelProperty(value = "处置方式:1:违章再教育;2:加入黑名单;")
|
||||
private Integer handleType;
|
||||
/**
|
||||
|
||||
@ -617,6 +617,15 @@ public class AiAnalyseHardWareAlarmRecordServiceImpl extends ServiceImpl<AiAnaly
|
||||
}
|
||||
}
|
||||
}
|
||||
//违章人员发生违章后拉入黑名单:需要通知EPC的安全、项目经理
|
||||
//加入黑名单:
|
||||
//标题:人员黑名单报警
|
||||
//内容:(XXX)人员发生违章超过两次,已拉入人员黑名单。
|
||||
//发送时间:2025-01-10 16:00:00
|
||||
List<Long> epcUserIds = noticeService.getEpcUserIdsByConstruWorkerIds(blacklists.stream().map(WorkerBlacklist::getWorkerId).collect(Collectors.toList()));
|
||||
noticeService.addUsersNotice(epcUserIds, "人员黑名单报警",
|
||||
StrUtil.format("标题:人员黑名单报警,内容:{}人员发生违章超过两次,已拉入人员黑名单,发送时间:{}",
|
||||
StrUtil.join(",", blacklists.stream().map(WorkerBlacklist::getWorkerName).collect(Collectors.toList())), DateUtil.now()), "2");
|
||||
}
|
||||
}
|
||||
|
||||
@ -642,7 +651,7 @@ public class AiAnalyseHardWareAlarmRecordServiceImpl extends ServiceImpl<AiAnaly
|
||||
if (violationsTime >= 3) {
|
||||
//加入黑名单
|
||||
blacklists.add(mpWorkerBlacklist(workerInfo, name, alarmRecord.getProjectSn()));
|
||||
thisBlack =true;
|
||||
thisBlack = true;
|
||||
}
|
||||
education.setHandleTime(new Date());
|
||||
violationReEducationMapper.updateById(education);
|
||||
@ -747,13 +756,35 @@ public class AiAnalyseHardWareAlarmRecordServiceImpl extends ServiceImpl<AiAnaly
|
||||
FileUtil.copy(PathUtil.getBasePath() + "/" + record.getAlarmVideo(), dir + "/" + FileUtil.getName(record.getAlarmVideo()), true);
|
||||
baseMapper.updateById(record);
|
||||
|
||||
UserInfo user = SecurityUtils.getUser();
|
||||
if (user != null) {
|
||||
List<String> noticeUserIds = aiAnalyseHardWareRecordService.getUserIdsByAiAnalyseHardId(record.getHardwareId());
|
||||
for (String noticeUserId : noticeUserIds) {
|
||||
noticeService.addUserNotice(Long.valueOf(noticeUserId), "AI预警通知", "您有一条AI预警数据需要处置,请及时查看。", "3");
|
||||
}
|
||||
// UserInfo user = SecurityUtils.getUser();
|
||||
// if (user != null) {
|
||||
// List<String> noticeUserIds = aiAnalyseHardWareRecordService.getUserIdsByAiAnalyseHardId(record.getHardwareId());
|
||||
// for (String noticeUserId : noticeUserIds) {
|
||||
// noticeService.addUserNotice(Long.valueOf(noticeUserId), "AI预警通知", "您有一条AI预警数据需要处置,请及时查看。", "3");
|
||||
// }
|
||||
// }
|
||||
|
||||
//违章人员发生违章以及拉入黑名单:需要通知EPC的安全、项目经理
|
||||
//AI违章处置:
|
||||
//标题:人员AI违章报警
|
||||
//内容:(XXX)人员发生(XX报警类型)违章。来源:XXX
|
||||
//发送时间:2025-01-10 16:00:00
|
||||
List<Long> workerIds = workerInfoToAiAnalyseHardWareAlarmRecordMapper.selectList(new LambdaQueryWrapper<WorkerInfoToAiAnalyseHardWareAlarmRecord>()
|
||||
.eq(WorkerInfoToAiAnalyseHardWareAlarmRecord::getAiAnalyseHardWareAlarmRecordId, id)).stream().map(WorkerInfoToAiAnalyseHardWareAlarmRecord::getWorkerInfoId).collect(Collectors.toList());
|
||||
if (CollUtil.isEmpty(workerIds)) {
|
||||
return;
|
||||
}
|
||||
List<DictionaryItem> dictList = dictionaryItemService.getDictList(DictionaryConstant.AI_ANALYSE_HARD_WARE_ALARM_RECORD_TYPE, record.getProjectSn());
|
||||
Map<String, DictionaryItem> typeMap = dictList.stream().collect(Collectors.toMap(DictionaryItem::getData, Function.identity(), (dictionaryItem, dictionaryItem2) -> dictionaryItem));
|
||||
DictionaryItem item = typeMap.get(record.getAlarmType() + "");
|
||||
List<WorkerInfo> workerInfos = workerInfoService.list(new LambdaQueryWrapper<WorkerInfo>()
|
||||
.in(WorkerInfo::getId, workerIds).last(Cts.IGNORE_DATA_SCOPE_CONDITION));
|
||||
List<Long> epcUserIds = noticeService.getEpcUserIdsByConstruWorkerIds(workerInfos.stream().map(WorkerInfo::getId).collect(Collectors.toList()));
|
||||
noticeService.addUsersNotice(epcUserIds, "人员AI违章报警",
|
||||
StrUtil.format("标题:人员AI违章报警,内容:{}人员发生{}违章。来源:{},发送时间:{}",
|
||||
StrUtil.join(",", workerInfos.stream().map(WorkerInfo::getWorkerName).collect(Collectors.toList())),
|
||||
item != null ? item.getName() : "未知", record.getLocation(), DateUtil.now()), "2");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -66,9 +66,9 @@ public class EasyPoiUtil {
|
||||
/**
|
||||
* 根据模板导出word会换行的
|
||||
*
|
||||
* @param map
|
||||
* @param url
|
||||
* @param tempFile
|
||||
* @param map 参数map
|
||||
* @param url 模板url
|
||||
* @param tempFile 导出位置
|
||||
*/
|
||||
public static void exportNewLineWord(Map<String, Object> map, String url, File tempFile) {
|
||||
try {
|
||||
|
||||
@ -31,9 +31,11 @@ import com.wflow.workflow.bean.vo.ProcessTaskVo;
|
||||
import com.wflow.workflow.config.WflowGlobalVarDef;
|
||||
import com.wflow.workflow.service.*;
|
||||
import com.wflow.workflow.service.impl.ProcessTaskServiceImpl;
|
||||
import com.wflow.workflow.utils.Executor;
|
||||
import com.wflow.workflow.utils.FlowableUtils;
|
||||
import com.zhgd.xmgl.modules.baotou.entity.vo.CountFlowVO;
|
||||
import com.zhgd.xmgl.security.util.SecurityUtils;
|
||||
import com.zhgd.xmgl.tenant.TenantContextHolder;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.flowable.engine.HistoryService;
|
||||
@ -41,6 +43,7 @@ import org.flowable.engine.RepositoryService;
|
||||
import org.flowable.engine.RuntimeService;
|
||||
import org.flowable.engine.TaskService;
|
||||
import org.flowable.engine.history.HistoricProcessInstance;
|
||||
import org.flowable.engine.history.HistoricProcessInstanceQuery;
|
||||
import org.flowable.engine.runtime.ProcessInstance;
|
||||
import org.flowable.engine.runtime.ProcessInstanceQuery;
|
||||
import org.flowable.task.api.Task;
|
||||
@ -383,6 +386,8 @@ public class FlowSeviceUtil {
|
||||
public CountFlowVO countFlow(Map<String, Object> map) {
|
||||
String projectSn = MapUtils.getString(map, "projectSn");
|
||||
String userId = SecurityUtils.getUser().getUserId() + "";
|
||||
|
||||
//查询我的待办、质量待办、安全待办、抄送我的
|
||||
TaskQuery taskQuery = taskService.createTaskQuery();
|
||||
ProcessInstanceQuery processInstanceQuery = runtimeService.createProcessInstanceQuery();
|
||||
Set<String> stringSet = processInstanceQuery.list().stream().map(p -> p.getProcessInstanceId()).collect(Collectors.toSet());
|
||||
@ -429,9 +434,47 @@ public class FlowSeviceUtil {
|
||||
vo.setSafe(safe);
|
||||
vo.setQuality(quality);
|
||||
vo.setCsMe((int) processService.getCcMeInstance(1, 1, null, null, null, null, null).getTotal());
|
||||
|
||||
//查询待催办、已办结
|
||||
vo.setNeedCall((int) getTaskNum(userId, false).count());
|
||||
vo.setDone((int) getTaskNum(userId, true).count());
|
||||
return vo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询任务数量
|
||||
*
|
||||
* @param userId
|
||||
* @param finished
|
||||
* @return
|
||||
*/
|
||||
private HistoricProcessInstanceQuery getTaskNum(String userId, boolean finished) {
|
||||
HistoricProcessInstanceQuery instanceQuery = historyService.createHistoricProcessInstanceQuery();
|
||||
instanceQuery.processInstanceTenantId(TenantContextHolder.getTenantId());
|
||||
Executor.builder()
|
||||
.ifNotBlankNext(userId, instanceQuery::involvedUser)
|
||||
// .ifNotBlankNext(startUser, instanceQuery::startedBy)
|
||||
// .ifNotBlankNext(code, instanceQuery::processDefinitionKey)
|
||||
// .ifTrueNext(null != startTimes && startTimes.length > 1, () -> {
|
||||
// instanceQuery.startedAfter(DateUtil.parse(startTimes[0]));
|
||||
// instanceQuery.startedBefore(DateUtil.parse(startTimes[1]));
|
||||
// })
|
||||
// .ifNotBlankNext(keyword, v -> instanceQuery.processInstanceNameLike(StrUtil.format("%{}%", keyword)))
|
||||
.ifTrueNext(Boolean.TRUE.equals(finished), instanceQuery::finished)
|
||||
.ifTrueNext(Boolean.FALSE.equals(finished), instanceQuery::unfinished)
|
||||
// .ifNotBlankNext(fieldId, id -> {
|
||||
// if (StrUtil.isBlank(code)){
|
||||
// throw new BusinessException("搜索表单值必须先指定表单流程类型");
|
||||
// }
|
||||
// if (StrUtil.isNotBlank(fieldVal)){
|
||||
// instanceQuery.variableValueLike(fieldId, "%" + fieldVal + "%");
|
||||
// }
|
||||
// })
|
||||
;
|
||||
instanceQuery.count();
|
||||
return instanceQuery;
|
||||
}
|
||||
|
||||
public String getFlowIdByInstanceId(String instanceId) {
|
||||
ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(instanceId).singleResult();
|
||||
if (processInstance == null) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user