| | |
| | | import com.whyc.constant.WorkflowEnum; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.dto.WorkflowLinkDTO; |
| | | import com.whyc.mapper.WorkflowLinkMapper; |
| | | import com.whyc.pojo.BattDischargePlanTemp; |
| | | import com.whyc.pojo.UserInf; |
| | | import com.whyc.pojo.WorkflowLink; |
| | | import com.whyc.pojo.WorkflowMain; |
| | | import com.whyc.mapper.*; |
| | | import com.whyc.pojo.*; |
| | | import com.whyc.util.ActionUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | @Autowired |
| | | private BattdischargePlanService planService; |
| | | |
| | | public void addBatch(List<WorkflowLink> links){ |
| | | @Autowired(required = false) |
| | | private Fbs9100SetParamTempMapper tmpMapper; |
| | | |
| | | @Autowired(required = false) |
| | | private BatttestdataInfMapper testInfMapper; |
| | | |
| | | @Autowired(required = false) |
| | | private BattInfMapper binfMapper; |
| | | |
| | | @Autowired(required = false) |
| | | private WorkflowMainMapper mainMapper; |
| | | |
| | | public void addBatch(List<WorkflowLink> links) { |
| | | mapper.insertBatchSomeColumn(links); |
| | | } |
| | | |
| | | |
| | | public List<WorkflowLink> getWorkflowInfo(Integer mainId) { |
| | | QueryWrapper<WorkflowLink> wrapper = Wrappers.query(); |
| | | wrapper.eq("main_id",mainId); |
| | | wrapper.eq("main_id", mainId); |
| | | return mapper.selectList(wrapper); |
| | | } |
| | | |
| | |
| | | private void updateLinkField(WorkflowLink link) { |
| | | Date now = new Date(); |
| | | link.setDealTime(now); |
| | | link.setDealDesc("管理员处理通过"); |
| | | mapper.updateById(link); |
| | | } |
| | | |
| | |
| | | linkNew.setDealRoleId(RoleEnum.LEADER.getId()); |
| | | linkNew.setDealType(WorkflowEnum.TYPE_TRANSFER_DISPATCH.getValue()); |
| | | String dealUserName = ActionUtil.getUser().getUName(); |
| | | linkNew.setDealDesc(dealUserName + "处理完成"); |
| | | linkNew.setDealDesc("领导层处理中"); |
| | | linkNew.setStatus(WorkflowEnum.STATUS_WAIT_FOR_APPROVE.getValue()); |
| | | mapper.insert(linkNew); |
| | | } |
| | |
| | | case 10://当前节点为过程10-领导层审批 |
| | | { |
| | | link.setDealUserId(userId); |
| | | link.setDealDesc("领导层审批通过"); |
| | | updateLinkFieldAndFinish(link); |
| | | } |
| | | } |
| | | return new Response().setII(1, "更新完成"); |
| | | return new Response().set(1, true); |
| | | } |
| | | |
| | | //查询节点(除放电计划之外的) |
| | | public Response searchTmp(int pageNum, int pageSize) { |
| | | public Response searchTmp(int type, int status, int pageNum, int pageSize) { |
| | | UserInf uinf = ActionUtil.getUser(); |
| | | //查询自己需要处理或者审批的 |
| | | PageHelper.startPage(pageNum, pageSize); |
| | | List<WorkflowLink> list = mapper.searchTmp(uinf); |
| | | List<WorkflowLink> list = mapper.searchTmp(uinf.getUId().intValue(), uinf.getURole(), type, status); |
| | | PageInfo pageInfo = new PageInfo(list); |
| | | return new Response().setII(1, list == null ? false : true, list, "查询节点(除放电计划之外的)"); |
| | | } |
| | | |
| | | //节点为二次放电时查询二次放电参数和本年上一次有效核容数据 |
| | | public Response searchLastHrById(int mid) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | //查询二次放电参数 |
| | | QueryWrapper tmpWrapper = Wrappers.query(); |
| | | tmpWrapper.eq("main_id", mid); |
| | | tmpWrapper.last("limit 1"); |
| | | Fbs9100SetParamTemp tmp = tmpMapper.selectOne(tmpWrapper); |
| | | map.put("paramTmp", tmp); |
| | | //main表单信息 |
| | | QueryWrapper mainWrapper = Wrappers.query(); |
| | | mainWrapper.eq("id", mid); |
| | | mainWrapper.last("limit 1"); |
| | | WorkflowMain main = mainMapper.selectOne(mainWrapper); |
| | | map.put("main", main); |
| | | //本年上一次有效核容数据 |
| | | if (tmp != null) { |
| | | BatttestdataInf tinf = testInfMapper.searchHrYear(tmp.getBattGroupId()); |
| | | map.put("testInf", tinf); |
| | | QueryWrapper infWrapper = new QueryWrapper(); |
| | | infWrapper.eq("battGroupId", tmp.getBattGroupId()); |
| | | infWrapper.last("limit 1"); |
| | | Battinf binf = binfMapper.selectOne(infWrapper); |
| | | map.put("binf", binf); |
| | | } |
| | | |
| | | return new Response().setII(1, true, map, "节点为二次放电时查询二次放电参数和本年上一次有效核容数据"); |
| | | } |
| | | |
| | | //查询自己申请的工单(去除放电计划) |
| | | public Response getFlowMainByUid(int type, int status, int pageNum, int pageSize) { |
| | | UserInf uinf = ActionUtil.getUser(); |
| | | //查询自己需要处理或者审批的 |
| | | PageHelper.startPage(pageNum, pageSize); |
| | | List<WorkflowMain> list = mapper.getFlowMainByUid(uinf.getUId().intValue(), type, status); |
| | | PageInfo pageInfo = new PageInfo(list); |
| | | return new Response().setII(1, list == null ? false : true, list, "查询自己申请的工单(去除放电计划)"); |
| | | } |
| | | } |