2024-02-22 09:19:36 +08:00
|
|
|
|
package com.zcloud.controller.positioning;
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.zcloud.controller.base.BaseController;
|
|
|
|
|
import com.zcloud.entity.Page;
|
|
|
|
|
import com.zcloud.entity.PageData;
|
2024-02-26 15:38:06 +08:00
|
|
|
|
import com.zcloud.service.system.UsersService;
|
2024-02-22 09:19:36 +08:00
|
|
|
|
import com.zcloud.util.Jurisdiction;
|
|
|
|
|
import com.zcloud.util.PLSUtil;
|
|
|
|
|
import com.zcloud.util.ReturnMap;
|
2024-02-26 15:38:06 +08:00
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
2024-02-22 09:19:36 +08:00
|
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 说明:用户定位卡管理
|
|
|
|
|
* 作者:wangxuan
|
|
|
|
|
* 官网:www.zcloudchina.com
|
|
|
|
|
*/
|
|
|
|
|
@Controller
|
|
|
|
|
@RequestMapping("/deploy/card")
|
|
|
|
|
public class UserCardController extends BaseController {
|
|
|
|
|
|
2024-02-26 15:38:06 +08:00
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private UsersService usersService;
|
|
|
|
|
|
2024-02-22 09:19:36 +08:00
|
|
|
|
/**
|
|
|
|
|
* @Description: 人员卡管理
|
|
|
|
|
* @Author: dearLin
|
|
|
|
|
* @Date: 2024/1/26/026 16:43
|
|
|
|
|
* @Param: [] []
|
|
|
|
|
* @Return: com.zcloud.util.ReturnMap
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value = "/list")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public ReturnMap list(Page page) throws Exception {
|
|
|
|
|
PageData pageData = this.getPageData();
|
|
|
|
|
ReturnMap returnMap = new ReturnMap();
|
|
|
|
|
page.setPd(pageData);
|
|
|
|
|
JSONObject body = PLSUtil.getUserCardDataList(
|
2024-03-01 09:05:45 +08:00
|
|
|
|
Jurisdiction.getCORPINFO_ID(), Integer.parseInt(pageData.getString("currentPage")), Integer.parseInt(pageData.getString("showCount")), pageData.getString("KEYWORDS"));
|
2024-02-22 09:19:36 +08:00
|
|
|
|
if (body != null) {
|
|
|
|
|
List<JSONObject> list = body.getJSONArray("rows").toJavaList(JSONObject.class);
|
|
|
|
|
returnMap.put("varList", list);
|
|
|
|
|
page.setTotalResult(body.getIntValue("total"));
|
|
|
|
|
returnMap.put("page", page);
|
|
|
|
|
}
|
|
|
|
|
return returnMap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Description: 修改卡信息
|
|
|
|
|
* @Author: dearLin
|
|
|
|
|
* @Date: 2024/1/26/026 16:43
|
|
|
|
|
* @Param: [] []
|
|
|
|
|
* @Return: com.zcloud.util.ReturnMap
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value = "/edit")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public ReturnMap edit() throws Exception {
|
|
|
|
|
PageData pageData = this.getPageData();
|
|
|
|
|
ReturnMap returnMap = new ReturnMap();
|
|
|
|
|
JSONObject body = PLSUtil.GeneralPut("/deploy/card", pageData, Jurisdiction.getCORPINFO_ID());
|
|
|
|
|
if (body != null) {
|
|
|
|
|
returnMap.putAll(body);
|
2024-02-26 15:38:06 +08:00
|
|
|
|
if (!"200".equals(body.getString("code"))) return ReturnMap.error(body.getString("msg"));
|
|
|
|
|
usersService.editUserCardNoByPid(pageData);
|
2024-02-22 09:19:36 +08:00
|
|
|
|
}
|
|
|
|
|
return returnMap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Description: 可绑卡人信息
|
|
|
|
|
* @Author: dearLin
|
|
|
|
|
* @Date: 2024/1/26/026 16:43
|
|
|
|
|
* @Param: [] []
|
|
|
|
|
* @Return: com.zcloud.util.ReturnMap
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value = "/thePersonWhoDidNotBindTheCard")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public ReturnMap thePersonWhoDidNotBindTheCard() throws Exception {
|
|
|
|
|
ReturnMap returnMap = new ReturnMap();
|
|
|
|
|
JSONObject body = PLSUtil.GetGeneral("/deploy/card/thePersonWhoDidNotBindTheCard", Jurisdiction.getCORPINFO_ID());
|
|
|
|
|
if (body != null) {
|
|
|
|
|
returnMap.putAll(body);
|
|
|
|
|
}
|
|
|
|
|
return returnMap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Description: 查找信息
|
|
|
|
|
* @Author: dearLin
|
|
|
|
|
* @Date: 2024/1/26/026 16:43
|
|
|
|
|
* @Param: [] []
|
|
|
|
|
* @Return: com.zcloud.util.ReturnMap
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value = "/goEdit")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public ReturnMap goEdit() throws Exception {
|
|
|
|
|
PageData pageData = getPageData();
|
|
|
|
|
ReturnMap returnMap = new ReturnMap();
|
|
|
|
|
JSONObject body = PLSUtil.GeneralGetById("/deploy/card/feign-client/", Integer.parseInt(pageData.getString("cardNo")), Jurisdiction.getCORPINFO_ID());
|
|
|
|
|
if (body != null) {
|
|
|
|
|
returnMap.putAll(body);
|
|
|
|
|
}
|
|
|
|
|
return returnMap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Description: 删除卡
|
|
|
|
|
* @Author: dearLin
|
|
|
|
|
* @Date: 2024/1/26/026 16:43
|
|
|
|
|
* @Param: [] []
|
|
|
|
|
* @Return: com.zcloud.util.ReturnMap
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value = "/remove")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public ReturnMap remove() throws Exception {
|
|
|
|
|
PageData pageData = getPageData();
|
|
|
|
|
ReturnMap returnMap = new ReturnMap();
|
|
|
|
|
JSONObject body = PLSUtil.GeneralDelete("/deploy/card/", pageData.getString("DATA_IDS"), Jurisdiction.getCORPINFO_ID());
|
|
|
|
|
if (body != null) {
|
2024-02-26 15:38:06 +08:00
|
|
|
|
if (!"200".equals(body.getString("code"))) return ReturnMap.error(body.getString("msg"));
|
|
|
|
|
|
2024-02-22 09:19:36 +08:00
|
|
|
|
returnMap.putAll(body);
|
|
|
|
|
}
|
|
|
|
|
return returnMap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Description: 批量解绑
|
|
|
|
|
* @Author: dearLin
|
|
|
|
|
* @Date: 2024/1/26/026 16:43
|
|
|
|
|
* @Param: [] []
|
|
|
|
|
* @Return: com.zcloud.util.ReturnMap
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value = "/batchUnbinding")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public ReturnMap removeBatch() throws Exception {
|
|
|
|
|
PageData pageData = getPageData();
|
|
|
|
|
ReturnMap returnMap = new ReturnMap();
|
|
|
|
|
JSONObject body = PLSUtil.GeneralDelete("/deploy/card/batchUnbinding/", pageData.getString("DATA_IDS"), Jurisdiction.getCORPINFO_ID());
|
|
|
|
|
if (body != null) {
|
2024-02-22 16:04:48 +08:00
|
|
|
|
if (!"200".equals(body.getString("code"))) return ReturnMap.error(body.getString("msg"));
|
2024-02-22 09:19:36 +08:00
|
|
|
|
returnMap.putAll(body);
|
2024-02-26 15:38:06 +08:00
|
|
|
|
// 人员表里给 对应卡号得人 得 卡移除掉
|
|
|
|
|
String[] dataIds = pageData.getString("DATA_IDS").split(",");
|
|
|
|
|
pageData.put("USER_IDS", dataIds);
|
|
|
|
|
pageData.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
|
|
|
|
usersService.removeCardNoUser(pageData);
|
2024-02-22 09:19:36 +08:00
|
|
|
|
}
|
|
|
|
|
return returnMap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Description: 批量制卡
|
|
|
|
|
* @Author: dearLin
|
|
|
|
|
* @Date: 2024/2/21/021 15:33
|
|
|
|
|
* @Param: [] []
|
|
|
|
|
* @Return: com.zcloud.util.ReturnMap
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value = "/addInBulk")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public ReturnMap addInBulk() throws Exception {
|
|
|
|
|
PageData pageData = this.getPageData();
|
|
|
|
|
ReturnMap returnMap = new ReturnMap();
|
|
|
|
|
JSONObject body = PLSUtil.GeneralPost("/deploy/card/addInBulk", pageData, Jurisdiction.getCORPINFO_ID());
|
|
|
|
|
if (body != null) {
|
|
|
|
|
returnMap.putAll(body);
|
|
|
|
|
}
|
|
|
|
|
return returnMap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|