|
|
@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.alibaba.fastjson.TypeReference; |
|
|
|
import com.alibaba.fastjson.TypeReference; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.hnac.hzims.common.logs.utils.StringUtils; |
|
|
|
import com.hnac.hzims.common.logs.utils.StringUtils; |
|
|
|
import com.hnac.hzims.message.MessageConstants; |
|
|
|
import com.hnac.hzims.message.MessageConstants; |
|
|
|
import com.hnac.hzims.message.dto.BusinessMessageDTO; |
|
|
|
import com.hnac.hzims.message.dto.BusinessMessageDTO; |
|
|
@ -16,11 +17,16 @@ import com.hnac.hzims.operational.access.entity.OperAccessContentEntity; |
|
|
|
import com.hnac.hzims.operational.access.entity.OperAccessMaterialEntity; |
|
|
|
import com.hnac.hzims.operational.access.entity.OperAccessMaterialEntity; |
|
|
|
import com.hnac.hzims.operational.access.entity.OperAccessStatisticsEntity; |
|
|
|
import com.hnac.hzims.operational.access.entity.OperAccessStatisticsEntity; |
|
|
|
import com.hnac.hzims.operational.access.entity.OperAccessTaskDetailEntity; |
|
|
|
import com.hnac.hzims.operational.access.entity.OperAccessTaskDetailEntity; |
|
|
|
|
|
|
|
import com.hnac.hzims.operational.access.mapper.OperAccessTaskMapper; |
|
|
|
import com.hnac.hzims.operational.access.service.*; |
|
|
|
import com.hnac.hzims.operational.access.service.*; |
|
|
|
|
|
|
|
import com.hnac.hzims.operational.access.vo.OperAccessTaskVO; |
|
|
|
|
|
|
|
import com.hnac.hzims.operational.access.wrapper.OperAccessTaskWrapper; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.lang3.RandomUtils; |
|
|
|
import org.apache.commons.lang3.RandomUtils; |
|
|
|
import org.springblade.core.log.exception.ServiceException; |
|
|
|
import org.springblade.core.log.exception.ServiceException; |
|
|
|
|
|
|
|
import org.springblade.core.mp.support.Condition; |
|
|
|
|
|
|
|
import org.springblade.core.mp.support.Query; |
|
|
|
import org.springblade.core.secure.utils.AuthUtil; |
|
|
|
import org.springblade.core.secure.utils.AuthUtil; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.core.tool.utils.BeanUtil; |
|
|
|
import org.springblade.core.tool.utils.BeanUtil; |
|
|
@ -37,10 +43,10 @@ import org.springblade.system.user.entity.User; |
|
|
|
import org.springblade.system.user.feign.IUserClient; |
|
|
|
import org.springblade.system.user.feign.IUserClient; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.util.CollectionUtils; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.text.DecimalFormat; |
|
|
|
import java.text.DecimalFormat; |
|
|
|
import java.util.*; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import java.util.Map; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -61,6 +67,8 @@ public class AccessTaskV4ServiceImpl implements AccessTaskV4Service { |
|
|
|
|
|
|
|
|
|
|
|
private final IOperAccessStatisticsService statisticsService; |
|
|
|
private final IOperAccessStatisticsService statisticsService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final OperAccessTaskMapper operAccessTaskMapper; |
|
|
|
|
|
|
|
|
|
|
|
private final ISysClient sysClient; |
|
|
|
private final ISysClient sysClient; |
|
|
|
|
|
|
|
|
|
|
|
private final IFlowClient flowClient; |
|
|
|
private final IFlowClient flowClient; |
|
|
@ -96,6 +104,9 @@ public class AccessTaskV4ServiceImpl implements AccessTaskV4Service { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private void startProcess(AccessTaskV4DTO entity) { |
|
|
|
private void startProcess(AccessTaskV4DTO entity) { |
|
|
|
Map<String, Object> variables = JSONObject.parseObject(JSONObject.toJSONStringWithDateFormat(entity,DateUtil.PATTERN_DATETIME), Map.class); |
|
|
|
Map<String, Object> variables = JSONObject.parseObject(JSONObject.toJSONStringWithDateFormat(entity,DateUtil.PATTERN_DATETIME), Map.class); |
|
|
|
|
|
|
|
if(ObjectUtil.isNotEmpty(entity.getCreateUser())){ |
|
|
|
|
|
|
|
variables.put("startFlowUserId",entity.getCreateUser().toString()); |
|
|
|
|
|
|
|
} |
|
|
|
variables.put("solve",TaskUtil.getTaskUser(entity.getHandler().toString())); |
|
|
|
variables.put("solve",TaskUtil.getTaskUser(entity.getHandler().toString())); |
|
|
|
R<BladeFlow> result = flowClient.startProcessInstanceContainNameByKey("overhaul_task", FlowUtil.getBusinessKey("access_task_v4", String.valueOf(entity.getId())), entity.getName(),variables); |
|
|
|
R<BladeFlow> result = flowClient.startProcessInstanceContainNameByKey("overhaul_task", FlowUtil.getBusinessKey("access_task_v4", String.valueOf(entity.getId())), entity.getName(),variables); |
|
|
|
// 更新任务流程Id
|
|
|
|
// 更新任务流程Id
|
|
|
@ -216,6 +227,7 @@ public class AccessTaskV4ServiceImpl implements AccessTaskV4Service { |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 推送业务流程消息 |
|
|
|
* 推送业务流程消息 |
|
|
|
* @param entity |
|
|
|
* @param entity |
|
|
@ -271,4 +283,17 @@ public class AccessTaskV4ServiceImpl implements AccessTaskV4Service { |
|
|
|
} |
|
|
|
} |
|
|
|
statisticsService.save(statisticsDTO); |
|
|
|
statisticsService.save(statisticsDTO); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 我的检修任务 |
|
|
|
|
|
|
|
* @param taskName |
|
|
|
|
|
|
|
* @param query |
|
|
|
|
|
|
|
* @return |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public IPage<OperAccessTaskVO> myAccessTasks(String taskName, Query query) { |
|
|
|
|
|
|
|
IPage<OperAccessTaskVO> pages = operAccessTaskMapper.myAccessTasks(AuthUtil.getUser().getUserId(),taskName, Condition.getPage(query)); |
|
|
|
|
|
|
|
pages.setRecords(OperAccessTaskWrapper.build().listVOExtras(pages.getRecords())); |
|
|
|
|
|
|
|
return pages; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |