Browse Source

批量修改投递状态接口

LiFei 6 years ago
parent
commit
6c403f9f27

+ 29 - 0
happy-boot-module-hppay/src/main/java/org/jeecg/modules/api/dpposition/DpPositionControllerAPI.java

@@ -307,4 +307,33 @@ public class DpPositionControllerAPI extends BaseAppController {
         ModelAndView view = new ModelAndView(new MappingJackson2JsonView(), obj);
         return view;
     }
+
+
+
+
+    /**
+     * 投递状态改变接口(批量修改)
+     */
+    @PostMapping(value = "/changeApplysStatus")
+    public ModelAndView changeApplysStatus(HttpServletRequest request, HttpServletResponse response) {
+        Map<String, Object> returnMap = new HashMap<String, Object>();
+        Map<String, String> requestMap = findRequestMap(request);
+        Map<String, Object> obj = null;
+        try {
+            returnMap = positionService.changeApplysStatus(requestMap, request, response);
+            if ("1004".equals(returnMap.get("success"))) {
+                obj = errorResult(ErrorCode.code_2008, "用户信息验证失败");
+            } else {
+                obj = successResult(ErrorCode.code_1000, "投递状态改变成功", returnMap);
+            }
+        } catch (Exception e) {
+            System.out.println("Exception e:" + e);
+            e.printStackTrace();
+            obj = errorResult(ErrorCode.code_2006, "投递状态改变失败");
+            logError(request, e.getMessage(), e);
+        }
+
+        ModelAndView view = new ModelAndView(new MappingJackson2JsonView(), obj);
+        return view;
+    }
 }

+ 2 - 0
happy-boot-module-hppay/src/main/java/org/jeecg/modules/hpposition/service/IPositionService.java

@@ -43,4 +43,6 @@ public interface IPositionService extends IService<Position> {
     List<String> findListByUserId(String userId);
 
     boolean updateById1(Position position);
+
+    Map<String,Object> changeApplysStatus(Map<String,String> requestMap, HttpServletRequest request, HttpServletResponse response);
 }

+ 37 - 0
happy-boot-module-hppay/src/main/java/org/jeecg/modules/hpposition/service/impl/PositionServiceImpl.java

@@ -549,6 +549,43 @@ public class PositionServiceImpl extends ServiceImpl<PositionMapper, Position> i
     }
 
 
+
+    /**
+     * 投递状态改变接口
+     */
+    @Override
+    public Map<String, Object> changeApplysStatus(Map<String, String> requestMap, HttpServletRequest request, HttpServletResponse response) {
+        Map<String, Object> returnMap = new HashMap<String, Object>();
+        Map<String, Object> sendMap = new HashMap<String, Object>();
+        String userId = requestMap.get("user_id1"); //C端用户id
+        String userId1 = requestMap.get("user_id");
+        String userToken = requestMap.get("user_token");
+        if (TokenUtil.validateToken(userId1, userToken)) {
+            String positionId = requestMap.get("positionId");
+            String positionCategory = requestMap.get("positionCategory");
+            String type = requestMap.get("type");  //1:查询新报名 2:查询待面试
+            String sendMsgUrl = "";
+            if ("1".equals(type)) {
+                String isRefuse = requestMap.get("isRefuse");  //是否拒绝(0:未拒绝 1:拒绝)
+                sendMsgUrl = path + "/f/api/sendmessage/changeApplysStatus?positionId=" + positionId + "&userId=" + userId + "&positionCategory=" + positionCategory + "&type=" + type + "&isRefuse=" + isRefuse;
+            } else if ("2".equals(type)) {
+                String isEmploy = requestMap.get("isEmploy");  //是否录用(0:拒绝 1:录用)
+                sendMsgUrl = path + "/f/api/sendmessage/changeApplysStatus?positionId=" + positionId + "&userId=" + userId + "&positionCategory=" + positionCategory + "&type=" + type + "&isEmploy=" + isEmploy;
+            }
+            JSONObject paramJson = JSONObject.fromObject(CommUtil.doPost(sendMsgUrl, null));
+            String returnStatus = paramJson.getString("success");
+            if ("1".equals(returnStatus)) {
+                returnMap.put("success", true);
+            } else {
+                returnMap.put("success", false);
+            }
+        } else {
+            returnMap.put("success", "1004");
+        }
+        return returnMap;
+    }
+
+
     /**
      * 邀请面试接口
      */