Merge remote-tracking branch 'origin/master'
| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.config.annotation.EncryptionReq; |
| | | import com.doumee.config.annotation.EncryptionResp; |
| | | import com.doumee.core.annotation.trace.Trace; |
| | | import com.doumee.core.constants.Constants; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | |
| | | package com.doumee.api.web; |
| | | |
| | | import com.doumee.config.Jwt.JwtTokenUtil; |
| | | import com.doumee.config.annotation.EncryptionReq; |
| | | import com.doumee.config.annotation.EncryptionResp; |
| | | import com.doumee.config.annotation.LoginRequired; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | |
| | | @LoginRequired |
| | | @GetMapping("/categoryTree") |
| | | @ApiOperation("获取分类类别获取分类树") |
| | | @EncryptionReq |
| | | @EncryptionResp |
| | | public ApiResponse<List<CategoryVO>> categoryVOTree(@RequestParam String categoryType,Integer categoryId, @RequestHeader(JwtTokenUtil.HEADER_KEY) String token){ |
| | | try { |
| | | |
| | |
| | | @LoginRequired |
| | | @GetMapping("/getCategoryVOForGCXTree") |
| | | @ApiOperation("获取分类类别获取分类树 - 观察项") |
| | | @EncryptionReq |
| | | @EncryptionResp |
| | | public ApiResponse<List<CategoryVO>> getCategoryVOForGCXTree(@RequestParam Integer categoryId, @RequestHeader(JwtTokenUtil.HEADER_KEY) String token){ |
| | | try { |
| | | |
| | |
| | | @LoginRequired |
| | | @GetMapping("/categoryList") |
| | | @ApiOperation("获取分类类别获取分类列表") |
| | | @EncryptionReq |
| | | @EncryptionResp |
| | | public ApiResponse<List<CategoryVO>> categoryList(Integer categoryType,Integer isRoot ,@RequestHeader(JwtTokenUtil.HEADER_KEY) String token){ |
| | | try { |
| | | jwtTokenUtil.getUserInfoByToken(token); |
| | |
| | | @PreventRepeat(limit = 10, lockTime = 10000) |
| | | @ApiOperation("H5业务登录") |
| | | @PostMapping("/loginH5") |
| | | // @EncryptionReq |
| | | // @EncryptionResp |
| | | @EncryptionReq |
| | | @EncryptionResp |
| | | public ApiResponse<Member> loginH5 (@RequestBody LoginH5DTO dto) { |
| | | try { |
| | | //拿CODE换qwid,先查下本系统是否存在,存在直接返回member,否则用qwid查询企业用户数据,插入数据库(member) |
| | |
| | | @LoginRequired |
| | | @ApiOperation("更新用户邮箱信息") |
| | | @PostMapping("/upateInfo") |
| | | @EncryptionReq |
| | | @EncryptionResp |
| | | public ApiResponse upateInfo (@RequestBody UpdEmailDTO updEmailDTO ,@RequestHeader(JwtTokenUtil.HEADER_KEY) String token) { |
| | | try { |
| | | Member user = jwtTokenUtil.getUserInfoByToken(token); |
| | |
| | | @ApiOperation("获取企业微信JS签名") |
| | | @PostMapping("/getQwSignature") |
| | | @ResponseBody |
| | | @EncryptionReq |
| | | @EncryptionResp |
| | | public ApiResponse<WebQwSingatureVO> getQwSignature(@RequestBody WebQwSingatureDto param) { |
| | | try { |
| | | String jsapiTicket = systemDictDataBiz.queryByCode(Constants.QYWX,Constants.QYWX_JS_API_TICKET).getCode(); |
| | |
| | | @LoginRequired |
| | | @ApiOperation("查询可被抄送人分页") |
| | | @PostMapping("/getCopySendUserPage") |
| | | @EncryptionReq |
| | | @EncryptionResp |
| | | public ApiResponse<PageData<Member>> getCopySendUserPage (@RequestBody PageWrap<Member> pageWrap) { |
| | | pageWrap.getModel().setIsSendCopy(Constants.ONE); |
| | | return ApiResponse.success(memberService.findPage(pageWrap)); |
| | |
| | | package com.doumee.api.web; |
| | | |
| | | import com.doumee.config.Jwt.JwtTokenUtil; |
| | | import com.doumee.config.annotation.EncryptionReq; |
| | | import com.doumee.config.annotation.EncryptionResp; |
| | | import com.doumee.config.annotation.LoginRequired; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | |
| | | @LoginRequired |
| | | @ApiOperation("风险上报") |
| | | @PostMapping("/create") |
| | | @EncryptionReq |
| | | @EncryptionResp |
| | | public ApiResponse create (@RequestBody Workorder workorder, @RequestHeader(JwtTokenUtil.HEADER_KEY) String token) { |
| | | try { |
| | | Member user = jwtTokenUtil.getUserInfoByToken(token); |
| | |
| | | @LoginRequired |
| | | @ApiOperation("通知人查询") |
| | | @PostMapping("/managersList") |
| | | @EncryptionReq |
| | | @EncryptionResp |
| | | public ApiResponse<List<Managers>> managersList (@RequestBody Managers model, @RequestHeader(JwtTokenUtil.HEADER_KEY) String token) { |
| | | try { |
| | | |
| | |
| | | @LoginRequired |
| | | @ApiOperation("风险上报详情") |
| | | @GetMapping("/detail") |
| | | @EncryptionReq |
| | | @EncryptionResp |
| | | public ApiResponse<Workorder> detail (@RequestParam Integer id, @RequestHeader(JwtTokenUtil.HEADER_KEY) String token) { |
| | | try { |
| | | return ApiResponse.success(workorderService.getDetail(id,jwtTokenUtil.getUserInfoByToken(token))); |
| | |
| | | @LoginRequired |
| | | @ApiOperation("工单关闭") |
| | | @PostMapping("/closeWorkOrder") |
| | | @EncryptionReq |
| | | @EncryptionResp |
| | | public ApiResponse closeWorkOrder(@RequestBody CloseDTO closeDTO, @RequestHeader(JwtTokenUtil.HEADER_KEY) String token) { |
| | | try { |
| | | closeDTO.setMember(jwtTokenUtil.getUserInfoByToken(token)); |
| | |
| | | @LoginRequired |
| | | @ApiOperation("工单指派") |
| | | @PostMapping("/passOn") |
| | | @EncryptionReq |
| | | @EncryptionResp |
| | | public ApiResponse passOn(@RequestBody PassOnDTO passOnDTO, @RequestHeader(JwtTokenUtil.HEADER_KEY) String token) { |
| | | try { |
| | | passOnDTO.setMember(jwtTokenUtil.getUserInfoByToken(token)); |
| | |
| | | @LoginRequired |
| | | @ApiOperation("工单催促") |
| | | @GetMapping("/urge") |
| | | @EncryptionReq |
| | | @EncryptionResp |
| | | public ApiResponse urge(@RequestParam Integer workorderId, @RequestHeader(JwtTokenUtil.HEADER_KEY) String token) { |
| | | try { |
| | | workorderService.urge(workorderId,jwtTokenUtil.getUserInfoByToken(token)); |
| | |
| | | @LoginRequired |
| | | @ApiOperation("工单抄送") |
| | | @PostMapping("/sendCopy") |
| | | @EncryptionReq |
| | | @EncryptionResp |
| | | public ApiResponse sendCopy(@RequestBody SendCopyDTO sendCopyDTO, @RequestHeader(JwtTokenUtil.HEADER_KEY) String token) { |
| | | try { |
| | | sendCopyDTO.setMember(jwtTokenUtil.getUserInfoByToken(token)); |
| | |
| | | @LoginRequired |
| | | @ApiOperation("SHE、跌绊滑报表") |
| | | @PostMapping("/getWorkOrderData") |
| | | @EncryptionReq |
| | | @EncryptionResp |
| | | public ApiResponse<List<WorkOrderDataVO>> getWorkOrderData(@RequestBody OrderDataDTO orderDataDTO, @RequestHeader(JwtTokenUtil.HEADER_KEY) String token) { |
| | | try { |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @LoginRequired |
| | | @ApiOperation("分页查询") |
| | | @PostMapping("/page") |
| | | @EncryptionReq |
| | | @EncryptionResp |
| | | public ApiResponse<PageData<Workorder>> findPage (@RequestBody PageWrap<Workorder> pageWrap,@RequestHeader(JwtTokenUtil.HEADER_KEY) String token) { |
| | | try { |
| | | Member member = jwtTokenUtil.getUserInfoByToken(token); |
| | |
| | | e.printStackTrace(); |
| | | return ApiResponse.failed(ResponseStatus.SERVER_ERROR); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | objectMapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")); |
| | | String aesEncryptData = AESUtils.encrypt(objectMapper.writeValueAsString(apiResponse.getData()), str); |
| | | |
| | | apiResponse.setData(aesEncryptData); |
| | | String aesEncryptMessage = AESUtils.encrypt(objectMapper.writeValueAsString(apiResponse.getMessage()), str); |
| | | apiResponse.setMessage(aesEncryptMessage + " " + afterDealStr); |
| | |
| | | //获取成员详情,access_token=调用接口凭证,userid=成员UserID |
| | | public final static String[] GET_USER_DETAIL =new String[]{ "/cgi-bin/user/get?access_token=${accesstoken}&userid=${id}","获取成员详情"}; |
| | | //发送应用消息,access_token=调用接口凭证 POST请求, |
| | | public final static String[] SEND_MSG =new String[]{ "/cgi-bin/message/send?access_token=${accesstoken}","发生推送消息"}; |
| | | public final static String[] SEND_MSG =new String[]{ "/cgi-bin/message/send?access_token=${accesstoken}","发送推送消息"}; |
| | | public final static String[] GET_USER_BY_AUTH_CODE =new String[]{ "/cgi-bin/auth/getuserinfo?access_token=${accesstoken}&code=${code}","获取用户登录身份"}; |
| | | public final static String[] GET_JSAPI_TICKET =new String[]{ "/cgi-bin/get_jsapi_ticket?access_token=${accesstoken}","获取企业 jsapi_ticket"}; |
| | | |
| | |
| | | String url = interfaceUrl[0].replace("${accesstoken}",token); |
| | | QywxSendMsgResponse response = sendHttpRequestSingle(url,interfaceUrl[1],JSONObject.toJSONString(param) |
| | | ,new TypeReference<QywxSendMsgResponse>(){}); |
| | | log.error("推送消息结果{}",JSONObject.toJSONString(response)); |
| | | if(response.getErrcode()!=null && response.getErrcode() ==0){ |
| | | return response; |
| | | } |
| | |
| | | } |
| | | String token = systemDictDataBiz.queryByCode(Constants.QYWX,Constants.QYWX_TOKEN).getCode(); |
| | | //根据code换区企业微信ID |
| | | QywxBaseResponse<String> qwIdBaseResponse= QywxUtil.getUserInfoByCode(token,dto.getCode()); |
| | | QywxBaseResponse<String> qwIdBaseResponse = QywxUtil.getUserInfoByCode(token,dto.getCode()); |
| | | if(Objects.isNull(qwIdBaseResponse)||Objects.isNull(qwIdBaseResponse.getErrcode())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"企业微信登录码解析失败,请联系管理员"); |
| | | } |
| | |
| | | */ |
| | | public Integer saveLog(String beforeJson,Workorder afterWorkorder,Integer objType,Integer memberId,String title,String content,String paramr2){ |
| | | WorkorderLog workorderLog = new WorkorderLog(); |
| | | workorderLog.setCreateDate(afterWorkorder.getCreateDate()); |
| | | workorderLog.setEditDate(afterWorkorder.getCreateDate()); |
| | | workorderLog.setCreateDate(afterWorkorder.getEditDate()); |
| | | workorderLog.setEditDate(afterWorkorder.getEditDate()); |
| | | workorderLog.setIsdeleted(Constants.ZERO); |
| | | workorderLog.setBeforeContent(beforeJson); |
| | | workorderLog.setAfterContent(JSONObject.toJSONString(afterWorkorder)); |
| | |
| | | } |
| | | workorder.setStatus(Constants.WorkOrderStatus.wtsClose.getKey()); |
| | | qwIds.addAll(Arrays.asList(workorder.getQwnoticeMemberIds().split(","))); |
| | | qwIds.add(workorder.getDealerId()); |
| | | qwIds.add(workorder.getManagerId()); |
| | | qwIds.remove(closeDTO.getMember().getQwId()); |
| | | }else{ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"工单状态已流转"); |
| | |
| | | workorder.setDealInfo(closeDTO.getInfo()); |
| | | workorderMapper.updateById(workorder); |
| | | //处理上报日志 |
| | | Integer logId = this.saveLog(beforeJson,workorder,Constants.THREE,workorder.getMemberId(),"任务已处理",closeDTO.getInfo(),null); |
| | | Integer logId = this.saveLog(beforeJson,workorder,Constants.THREE,closeDTO.getMember().getId(),"任务已处理",closeDTO.getInfo(),null); |
| | | List<Multifile> multifileList = closeDTO.getMultifileList(); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(multifileList)){ |
| | | for (Multifile multifile:multifileList) { |
| | |
| | | //处理上报日志 |
| | | Integer logId = this.saveLog(beforeJson,workorder, |
| | | Constants.equalsInteger(passOnDTO.getPassOnType(),Constants.ZERO)?Constants.ONE:Constants.TWO |
| | | ,workorder.getMemberId(),"任务分配",passOnDTO.getInfo(),paramr2); |
| | | ,passOnDTO.getMember().getId(),"任务分配",passOnDTO.getInfo(),paramr2); |
| | | List<Multifile> multifileList = passOnDTO.getMultifileList(); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(multifileList)){ |
| | | for (Multifile multifile:multifileList) { |