| | |
| | | import com.zy.crm.common.web.BaseController; |
| | | import com.zy.crm.manager.entity.*; |
| | | import com.zy.crm.manager.service.*; |
| | | import com.zy.crm.manager.utils.CompanySearchUtils; |
| | | import com.zy.crm.system.entity.User; |
| | | import com.zy.crm.system.service.UserService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | wrapper.or().eq("host_id", 1); |
| | | } |
| | | } |
| | | @RequestMapping(value = "/priOnline2/HJ/add/auth") |
| | | @ManagerAuth(memo = "接取集成核价任务") |
| | | public R addHJ(PriOnline2 priOnline2) { |
| | | PriOnline2 priOnline21 = priOnline2Service.selectById(priOnline2.getId()); |
| | | if (priOnline21.getSettle()!=1 || !priOnline21.getMemberId().equals(0L)){ |
| | | return R.error("此集成核价单状态已改变,请刷新页面重新选择!"); |
| | | } |
| | | Date now = new Date(); |
| | | priOnline21.setMemberId(getUserId()); |
| | | |
| | | |
| | | List<SettleDto> planDtos = JSON.parseArray(priOnline21.getSettleMsg(), SettleDto.class); |
| | | List<SettleDto> planDtoList = new ArrayList<>(); |
| | | for (SettleDto dto : planDtos) { |
| | | if (dto.getStep().equals(2)) { |
| | | dto.setUserId(getUserId()); |
| | | dto.setUsername(getUser().getNickname()); |
| | | if (Cools.isEmpty(dto.getMsg())) { |
| | | dto.setMsg(getUser().getNickname() + "接取核价"); |
| | | } else { |
| | | dto.setMsg(dto.getMsg() + PZH + DateUtils.convert(now) + " " + getUser().getNickname() + "接取核价"); |
| | | } |
| | | dto.setTime(DateUtils.convert(new Date())); |
| | | } |
| | | planDtoList.add(dto); |
| | | } |
| | | priOnline21.setSettleMsg(JSON.toJSONString(planDtoList)); |
| | | priOnline21.setUpdateUserId(getUserId()); |
| | | priOnline21.setUpdateTime(now); |
| | | priOnline2Service.updateById(priOnline21); |
| | | return R.ok("接取成功"); |
| | | } |
| | | |
| | | @RequestMapping(value = "/priOnline2/HJ/search/auth") |
| | | @ManagerAuth |
| | | public R priOnline2Search(String condition) { |
| | | EntityWrapper<PriOnline2> wrapper = new EntityWrapper<>(); |
| | | wrapper.like("template_name", condition); |
| | | wrapper.eq("member_id",0L); |
| | | |
| | | List<ProcessPermissions> processPermissionsList = processPermissionsService.selectList(new EntityWrapper<ProcessPermissions>().eq("process_memo", 5));//2:核价流程 |
| | | int type =0; |
| | | for (ProcessPermissions processPermissions:processPermissionsList){ |
| | | if (getUserId().equals(processPermissions.getUserId())){ |
| | | type=1; |
| | | break; |
| | | } |
| | | } |
| | | if (type==0){ |
| | | return R.error("你不是核价员,无权接任务"); |
| | | } |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | |
| | | List<PriOnline2> priOnline2s = priOnline2Service.selectList(wrapper); |
| | | for (PriOnline2 priOnline2 : priOnline2s){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", priOnline2.getId()); |
| | | map.put("name", priOnline2.getTemplateName()+" - ID:"+priOnline2.getId()); |
| | | result.add(map); |
| | | } |
| | | return R.ok(result); |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/priOnline2/add/auth") |
| | | @ManagerAuth(memo = "添加核价管理") |
| | |
| | | users.add(getUser()); |
| | | users.add(getUser()); |
| | | if (planType.getType().equals(2)) { |
| | | users.add(userService.selectById(73)); |
| | | users.add(new User()); |
| | | } |
| | | users.add(userUp); |
| | | priOnline2.setSettleMsg(JSON.toJSONString(SettleDto.InItFlowPath(users, initNames, users.size()))); |
| | |
| | | } |
| | | dto.setTime(DateUtils.convert(new Date())); |
| | | } else if (dto.getStep().equals(priOnline2.getSettle() + 2)) { |
| | | nextUserId=dto.getUserId(); |
| | | if (priOnline2.getSettleSize().equals(4)){ |
| | | nextUserId = 0L; |
| | | }else { |
| | | nextUserId=dto.getUserId(); |
| | | } |
| | | } |
| | | } |
| | | priOnline2.setSettleMsg(JSON.toJSONString(list)); |