添加审签逻辑,移动flow通用代码,添加根据角色查询用户,新增时间工具类,修改指派设备bug
已重命名11个文件
已添加16个文件
已修改26个文件
已删除6个文件
| | |
| | | public class DocInfo { |
| | | @TableId(value = "doc_id") |
| | | private String docId; |
| | | |
| | | @TableField(value = "doc_name") |
| | | private String docName; |
| | | @TableField(value = "doc_alias") |
| | |
| | | @TableField(value = "doc_status") |
| | | @Dict(dicCode = "dnc_product_status") |
| | | private Integer docStatus; |
| | | @TableField(value = "doc_dispatch_status") |
| | | @Dict(dicCode = "nc_doc_dispatch_status") |
| | | private Integer docDispatchStatus; |
| | | @TableField(value = "publish_file_id") |
| | | private String publishFileId; |
| | | @TableField(value = "publish_version") |
| | |
| | | @TableField(value = "parent_id") |
| | | private Long parentId; |
| | | // åç§° |
| | | @TableField(value = "name") |
| | | @TableField(value = "tree_name") |
| | | private String name; |
| | | // code |
| | | @TableField(value = "tree_code") |
| | |
| | | ,r.attribution_type |
| | | ,r.attribution_id |
| | | ,u.doc_status |
| | | ,u.doc_dispatch_status |
| | | ,u.publish_file_id |
| | | ,u.publish_version |
| | | ,u.description |
| | |
| | | WHERE |
| | | nr.doc_id = #{docId} |
| | | AND nr.delete_flag = 0 |
| | | AND nr.attribution_type = 4 |
| | | AND nr.attribution_type = 7 |
| | | AND nr.attribution_id = d.id |
| | | ); |
| | | </select> |
| | |
| | | SELECT DISTINCT |
| | | mix.id, |
| | | mix.tree_code 'code', |
| | | mix.name, |
| | | mix.tree_name 'name', |
| | | mix.parent_id, |
| | | mix.tree_type AS 'type', |
| | | mix.extend, |
| | |
| | | order by mix.tree_type, mix.create_time asc |
| | | </select> |
| | | <select id="loadProductMixAll" resultType="org.jeecg.modules.dnc.entity.ProductMix"> |
| | | SELECT DISTINCT |
| | | mix.id, |
| | | SELECT DISTINCT mix.id, |
| | | mix.tree_code 'code', |
| | | mix.name, |
| | | mix.tree_name 'name', |
| | | mix.parent_id, |
| | | mix.tree_type AS 'type', |
| | | mix.extend, |
| | | mix.create_time |
| | | FROM |
| | | nc_product_mix mix -- è¿æ¥æé表ï¼çéé¨é¨ç¸å
³è®°å½ |
| | | FROM nc_product_mix mix -- è¿æ¥æé表ï¼çéé¨é¨ç¸å
³è®°å½ |
| | | LEFT JOIN nc_permission_stream_new nps_user ON mix.id = nps_user.business_id |
| | | AND nps_user.user_id = #{userId} |
| | | AND nps_user.delete_flag = '0' |
| | | WHERE |
| | | nps_user.business_id IS NOT NULL |
| | | WHERE nps_user.business_id IS NOT NULL |
| | | order by mix.tree_type, mix.create_time asc |
| | | </select> |
| | | </mapper> |
| | |
| | | package org.jeecg.modules.dnc.request; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import org.jeecg.common.aspect.annotation.Dict; |
| | | |
| | | @Data |
| | | @NoArgsConstructor |
| | | @ApiModel(value = "ææ¡£æ¥è¯¢åæ°", description = "ææ¡£æ¥è¯¢åæ°") |
| | | public class DocInfoQueryRequest { |
| | | @ApiModelProperty(value = "ææ¡£id") |
| | | private String docId; |
| | | @ApiModelProperty(value = "ç»å®ç±»å 1 产å 2 é¨ä»¶ 3 é¶ä»¶ 4 è®¾å¤ 5 å·¥åº", example = "1", required = true) |
| | | private Integer attributionType; |
| | | @ApiModelProperty(value = "ç»å®ç±»å对åºçid 1 产åid 2 é¨ä»¶id 3 é¶ä»¶id 4 设å¤id 5 å·¥åºid", example = "234324234", required = true) |
| | |
| | | private String attributionId; |
| | | private Integer attributionType; |
| | | private String docClassCode; |
| | | /**æ¯å¦è¿å
¥å®¡ç¾æµç¨*/ |
| | | private Boolean isApprove = true; |
| | | } |
| | |
| | | package org.jeecg.modules.dnc.service.impl; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
| | |
| | | import org.jeecg.common.api.vo.FileUploadResult; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.dnc.entity.*; |
| | | import org.jeecg.modules.dnc.exception.ExceptionCast; |
| | | import org.jeecg.modules.dnc.mapper.DocInfoMapper; |
| | | import org.jeecg.modules.dnc.request.DocInfoQueryRequest; |
| | | import org.jeecg.modules.dnc.request.DocInfoUploadRequest; |
| | | import org.jeecg.modules.dnc.response.*; |
| | | import org.jeecg.modules.dnc.service.*; |
| | | import org.jeecg.modules.dnc.utils.CamelToSnakeRegex; |
| | | import org.jeecg.modules.dnc.utils.ValidateUtil; |
| | | |
| | | |
| | | import org.jeecg.modules.dnc.request.DocInfoQueryRequest; |
| | | import org.jeecg.modules.dnc.request.DocInfoUploadRequest; |
| | | import org.jeecg.modules.dnc.utils.file.FileUtilS; |
| | | |
| | | import org.jeecg.modules.dnc.entity.*; |
| | | import org.jeecg.modules.dnc.response.*; |
| | | import org.jeecg.modules.dncFlow.entity.DispatchFile; |
| | | import org.jeecg.modules.dncFlow.service.IDispatchFileService; |
| | | import org.jeecg.modules.mdc.entity.MdcEquipment; |
| | | import org.jeecg.modules.system.service.ISysDictService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | |
| | | private IDeviceInfoService deviceInfoService; |
| | | @Autowired |
| | | private IDeviceGroupService deviceGroupService; |
| | | |
| | | @Autowired |
| | | private IDispatchFileService dispatchFileService; |
| | | |
| | | /*å¤ä»½å¤ç*/ |
| | | @Override |
| | |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | | boolean saveBool = super.save(docInfo); |
| | | if (uploadRequest.getIsApprove()&&saveBool){ |
| | | //触åå®¡ç¾ |
| | | DispatchFile dispatchFile = new DispatchFile(); |
| | | dispatchFile.setDocId(docInfo.getDocId()); |
| | | dispatchFile.setFileId(docFile.getFileId()); |
| | | dispatchFile.setAttributionId(uploadRequest.getAttributionId()); |
| | | dispatchFile.setAttributionType(String.valueOf(uploadRequest.getAttributionType())); |
| | | dispatchFile.setDocClassCode(uploadRequest.getDocClassCode()); |
| | | dispatchFileService.saveDispatchFile(dispatchFile); |
| | | } |
| | | return saveBool; |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | |
| | | } |
| | | String recF = pathFile.substring(0,recNum);//å°è¿ådef}ab |
| | | Integer equipmentId = recF.lastIndexOf("\\"); |
| | | String deviceNo = recF.substring(equipmentId+1,recF.length()); |
| | | String deviceNo = recF.substring(equipmentId+1); |
| | | if (StringUtils.isEmpty(deviceNo)) { |
| | | return false; |
| | | } |
| | |
| | | } |
| | | queryWrapper.ge(StrUtil.isNotEmpty(docQuery.getStartTime()),"u.create_time",docQuery.getStartTime()+" 00:00:00"); |
| | | queryWrapper.le(StrUtil.isNotEmpty(docQuery.getEndTime()),"u.create_time",docQuery.getEndTime()+" 23:59:59"); |
| | | if (StrUtil.isNotEmpty(docQuery.getColumn())){ |
| | | if (("desc").equals(docQuery.getOrder())){ |
| | | queryWrapper.orderByDesc("u."+ CamelToSnakeRegex.camelToSnake(docQuery.getColumn())); |
| | | }else { |
| | | queryWrapper.orderByAsc("u."+CamelToSnakeRegex.camelToSnake(docQuery.getColumn())); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public boolean deleteByDocAttr(Integer attrType, String attrId) { |
| | | int i = super.getBaseMapper().deleteByDocAttr(attrType, attrId); |
| | | if(i >= 0) { |
| | | return true; |
| | | } |
| | | return false; |
| | | return i >= 0; |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | QueryWrapper<DocInfo> queryWrapper = Wrappers.query(); |
| | | queryWrapper.eq(StrUtil.isNotEmpty(docQuery.getDocId()),"u.doc_id",docQuery.getDocId()); |
| | | queryWrapper.eq("r.attribution_type", docQuery.getAttributionType()).eq("r.attribution_id", docQuery.getAttributionId()) |
| | | .eq("r.classification_id", docClassification.getClassificationId()); |
| | | if (StringUtils.isNotEmpty(docQuery.getDocName())) { |
| | |
| | | stream.setComponentId(null); |
| | | stream.setPartsId(null); |
| | | stream.setProcessName(stream.getProcessName().toUpperCase()); |
| | | stream.setProcessCode(null); |
| | | stream.setProcessCode(stream.getProcessCode().toUpperCase()); |
| | | boolean b = super.updateById(stream); |
| | | //åæ¥ä¿®æ¹ç»ææ |
| | | ProductMix productMix = productMixService.getById(Long.parseLong(id)); |
| | |
| | | import org.jeecg.modules.dnc.service.*; |
| | | import org.jeecg.modules.dnc.ucenter.UserDepartExt; |
| | | import org.jeecg.modules.dnc.utils.ValidateUtil; |
| | | import org.jeecg.modules.system.entity.DncDevicePermission; |
| | | import org.jeecg.modules.system.entity.SysUser; |
| | | import org.jeecg.modules.system.service.ISysUserService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | case "4": |
| | | //å·¥èºè§ç¨çæ¬å· |
| | | processSpecVersionPermissionService.save(new ProcessSpecVersionPermission(id, userId)); |
| | | break; |
| | | case "5": |
| | | // å·¥åºæé |
| | | processStreamPermissionService.save(new ProcessionPermission(id, userId)); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.dncFlow.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.modules.dncFlow.entity.DispatchFile; |
| | | import org.jeecg.modules.dncFlow.service.IDispatchFileService; |
| | | import org.jeecg.modules.dncFlow.vo.DispatchFileFlowTaskVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | | * @Description: ncç¨åºä¸çµåå¾çç¾æ´¾ |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-03-19 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Api(tags="ncç¨åºä¸çµåå¾çç¾æ´¾") |
| | | @RestController |
| | | @RequestMapping("/dncFlow/dispatchFile") |
| | | @Slf4j |
| | | public class DispatchFileController extends JeecgController<DispatchFile, IDispatchFileService> { |
| | | @Autowired |
| | | private IDispatchFileService dispatchFileService; |
| | | |
| | | /** |
| | | * å页å表æ¥è¯¢ |
| | | * |
| | | * @param dispatchFile |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @param req |
| | | * @return |
| | | */ |
| | | //@AutoLog(value = "ncç¨åºä¸çµåå¾çç¾æ´¾-å页å表æ¥è¯¢") |
| | | @ApiOperation(value="ncç¨åºä¸çµåå¾çç¾æ´¾-å页å表æ¥è¯¢", notes="ncç¨åºä¸çµåå¾çç¾æ´¾-å页å表æ¥è¯¢") |
| | | @GetMapping(value = "/list") |
| | | public Result<IPage<DispatchFile>> queryPageList(DispatchFile dispatchFile, |
| | | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
| | | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | QueryWrapper<DispatchFile> queryWrapper = QueryGenerator.initQueryWrapper(dispatchFile, req.getParameterMap()); |
| | | Page<DispatchFile> page = new Page<DispatchFile>(pageNo, pageSize); |
| | | IPage<DispatchFile> pageList = dispatchFileService.page(page, queryWrapper); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | /** |
| | | * éæ°å¯å¨ |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "ncç¨åºä¸çµåå¾çç¾æ´¾-éæ°å¯å¨") |
| | | @ApiOperation(value="ncç¨åºä¸çµåå¾çç¾æ´¾-éæ°å¯å¨", notes="ncç¨åºä¸çµåå¾çç¾æ´¾-éæ°å¯å¨") |
| | | @GetMapping(value = "/saveDispatchFile") |
| | | public Result<?> saveDispatchFile(String id){ |
| | | return dispatchFileService.reStartDispatchFile(id); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * å®¡æ¹æä½ |
| | | * @param dispatchFileFlowTaskVo |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "ncç¨åºä¸çµåå¾çç¾æ´¾-å®¡æ¹æä½") |
| | | @ApiOperation(value="ncç¨åºä¸çµåå¾çç¾æ´¾-å®¡æ¹æä½", notes="ncç¨åºä¸çµåå¾çç¾æ´¾-å®¡æ¹æä½") |
| | | @GetMapping(value = "/approval") |
| | | public Result<?> approval(DispatchFileFlowTaskVo dispatchFileFlowTaskVo){ |
| | | return dispatchFileService.auditDispatchFile(dispatchFileFlowTaskVo); |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * |
| | | * @param dispatchFile |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "ncç¨åºä¸çµåå¾çç¾æ´¾-æ·»å ") |
| | | @ApiOperation(value="ncç¨åºä¸çµåå¾çç¾æ´¾-æ·»å ", notes="ncç¨åºä¸çµåå¾çç¾æ´¾-æ·»å ") |
| | | //@RequiresPermissions("org.jeecg.modules:nc_dispatch_file:add") |
| | | @PostMapping(value = "/add") |
| | | public Result<String> add(@RequestBody DispatchFile dispatchFile) { |
| | | dispatchFileService.save(dispatchFile); |
| | | return Result.OK("æ·»å æåï¼"); |
| | | } |
| | | |
| | | /** |
| | | * ç¼è¾ |
| | | * |
| | | * @param dispatchFile |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "ncç¨åºä¸çµåå¾çç¾æ´¾-ç¼è¾") |
| | | @ApiOperation(value="ncç¨åºä¸çµåå¾çç¾æ´¾-ç¼è¾", notes="ncç¨åºä¸çµåå¾çç¾æ´¾-ç¼è¾") |
| | | //@RequiresPermissions("org.jeecg.modules:nc_dispatch_file:edit") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
| | | public Result<String> edit(@RequestBody DispatchFile dispatchFile) { |
| | | dispatchFileService.updateById(dispatchFile); |
| | | return Result.OK("ç¼è¾æå!"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idå é¤ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "ncç¨åºä¸çµåå¾çç¾æ´¾-éè¿idå é¤") |
| | | @ApiOperation(value="ncç¨åºä¸çµåå¾çç¾æ´¾-éè¿idå é¤", notes="ncç¨åºä¸çµåå¾çç¾æ´¾-éè¿idå é¤") |
| | | //@RequiresPermissions("org.jeecg.modules:nc_dispatch_file:delete") |
| | | @DeleteMapping(value = "/delete") |
| | | public Result<String> delete(@RequestParam(name="id",required=true) String id) { |
| | | dispatchFileService.removeById(id); |
| | | return Result.OK("å 餿å!"); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "ncç¨åºä¸çµåå¾çç¾æ´¾-æ¹éå é¤") |
| | | @ApiOperation(value="ncç¨åºä¸çµåå¾çç¾æ´¾-æ¹éå é¤", notes="ncç¨åºä¸çµåå¾çç¾æ´¾-æ¹éå é¤") |
| | | //@RequiresPermissions("org.jeecg.modules:nc_dispatch_file:deleteBatch") |
| | | @DeleteMapping(value = "/deleteBatch") |
| | | public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
| | | this.dispatchFileService.removeByIds(Arrays.asList(ids.split(","))); |
| | | return Result.OK("æ¹éå 餿å!"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idæ¥è¯¢ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | //@AutoLog(value = "ncç¨åºä¸çµåå¾çç¾æ´¾-éè¿idæ¥è¯¢") |
| | | @ApiOperation(value="ncç¨åºä¸çµåå¾çç¾æ´¾-éè¿idæ¥è¯¢", notes="ncç¨åºä¸çµåå¾çç¾æ´¾-éè¿idæ¥è¯¢") |
| | | @GetMapping(value = "/queryById") |
| | | public Result<DispatchFile> queryById(@RequestParam(name="id",required=true) String id) { |
| | | DispatchFile dispatchFile = dispatchFileService.getById(id); |
| | | if(dispatchFile==null) { |
| | | return Result.error("æªæ¾å°å¯¹åºæ°æ®"); |
| | | } |
| | | return Result.OK(dispatchFile); |
| | | } |
| | | |
| | | @GetMapping(value = "/selectVoById") |
| | | public Result<?> selectVoById(@RequestParam(name="id") String id){ |
| | | return dispatchFileService.queryDispatchFile(id); |
| | | } |
| | | |
| | | /** |
| | | * 导åºexcel |
| | | * |
| | | * @param request |
| | | * @param dispatchFile |
| | | */ |
| | | //@RequiresPermissions("org.jeecg.modules:nc_dispatch_file:exportXls") |
| | | @RequestMapping(value = "/exportXls") |
| | | public ModelAndView exportXls(HttpServletRequest request, DispatchFile dispatchFile) { |
| | | return super.exportXls(request, dispatchFile, DispatchFile.class, "ncç¨åºä¸çµåå¾çç¾æ´¾"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿excel导å
¥æ°æ® |
| | | * |
| | | * @param request |
| | | * @param response |
| | | * @return |
| | | */ |
| | | //@RequiresPermissions("nc_dispatch_file:importExcel") |
| | | @RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
| | | public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
| | | return super.importExcel(request, response, DispatchFile.class); |
| | | } |
| | | |
| | | } |
| | |
| | | private String componentId; |
| | | @TableField(value = "parts_id") |
| | | private String partsId; |
| | | //å·¥èºè§ç¨id |
| | | @TableField(value = "psv_id") |
| | | private String psvId; |
| | | @TableField(value = "process_id") |
| | | private String processId; |
| | | @TableField(value = "step_id") |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.dncFlow.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | import org.jeecgframework.poi.excel.annotation.Excel; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Description: ncç¨åºä¸çµåå¾çç¾æ´¾ |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-03-19 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Data |
| | | @TableName("nc_dispatch_file") |
| | | @Accessors(chain = true) |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ApiModel(value="nc_dispatch_file对象", description="ncç¨åºä¸çµåå¾çç¾æ´¾") |
| | | public class DispatchFile implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /**主é®*/ |
| | | @TableId(type = IdType.ASSIGN_ID) |
| | | @ApiModelProperty(value = "主é®") |
| | | private String id; |
| | | /**产åid*/ |
| | | @Excel(name = "产åid", width = 15) |
| | | @ApiModelProperty(value = "产åid") |
| | | private String productId; |
| | | /**é¨ä»¶id*/ |
| | | @Excel(name = "é¨ä»¶id", width = 15) |
| | | @ApiModelProperty(value = "é¨ä»¶id") |
| | | private String componentId; |
| | | /**é¶ä»¶id*/ |
| | | @Excel(name = "é¶ä»¶id", width = 15) |
| | | @ApiModelProperty(value = "é¶ä»¶id") |
| | | private String partsId; |
| | | /**å·¥èºè§ç¨id*/ |
| | | @Excel(name = "å·¥èºè§ç¨id", width = 15) |
| | | @ApiModelProperty(value = "å·¥èºè§ç¨id") |
| | | private String psvId; |
| | | /**å·¥åºid*/ |
| | | @Excel(name = "å·¥åºid", width = 15) |
| | | @ApiModelProperty(value = "å·¥åºid") |
| | | private String processId; |
| | | /**å·¥æ¥id*/ |
| | | @Excel(name = "å·¥æ¥id", width = 15) |
| | | @ApiModelProperty(value = "å·¥æ¥id") |
| | | private String stepId; |
| | | /**æå±ID*/ |
| | | @Excel(name = "æå±ID", width = 15) |
| | | @ApiModelProperty(value = "æå±ID") |
| | | private String attributionId; |
| | | /**æå±type*/ |
| | | @Excel(name = "æå±type", width = 15) |
| | | @ApiModelProperty(value = "æå±type") |
| | | private String attributionType; |
| | | /**æä»¶ç±»å*/ |
| | | @Excel(name = "æä»¶ç±»å", width = 15) |
| | | @ApiModelProperty(value = "æä»¶ç±»å") |
| | | private String docClassCode; |
| | | /**设å¤ç±»id*/ |
| | | @Excel(name = "设å¤ç±»id", width = 15) |
| | | @ApiModelProperty(value = "设å¤ç±»id") |
| | | private String deviceTypeId; |
| | | /**ææ¡£id*/ |
| | | @Excel(name = "ææ¡£id", width = 15) |
| | | @ApiModelProperty(value = "ææ¡£id") |
| | | private String docId; |
| | | /**æä»¶è¡¨id*/ |
| | | @Excel(name = "æä»¶è¡¨id", width = 15) |
| | | @ApiModelProperty(value = "æä»¶è¡¨id") |
| | | private String fileId; |
| | | /**å½åèç¹*/ |
| | | @Excel(name = "å½åèç¹", width = 15) |
| | | @ApiModelProperty(value = "å½åèç¹") |
| | | private String currentNode; |
| | | /**èç¹ç¶æ*/ |
| | | @Excel(name = "èç¹ç¶æ", width = 15) |
| | | @ApiModelProperty(value = "èç¹ç¶æ") |
| | | private String nodeState; |
| | | /**å建人*/ |
| | | @ApiModelProperty(value = "å建人") |
| | | private String createBy; |
| | | /**åå»ºæ¥æ*/ |
| | | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "åå»ºæ¥æ") |
| | | private Date createTime; |
| | | /**æ´æ°äºº*/ |
| | | @ApiModelProperty(value = "æ´æ°äºº") |
| | | private String updateBy; |
| | | /**æ´æ°æ¥æ*/ |
| | | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "æ´æ°æ¥æ") |
| | | private Date updateTime; |
| | | |
| | | /**ç³è¯·çç±*/ |
| | | @ApiModelProperty(value = "ç³è¯·çç±") |
| | | private transient String organization; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.dncFlow.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.jeecg.modules.dncFlow.entity.DispatchFile; |
| | | |
| | | /** |
| | | * @Description: ncç¨åºä¸çµåå¾çç¾æ´¾ |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-03-19 |
| | | * @Version: V1.0 |
| | | */ |
| | | public interface DispatchFileMapper extends BaseMapper<DispatchFile> { |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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="org.jeecg.modules.dncFlow.mapper.DispatchFileMapper"> |
| | | |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.dncFlow.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.modules.dncFlow.entity.DispatchFile; |
| | | import org.jeecg.modules.dncFlow.vo.DispatchFileFlowTaskVo; |
| | | |
| | | /** |
| | | * @Description: ncç¨åºä¸çµåå¾çç¾æ´¾ |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-03-19 |
| | | * @Version: V1.0 |
| | | */ |
| | | public interface IDispatchFileService extends IService<DispatchFile> { |
| | | |
| | | /** |
| | | * æµç¨å¯å¨,ä¿å对åºçæ°æ® |
| | | * @param dispatchFile |
| | | * @return |
| | | */ |
| | | Result<?> saveDispatchFile(DispatchFile dispatchFile); |
| | | |
| | | /** |
| | | * éæ°å¯å¨ |
| | | * @param id |
| | | */ |
| | | Result<?> reStartDispatchFile(String id); |
| | | |
| | | /** |
| | | * å®¡æ¹æä½ |
| | | * @param dispatchFileFlowTaskVo |
| | | * @return |
| | | */ |
| | | Result<?> auditDispatchFile(DispatchFileFlowTaskVo dispatchFileFlowTaskVo); |
| | | |
| | | /** |
| | | * æ¥è¯¢å®¡ç¾åºæ¬ä¿¡æ¯ |
| | | * @param id |
| | | */ |
| | | Result<?> queryDispatchFile(String id); |
| | | |
| | | } |
| | |
| | | //flowableå¤ç |
| | | FlowTaskVo flowTaskVo = new FlowTaskVo(); |
| | | BeanUtils.copyProperties(assignFlowTaskVo, flowTaskVo); |
| | | Map<String, Object> values=new HashMap<>(); |
| | | values.put("dataId", assignFlowTaskVo.getDataId()); |
| | | flowTaskVo.setTaskId(assignFlowTaskVo.getTaskId()); |
| | | flowTaskVo.setValues(values); |
| | | flowTaskService.complete(flowTaskVo); |
| | | //æ´æ°å¯¹è±¡å°è£
|
| | | AssignFileStream up = new AssignFileStream(); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.dncFlow.service.impl; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.google.common.collect.Lists; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.flowable.engine.TaskService; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.dnc.entity.*; |
| | | import org.jeecg.modules.dnc.exception.ExceptionCast; |
| | | import org.jeecg.modules.dnc.mapper.DocInfoMapper; |
| | | import org.jeecg.modules.dnc.request.DocInfoQueryRequest; |
| | | import org.jeecg.modules.dnc.response.ActivitiCode; |
| | | import org.jeecg.modules.dnc.response.CommonCode; |
| | | import org.jeecg.modules.dnc.response.UcenterCode; |
| | | import org.jeecg.modules.dnc.service.*; |
| | | import org.jeecg.modules.dnc.utils.ValidateUtil; |
| | | import org.jeecg.modules.dncFlow.entity.DispatchFile; |
| | | import org.jeecg.modules.dncFlow.mapper.DispatchFileMapper; |
| | | import org.jeecg.modules.dncFlow.service.IDispatchFileService; |
| | | import org.jeecg.modules.dncFlow.vo.DispatchFileFlowTaskVo; |
| | | import org.jeecg.modules.flowable.apithird.business.entity.FlowMyBusiness; |
| | | import org.jeecg.modules.flowable.apithird.business.service.IFlowMyBusinessService; |
| | | import org.jeecg.modules.flowable.apithird.service.FlowCallBackServiceI; |
| | | import org.jeecg.modules.flowable.apithird.service.FlowCommonService; |
| | | import org.jeecg.modules.flowable.service.IFlowDefinitionService; |
| | | import org.jeecg.modules.flowable.service.IFlowTaskService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Description: ncç¨åºä¸çµåå¾çç¾æ´¾ |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-03-19 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Service("IDispatchFileService") |
| | | public class DispatchFileServiceImpl extends ServiceImpl<DispatchFileMapper, DispatchFile> implements IDispatchFileService, FlowCallBackServiceI { |
| | | |
| | | @Autowired |
| | | @Lazy |
| | | private IDocInfoService docInfoService; |
| | | @Autowired |
| | | private IProcessStreamService processStreamService; |
| | | @Autowired |
| | | private IWorkStepService workStepService; |
| | | @Autowired |
| | | private IPermissionStreamNewService permissionStreamNewService; |
| | | @Resource |
| | | private FlowCommonService flowCommonService; |
| | | @Resource |
| | | private IFlowDefinitionService flowDefinitionService; |
| | | @Autowired |
| | | private IFlowTaskService flowTaskService; |
| | | @Autowired |
| | | private IDeviceTypeService deviceTypeService; |
| | | @Autowired |
| | | private TaskService taskService; |
| | | @Autowired |
| | | private IFlowMyBusinessService flowMyBusinessService; |
| | | @Autowired |
| | | private DocInfoMapper docInfoMapper; |
| | | /** |
| | | * æµç¨å¯å¨,ä¿å对åºçæ°æ® |
| | | * @param dispatchFile |
| | | * @return |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public Result<?> saveDispatchFile(DispatchFile dispatchFile){ |
| | | //æ ¡éªåæ° |
| | | checkParam(dispatchFile); |
| | | //è·åæä»¶ä¿¡æ¯ |
| | | DocInfo docInfo = docInfoService.getById(dispatchFile.getDocId()); |
| | | PermissionStreamNew permissionStreams = getPermissionStreams(dispatchFile); |
| | | if (permissionStreams==null){ |
| | | return Result.error("ç¨æ·æ²¡ææé"); |
| | | } |
| | | dispatchFile.setAttributionType(dispatchFile.getAttributionType()); |
| | | dispatchFile.setAttributionId(dispatchFile.getAttributionId()); |
| | | dispatchFile.setDocClassCode(dispatchFile.getDocClassCode()); |
| | | super.save(dispatchFile); |
| | | System.out.println("NCç¨åºåçµåæ ·æ¿å®¡ç¾æµç¨ï¼" + dispatchFile.getDocId()); |
| | | flowCommonService.initActBusiness(docInfo.getDocName()+"."+docInfo.getDocSuffix()+"æä»¶è¿è¡å®¡ç¾", |
| | | dispatchFile.getId(), "IDispatchFileService", "nc_dispatch_file", null); |
| | | Map<String, Object> variables = new HashMap<>(); |
| | | variables.put("dataId", dispatchFile.getId()); |
| | | variables.put("organization", "导å
¥ææ¡£é»è®¤å¯å¨æµç¨"); |
| | | variables.put("proofreading",true); |
| | | Result result= flowDefinitionService.startProcessInstanceByKey("nc_dispatch_file", variables); |
| | | if (!result.isSuccess()) { |
| | | super.removeById(dispatchFile.getId()); |
| | | }else { |
| | | docInfo.setDocDispatchStatus(1); |
| | | docInfoService.updateById(docInfo); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * éæ°å¯å¨ |
| | | * @param id |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public Result<?> reStartDispatchFile(String id){ |
| | | DispatchFile dispatchFile = this.getById(id); |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | if (!dispatchFile.getCreateBy().equals(user.getUsername())){ |
| | | return Result.error("æ¨æ²¡ææééæ°å¯å¨"); |
| | | } |
| | | FlowMyBusiness flowMyBusiness=flowMyBusinessService.list(new QueryWrapper<FlowMyBusiness>() |
| | | .eq("data_id",dispatchFile.getId())).get(0); |
| | | String processInstanceId = flowMyBusiness.getProcessInstanceId(); |
| | | Map<String, Object> variables = new HashMap<>(); |
| | | variables.put("dataId", dispatchFile.getId()); |
| | | variables.put("organization", "éæ°å¯å¨"); |
| | | String TaskId=taskService.createTaskQuery().processInstanceId(processInstanceId).singleResult().getId(); |
| | | taskService.complete(TaskId, variables); |
| | | return Result.ok("éæ°å¯å¨æå"); |
| | | } |
| | | |
| | | /** |
| | | * å®¡æ¹æä½ |
| | | * @param dispatchFileFlowTaskVo |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result<?> auditDispatchFile(DispatchFileFlowTaskVo dispatchFileFlowTaskVo) { |
| | | try { |
| | | // åæ°æ ¡éª |
| | | if (!ValidateUtil.validateString(dispatchFileFlowTaskVo.getTaskId()) || !ValidateUtil.validateString(dispatchFileFlowTaskVo.getDataId())) { |
| | | return Result.error(CommonCode.INVALID_PARAM.toString()); |
| | | } |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | String userId = user.getId(); |
| | | dispatchFileFlowTaskVo.setAssignee(user.getUsername()); |
| | | if (!ValidateUtil.validateString(userId)) { |
| | | return Result.error(UcenterCode.UCENTER_ACCOUNT_NOT_EXIST.toString()); |
| | | } |
| | | |
| | | // æ°æ®æ¥è¯¢ |
| | | DispatchFile dispatchFile = this.getById(dispatchFileFlowTaskVo.getDataId()); |
| | | if (dispatchFile == null) { |
| | | return Result.error(CommonCode.INVALID_PARAM.toString()); |
| | | } |
| | | DocInfo docInfo = docInfoService.getById(dispatchFile.getDocId()); |
| | | if (docInfo == null) { |
| | | return Result.error(ActivitiCode.ACT_DOC_ERROR.toString()); |
| | | } |
| | | |
| | | // 设置æµç¨åé |
| | | Map<String, Object> values = setProcessVariables(dispatchFile, userId, dispatchFileFlowTaskVo); |
| | | dispatchFileFlowTaskVo.setValues(values); |
| | | |
| | | // 宿æµç¨ä»»å¡ |
| | | Result result = flowTaskService.complete(dispatchFileFlowTaskVo); |
| | | if (result.isSuccess()) { |
| | | // æ´æ°ç¶æ |
| | | updateStatus(dispatchFile, docInfo, dispatchFileFlowTaskVo); |
| | | docInfoService.updateById(docInfo); |
| | | this.updateById(dispatchFile); |
| | | } else { |
| | | return result; |
| | | } |
| | | |
| | | return Result.OK("æä½æå"); |
| | | } catch (Exception e) { |
| | | return Result.error("æä½å¤±è´¥ï¼" + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢å®¡ç¾åºæ¬ä¿¡æ¯ |
| | | * @param id |
| | | */ |
| | | public Result<?> queryDispatchFile(String id){ |
| | | DispatchFile dispatchFile=this.getById(id); |
| | | if (dispatchFile==null){ |
| | | return Result.error("审ç¾åºæ¬ä¿¡æ¯ä¸åå¨"); |
| | | } |
| | | DocInfoQueryRequest docInfoQueryRequest=new DocInfoQueryRequest(); |
| | | docInfoQueryRequest.setDocId(dispatchFile.getDocId()); |
| | | docInfoQueryRequest.setAttributionId(dispatchFile.getAttributionId()); |
| | | docInfoQueryRequest.setAttributionType(Integer.valueOf(dispatchFile.getAttributionType())); |
| | | docInfoQueryRequest.setDocClassCode(dispatchFile.getDocClassCode()); |
| | | List<DocInfo> docInfoList = docInfoService.findList(docInfoQueryRequest); |
| | | return Result.OK(docInfoList); |
| | | } |
| | | |
| | | private Map<String, Object> setProcessVariables(DispatchFile dispatchFile, String userId, DispatchFileFlowTaskVo dispatchFileFlowTaskVo) { |
| | | Map<String, Object> values = new HashMap<>(); |
| | | values.put("dataId", dispatchFile.getId()); |
| | | values.put("organization", dispatchFile.getOrganization()); |
| | | values.put("assignee", userId); |
| | | values.put("comment", dispatchFileFlowTaskVo.getComment()); |
| | | |
| | | if (StrUtil.isNotBlank(dispatchFileFlowTaskVo.getProofreadStatus())) { |
| | | values.put("proofreadStatus", dispatchFileFlowTaskVo.getProofreadStatus()); |
| | | } |
| | | if (dispatchFileFlowTaskVo.getRatify() != null) { |
| | | values.put("ratify", dispatchFileFlowTaskVo.getRatify()); |
| | | } |
| | | if (dispatchFileFlowTaskVo.getCut() != null) { |
| | | values.put("cut", dispatchFileFlowTaskVo.getCut()); |
| | | } |
| | | if (dispatchFileFlowTaskVo.getStereotype() != null) { |
| | | values.put("stereotype", dispatchFileFlowTaskVo.getStereotype()); |
| | | } |
| | | return values; |
| | | } |
| | | |
| | | private void updateStatus(DispatchFile dispatchFile, DocInfo docInfo, DispatchFileFlowTaskVo dispatchFileFlowTaskVo) { |
| | | if (StrUtil.isNotBlank(dispatchFileFlowTaskVo.getProofreadStatus())) { |
| | | switch (dispatchFileFlowTaskVo.getProofreadStatus()) { |
| | | case "1": |
| | | // ç´æ¥å®å |
| | | dispatchFile.setCurrentNode("5"); |
| | | docInfo.setDocDispatchStatus(5); |
| | | break; |
| | | case "2": |
| | | // æ ¡å¯¹éè¿ |
| | | dispatchFile.setCurrentNode("2"); |
| | | docInfo.setDocDispatchStatus(2); |
| | | break; |
| | | default: |
| | | // æ ¡å¯¹ä¸éè¿ |
| | | dispatchFile.setCurrentNode("1"); |
| | | docInfo.setDocDispatchStatus(1); |
| | | break; |
| | | } |
| | | } |
| | | if (dispatchFileFlowTaskVo.getRatify() != null && dispatchFileFlowTaskVo.getRatify()) { |
| | | dispatchFile.setCurrentNode("3"); |
| | | docInfo.setDocDispatchStatus(3); |
| | | } |
| | | if (dispatchFileFlowTaskVo.getCut() != null && dispatchFileFlowTaskVo.getCut()) { |
| | | dispatchFile.setCurrentNode("4"); |
| | | docInfo.setDocDispatchStatus(4); |
| | | } |
| | | if (dispatchFileFlowTaskVo.getStereotype() != null && dispatchFileFlowTaskVo.getStereotype()) { |
| | | dispatchFile.setCurrentNode("5"); |
| | | docInfo.setDocDispatchStatus(5); |
| | | } |
| | | } |
| | | |
| | | //ä¼ åéªè¯ |
| | | public boolean checkParam(DispatchFile dispatchFile) { |
| | | if (dispatchFile == null) { |
| | | ExceptionCast.cast(CommonCode.INVALID_PARAM); |
| | | } |
| | | if (!ValidateUtil.validateString(dispatchFile.getAttributionId()) || !ValidateUtil.validateString(dispatchFile.getDocId()) |
| | | || !ValidateUtil.validateString(dispatchFile.getFileId()) || !ValidateUtil.validateString(dispatchFile.getAttributionType())) { |
| | | ExceptionCast.cast(CommonCode.INVALID_PARAM); |
| | | } |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | String userId = user.getId(); |
| | | if (!ValidateUtil.validateString(userId)) { |
| | | ExceptionCast.cast(UcenterCode.UCENTER_ACCOUNT_NOT_EXIST); |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | //è·åæä»¶ä¿¡æ¯ |
| | | private DocInfo getDocInfo(DispatchFile dispatchFile) { |
| | | DocInfo docInfo = docInfoService.getByDocAttrAndDocId(dispatchFile.getDocId(), |
| | | Integer.parseInt(dispatchFile.getAttributionType()), dispatchFile.getAttributionId()); |
| | | if (docInfo == null || docInfo.getDocStatus() == 3) { |
| | | ExceptionCast.cast(ActivitiCode.ACT_DOC_ERROR); |
| | | } |
| | | return docInfo; |
| | | } |
| | | |
| | | |
| | | private PermissionStreamNew getPermissionStreams(DispatchFile dispatchFile) { |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | DeviceType deviceType = deviceTypeService.getById(dispatchFile.getAttributionId()); |
| | | String attributionId = deviceType != null ? deviceType.getAttributionId() : dispatchFile.getAttributionId(); |
| | | |
| | | PermissionStreamNew permissionStreams; |
| | | if (dispatchFile.getAttributionType().equals("5")) { |
| | | // å·¥åº |
| | | permissionStreams = handleProcess(dispatchFile, attributionId, user); |
| | | } else { |
| | | // å·¥æ¥ |
| | | permissionStreams = handleWorkStep(dispatchFile, attributionId, user); |
| | | } |
| | | if (permissionStreams == null) { |
| | | ExceptionCast.cast(ActivitiCode.ACT_NODE_DEPART_NONE); |
| | | } |
| | | return permissionStreams; |
| | | } |
| | | |
| | | private PermissionStreamNew handleProcess(DispatchFile dispatchFile, String attributionId, LoginUser user) { |
| | | ProcessStream processStream = processStreamService.getById(attributionId); |
| | | if (processStream == null) { |
| | | ExceptionCast.cast(CommonCode.INVALID_PARAM); |
| | | } |
| | | dispatchFile.setProductId(processStream.getProductId()); |
| | | dispatchFile.setComponentId(processStream.getComponentId()); |
| | | dispatchFile.setPartsId(processStream.getPartsId()); |
| | | dispatchFile.setPsvId(processStream.getPsvId()); |
| | | dispatchFile.setProcessId(processStream.getProcessId()); |
| | | if (deviceTypeService.getById(dispatchFile.getAttributionId()) != null) { |
| | | dispatchFile.setDeviceTypeId(deviceTypeService.getById(dispatchFile.getAttributionId()).getId()); |
| | | } |
| | | return permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndUserId(processStream.getProcessId(), user.getId(), "5"); |
| | | } |
| | | |
| | | private PermissionStreamNew handleWorkStep(DispatchFile dispatchFile, String attributionId, LoginUser user) { |
| | | WorkStep workStep = workStepService.getById(attributionId); |
| | | if (workStep == null) { |
| | | ExceptionCast.cast(CommonCode.INVALID_PARAM); |
| | | } |
| | | dispatchFile.setProductId(workStep.getProductId()); |
| | | dispatchFile.setComponentId(workStep.getComponentId()); |
| | | dispatchFile.setPartsId(workStep.getPartsId()); |
| | | dispatchFile.setPsvId(workStep.getPsvId()); |
| | | dispatchFile.setProcessId(workStep.getProcessId()); |
| | | dispatchFile.setStepId(workStep.getId()); |
| | | if (deviceTypeService.getById(dispatchFile.getAttributionId()) != null) { |
| | | dispatchFile.setDeviceTypeId(deviceTypeService.getById(dispatchFile.getAttributionId()).getId()); |
| | | } |
| | | return permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndUserId(workStep.getId(), user.getId(), "6"); |
| | | } |
| | | |
| | | @Override |
| | | public void afterFlowHandle(FlowMyBusiness business) { |
| | | business.getTaskNameId();//æ¥ä¸æ¥å®¡æ¹çèç¹ |
| | | business.getValues();//åç«¯ä¼ è¿æ¥çåæ° |
| | | business.getActStatus(); |
| | | } |
| | | |
| | | @Override |
| | | public Object getBusinessDataById(String dataId) { |
| | | return this.getById(dataId); |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> flowValuesOfTask(String taskNameId, Map<String, Object> values) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public List<String> flowCandidateUsernamesOfTask(String taskNameId, Map<String, Object> values) { |
| | | String dataId = values.get("dataId").toString(); |
| | | FlowMyBusiness flowMyBusiness=flowMyBusinessService.list(new QueryWrapper<FlowMyBusiness>().eq("data_id",dataId)).get(0); |
| | | return Lists.newArrayList(flowMyBusiness.getCreateBy()); |
| | | } |
| | | } |
| | |
| | | package org.jeecg.modules.dncFlow.vo; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | import org.jeecg.modules.flowable.domain.vo.FlowTaskVo; |
| | | |
| | | /** |
| | | * <p>æµç¨ä»»å¡<p> |
| | | * |
| | | */ |
| | | @Data |
| | | @ApiModel("工使µä»»å¡ç¸å
³--请æ±åæ°") |
| | | public class AssignFlowTaskVo { |
| | | |
| | | @ApiModelProperty("æ°æ®Id") |
| | | private String dataId; |
| | | @ApiModelProperty("ä»»å¡Id") |
| | | private String taskId; |
| | | |
| | | @ApiModelProperty("ç¨æ·Id") |
| | | private String userId; |
| | | |
| | | @ApiModelProperty("任塿è§") |
| | | private String comment; |
| | | |
| | | @ApiModelProperty("æµç¨å®ä¾Id") |
| | | private String instanceId; |
| | | |
| | | @ApiModelProperty("èç¹") |
| | | private String targetKey; |
| | | |
| | | @ApiModelProperty("æµç¨åéä¿¡æ¯") |
| | | private Map<String, Object> values; |
| | | |
| | | @ApiModelProperty("审æ¹äºº") |
| | | private String assignee; |
| | | |
| | | @ApiModelProperty("åé人") |
| | | private List<String> candidateUsers; |
| | | |
| | | @ApiModelProperty("审æ¹ç»") |
| | | private List<String> candidateGroups; |
| | | @ApiModel("ææ´¾è®¾å¤å·¥ä½æµä»»å¡ç¸å
³--请æ±åæ°") |
| | | public class AssignFlowTaskVo extends FlowTaskVo { |
| | | |
| | | private String xiugaiId; |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.dncFlow.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | import org.jeecg.modules.flowable.domain.vo.FlowTaskVo; |
| | | @Data |
| | | @ApiModel("NCç¾æ´¾å·¥ä½æµä»»å¡ç¸å
³--请æ±åæ°") |
| | | public class DispatchFileFlowTaskVo extends FlowTaskVo { |
| | | |
| | | /**æ ¡å¯¹ç±»å |
| | | * 1:ç´æ¥å®å |
| | | * 2:æ ¡å¯¹éè¿ |
| | | * 3:æ ¡å¯¹ä¸éè¿ |
| | | */ |
| | | private String proofreadStatus; |
| | | |
| | | /** |
| | | * æ¹åç±»å |
| | | * true:æ¹åéè¿ |
| | | * false:æ¹åä¸éè¿ |
| | | */ |
| | | private Boolean ratify ; |
| | | |
| | | /** |
| | | * è¯åç±»å |
| | | * true:è¯åéè¿ |
| | | * false:è¯åä¸éè¿ |
| | | */ |
| | | private Boolean cut; |
| | | |
| | | /** |
| | | * å®åç±»å |
| | | * true:å®åéè¿ |
| | | * false:å®åä¸éè¿ |
| | | */ |
| | | private Boolean stereotype; |
| | | } |
| | |
| | | private transient String flowName; |
| | | |
| | | /**æµç¨å¼å§æ¶é´*/ |
| | | private transient String startTime; |
| | | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private transient Date startTime; |
| | | |
| | | /**æµç¨ç»ææ¶é´*/ |
| | | private transient String endTime; |
| | | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private transient Date endTime; |
| | | |
| | | /**å½åç¨æ·*/ |
| | | private transient String currentUser; |
| | | |
| | | @ApiModelProperty(value = "å驱èç¹") |
| | | private transient String preNode; |
| | | |
| | | /**å¤çæ¶é¿ï¼åéï¼*/ |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "å¤çæ¶é¿ï¼åéï¼") |
| | | private transient String duration; |
| | | |
| | | } |
| | |
| | | <mapper namespace="org.jeecg.modules.flowable.apithird.business.mapper.FlowMyBusinessMapper"> |
| | | <select id="PageList" resultType="org.jeecg.modules.flowable.apithird.business.dto.FlowMyBusinessDto"> |
| | | SELECT |
| | | flow_my_business.*, |
| | | ACT_HI_PROCINST.START_TIME_ as start_time, |
| | | ACT_HI_PROCINST.END_TIME_ as end_time, |
| | | ACT_RE_PROCDEF.NAME_ as flowName, |
| | | ACT_RE_PROCDEF.CATEGORY_ as category |
| | | flow_my_business.id, |
| | | flow_my_business.title, |
| | | flow_my_business.proposer, |
| | | flow_my_business.task_name, |
| | | flow_my_business.task_id, |
| | | ACT_RU_TASK.ASSIGNEE_ as todoUsers, |
| | | flow_my_business.done_Users, |
| | | ACT_HI_PROCINST.START_TIME_ AS start_time, |
| | | ACT_HI_PROCINST.END_TIME_ AS end_time, |
| | | ACT_RE_PROCDEF.NAME_ AS flowName, |
| | | ACT_RE_PROCDEF.CATEGORY_ AS category |
| | | FROM |
| | | flow_my_business |
| | | LEFT JOIN ACT_HI_PROCINST ON flow_my_business.process_instance_id = ACT_HI_PROCINST.ID_ |
| | | LEFT JOIN ACT_RE_PROCDEF ON flow_my_business.process_definition_id = ACT_RE_PROCDEF.ID_ |
| | | where |
| | | left join ACT_RU_TASK on flow_my_business.task_id = ACT_RU_TASK.ID_ |
| | | WHERE |
| | | 1 = 1 |
| | | <if test="flowMyBusinessDto.category != null and flowMyBusinessDto.category != ''"> |
| | | and ACT_RE_PROCDEF.CATEGORY_ = #{flowMyBusinessDto.category} |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.flowable.engine.HistoryService; |
| | | import org.flowable.engine.history.HistoricActivityInstance; |
| | | import org.jeecg.modules.flowable.apithird.business.dto.FlowMyBusinessDto; |
| | | import org.jeecg.modules.flowable.apithird.business.entity.FlowMyBusiness; |
| | | import org.jeecg.modules.flowable.apithird.business.mapper.FlowMyBusinessMapper; |
| | | import org.jeecg.modules.flowable.apithird.business.service.IFlowMyBusinessService; |
| | | import org.jeecg.modules.flowable.domain.dto.FlowTaskDto; |
| | | import org.jeecg.modules.flowable.util.TimeUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Isolation; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: æµç¨ä¸å¡æ©å±è¡¨ |
| | |
| | | @Autowired |
| | | private FlowMyBusinessMapper flowMyBusinessMapper; |
| | | |
| | | @Autowired |
| | | private HistoryService historyService; |
| | | |
| | | public HistoricActivityInstance getPreviousNode(String taskId) { |
| | | // è·åå½åä»»å¡çæ§è¡å®ä¾ ID |
| | | String executionId = historyService.createHistoricTaskInstanceQuery() |
| | | .taskId(taskId) |
| | | .singleResult() |
| | | .getExecutionId(); |
| | | |
| | | // æ¥è¯¢å岿´»å¨å®ä¾ |
| | | List<HistoricActivityInstance> historicActivityInstances = historyService.createHistoricActivityInstanceQuery() |
| | | .executionId(executionId) |
| | | .activityType("userTask") |
| | | .finished() |
| | | .orderByHistoricActivityInstanceEndTime() |
| | | .desc() |
| | | .list(); |
| | | |
| | | // å第ä¸ä¸ªç»æï¼å³ä¸ä¸çº§èç¹ |
| | | if (!historicActivityInstances.isEmpty()) { |
| | | return historicActivityInstances.get(0); |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | @Transactional(isolation = Isolation.READ_COMMITTED) // éä½éç¦»çº§å« |
| | | public FlowMyBusiness getByDataId(String dataId) { |
| | | LambdaQueryWrapper<FlowMyBusiness> flowMyBusinessLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | flowMyBusinessLambdaQueryWrapper.eq(FlowMyBusiness::getDataId,dataId) |
| | |
| | | * @return |
| | | */ |
| | | public IPage<FlowMyBusinessDto> getPageList(Page page, FlowMyBusinessDto flowMyBusinessDto){ |
| | | return flowMyBusinessMapper.PageList(page,flowMyBusinessDto); |
| | | IPage<FlowMyBusinessDto> flowMyBusinessDtoIPage =flowMyBusinessMapper.PageList(page,flowMyBusinessDto); |
| | | flowMyBusinessDtoIPage.getRecords().forEach(item -> { |
| | | if (!("").equals(item.getTaskId())&&item.getTaskId()!=null){ |
| | | HistoricActivityInstance historicActivityInstance = getPreviousNode(item.getTaskId()); |
| | | if (historicActivityInstance != null){ |
| | | item.setPreNode(historicActivityInstance.getActivityName()); |
| | | } |
| | | } |
| | | if (item.getDoneUsers() == null){ |
| | | item.setDoneUsers(""); |
| | | }else { |
| | | //å»é¤[] |
| | | item.setDoneUsers(item.getDoneUsers().replaceAll("\\[", "").replaceAll("\\]", "")); |
| | | item.setDoneUsers(item.getDoneUsers().replaceAll("\"", "")); |
| | | } |
| | | //计ç®å¤çæ¶é¿ |
| | | Date kssj=item.getStartTime(); |
| | | Date jssj; |
| | | if (item.getEndTime() != null){ |
| | | jssj=item.getEndTime(); |
| | | }else { |
| | | jssj=new Date(); |
| | | } |
| | | item.setDuration(TimeUtil.howLong(kssj, jssj,2)); |
| | | |
| | | }); |
| | | return flowMyBusinessDtoIPage; |
| | | } |
| | | } |
ÎļþÃû´Ó lxzn-module-dnc/src/main/java/org/jeecg/modules/dncFlow/controller/AssignFileStreamFlowController.java ÐÞ¸Ä |
| | |
| | | package org.jeecg.modules.dncFlow.controller; |
| | | package org.jeecg.modules.flowable.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.flowable.bpmn.model.BpmnModel; |
| | | import org.flowable.engine.*; |
| | | import org.flowable.engine.HistoryService; |
| | | import org.flowable.engine.ProcessEngine; |
| | | import org.flowable.engine.ProcessEngineConfiguration; |
| | | import org.flowable.engine.RepositoryService; |
| | | import org.flowable.engine.history.HistoricActivityInstance; |
| | | import org.flowable.image.ProcessDiagramGenerator; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.dncFlow.entity.WorkTaskData; |
| | | import org.jeecg.modules.dncFlow.entity.WorkTaskDataVo; |
| | | import org.jeecg.modules.dncFlow.service.IAssignFileStreamService; |
| | | import org.jeecg.modules.dncFlow.service.IHisWorkTaskService; |
| | | import org.jeecg.modules.dncFlow.service.IWorkTaskService; |
| | | import org.jeecg.modules.dncFlow.service.IWorkTaskServiceVo; |
| | | import org.jeecg.modules.dncFlow.vo.FlowMy; |
| | | import org.jeecg.modules.flowable.apithird.business.dto.FlowMyBusinessDto; |
| | | import org.jeecg.modules.flowable.apithird.business.service.impl.FlowMyBusinessServiceImpl; |
| | | import org.jeecg.modules.flowable.domain.dto.FlowTaskDto; |
| | | import org.jeecg.modules.flowable.domain.vo.FlowMy; |
| | | import org.jeecg.modules.flowable.domain.vo.WorkTaskDataVo; |
| | | import org.jeecg.modules.flowable.service.IFlowTaskService; |
| | | import org.jeecg.modules.flowable.service.IHisWorkTaskService; |
| | | import org.jeecg.modules.flowable.service.IWorkTaskServiceVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @RequestMapping("/nc/assign/flow") |
| | | @RequestMapping("assign/flow") |
| | | @Slf4j |
| | | public class AssignFileStreamFlowController { |
| | | public class AssignStreamFlowController { |
| | | @Autowired |
| | | FlowMyBusinessServiceImpl flowMyBusinessService; |
| | | @Autowired |
| | | IWorkTaskService workTaskService; |
| | | @Autowired |
| | | IFlowTaskService flowTaskService; |
| | | @Autowired |
| | |
| | | @Autowired |
| | | IHisWorkTaskService hisWorkTaskService; |
| | | @Autowired |
| | | private TaskService taskService; |
| | | @Autowired |
| | | private RepositoryService repositoryService; |
| | | @Autowired |
| | | private HistoryService historyService; |
| | | @Autowired |
| | | private ProcessEngine processEngine; |
| | | @Autowired |
| | | private IAssignFileStreamService assignFileStreamService; |
| | | |
| | | @ApiOperation(value = "è·åæ»å°è´¦", response = FlowTaskDto.class) |
| | | @GetMapping(value = "/list") |
| | | public Result<IPage<FlowMyBusinessDto>> queryPageList(FlowMyBusinessDto flowMyBusinessDto, |
| | | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
| | |
| | | HttpServletRequest req) { |
| | | Page page = new Page(pageNo, pageSize); |
| | | IPage<FlowMyBusinessDto> pageList = flowMyBusinessService.getPageList(page, flowMyBusinessDto); |
| | | pageList.getRecords().forEach(item -> { |
| | | if (item.getTodoUsers() == null){ |
| | | item.setTodoUsers(""); |
| | | }else{ |
| | | //å»é¤[] |
| | | item.setTodoUsers(item.getTodoUsers().replaceAll("\\[", "").replaceAll("\\]", "")); |
| | | item.setTodoUsers(item.getTodoUsers().replaceAll("\"", "")); |
| | | } |
| | | if (item.getDoneUsers() == null){ |
| | | item.setDoneUsers(""); |
| | | }else { |
| | | //å»é¤[] |
| | | item.setDoneUsers(item.getDoneUsers().replaceAll("\\[", "").replaceAll("\\]", "")); |
| | | item.setDoneUsers(item.getDoneUsers().replaceAll("\"", "")); |
| | | } |
| | | }); |
| | | return Result.OK(pageList); |
| | | } |
| | | /* |
| | | * è·åææä»»å¡å表 |
| | | * */ |
| | | @GetMapping(value = "/workTasklist") |
| | | public Result<IPage<WorkTaskData>> queryTaskPageList(WorkTaskData workTaskData, |
| | | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
| | | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | List<WorkTaskData> list = workTaskService.queryAllworkTask(); |
| | | IPage<WorkTaskData> pageList = new Page<>(pageNo, pageSize, list.size()); |
| | | pageList.setRecords(list); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | @ApiOperation(value = "è·åå¾
åå表", response = FlowTaskDto.class) |
| | | @GetMapping(value = "/todoList") |
| | | public Result todoList(@ApiParam(value = "å½å页ç ", required = true) @RequestParam (name="pageNum", defaultValue="1") Integer pageNum, |
| | |
| | | |
| | | @ApiOperation(value = "è·å工使µåå²ä»»å¡", response = FlowTaskDto.class) |
| | | @GetMapping(value = "/queryHisTaskList") |
| | | public Result<?> queryHisTaskList(@RequestParam(name = "drapprovedataId") String drapprovedataId) { |
| | | return Result.OK(hisWorkTaskService.queryHisTaskList(drapprovedataId)); |
| | | public Result<?> queryHisTaskList(@RequestParam(name = "procInstId") String procInstId) { |
| | | return Result.OK(hisWorkTaskService.queryHisTaskByProcInstId(procInstId)); |
| | | } |
| | | |
| | | @ApiOperation(value = "审æ¹ä»»å¡-æ¥çæµç¨å¾") |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.flowable.domain.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 工使µåå²è®°å½ï¼éç¨ï¼ |
| | | * |
| | | */ |
| | | @Data |
| | | @ApiModel("工使µ--工使µåå²è®°å½ï¼éç¨ï¼") |
| | | public class FlowHistoricalVo { |
| | | /** |
| | | * æµç¨å®ä¾ID |
| | | */ |
| | | private String procInstId; |
| | | /** |
| | | * ä¸å¡é® |
| | | */ |
| | | private String businessKey; |
| | | /** |
| | | * æµç¨å¼å§æ¶é´ |
| | | */ |
| | | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date startTime; |
| | | /** |
| | | * æµç¨ç»ææ¶é´ |
| | | */ |
| | | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date endTime; |
| | | /** |
| | | * èç¹åç§° |
| | | */ |
| | | private String actName; |
| | | /** |
| | | * èç¹ç±»å |
| | | */ |
| | | private String actType; |
| | | /** |
| | | * èç¹å¼å§æ¶é´ |
| | | */ |
| | | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date actStartTime; |
| | | /** |
| | | * èç¹ç»ææ¶é´ |
| | | */ |
| | | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date actEndTime; |
| | | /** |
| | | * ä»»å¡åç§° |
| | | */ |
| | | private String taskName; |
| | | /** |
| | | * å¤ç人 |
| | | */ |
| | | private String assignee; |
| | | /** |
| | | * ä»»å¡èæ¶ |
| | | */ |
| | | private String duration; |
| | | /** |
| | | * ä»»å¡æè¿° |
| | | */ |
| | | private String description; |
| | | } |
ÎļþÃû´Ó lxzn-module-dnc/src/main/java/org/jeecg/modules/dncFlow/vo/FlowMy.java ÐÞ¸Ä |
| | |
| | | package org.jeecg.modules.dncFlow.vo; |
| | | package org.jeecg.modules.flowable.domain.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | |
| | | @ApiModelProperty("审æ¹ç»") |
| | | private List<String> candidateGroups; |
| | | |
| | | private String xiugaiId; |
| | | |
| | | private Integer status; |
| | | } |
ÎļþÃû´Ó lxzn-module-dnc/src/main/java/org/jeecg/modules/dncFlow/entity/HisWorkTask.java ÐÞ¸Ä |
| | |
| | | package org.jeecg.modules.dncFlow.entity; |
| | | package org.jeecg.modules.flowable.domain.vo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
ÎļþÃû´Ó lxzn-module-dnc/src/main/java/org/jeecg/modules/dncFlow/entity/WorkTaskData.java ÐÞ¸Ä |
| | |
| | | package org.jeecg.modules.dncFlow.entity; |
| | | package org.jeecg.modules.flowable.domain.vo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.flowable.domain.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.jeecg.common.aspect.annotation.Dict; |
| | | import org.jeecgframework.poi.excel.annotation.Excel; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Description:工使µä»»å¡æ°æ® |
| | | */ |
| | | @Data |
| | | @ApiModel(value="act_ru_task", description="æçå¾
å") |
| | | public class WorkTaskDataVo implements Serializable { |
| | | /**主é®*/ |
| | | // @TableField("id_") |
| | | private String id; |
| | | /**çæ¬å·ï¼ç¨äºä¹è§éæ§å¶å¹¶åæ´æ°*/ |
| | | // @TableField("rev_") |
| | | private int rev; |
| | | /**æ§è¡å®ä¾IDï¼ä¸æ§è¡å®ä¾è¡¨ä¸çIDåæ®µå
³è*/ |
| | | // @TableField("execution_id_") |
| | | private String executionId; |
| | | /**æµç¨å®ä¾IDï¼ä¸æµç¨å®ä¾è¡¨ä¸çIDåæ®µå
³è*/ |
| | | // @TableField("proc_inst_id_") |
| | | private String procInstId; |
| | | /**æµç¨å®ä¹IDï¼ä¸æµç¨å®ä¹è¡¨ä¸çIDåæ®µå
³è*/ |
| | | // @TableField("proc_def_id_") |
| | | private String procDefId; |
| | | /**ä»»å¡åç§°*/ |
| | | // @TableField("name_") |
| | | private String name; |
| | | /**ä»»å¡å®ä¹Keyï¼ä¸æµç¨å®ä¹è¡¨ä¸çKEYåæ®µå
³è*/ |
| | | // @TableField("task_def_key_") |
| | | private String taskDefKey; |
| | | /**ä»»å¡çåç人ï¼å³å®é
æ§è¡ä»»å¡çç¨æ·*/ |
| | | // @TableField("assignee_") |
| | | @Dict(dictTable = "sys_user", dicCode = "username", dicText = "realname") |
| | | private String assignee; |
| | | /**ä»»å¡çä¼å
级*/ |
| | | // @TableField("priority_") |
| | | private int priority; |
| | | /** ä»»å¡å建æ¶é´*/ |
| | | // @TableField("create_time_") |
| | | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | /** ä»»å¡çæåç¶æï¼ç¨äºæ§å¶ä»»å¡çæå忢å¤*/ |
| | | // @TableField("suspension_state_") |
| | | private int suspensionState; |
| | | /** æµç¨åé*/ |
| | | private Map<String,Object> variables; |
| | | // @TableField("act_status") |
| | | @ApiModelProperty(value = "æµç¨ç¶æè¯´æï¼æï¼å¯å¨ æ¤å 驳å 审æ¹ä¸ 审æ¹éè¿ å®¡æ¹å¼å¸¸") |
| | | private String actStatus; |
| | | // @TableField("title") |
| | | @ApiModelProperty(value = "æµç¨ä¸å¡ç®è¦æè¿°") |
| | | private String title; |
| | | // @TableField("data_id") |
| | | @ApiModelProperty(value = "ä¸å¡è¡¨idï¼ç论å¯ä¸") |
| | | private String dataId; |
| | | @ApiModelProperty(value = "å驱èç¹") |
| | | private String preNode; |
| | | |
| | | @ApiModelProperty(value = "æµç¨åç§°") |
| | | private transient String flowName; |
| | | |
| | | @ApiModelProperty(value = "æµç¨ç±»å") |
| | | @Dict(dicCode = "flow_type") |
| | | private transient String category; |
| | | |
| | | /**æµç¨å®ä¹key ä¸ä¸ªkey伿å¤ä¸ªçæ¬çid*/ |
| | | @Excel(name = "æµç¨å®ä¹key ä¸ä¸ªkey伿å¤ä¸ªçæ¬çid", width = 15) |
| | | @ApiModelProperty(value = "æµç¨å®ä¹key ä¸ä¸ªkey伿å¤ä¸ªçæ¬çid") |
| | | private String processDefinitionKey; |
| | | /**æµç¨å®ä¹id ä¸ä¸ªæµç¨å®ä¹å¯ä¸*/ |
| | | @Excel(name = "æµç¨å®ä¹id ä¸ä¸ªæµç¨å®ä¹å¯ä¸", width = 15) |
| | | @ApiModelProperty(value = "æµç¨å®ä¹id ä¸ä¸ªæµç¨å®ä¹å¯ä¸") |
| | | private String processDefinitionId; |
| | | /**æµç¨ä¸å¡å®ä¾id ä¸ä¸ªæµç¨ä¸å¡å¯ä¸ï¼æ¬è¡¨ä¸ä¹å¯ä¸*/ |
| | | @Excel(name = "æµç¨ä¸å¡å®ä¾id ä¸ä¸ªæµç¨ä¸å¡å¯ä¸ï¼æ¬è¡¨ä¸ä¹å¯ä¸", width = 15) |
| | | @ApiModelProperty(value = "æµç¨ä¸å¡å®ä¾id ä¸ä¸ªæµç¨ä¸å¡å¯ä¸ï¼æ¬è¡¨ä¸ä¹å¯ä¸") |
| | | private String processInstanceId; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.flowable.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.flowable.domain.vo.FlowHistoricalVo; |
| | | import org.jeecg.modules.flowable.domain.vo.HisWorkTask; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface IHisWorkTaskMapper extends BaseMapper<HisWorkTask> { |
| | | |
| | | List<HisWorkTask> queryHisTaskList(@Param("drapprovedataId") String drapprovedataId); |
| | | |
| | | /** |
| | | * éè¿æµç¨å®ä¾idæ¥è¯¢åå²ä»»å¡ã |
| | | * @param procInstId |
| | | * @return |
| | | */ |
| | | List<FlowHistoricalVo> queryHisTaskByProcInstId(@Param("procInstId") String procInstId); |
| | | |
| | | } |
ÎļþÃû´Ó lxzn-module-dnc/src/main/java/org/jeecg/modules/dncFlow/mapper/IWorkTaskMapper.java ÐÞ¸Ä |
| | |
| | | package org.jeecg.modules.dncFlow.mapper; |
| | | package org.jeecg.modules.flowable.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.jeecg.modules.dncFlow.entity.WorkTaskData; |
| | | import org.jeecg.modules.flowable.domain.vo.WorkTaskData; |
| | | |
| | | import java.util.List; |
| | | |
ÎļþÃû´Ó lxzn-module-dnc/src/main/java/org/jeecg/modules/dncFlow/mapper/IWorkTaskVoMapper.java ÐÞ¸Ä |
| | |
| | | package org.jeecg.modules.dncFlow.mapper; |
| | | package org.jeecg.modules.flowable.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.dncFlow.entity.WorkTaskDataVo; |
| | | import org.jeecg.modules.dncFlow.vo.FlowMy; |
| | | |
| | | import java.util.List; |
| | | import org.jeecg.modules.flowable.domain.vo.FlowMy; |
| | | import org.jeecg.modules.flowable.domain.vo.WorkTaskDataVo; |
| | | |
| | | public interface IWorkTaskVoMapper extends BaseMapper<WorkTaskDataVo> { |
| | | |
| | | IPage<WorkTaskDataVo> taskBySelf(@Param("flowMy") FlowMy flowMy, @Param("page") Page page); |
| | | List<WorkTaskDataVo> allList(@Param("userId") String userId); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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="org.jeecg.modules.flowable.mapper.IHisWorkTaskMapper"> |
| | | <select id="queryHisTaskList" resultType="org.jeecg.modules.flowable.domain.vo.HisWorkTask"> |
| | | SELECT |
| | | fb.id AS id, |
| | | aht.NAME_ AS name, |
| | | aht.DESCRIPTION_ AS cause, |
| | | su.realname AS assignee, |
| | | aht.START_TIME_ AS startTime, |
| | | aht.END_TIME_ AS endTime, |
| | | assign.status as status |
| | | FROM |
| | | flow_my_business fb, |
| | | act_hi_taskinst aht, |
| | | NC_ASSIGN_FILE_STREAM assign, |
| | | sys_user su |
| | | WHERE |
| | | fb.data_id= #{drapprovedataId} |
| | | AND fb.process_instance_id= aht.PROC_INST_ID_ |
| | | AND su.username= aht.ASSIGNEE_ |
| | | AND fb.data_id= assign.STREAM_ID |
| | | ORDER BY |
| | | aht.START_TIME_ ASC |
| | | </select> |
| | | <select id="queryHisTaskByProcInstId" resultType="org.jeecg.modules.flowable.domain.vo.FlowHistoricalVo"> |
| | | SELECT |
| | | p.PROC_INST_ID_ AS procInstId, |
| | | p.BUSINESS_KEY_ AS businessKey, |
| | | p.START_TIME_ AS startTime, |
| | | p.END_TIME_ AS endTime, |
| | | a.ACT_NAME_ AS actName, |
| | | a.ACT_TYPE_ AS actType, |
| | | a.START_TIME_ AS actStartTime, |
| | | a.END_TIME_ AS actEndTime, |
| | | c.NAME_ AS taskName, |
| | | c.ASSIGNEE_ AS assignee, |
| | | CASE |
| | | WHEN c.DURATION_ IS NOT NULL THEN |
| | | CASE |
| | | WHEN FLOOR(c.DURATION_ / 1000.0) = 0 THEN NULL |
| | | ELSE FLOOR(c.DURATION_ / 1000.0) |
| | | END |
| | | ELSE NULL |
| | | END AS duration, |
| | | c.DESCRIPTION_ AS description |
| | | FROM |
| | | act_hi_procinst p |
| | | LEFT JOIN act_hi_actinst a ON p.PROC_INST_ID_ = a.PROC_INST_ID_ |
| | | LEFT JOIN ACT_HI_TASKINST c ON a.TASK_ID_ = c.ID_ |
| | | WHERE |
| | | p.PROC_INST_ID_ = #{procInstId} |
| | | AND a.ACT_NAME_ IS NOT NULL |
| | | ORDER BY |
| | | COALESCE(a.END_TIME_, '9999-12-31') ASC; |
| | | </select> |
| | | </mapper> |
ÎļþÃû´Ó lxzn-module-dnc/src/main/java/org/jeecg/modules/dncFlow/mapper/xml/WorkTaskMapper.xml ÐÞ¸Ä |
| | |
| | | <?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="org.jeecg.modules.dncFlow.mapper.IWorkTaskMapper"> |
| | | <select id="queryAllworkTask" resultType="org.jeecg.modules.dncFlow.entity.WorkTaskData"> |
| | | <mapper namespace="org.jeecg.modules.flowable.mapper.IWorkTaskMapper"> |
| | | <select id="queryAllworkTask" resultType="org.jeecg.modules.flowable.domain.vo.WorkTaskData"> |
| | | select id_,rev_,execution_id_,proc_inst_id_,proc_def_id_,name_,task_def_key_,assignee_,priority_,create_time_,suspension_state_,task_def_id_,scope_id_,sub_scope_id_,scope_type_,scope_definition_id_,propagated_stage_inst_id_,parent_task_id_,description_,owner_,delegation_,due_date_,category_,form_key_,claim_time_,is_count_enabled_,var_count_,id_link_count_,sub_task_count_ |
| | | from act_ru_task ORDER BY create_time_ DESC |
| | | </select> |
ÎļþÃû´Ó lxzn-module-dnc/src/main/java/org/jeecg/modules/dncFlow/mapper/xml/WorkTaskVoMapper.xml ÐÞ¸Ä |
| | |
| | | <?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="org.jeecg.modules.dncFlow.mapper.IWorkTaskVoMapper"> |
| | | <select id="taskBySelf" resultType="org.jeecg.modules.dncFlow.entity.WorkTaskDataVo"> |
| | | <mapper namespace="org.jeecg.modules.flowable.mapper.IWorkTaskVoMapper"> |
| | | <select id="taskBySelf" resultType="org.jeecg.modules.flowable.domain.vo.WorkTaskDataVo"> |
| | | SELECT |
| | | atask.id_ AS id, |
| | | atask.rev_ AS rev, |
| | |
| | | atask.proc_def_id_ AS procDefId, |
| | | atask.name_ AS name, |
| | | atask.task_def_key_ as taskDefKey, |
| | | su.realname as assignee, |
| | | atask.priority_ AS priority, |
| | | atask.create_time_ AS createTime, |
| | | atask.suspension_state_ AS suspensionState, |
| | |
| | | pro.name_ as flowName, |
| | | pro.CATEGORY_ as category |
| | | FROM |
| | | act_ru_task AS atask, |
| | | flow_my_business AS fmb, |
| | | ACT_RE_PROCDEF AS pro, |
| | | sys_user AS su |
| | | act_ru_task AS atask |
| | | LEFT JOIN flow_my_business fmb on atask.id_ = fmb.task_id |
| | | LEFT JOIN ACT_RE_PROCDEF pro on atask.PROC_DEF_ID_ = pro.id_ |
| | | WHERE |
| | | atask.assignee_ = #{flowMy.username} |
| | | AND atask.id_ = fmb.task_id |
| | | AND atask.PROC_DEF_ID_ = pro.id_ |
| | | AND atask.assignee_ = su.username |
| | | <if test="flowMy.flowName!= null and flowMy.flowName!= ''"> |
| | | AND pro.name_ LIKE CONCAT('%',#{flowMy.flowName},'%') |
| | | </if> |
| | |
| | | </if> |
| | | ORDER BY |
| | | create_time_ DESC |
| | | </select> |
| | | <select id="allList" parameterType="String" resultType="org.jeecg.modules.dncFlow.entity.WorkTaskDataVo"> |
| | | select * from act_ru_task |
| | | </select> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.flowable.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.flowable.domain.vo.FlowHistoricalVo; |
| | | import org.jeecg.modules.flowable.domain.vo.HisWorkTask; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface IHisWorkTaskService extends IService<HisWorkTask> { |
| | | |
| | | List<HisWorkTask> queryHisTaskList(String drapprovedataId); |
| | | |
| | | /** |
| | | * éè¿æµç¨å®ä¾idæ¥è¯¢åå²ä»»å¡ã |
| | | * @param procInstId |
| | | * @return |
| | | */ |
| | | List<FlowHistoricalVo> queryHisTaskByProcInstId(@Param("procInstId") String procInstId); |
| | | } |
ÎļþÃû´Ó lxzn-module-dnc/src/main/java/org/jeecg/modules/dncFlow/service/IWorkTaskService.java ÐÞ¸Ä |
| | |
| | | package org.jeecg.modules.dncFlow.service; |
| | | package org.jeecg.modules.flowable.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.dncFlow.entity.WorkTaskData; |
| | | import org.jeecg.modules.flowable.domain.vo.WorkTaskData; |
| | | |
| | | import java.util.List; |
| | | |
ÎļþÃû´Ó lxzn-module-dnc/src/main/java/org/jeecg/modules/dncFlow/service/IWorkTaskServiceVo.java ÐÞ¸Ä |
| | |
| | | package org.jeecg.modules.dncFlow.service; |
| | | package org.jeecg.modules.flowable.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.dncFlow.entity.WorkTaskDataVo; |
| | | import org.jeecg.modules.dncFlow.vo.FlowMy; |
| | | import org.jeecg.modules.flowable.domain.vo.FlowMy; |
| | | import org.jeecg.modules.flowable.domain.vo.WorkTaskDataVo; |
| | | |
| | | public interface IWorkTaskServiceVo extends IService<WorkTaskDataVo> { |
| | | |
| | |
| | | import org.jeecg.modules.flowable.apithird.business.service.impl.FlowMyBusinessServiceImpl; |
| | | import org.jeecg.modules.flowable.apithird.common.constant.ProcessConstants; |
| | | import org.jeecg.modules.flowable.apithird.common.enums.FlowComment; |
| | | import org.jeecg.modules.flowable.apithird.entity.ActStatus; |
| | | import org.jeecg.modules.flowable.apithird.entity.SysUser; |
| | | import org.jeecg.modules.flowable.apithird.service.FlowCallBackServiceI; |
| | | import org.jeecg.modules.flowable.apithird.service.IFlowThirdService; |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public Result<?> startProcessInstanceByKey(String procDefKey, Map<String, Object> variables) { |
| | | ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery() |
| | | .processDefinitionKey(procDefKey) |
| | |
| | | ProcessInstance processInstance = runtimeService.startProcessInstanceById(procDefId, variables); |
| | | // ç»ç¬¬ä¸æ¥ç³è¯·äººèç¹è®¾ç½®ä»»å¡æ§è¡äººåæè§ |
| | | Task task = taskService.createTaskQuery().processInstanceId(processInstance.getProcessInstanceId()).active().singleResult(); |
| | | if (!sysUser.getUsername().equals(task.getAssignee())){ |
| | | return Result.error("å½åç¨æ·ä¸æ¯æµç¨å起人"); |
| | | } |
| | | if (Objects.nonNull(task)) { |
| | | taskService.addComment(task.getId(), processInstance.getProcessInstanceId(), FlowComment.NORMAL.getType(), sysUser.getRealname() + "åèµ·æµç¨ç³è¯·"); |
| | | taskService.addComment(task.getId(), processInstance.getProcessInstanceId(), FlowComment.NORMAL.getType(), variables.get("organization").toString()); |
| | | taskService.setAssignee(task.getId(), sysUser.getUsername()); |
| | | task.setDescription(variables.get("organization").toString()); |
| | | // æ´æ°ä»»å¡ |
| | | taskService.saveTask(task); |
| | | //taskService.complete(task.getId(), variables); |
| | | } |
| | | //设置ææç³è¯·äºº |
| | |
| | | |
| | | business.setProcessDefinitionId(procDefId) |
| | | .setProcessInstanceId(processInstance.getProcessInstanceId()) |
| | | .setActStatus(ActStatus.start) |
| | | //// .setActStatus(ActStatus.start) |
| | | .setProposer(sysUser.getUsername()) |
| | | .setTaskId(task2.getId()) |
| | | .setTaskName(nextTask.getName()) |
| | |
| | | // **没æä¸ä¸ä¸ªèç¹ï¼æµç¨å·²ç»ç»æäº |
| | | business.setProcessDefinitionId(procDefId) |
| | | .setProcessInstanceId(processInstance.getProcessInstanceId()) |
| | | .setActStatus(ActStatus.pass) |
| | | // .setActStatus(ActStatus.pass) |
| | | .setProposer(sysUser.getUsername()) |
| | | .setDoneUsers(doneUserList.toJSONString()) |
| | | ; |
| | |
| | | package org.jeecg.modules.flowable.service.impl; |
| | | |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | |
| | | import org.jeecg.common.util.SpringContextUtils; |
| | | import org.jeecg.modules.flowable.apithird.business.entity.FlowMyBusiness; |
| | | import org.jeecg.modules.flowable.apithird.business.service.impl.FlowMyBusinessServiceImpl; |
| | | import org.jeecg.modules.flowable.apithird.entity.ActStatus; |
| | | import org.jeecg.modules.flowable.apithird.common.exception.CustomException; |
| | | import org.jeecg.modules.flowable.apithird.entity.SysUser; |
| | | import org.jeecg.modules.flowable.apithird.service.FlowCallBackServiceI; |
| | | import org.jeecg.modules.flowable.apithird.service.IFlowThirdService; |
| | | import org.jeecg.modules.flowable.apithird.common.exception.CustomException; |
| | | import org.jeecg.modules.flowable.domain.vo.FlowTaskVo; |
| | | import org.jeecg.modules.flowable.factory.FlowServiceFactory; |
| | | import org.jeecg.modules.flowable.service.IFlowInstanceService; |
| | |
| | | doneUserList.add(sysUser.getUsername()); |
| | | } |
| | | business |
| | | .setActStatus(ActStatus.recall) |
| | | // .setActStatus(ActStatus.recall) |
| | | .setTaskId("") |
| | | .setTaskName("å·²æ¤å") |
| | | .setPriority("") |
| | |
| | | import org.jeecg.modules.flowable.apithird.common.constant.ProcessConstants; |
| | | import org.jeecg.modules.flowable.apithird.common.enums.FlowComment; |
| | | import org.jeecg.modules.flowable.apithird.common.exception.CustomException; |
| | | import org.jeecg.modules.flowable.apithird.entity.ActStatus; |
| | | import org.jeecg.modules.flowable.apithird.entity.SysUser; |
| | | import org.jeecg.modules.flowable.apithird.service.FlowCallBackServiceI; |
| | | import org.jeecg.modules.flowable.apithird.service.IFlowThirdService; |
| | |
| | | taskService.saveTask(task); |
| | | } |
| | | SysUser loginUser = iFlowThirdService.getLoginUser(); |
| | | //å¤æç¨æ·æ¯å¦ææé |
| | | if (!task.getAssignee().equals(loginUser.getUsername())){ |
| | | return Result.error("å½åç¨æ·æ æé"); |
| | | } |
| | | if (DelegationState.PENDING.equals(task.getDelegationState())) { |
| | | taskService.addComment(taskVo.getTaskId(), taskVo.getInstanceId(), FlowComment.DELEGATE.getType(), taskVo.getComment()); |
| | | //taskService.resolveTask(taskVo.getTaskId(), taskVo.getValues()); |
| | |
| | | System.out.println("taskVo.getTaskId()--->taskVo.getInstanceId()--->FlowComment.NORMAL.getType()--->taskVo.getComment()"+taskVo.getTaskId() + "---" + taskVo.getInstanceId() + "---" + FlowComment.NORMAL.getType() + "---"+taskVo.getComment() ); |
| | | taskService.addComment(taskVo.getTaskId(), taskVo.getInstanceId(), FlowComment.NORMAL.getType(), taskVo.getComment()); |
| | | taskService.setAssignee(taskVo.getTaskId(), loginUser.getUsername()); |
| | | //taskService.complete(taskVo.getTaskId(), taskVo.getValues()); |
| | | } |
| | | /*======================审æ¹ç»æ åè°ä»¥åå
³é®æ°æ®ä¿å======================*/ |
| | | //ä¸å¡æ°æ®id |
| | |
| | | |
| | | if (task2!=null && task.getTaskDefinitionKey().equals(task2.getTaskDefinitionKey())){ |
| | | // * å½åèç¹æ¯ä¼ç¾èç¹ï¼æ²¡æèµ°å® |
| | | business.setActStatus(ActStatus.doing) |
| | | .setTaskId(task2.getId()) |
| | | business.setTaskId(task2.getId()) |
| | | // .setActStatus(ActStatus.doing) |
| | | .setDoneUsers(doneUserList.toJSONString()) |
| | | ; |
| | | String todoUsersStr = business.getTodoUsers(); |
| | |
| | | // åç«¯ä¼ å
¥åé人 |
| | | collect_username = candidateUsers; |
| | | } |
| | | business.setActStatus(ActStatus.doing) |
| | | business |
| | | .setTaskId(task2.getId()) |
| | | // .setActStatus(ActStatus.doing) |
| | | .setTaskNameId(nextTask.getId()) |
| | | .setTaskName(nextTask.getName()) |
| | | .setPriority(nextTask.getPriority()) |
| | |
| | | |
| | | } else { |
| | | // **没æä¸ä¸ä¸ªèç¹ï¼æµç¨å·²ç»ç»æäº |
| | | business.setActStatus(ActStatus.pass) |
| | | business |
| | | .setDoneUsers(doneUserList.toJSONString()) |
| | | .setTodoUsers("") |
| | | .setTaskId("") |
| | |
| | | if (flowCallBackService!=null)flowCallBackService.afterFlowHandle(business); |
| | | return Result.OK(); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Result completeByDateId(FlowTaskVo flowTaskVo){ |
| | | return this.complete(flowTaskVo); |
| | | } |
| | | |
| | | @Override |
| | | public void taskRejectByDataId(FlowTaskVo flowTaskVo){ |
| | | FlowMyBusiness business = flowMyBusinessService.getByDataId(flowTaskVo.getDataId()); |
| | |
| | | if (!doneUserList.contains(loginUser.getUsername())){ |
| | | doneUserList.add(loginUser.getUsername()); |
| | | } |
| | | business.setActStatus(ActStatus.reject) |
| | | business |
| | | .setTaskId(task2.getId()) |
| | | // .setActStatus(ActStatus.reject) |
| | | .setTaskNameId(task2.getTaskDefinitionKey()) |
| | | .setTaskName(task2.getName()) |
| | | .setDoneUsers(doneUserList.toJSONString()) |
| | |
| | | //**跳转å°ç®æ èç¹ |
| | | List<Task> task2List = taskService.createTaskQuery().processInstanceId(business.getProcessInstanceId()).active().list(); |
| | | Task targetTask = task2List.get(0); |
| | | business.setActStatus(ActStatus.reject) |
| | | business |
| | | .setTaskId(targetTask.getId()) |
| | | // .setActStatus(ActStatus.reject) |
| | | .setTaskNameId(targetTask.getTaskDefinitionKey()) |
| | | .setTaskName(targetTask.getName()) |
| | | .setPriority(targetTask.getPriority()+"") |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.flowable.service.impl; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.flowable.domain.vo.FlowHistoricalVo; |
| | | import org.jeecg.modules.flowable.domain.vo.HisWorkTask; |
| | | import org.jeecg.modules.flowable.mapper.IHisWorkTaskMapper; |
| | | import org.jeecg.modules.flowable.service.IHisWorkTaskService; |
| | | import org.jeecg.modules.flowable.util.TimeUtil; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | @Service |
| | | |
| | | public class HisWorkTaskServiceImpl extends ServiceImpl<IHisWorkTaskMapper,HisWorkTask> implements IHisWorkTaskService { |
| | | @Override |
| | | public List<HisWorkTask> queryHisTaskList(String drapprovedataId) { |
| | | return baseMapper.queryHisTaskList(drapprovedataId); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * éè¿æµç¨å®ä¾idæ¥è¯¢åå²ä»»å¡ã |
| | | * @param procInstId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<FlowHistoricalVo> queryHisTaskByProcInstId(@Param("procInstId") String procInstId){ |
| | | List<FlowHistoricalVo> flowHistoricalVoList=baseMapper.queryHisTaskByProcInstId(procInstId); |
| | | flowHistoricalVoList.forEach(flowHistoricalVo->{ |
| | | //è®¡ç®æ¶é´ |
| | | if (StrUtil.isNotEmpty(flowHistoricalVo.getDuration())){ |
| | | flowHistoricalVo.setDuration(TimeUtil.howLongByMillis(Long.parseLong(flowHistoricalVo.getDuration()),2)); |
| | | } |
| | | }); |
| | | return flowHistoricalVoList; |
| | | } |
| | | } |
ÎļþÃû´Ó lxzn-module-dnc/src/main/java/org/jeecg/modules/dncFlow/service/impl/WorkTaskServiceImpl.java ÐÞ¸Ä |
| | |
| | | package org.jeecg.modules.dncFlow.service.impl; |
| | | package org.jeecg.modules.flowable.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.jeecg.modules.dncFlow.entity.WorkTaskData; |
| | | import org.jeecg.modules.dncFlow.mapper.IWorkTaskMapper; |
| | | import org.jeecg.modules.dncFlow.service.IWorkTaskService; |
| | | import org.jeecg.modules.flowable.domain.vo.WorkTaskData; |
| | | import org.jeecg.modules.flowable.mapper.IWorkTaskMapper; |
| | | import org.jeecg.modules.flowable.service.IWorkTaskService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.flowable.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.flowable.engine.history.HistoricActivityInstance; |
| | | import org.jeecg.modules.flowable.apithird.business.service.impl.FlowMyBusinessServiceImpl; |
| | | import org.jeecg.modules.flowable.domain.vo.FlowMy; |
| | | import org.jeecg.modules.flowable.domain.vo.WorkTaskDataVo; |
| | | import org.jeecg.modules.flowable.mapper.IWorkTaskVoMapper; |
| | | import org.jeecg.modules.flowable.service.IWorkTaskServiceVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class WorkTaskServiceImplVo extends ServiceImpl<IWorkTaskVoMapper, WorkTaskDataVo> implements IWorkTaskServiceVo { |
| | | @Autowired |
| | | FlowMyBusinessServiceImpl flowMyBusinessService; |
| | | @Override |
| | | public IPage<WorkTaskDataVo> toTaskBySelf(FlowMy flowMy, Page page) { |
| | | IPage<WorkTaskDataVo> workTaskDataVoIPage=baseMapper.taskBySelf(flowMy,page); |
| | | workTaskDataVoIPage.getRecords().forEach(workTaskDataVo -> { |
| | | HistoricActivityInstance historicActivityInstance=flowMyBusinessService.getPreviousNode(workTaskDataVo.getId()); |
| | | if (historicActivityInstance != null){ |
| | | workTaskDataVo.setPreNode(historicActivityInstance.getActivityName()); |
| | | workTaskDataVo.setAssignee(historicActivityInstance.getAssignee()); |
| | | } |
| | | }); |
| | | return workTaskDataVoIPage; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.flowable.util; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * æè¿°ï¼æ¶é´å·¥å
·ç±» |
| | | * |
| | | * @Date 2023/10/11 |
| | | */ |
| | | public class TimeUtil { |
| | | |
| | | /**ä¸å¤©*/ |
| | | public static final long day = 1000 * 60 * 60 * 24; |
| | | /**ä¸å°æ¶*/ |
| | | public static final long hour = 1000 * 60 * 60; |
| | | /**ä¸åé*/ |
| | | public static final long minute = 1000 * 60; |
| | | /**ä¸ç§*/ |
| | | public static final long second = 1000; |
| | | |
| | | /** |
| | | * 计ç®ä¸¤ä¸ªæ¶é´å·®ï¼ä»¥æ¶åç§çæ¹å¼å±ç°ã |
| | | * @param start |
| | | * @param end |
| | | * @param type 1ä¿çæ¯«ç§ 2ä¿çç§ 3ä¿çåé 4ä¿çå°æ¶ 5ä¿ç天 |
| | | * @return |
| | | */ |
| | | public static String howLong(Date start, Date end, int type){ |
| | | if(start == null || end == null) |
| | | return ""; |
| | | return howLong(start.getTime(), end.getTime(), type); |
| | | } |
| | | |
| | | /** |
| | | * 计ç®ä¸¤ä¸ªæ¶é´å·®ï¼ä»¥æ¶åç§çæ¹å¼å±ç°ã |
| | | * @param start |
| | | * @param end |
| | | * @return |
| | | */ |
| | | public static String howLong(Date start, Date end){ |
| | | if(start == null || end == null) |
| | | return ""; |
| | | return howLong(start.getTime(), end.getTime(), 1); |
| | | } |
| | | |
| | | /** |
| | | * 计ç®ç»å®æ¶é´è·ç¦»ç°å¨çæ¶é´å·®ï¼ä»¥æ¶åç§çæ¹å¼å±ç°ã |
| | | * @param startTime |
| | | * @return |
| | | */ |
| | | public static String howLong(long startTime){ |
| | | return howLong(startTime, System.currentTimeMillis(),1); |
| | | } |
| | | |
| | | /** |
| | | * 计ç®èæ¶æ¶é¿ |
| | | * @param startTime èµ·ç¹æ¶é´ï¼æ¯«ç§æ° |
| | | * @return |
| | | */ |
| | | public static String howLong(long startTime, long endTime ,int type) { |
| | | long millis = endTime - startTime; |
| | | return howLongByMillis(millis, type); |
| | | } |
| | | |
| | | /** |
| | | * 计ç®èæ¶æ¶é¿ |
| | | * @param millis |
| | | * @param type |
| | | * @return |
| | | */ |
| | | public static String howLongByMillis(long millis, int type) { |
| | | if(millis <= 0) return "å°äº1ç§"; |
| | | |
| | | if(type > 5) return "æ ¼å¼é误"; |
| | | |
| | | StringBuilder sb = new StringBuilder(); |
| | | |
| | | //天 |
| | | if(millis >= day && type <=5){ |
| | | long days = millis / day; |
| | | sb.append(days).append("天"); |
| | | millis -= days * day; |
| | | } |
| | | // å°æ¶è®¡ |
| | | if(millis >= hour && type <=4){ |
| | | long hours = millis / hour; |
| | | sb.append(hours).append("å°æ¶"); |
| | | millis -= hours * hour; |
| | | } |
| | | |
| | | if(millis >= minute && type <=3){ |
| | | long minutes = millis / minute; |
| | | sb.append(minutes).append("åé"); |
| | | millis -= minutes * minute; |
| | | } |
| | | |
| | | if(millis >= second && type <=2){ |
| | | long seconds = millis / second; |
| | | sb.append(seconds).append("ç§"); |
| | | millis -= seconds * second; |
| | | } |
| | | |
| | | if(millis > 0 && type <=1){ |
| | | sb.append(millis).append("毫ç§"); |
| | | } |
| | | |
| | | return sb.toString(); |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * è·åç¨æ·åè¡¨æ°æ® |
| | | * @param user |
| | | * @param req |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/listAll", method = RequestMethod.GET) |
| | | public Result<List<SysUser>> listAll(SysUser user,HttpServletRequest req) { |
| | | Result<List<SysUser>> result = new Result<List<SysUser>>(); |
| | | QueryWrapper<SysUser> queryWrapper = QueryGenerator.initQueryWrapper(user, req.getParameterMap()); |
| | | |
| | | //update-begin-Author:wangshuai--Date:20211119--for:ãvue3ãéè¿é¨é¨idæ¥è¯¢ç¨æ·ï¼éè¿codeæ¥è¯¢id |
| | | //é¨é¨ID |
| | | String departId = req.getParameter("departId"); |
| | | if(oConvertUtils.isNotEmpty(departId)){ |
| | | LambdaQueryWrapper<SysUserDepart> query = new LambdaQueryWrapper<>(); |
| | | query.eq(SysUserDepart::getDepId,departId); |
| | | List<SysUserDepart> list = sysUserDepartService.list(query); |
| | | List<String> userIds = list.stream().map(SysUserDepart::getUserId).collect(Collectors.toList()); |
| | | //update-begin---author:wangshuai ---date:20220322 forï¼[issues/I4XTYB]æ¥è¯¢ç¨æ·æ¶ï¼å½é¨é¨id 䏿²¡æåé
ç¨æ·æ¶æ¥å£æ¥é------------ |
| | | if(oConvertUtils.listIsNotEmpty(userIds)){ |
| | | queryWrapper.in("id",userIds); |
| | | }else{ |
| | | return Result.OK(); |
| | | } |
| | | //update-end---author:wangshuai ---date:20220322 forï¼[issues/I4XTYB]æ¥è¯¢ç¨æ·æ¶ï¼å½é¨é¨id 䏿²¡æåé
ç¨æ·æ¶æ¥å£æ¥é------------ |
| | | } |
| | | //ç¨æ·ID |
| | | String code = req.getParameter("code"); |
| | | if(oConvertUtils.isNotEmpty(code)){ |
| | | queryWrapper.in("id",Arrays.asList(code.split(","))); |
| | | } |
| | | //update-end-Author:wangshuai--Date:20211119--for:ãvue3ãéè¿é¨é¨idæ¥è¯¢ç¨æ·ï¼éè¿codeæ¥è¯¢id |
| | | |
| | | //update-begin-author:taoyan--date:20220104--for: JTC-372 ãç¨æ·å»ç»é®é¢ã onlineææãç¨æ·ç»ä»¶ï¼éæ©ç¨æ·é½è½çå°è¢«å»ç»çç¨æ· |
| | | String status = req.getParameter("status"); |
| | | if(oConvertUtils.isNotEmpty(status)){ |
| | | queryWrapper.eq("status", Integer.parseInt(status)); |
| | | } |
| | | //update-end-author:taoyan--date:20220104--for: JTC-372 ãç¨æ·å»ç»é®é¢ã onlineææãç¨æ·ç»ä»¶ï¼éæ©ç¨æ·é½è½çå°è¢«å»ç»çç¨æ· |
| | | |
| | | //TODO å¤é¨æ¨¡æç»é临æ¶è´¦å·ï¼åè¡¨ä¸æ¾ç¤º |
| | | queryWrapper.ne("username","_reserve_user_external"); |
| | | List<SysUser> list = sysUserService.list(queryWrapper); |
| | | //æ¹éæ¥è¯¢ç¨æ·çæå±é¨é¨ |
| | | //step.1 å
æ¿å°å
¨é¨ç useids |
| | | //step.2 éè¿ useidsï¼ä¸æ¬¡æ§æ¥è¯¢ç¨æ·çæå±é¨é¨åå |
| | | List<String> userIds = list.stream().map(SysUser::getId).collect(Collectors.toList()); |
| | | Map<String, String> useProNames = sysUserService.getProNamesByUserIds(userIds); |
| | | if(userIds!=null && userIds.size()>0){ |
| | | Map<String,String> useDepNames = sysUserService.getDepNamesByUserIds(userIds); |
| | | list.forEach(item->{ |
| | | item.setOrgCodeTxt(useDepNames.get(item.getId())); |
| | | item.setProductionName(useProNames.get(item.getId())); |
| | | }); |
| | | } |
| | | result.setSuccess(true); |
| | | result.setResult(list); |
| | | log.info(list.toString()); |
| | | return result; |
| | | } |
| | | |
| | | //@RequiresRoles({"admin"}) |
| | | //Permissions("system:user:add") |
| | | @RequestMapping(value = "/add", method = RequestMethod.POST) |
| | |
| | | package org.jeecg.modules.system.mapper; |
| | | |
| | | import java.util.List; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.jeecg.modules.system.entity.SysUser; |
| | | import org.jeecg.modules.system.entity.SysUserRole; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Select("select id from sys_role where id in (select role_id from sys_user_role where user_id = (select id from sys_user where username=#{username}))") |
| | | List<String> getRoleIdByUserName(@Param("username") String username); |
| | | |
| | | /** |
| | | * æ ¹æ®è§è²æ¥è¯¢ç¨æ· |
| | | * @param roleList role_codeéå |
| | | * */ |
| | | List<SysUser> getUsersByRoles(@Param("roleList") List<String> roleList); |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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="org.jeecg.modules.system.mapper.SysUserRoleMapper"> |
| | | <select id="getUsersByRoles" resultType="org.jeecg.modules.system.entity.SysUser"> |
| | | select t.* from sys_user t where t.del_flag = 0 |
| | | and t.id in ( |
| | | select t1.user_id from sys_user_role t1 |
| | | left join sys_role t2 on t1.role_id = t2.id |
| | | <if test="roleList!=null and roleList.size()>0"> |
| | | and t2.role_code in |
| | | <foreach collection="roleList" index="index" item="roleCode" open="(" separator="," close=")"> |
| | | #{roleCode} |
| | | </foreach> |
| | | </if> |
| | | where t2.id is not null |
| | | ) |
| | | </select> |
| | | </mapper> |
| | |
| | | package org.jeecg.modules.system.service; |
| | | |
| | | import java.util.Map; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.system.entity.SysUser; |
| | | import org.jeecg.modules.system.entity.SysUserRole; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @since 2018-12-21 |
| | | */ |
| | | public interface ISysUserRoleService extends IService<SysUserRole> { |
| | | |
| | | /** |
| | | * æ ¹æ®è§è²æ¥è¯¢ç¨æ· |
| | | * @param roleList è§è²ç¼ç éå |
| | | * */ |
| | | List<SysUser> queryUsersByRoles(List<String> roleList); |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.constant.FillRuleConstant; |
| | | import org.jeecg.common.system.vo.DictModel; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.common.util.FillRuleUtil; |
| | | import org.jeecg.common.util.oConvertUtils; |
| | | import org.jeecg.modules.system.entity.*; |
| | |
| | | @Override |
| | | public List<MdcProductionTreeModel> queryTreeListByConfig(){ |
| | | SysParams sysParams = sysParamsService.getSysPramBySettingKey("dnc_production"); |
| | | LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | LambdaQueryWrapper<MdcProduction> query = new LambdaQueryWrapper<MdcProduction>(); |
| | | if (sysParams == null) { |
| | | return null; |
| | | }else { |
| | | List<String> productionIds = new ArrayList<>(); |
| | | if (!("admin").equals(loginUser.getUsername())) { |
| | | //䏿¯è¶
级管çåï¼è·åç¨æ·æ¥æç产线 |
| | | if (loginUser.getProductionIds() != null) { |
| | | if (loginUser.getProductionIds().contains(",")) { |
| | | productionIds = Arrays.asList(loginUser.getProductionIds().split(",")); |
| | | } else { |
| | | productionIds = Collections.singletonList(loginUser.getProductionIds()); |
| | | } |
| | | } |
| | | } |
| | | if (("0").equals(sysParams.getSettingValue())){ |
| | | query.eq(MdcProduction::getOrgType,"2"); |
| | | query.in(!productionIds.isEmpty(), MdcProduction::getId, productionIds); |
| | | query.eq(MdcProduction::getDelFlag, CommonConstant.DEL_FLAG_0.toString()); |
| | | query.orderByAsc(MdcProduction::getProductionOrder); |
| | | List<MdcProduction> list = this.list(query); |
| | |
| | | package org.jeecg.modules.system.service.impl; |
| | | |
| | | import java.util.IdentityHashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import org.jeecg.modules.system.entity.SysRole; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.jeecg.modules.system.entity.SysUser; |
| | | import org.jeecg.modules.system.entity.SysUserRole; |
| | | import org.jeecg.modules.system.mapper.SysUserRoleMapper; |
| | | import org.jeecg.modules.system.service.ISysRoleService; |
| | | import org.jeecg.modules.system.service.ISysUserRoleService; |
| | | import org.jeecg.modules.system.service.ISysUserService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class SysUserRoleServiceImpl extends ServiceImpl<SysUserRoleMapper, SysUserRole> implements ISysUserRoleService { |
| | | |
| | | @Autowired |
| | | private SysUserRoleMapper sysUserRoleMapper; |
| | | |
| | | /** |
| | | * æ ¹æ®è§è²æ¥è¯¢ç¨æ· |
| | | * @param roleList è§è²ç¼ç éå |
| | | * */ |
| | | @Override |
| | | public List<SysUser> queryUsersByRoles(List<String> roleList) { |
| | | return sysUserRoleMapper.getUsersByRoles(roleList); |
| | | } |
| | | |
| | | } |