给部分表增加启用状态和排序字段,完善对应接口
This commit is contained in:
@@ -182,4 +182,25 @@ public class AccountController {
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量设置状态-启用或者禁用
|
||||
* @param jsonObject
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/batchSetStatus")
|
||||
@ApiOperation(value = "批量设置状态")
|
||||
public String batchSetStatus(@RequestBody JSONObject jsonObject,
|
||||
HttpServletRequest request)throws Exception {
|
||||
Boolean status = jsonObject.getBoolean("status");
|
||||
String ids = jsonObject.getString("ids");
|
||||
Map<String, Object> objectMap = new HashMap<>();
|
||||
int res = accountService.batchSetStatus(status, ids);
|
||||
if(res > 0) {
|
||||
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
|
||||
} else {
|
||||
return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -202,4 +202,25 @@ public class DepotController {
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量设置状态-启用或者禁用
|
||||
* @param jsonObject
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/batchSetStatus")
|
||||
@ApiOperation(value = "批量设置状态")
|
||||
public String batchSetStatus(@RequestBody JSONObject jsonObject,
|
||||
HttpServletRequest request)throws Exception {
|
||||
Boolean status = jsonObject.getBoolean("status");
|
||||
String ids = jsonObject.getString("ids");
|
||||
Map<String, Object> objectMap = new HashMap<>();
|
||||
int res = depotService.batchSetStatus(status, ids);
|
||||
if(res > 0) {
|
||||
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
|
||||
} else {
|
||||
return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,12 +2,9 @@ package com.jsh.erp.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.constants.BusinessConstants;
|
||||
import com.jsh.erp.constants.ExceptionConstants;
|
||||
import com.jsh.erp.datasource.entities.InOutItem;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.service.inOutItem.InOutItemService;
|
||||
import com.jsh.erp.utils.BaseResponseInfo;
|
||||
import com.jsh.erp.utils.ErpInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.slf4j.Logger;
|
||||
@@ -20,6 +17,8 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
|
||||
|
||||
/**
|
||||
* @author jishenghua jshERP 2018年12月25日14:38:08
|
||||
*/
|
||||
@@ -61,4 +60,25 @@ public class InOutItemController {
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量设置状态-启用或者禁用
|
||||
* @param jsonObject
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/batchSetStatus")
|
||||
@ApiOperation(value = "批量设置状态")
|
||||
public String batchSetStatus(@RequestBody JSONObject jsonObject,
|
||||
HttpServletRequest request)throws Exception {
|
||||
Boolean status = jsonObject.getBoolean("status");
|
||||
String ids = jsonObject.getString("ids");
|
||||
Map<String, Object> objectMap = new HashMap<>();
|
||||
int res = inOutItemService.batchSetStatus(status, ids);
|
||||
if(res > 0) {
|
||||
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
|
||||
} else {
|
||||
return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,12 +2,10 @@ package com.jsh.erp.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.constants.BusinessConstants;
|
||||
import com.jsh.erp.constants.ExceptionConstants;
|
||||
import com.jsh.erp.datasource.entities.Person;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.service.person.PersonService;
|
||||
import com.jsh.erp.utils.BaseResponseInfo;
|
||||
import com.jsh.erp.utils.ErpInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.slf4j.Logger;
|
||||
@@ -20,6 +18,8 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
|
||||
|
||||
/**
|
||||
* @author ji|sheng|hua 华夏erp
|
||||
*/
|
||||
@@ -141,4 +141,25 @@ public class PersonController {
|
||||
}
|
||||
return dataArray;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量设置状态-启用或者禁用
|
||||
* @param jsonObject
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/batchSetStatus")
|
||||
@ApiOperation(value = "批量设置状态")
|
||||
public String batchSetStatus(@RequestBody JSONObject jsonObject,
|
||||
HttpServletRequest request)throws Exception {
|
||||
Boolean status = jsonObject.getBoolean("status");
|
||||
String ids = jsonObject.getString("ids");
|
||||
Map<String, Object> objectMap = new HashMap<>();
|
||||
int res = personService.batchSetStatus(status, ids);
|
||||
if(res > 0) {
|
||||
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
|
||||
} else {
|
||||
return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.service.role.RoleService;
|
||||
import com.jsh.erp.service.user.UserService;
|
||||
import com.jsh.erp.service.userBusiness.UserBusinessService;
|
||||
import com.jsh.erp.utils.ErpInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.slf4j.Logger;
|
||||
@@ -16,7 +17,11 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
|
||||
|
||||
/**
|
||||
* @author ji sheng hua jshERP
|
||||
@@ -70,4 +75,25 @@ public class RoleController {
|
||||
public List<Role> allList(HttpServletRequest request)throws Exception {
|
||||
return roleService.allList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量设置状态-启用或者禁用
|
||||
* @param jsonObject
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/batchSetStatus")
|
||||
@ApiOperation(value = "批量设置状态")
|
||||
public String batchSetStatus(@RequestBody JSONObject jsonObject,
|
||||
HttpServletRequest request)throws Exception {
|
||||
Boolean status = jsonObject.getBoolean("status");
|
||||
String ids = jsonObject.getString("ids");
|
||||
Map<String, Object> objectMap = new HashMap<>();
|
||||
int res = roleService.batchSetStatus(status, ids);
|
||||
if(res > 0) {
|
||||
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
|
||||
} else {
|
||||
return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,19 +1,21 @@
|
||||
package com.jsh.erp.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.constants.BusinessConstants;
|
||||
import com.jsh.erp.constants.ExceptionConstants;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.datasource.entities.Unit;
|
||||
import com.jsh.erp.service.unit.UnitService;
|
||||
import com.jsh.erp.utils.BaseResponseInfo;
|
||||
import com.jsh.erp.utils.ErpInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
|
||||
|
||||
/**
|
||||
* Description
|
||||
@@ -26,4 +28,49 @@ import javax.annotation.Resource;
|
||||
@Api(tags = {"单位管理"})
|
||||
public class UnitController {
|
||||
|
||||
@Resource
|
||||
private UnitService unitService;
|
||||
|
||||
/**
|
||||
* 单位列表
|
||||
* @param request
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@GetMapping(value = "/getAllList")
|
||||
@ApiOperation(value = "单位列表")
|
||||
public BaseResponseInfo getAllList(HttpServletRequest request) throws Exception{
|
||||
BaseResponseInfo res = new BaseResponseInfo();
|
||||
try {
|
||||
List<Unit> unitList = unitService.getUnit();
|
||||
res.code = 200;
|
||||
res.data = unitList;
|
||||
} catch(Exception e){
|
||||
e.printStackTrace();
|
||||
res.code = 500;
|
||||
res.data = "获取数据失败";
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量设置状态-启用或者禁用
|
||||
* @param jsonObject
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/batchSetStatus")
|
||||
@ApiOperation(value = "批量设置状态")
|
||||
public String batchSetStatus(@RequestBody JSONObject jsonObject,
|
||||
HttpServletRequest request)throws Exception {
|
||||
Boolean status = jsonObject.getBoolean("status");
|
||||
String ids = jsonObject.getString("ids");
|
||||
Map<String, Object> objectMap = new HashMap<>();
|
||||
int res = unitService.batchSetStatus(status, ids);
|
||||
if(res > 0) {
|
||||
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
|
||||
} else {
|
||||
return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user