| | |
| | | package org.jeecg.modules.eam.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | 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.DataBaseConstant; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.common.util.oConvertUtils; |
| | | import org.jeecg.modules.eam.entity.EamTechnicalStatusChange; |
| | | import org.jeecg.modules.eam.mapper.EamTechnicalStatusChangeMapper; |
| | | import org.jeecg.modules.eam.request.EamTechnicalStatusChangeQuery; |
| | | import org.jeecg.modules.eam.request.EamTechnicalStatusChangeRequest; |
| | | import org.jeecg.modules.eam.service.IEamTechnicalStatusChangeService; |
| | | import org.jeecg.modules.flowable.apithird.business.entity.FlowMyBusiness; |
| | | import org.jeecg.modules.flowable.apithird.service.FlowCallBackServiceI; |
| | | import org.jeecg.modules.system.entity.BaseFactory; |
| | | import org.jeecg.modules.system.entity.BaseFactoryUser; |
| | | import org.jeecg.modules.system.service.IBaseFactoryService; |
| | | import org.jeecg.modules.system.service.IBaseFactoryUserService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @Description: 技术状态变更申请 |
| | |
| | | * @Date: 2025-07-09 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Service |
| | | public class EamTechnicalStatusChangeServiceImpl extends ServiceImpl<EamTechnicalStatusChangeMapper, EamTechnicalStatusChange> implements IEamTechnicalStatusChangeService { |
| | | @Service("IEamTechnicalStatusChangeService") |
| | | public class EamTechnicalStatusChangeServiceImpl extends ServiceImpl<EamTechnicalStatusChangeMapper, EamTechnicalStatusChange> implements IEamTechnicalStatusChangeService, FlowCallBackServiceI { |
| | | @Autowired |
| | | private IBaseFactoryUserService baseFactoryUserService; |
| | | @Autowired |
| | | private IBaseFactoryService baseFactoryService; |
| | | @Override |
| | | public IPage<EamTechnicalStatusChange> queryPageList(Page<EamTechnicalStatusChange> page, EamTechnicalStatusChangeQuery query) { |
| | | QueryWrapper<EamTechnicalStatusChange> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("del_flag", CommonConstant.DEL_FLAG_0); |
| | | //用户数据权限 |
| | | LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | if (sysUser == null) { |
| | | return page; |
| | | } |
| | | //根据中心过滤数据权限 |
| | | List<BaseFactoryUser> baseFactoryUserList = baseFactoryUserService. |
| | | list(new LambdaQueryWrapper<BaseFactoryUser>().eq(BaseFactoryUser::getUserId, sysUser.getId())); |
| | | if (!CollectionUtils.isEmpty(baseFactoryUserList)) { |
| | | Set<String> factoryIds = baseFactoryUserList.stream().map(BaseFactoryUser::getFactoryId).collect(Collectors.toSet()); |
| | | Set<String> factoryCodeList = baseFactoryService.listByIds(factoryIds).stream().map(BaseFactory::getOrgCode).collect(Collectors.toSet()); |
| | | queryWrapper.in("factory_org_code", factoryCodeList); |
| | | } else { |
| | | return page; |
| | | } |
| | | if (query != null) { |
| | | //编码 模糊查询 |
| | | if (StringUtils.isNotBlank(query.getChangeOrderNum())) { |
| | | queryWrapper.like("change_order_num", query.getChangeOrderNum()); |
| | | } |
| | | //保养分类 |
| | | if (StringUtils.isNotBlank(query.getChangeStatus())) { |
| | | queryWrapper.eq("change_status", query.getChangeStatus()); |
| | | } |
| | | if (query.getDateBegin() != null && query.getDateEnd() != null) { |
| | | queryWrapper.between("designer_time", query.getDateBegin(), query.getDateEnd()); |
| | | } |
| | | //申请单位 |
| | | if(StringUtils.isNotBlank(query.getFactoryOrgCode())) { |
| | | queryWrapper.eq("factory_org_code", query.getFactoryOrgCode()); |
| | | } |
| | | //排序 |
| | | if (StringUtils.isNotBlank(query.getColumn()) && StringUtils.isNotBlank(query.getOrder())) { |
| | | String column = query.getColumn(); |
| | | if (column.endsWith(CommonConstant.DICT_TEXT_SUFFIX)) { |
| | | column = column.substring(0, column.lastIndexOf(CommonConstant.DICT_TEXT_SUFFIX)); |
| | | } |
| | | if (DataBaseConstant.SQL_ASC.equalsIgnoreCase(query.getOrder())) { |
| | | queryWrapper.orderByAsc(oConvertUtils.camelToUnderline(column)); |
| | | } else { |
| | | queryWrapper.orderByDesc(oConvertUtils.camelToUnderline(column)); |
| | | } |
| | | } else { |
| | | queryWrapper.orderByDesc("create_time"); |
| | | } |
| | | } else { |
| | | queryWrapper.orderByDesc("create_time"); |
| | | } |
| | | return this.getBaseMapper().selectPage(page, queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean addEamTechnicalStatusChange(EamTechnicalStatusChangeRequest request) { |
| | | return false; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean editEamTechnicalStatusChange(EamTechnicalStatusChangeRequest request) { |
| | | return false; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean submit(String id) { |
| | | return false; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public EamTechnicalStatusChange approval(EamTechnicalStatusChangeRequest request) { |
| | | return null; |
| | | } |
| | | |
| | | @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) { |
| | | //业务是否干预流程,业务干预,流程干预,指定人员进行处理 |
| | | //获取下一步处理人 |
| | | Object object = values.get("NextAssignee"); |
| | | return (List<String>) object; |
| | | } |
| | | } |