Commit 42835c94 authored by 乾坤平台's avatar 乾坤平台 Committed by 季圣华
Browse files

!50 异常封装

Merge pull request !50 from 乾坤平台/master
parents 7ce3af46 8a831229
...@@ -284,14 +284,6 @@ ...@@ -284,14 +284,6 @@
} }
}); });
}); });
$('#btnSetFunctions').click(function () {
var currentRow = $("#tableData").datagrid("getSelected");
if (currentRow == null) {
$.messager.alert('提示',"请选择一条数据再操作!",'warning');
return false;
}
this.href = "/pages/manage/roleFunctions.html?id=" + currentRow.id;
});
//查询父级商品类别 //查询父级商品类别
$("#lookForSelectMaterialCategory").on("click", function () { $("#lookForSelectMaterialCategory").on("click", function () {
$('#forSelectMaterialCategoryDlg').dialog({ $('#forSelectMaterialCategoryDlg').dialog({
......
...@@ -18,6 +18,17 @@ public class ExceptionConstants { ...@@ -18,6 +18,17 @@ public class ExceptionConstants {
**/ **/
public static final int SERVICE_SUCCESS_CODE = 200; public static final int SERVICE_SUCCESS_CODE = 200;
public static final String SERVICE_SUCCESS_MSG = "操作成功"; public static final String SERVICE_SUCCESS_MSG = "操作成功";
/**
* 数据查询异常
*/
public static final int DATA_READ_FAIL_CODE = 300;
public static final String DATA_READ_FAIL_MSG = "数据查询异常";
/**
* 数据写入异常
*/
public static final int DATA_WRITE_FAIL_CODE = 301;
public static final String DATA_WRITE_FAIL_MSG = "数据写入异常";
/** /**
* 系统运行时未知错误 * 系统运行时未知错误
**/ **/
......
package com.jsh.erp.controller; package com.jsh.erp.controller;
import com.alibaba.druid.util.StringUtils;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.BusinessConstants; import com.jsh.erp.constants.BusinessConstants;
...@@ -41,7 +40,7 @@ public class AccountController { ...@@ -41,7 +40,7 @@ public class AccountController {
* @return * @return
*/ */
@GetMapping(value = "/findBySelect") @GetMapping(value = "/findBySelect")
public String findBySelect(HttpServletRequest request) { public String findBySelect(HttpServletRequest request) throws Exception {
String res = null; String res = null;
try { try {
List<Account> dataList = accountService.findBySelect(); List<Account> dataList = accountService.findBySelect();
...@@ -70,7 +69,7 @@ public class AccountController { ...@@ -70,7 +69,7 @@ public class AccountController {
* @return * @return
*/ */
@GetMapping(value = "/getAccount") @GetMapping(value = "/getAccount")
public BaseResponseInfo getAccount(HttpServletRequest request) { public BaseResponseInfo getAccount(HttpServletRequest request) throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
try { try {
...@@ -100,7 +99,7 @@ public class AccountController { ...@@ -100,7 +99,7 @@ public class AccountController {
@RequestParam("pageSize") Integer pageSize, @RequestParam("pageSize") Integer pageSize,
@RequestParam("accountId") Long accountId, @RequestParam("accountId") Long accountId,
@RequestParam("initialAmount") BigDecimal initialAmount, @RequestParam("initialAmount") BigDecimal initialAmount,
HttpServletRequest request) { HttpServletRequest request) throws Exception{
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
try { try {
...@@ -133,7 +132,7 @@ public class AccountController { ...@@ -133,7 +132,7 @@ public class AccountController {
@PostMapping(value = "/updateAmountIsDefault") @PostMapping(value = "/updateAmountIsDefault")
public String updateAmountIsDefault(@RequestParam("isDefault") Boolean isDefault, public String updateAmountIsDefault(@RequestParam("isDefault") Boolean isDefault,
@RequestParam("accountId") Long accountId, @RequestParam("accountId") Long accountId,
HttpServletRequest request) { HttpServletRequest request) throws Exception{
Map<String, Object> objectMap = new HashMap<String, Object>(); Map<String, Object> objectMap = new HashMap<String, Object>();
int res = accountService.updateAmountIsDefault(isDefault, accountId); int res = accountService.updateAmountIsDefault(isDefault, accountId);
if(res > 0) { if(res > 0) {
......
...@@ -40,7 +40,7 @@ public class AccountHeadController { ...@@ -40,7 +40,7 @@ public class AccountHeadController {
* @return * @return
*/ */
@GetMapping(value = "/getMaxId") @GetMapping(value = "/getMaxId")
public BaseResponseInfo getMaxId(HttpServletRequest request) { public BaseResponseInfo getMaxId(HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
try { try {
...@@ -68,7 +68,7 @@ public class AccountHeadController { ...@@ -68,7 +68,7 @@ public class AccountHeadController {
public BaseResponseInfo findTotalPay(@RequestParam("supplierId") Integer supplierId, public BaseResponseInfo findTotalPay(@RequestParam("supplierId") Integer supplierId,
@RequestParam("endTime") String endTime, @RequestParam("endTime") String endTime,
@RequestParam("supType") String supType, @RequestParam("supType") String supType,
HttpServletRequest request) { HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
try { try {
...@@ -106,7 +106,7 @@ public class AccountHeadController { ...@@ -106,7 +106,7 @@ public class AccountHeadController {
*/ */
@GetMapping(value = "/getDetailByNumber") @GetMapping(value = "/getDetailByNumber")
public BaseResponseInfo getDetailByNumber(@RequestParam("billNo") String billNo, public BaseResponseInfo getDetailByNumber(@RequestParam("billNo") String billNo,
HttpServletRequest request) { HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
AccountHeadVo4ListEx ahl = new AccountHeadVo4ListEx(); AccountHeadVo4ListEx ahl = new AccountHeadVo4ListEx();
try { try {
...@@ -132,7 +132,7 @@ public class AccountHeadController { ...@@ -132,7 +132,7 @@ public class AccountHeadController {
* @param endTime * @param endTime
* @return * @return
*/ */
public BigDecimal allMoney(String getS, String type, String mode, String endTime) { public BigDecimal allMoney(String getS, String type, String mode, String endTime)throws Exception {
BigDecimal allMoney = BigDecimal.ZERO; BigDecimal allMoney = BigDecimal.ZERO;
try { try {
Integer supplierId = Integer.valueOf(getS); Integer supplierId = Integer.valueOf(getS);
......
...@@ -55,7 +55,7 @@ public class AccountItemController { ...@@ -55,7 +55,7 @@ public class AccountItemController {
@RequestParam("updated") String updated, @RequestParam("updated") String updated,
@RequestParam("headerId") Long headerId, @RequestParam("headerId") Long headerId,
@RequestParam("listType") String listType, @RequestParam("listType") String listType,
HttpServletRequest request) { HttpServletRequest request) throws Exception{
Map<String, Object> objectMap = new HashMap<String, Object>(); Map<String, Object> objectMap = new HashMap<String, Object>();
try { try {
...@@ -70,7 +70,7 @@ public class AccountItemController { ...@@ -70,7 +70,7 @@ public class AccountItemController {
@GetMapping(value = "/getDetailList") @GetMapping(value = "/getDetailList")
public BaseResponseInfo getDetailList(@RequestParam("headerId") Long headerId, public BaseResponseInfo getDetailList(@RequestParam("headerId") Long headerId,
HttpServletRequest request) { HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
try { try {
......
...@@ -48,7 +48,7 @@ public class AppController { ...@@ -48,7 +48,7 @@ public class AppController {
* @return * @return
*/ */
@GetMapping(value = "/findAppByUserId") @GetMapping(value = "/findAppByUserId")
public JSONObject findAppByUserId(@RequestParam("userId") String userId, HttpServletRequest request) { public JSONObject findAppByUserId(@RequestParam("userId") String userId, HttpServletRequest request)throws Exception {
List<UserBusiness> roleList = userBusinessService.findRoleByUserId(userId); List<UserBusiness> roleList = userBusinessService.findRoleByUserId(userId);
String roles = null; String roles = null;
if(roleList!=null && roleList.size()>0 && roleList.get(0)!=null){ if(roleList!=null && roleList.size()>0 && roleList.get(0)!=null){
...@@ -109,7 +109,7 @@ public class AppController { ...@@ -109,7 +109,7 @@ public class AppController {
} }
@GetMapping(value = "/findDesk") @GetMapping(value = "/findDesk")
public JSONObject findDesk(HttpServletRequest request) { public JSONObject findDesk(HttpServletRequest request)throws Exception {
JSONObject obj = new JSONObject(); JSONObject obj = new JSONObject();
List<App> dockList = appService.findDock(); List<App> dockList = appService.findDock();
JSONArray dockArray = new JSONArray(); JSONArray dockArray = new JSONArray();
...@@ -160,7 +160,7 @@ public class AppController { ...@@ -160,7 +160,7 @@ public class AppController {
*/ */
@PostMapping(value = "/findRoleAPP") @PostMapping(value = "/findRoleAPP")
public JSONArray findRoleAPP(@RequestParam("UBType") String type, @RequestParam("UBKeyId") String keyId, public JSONArray findRoleAPP(@RequestParam("UBType") String type, @RequestParam("UBKeyId") String keyId,
HttpServletRequest request) { HttpServletRequest request)throws Exception {
JSONArray arr = new JSONArray(); JSONArray arr = new JSONArray();
try { try {
List<App> dataListApp = appService.findRoleAPP(); List<App> dataListApp = appService.findRoleAPP();
...@@ -229,7 +229,7 @@ public class AppController { ...@@ -229,7 +229,7 @@ public class AppController {
*/ */
@PostMapping(value = "/uploadImg") @PostMapping(value = "/uploadImg")
public BaseResponseInfo uploadImg(MultipartFile fileInfo, @RequestParam("fileInfoName") String fileName, public BaseResponseInfo uploadImg(MultipartFile fileInfo, @RequestParam("fileInfoName") String fileName,
HttpServletRequest request) { HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
try { try {
if (fileInfo != null) { if (fileInfo != null) {
......
...@@ -41,7 +41,7 @@ public class DepotController { ...@@ -41,7 +41,7 @@ public class DepotController {
private UserBusinessService userBusinessService; private UserBusinessService userBusinessService;
@GetMapping(value = "/getAllList") @GetMapping(value = "/getAllList")
public BaseResponseInfo getAllList(HttpServletRequest request) { public BaseResponseInfo getAllList(HttpServletRequest request) throws Exception{
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
try { try {
List<Depot> depotList = depotService.getAllList(); List<Depot> depotList = depotService.getAllList();
...@@ -64,7 +64,7 @@ public class DepotController { ...@@ -64,7 +64,7 @@ public class DepotController {
*/ */
@PostMapping(value = "/findUserDepot") @PostMapping(value = "/findUserDepot")
public JSONArray findUserDepot(@RequestParam("UBType") String type, @RequestParam("UBKeyId") String keyId, public JSONArray findUserDepot(@RequestParam("UBType") String type, @RequestParam("UBKeyId") String keyId,
HttpServletRequest request) { HttpServletRequest request) throws Exception{
JSONArray arr = new JSONArray(); JSONArray arr = new JSONArray();
try { try {
List<Depot> dataList = depotService.findUserDepot(); List<Depot> dataList = depotService.findUserDepot();
...@@ -104,7 +104,7 @@ public class DepotController { ...@@ -104,7 +104,7 @@ public class DepotController {
@RequestMapping(value = "/findDepotByUserId") @RequestMapping(value = "/findDepotByUserId")
public JSONArray findDepotByUserId(@RequestParam("UBType") String type, @RequestParam("UBKeyId") String keyId, public JSONArray findDepotByUserId(@RequestParam("UBType") String type, @RequestParam("UBKeyId") String keyId,
HttpServletRequest request) { HttpServletRequest request) throws Exception{
JSONArray arr = new JSONArray(); JSONArray arr = new JSONArray();
try { try {
List<Depot> dataList = depotService.findUserDepot(); List<Depot> dataList = depotService.findUserDepot();
...@@ -145,7 +145,7 @@ public class DepotController { ...@@ -145,7 +145,7 @@ public class DepotController {
public String getDepotList( public String getDepotList(
@RequestParam(value = Constants.PAGE_SIZE, required = false) Integer pageSize, @RequestParam(value = Constants.PAGE_SIZE, required = false) Integer pageSize,
@RequestParam(value = Constants.CURRENT_PAGE, required = false) Integer currentPage, @RequestParam(value = Constants.CURRENT_PAGE, required = false) Integer currentPage,
@RequestParam(value = Constants.SEARCH, required = false) String search) { @RequestParam(value = Constants.SEARCH, required = false) String search) throws Exception{
Map<String, Object> parameterMap = new HashMap<String, Object>(); Map<String, Object> parameterMap = new HashMap<String, Object>();
//查询参数 //查询参数
JSONObject obj=JSON.parseObject(search); JSONObject obj=JSON.parseObject(search);
......
...@@ -55,7 +55,7 @@ public class DepotHeadController { ...@@ -55,7 +55,7 @@ public class DepotHeadController {
@PostMapping(value = "/batchSetStatus") @PostMapping(value = "/batchSetStatus")
public String batchSetStatus(@RequestParam("status") String status, public String batchSetStatus(@RequestParam("status") String status,
@RequestParam("depotHeadIDs") String depotHeadIDs, @RequestParam("depotHeadIDs") String depotHeadIDs,
HttpServletRequest request) { HttpServletRequest request) throws Exception{
Map<String, Object> objectMap = new HashMap<String, Object>(); Map<String, Object> objectMap = new HashMap<String, Object>();
int res = depotHeadService.batchSetStatus(status, depotHeadIDs); int res = depotHeadService.batchSetStatus(status, depotHeadIDs);
if(res > 0) { if(res > 0) {
...@@ -71,7 +71,7 @@ public class DepotHeadController { ...@@ -71,7 +71,7 @@ public class DepotHeadController {
* @return * @return
*/ */
@GetMapping(value = "/buildNumber") @GetMapping(value = "/buildNumber")
public BaseResponseInfo buildNumber(HttpServletRequest request) { public BaseResponseInfo buildNumber(HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
try { try {
...@@ -93,7 +93,7 @@ public class DepotHeadController { ...@@ -93,7 +93,7 @@ public class DepotHeadController {
* @return * @return
*/ */
@GetMapping(value = "/getMaxId") @GetMapping(value = "/getMaxId")
public BaseResponseInfo getMaxId(HttpServletRequest request) { public BaseResponseInfo getMaxId(HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
try { try {
...@@ -117,7 +117,7 @@ public class DepotHeadController { ...@@ -117,7 +117,7 @@ public class DepotHeadController {
*/ */
@GetMapping(value = "/findByMonth") @GetMapping(value = "/findByMonth")
public BaseResponseInfo findByMonth(@RequestParam("monthTime") String monthTime, public BaseResponseInfo findByMonth(@RequestParam("monthTime") String monthTime,
HttpServletRequest request) { HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
try { try {
...@@ -164,7 +164,7 @@ public class DepotHeadController { ...@@ -164,7 +164,7 @@ public class DepotHeadController {
@RequestParam("beginTime") String beginTime, @RequestParam("beginTime") String beginTime,
@RequestParam("endTime") String endTime, @RequestParam("endTime") String endTime,
@RequestParam("type") String type, @RequestParam("type") String type,
HttpServletRequest request) { HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
try { try {
...@@ -211,7 +211,7 @@ public class DepotHeadController { ...@@ -211,7 +211,7 @@ public class DepotHeadController {
@RequestParam("beginTime") String beginTime, @RequestParam("beginTime") String beginTime,
@RequestParam("endTime") String endTime, @RequestParam("endTime") String endTime,
@RequestParam("type") String type, @RequestParam("type") String type,
HttpServletRequest request) { HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
try { try {
...@@ -254,7 +254,7 @@ public class DepotHeadController { ...@@ -254,7 +254,7 @@ public class DepotHeadController {
@RequestParam("endTime") String endTime, @RequestParam("endTime") String endTime,
@RequestParam("organId") Integer organId, @RequestParam("organId") Integer organId,
@RequestParam("supType") String supType, @RequestParam("supType") String supType,
HttpServletRequest request) { HttpServletRequest request) throws Exception{
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
try { try {
...@@ -338,7 +338,7 @@ public class DepotHeadController { ...@@ -338,7 +338,7 @@ public class DepotHeadController {
public BaseResponseInfo findTotalPay(@RequestParam("supplierId") Integer supplierId, public BaseResponseInfo findTotalPay(@RequestParam("supplierId") Integer supplierId,
@RequestParam("endTime") String endTime, @RequestParam("endTime") String endTime,
@RequestParam("supType") String supType, @RequestParam("supType") String supType,
HttpServletRequest request) { HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
try { try {
...@@ -376,7 +376,7 @@ public class DepotHeadController { ...@@ -376,7 +376,7 @@ public class DepotHeadController {
*/ */
@GetMapping(value = "/getDetailByNumber") @GetMapping(value = "/getDetailByNumber")
public BaseResponseInfo getDetailByNumber(@RequestParam("number") String number, public BaseResponseInfo getDetailByNumber(@RequestParam("number") String number,
HttpServletRequest request) { HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
DepotHeadVo4List dhl = new DepotHeadVo4List(); DepotHeadVo4List dhl = new DepotHeadVo4List();
try { try {
...@@ -403,7 +403,7 @@ public class DepotHeadController { ...@@ -403,7 +403,7 @@ public class DepotHeadController {
* @param mode 合计或者金额 * @param mode 合计或者金额
* @return * @return
*/ */
public BigDecimal allMoney(String getS, String type, String subType, String mode, String endTime) { public BigDecimal allMoney(String getS, String type, String subType, String mode, String endTime)throws Exception {
BigDecimal allMoney = BigDecimal.ZERO; BigDecimal allMoney = BigDecimal.ZERO;
try { try {
Integer supplierId = Integer.valueOf(getS); Integer supplierId = Integer.valueOf(getS);
......
...@@ -51,7 +51,7 @@ public class DepotItemController { ...@@ -51,7 +51,7 @@ public class DepotItemController {
@GetMapping(value = "/getHeaderIdByMaterial") @GetMapping(value = "/getHeaderIdByMaterial")
public BaseResponseInfo getHeaderIdByMaterial(@RequestParam("materialParam") String materialParam, public BaseResponseInfo getHeaderIdByMaterial(@RequestParam("materialParam") String materialParam,
@RequestParam("depotIds") String depotIds, @RequestParam("depotIds") String depotIds,
HttpServletRequest request) { HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
try { try {
List<DepotItemVo4HeaderId> depotItemList = depotItemService.getHeaderIdByMaterial(materialParam, depotIds); List<DepotItemVo4HeaderId> depotItemList = depotItemService.getHeaderIdByMaterial(materialParam, depotIds);
...@@ -89,7 +89,7 @@ public class DepotItemController { ...@@ -89,7 +89,7 @@ public class DepotItemController {
public String findDetailByTypeAndMaterialId( public String findDetailByTypeAndMaterialId(
@RequestParam(value = Constants.PAGE_SIZE, required = false) Integer pageSize, @RequestParam(value = Constants.PAGE_SIZE, required = false) Integer pageSize,
@RequestParam(value = Constants.CURRENT_PAGE, required = false) Integer currentPage, @RequestParam(value = Constants.CURRENT_PAGE, required = false) Integer currentPage,
@RequestParam("materialId") String mId, HttpServletRequest request) { @RequestParam("materialId") String mId, HttpServletRequest request)throws Exception {
Map<String, String> parameterMap = ParamUtils.requestToMap(request); Map<String, String> parameterMap = ParamUtils.requestToMap(request);
parameterMap.put("mId", mId); parameterMap.put("mId", mId);
PageQueryInfo queryInfo = new PageQueryInfo(); PageQueryInfo queryInfo = new PageQueryInfo();
...@@ -139,7 +139,7 @@ public class DepotItemController { ...@@ -139,7 +139,7 @@ public class DepotItemController {
@RequestParam("projectId") Integer pid, @RequestParam("projectId") Integer pid,
@RequestParam("materialId") String mId, @RequestParam("materialId") String mId,
@RequestParam("monthTime") String monthTime, @RequestParam("monthTime") String monthTime,
HttpServletRequest request) { HttpServletRequest request) throws Exception{
Map<String, String> parameterMap = ParamUtils.requestToMap(request); Map<String, String> parameterMap = ParamUtils.requestToMap(request);
parameterMap.put("mId", mId); parameterMap.put("mId", mId);
parameterMap.put("monthTime", monthTime); parameterMap.put("monthTime", monthTime);
...@@ -203,7 +203,7 @@ public class DepotItemController { ...@@ -203,7 +203,7 @@ public class DepotItemController {
@RequestParam(value = Constants.CURRENT_PAGE, required = false) Integer currentPage, @RequestParam(value = Constants.CURRENT_PAGE, required = false) Integer currentPage,
@RequestParam("materialId") String mId, @RequestParam("materialId") String mId,
@RequestParam("monthTime") String monthTime, @RequestParam("monthTime") String monthTime,
HttpServletRequest request) { HttpServletRequest request) throws Exception{
Map<String, String> parameterMap = ParamUtils.requestToMap(request); Map<String, String> parameterMap = ParamUtils.requestToMap(request);
parameterMap.put("mId", mId); parameterMap.put("mId", mId);
parameterMap.put("monthTime", monthTime); parameterMap.put("monthTime", monthTime);
...@@ -250,7 +250,7 @@ public class DepotItemController { ...@@ -250,7 +250,7 @@ public class DepotItemController {
* @param mId * @param mId
* @return * @return
*/ */
public int sumNumberByMaterialId(String type, Long mId) { public int sumNumberByMaterialId(String type, Long mId)throws Exception {
int allNumber = 0; int allNumber = 0;
try { try {
allNumber = depotItemService.findByTypeAndMaterialId(type, mId); allNumber = depotItemService.findByTypeAndMaterialId(type, mId);
...@@ -291,7 +291,7 @@ public class DepotItemController { ...@@ -291,7 +291,7 @@ public class DepotItemController {
* *
* @return * @return
*/ */
public String findUnitName(Long mId) { public String findUnitName(Long mId)throws Exception {
String unitName = ""; String unitName = "";
try { try {
unitName = materialService.findUnitName(mId); unitName = materialService.findUnitName(mId);
...@@ -310,7 +310,7 @@ public class DepotItemController { ...@@ -310,7 +310,7 @@ public class DepotItemController {
@GetMapping(value = "/getDetailList") @GetMapping(value = "/getDetailList")
public BaseResponseInfo getDetailList(@RequestParam("headerId") Long headerId, public BaseResponseInfo getDetailList(@RequestParam("headerId") Long headerId,
@RequestParam("mpList") String mpList, @RequestParam("mpList") String mpList,
HttpServletRequest request) { HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
try { try {
...@@ -382,7 +382,7 @@ public class DepotItemController { ...@@ -382,7 +382,7 @@ public class DepotItemController {
* *
* @return * @return
*/ */
public String getOtherInfo(String[] mpArr, DepotItemVo4WithInfoEx diEx) { public String getOtherInfo(String[] mpArr, DepotItemVo4WithInfoEx diEx)throws Exception {
String materialOther = ""; String materialOther = "";
for (int i = 0; i < mpArr.length; i++) { for (int i = 0; i < mpArr.length; i++) {
if (mpArr[i].equals("颜色")) { if (mpArr[i].equals("颜色")) {
...@@ -427,7 +427,7 @@ public class DepotItemController { ...@@ -427,7 +427,7 @@ public class DepotItemController {
@RequestParam("headIds") String headIds, @RequestParam("headIds") String headIds,
@RequestParam("materialIds") String materialIds, @RequestParam("materialIds") String materialIds,
@RequestParam("mpList") String mpList, @RequestParam("mpList") String mpList,
HttpServletRequest request) { HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
try { try {
...@@ -497,7 +497,7 @@ public class DepotItemController { ...@@ -497,7 +497,7 @@ public class DepotItemController {
@RequestParam("monthTime") String monthTime, @RequestParam("monthTime") String monthTime,
@RequestParam("headIds") String headIds, @RequestParam("headIds") String headIds,
@RequestParam("materialIds") String materialIds, @RequestParam("materialIds") String materialIds,
HttpServletRequest request) { HttpServletRequest request) throws Exception{
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
try { try {
...@@ -540,7 +540,7 @@ public class DepotItemController { ...@@ -540,7 +540,7 @@ public class DepotItemController {
@RequestParam("headIds") String headIds, @RequestParam("headIds") String headIds,
@RequestParam("materialIds") String materialIds, @RequestParam("materialIds") String materialIds,
@RequestParam("mpList") String mpList, @RequestParam("mpList") String mpList,
HttpServletRequest request) { HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
try { try {
...@@ -600,7 +600,7 @@ public class DepotItemController { ...@@ -600,7 +600,7 @@ public class DepotItemController {
@RequestParam("headIds") String headIds, @RequestParam("headIds") String headIds,
@RequestParam("materialIds") String materialIds, @RequestParam("materialIds") String materialIds,
@RequestParam("mpList") String mpList, @RequestParam("mpList") String mpList,
HttpServletRequest request) { HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
try { try {
...@@ -665,7 +665,7 @@ public class DepotItemController { ...@@ -665,7 +665,7 @@ public class DepotItemController {
@RequestParam("monthTime") String monthTime, @RequestParam("monthTime") String monthTime,
@RequestParam("headIds") String headIds, @RequestParam("headIds") String headIds,
@RequestParam("materialIds") String materialIds, @RequestParam("materialIds") String materialIds,
HttpServletRequest request, HttpServletResponse response) { HttpServletRequest request, HttpServletResponse response)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
String message = "成功"; String message = "成功";
...@@ -731,7 +731,7 @@ public class DepotItemController { ...@@ -731,7 +731,7 @@ public class DepotItemController {
* @param isPrev * @param isPrev
* @return * @return
*/ */
public BigDecimal sumNumber(String type, Integer ProjectId, Long MId, String MonthTime, Boolean isPrev) { public BigDecimal sumNumber(String type, Integer ProjectId, Long MId, String MonthTime, Boolean isPrev)throws Exception {
BigDecimal sumNumber = BigDecimal.ZERO; BigDecimal sumNumber = BigDecimal.ZERO;
try { try {
BigDecimal sum = depotItemService.findByType(type, ProjectId, MId, MonthTime, isPrev); BigDecimal sum = depotItemService.findByType(type, ProjectId, MId, MonthTime, isPrev);
...@@ -744,7 +744,7 @@ public class DepotItemController { ...@@ -744,7 +744,7 @@ public class DepotItemController {
return sumNumber; return sumNumber;
} }
public BigDecimal assembleNumber(String subType, String mType, Integer ProjectId, Long MId, String MonthTime, Boolean isPrev) { public BigDecimal assembleNumber(String subType, String mType, Integer ProjectId, Long MId, String MonthTime, Boolean isPrev) throws Exception{
BigDecimal assembleNumber = BigDecimal.ZERO; BigDecimal assembleNumber = BigDecimal.ZERO;
try { try {
BigDecimal sum = depotItemService.findAssembleByType(subType, mType, ProjectId, MId, MonthTime, isPrev); BigDecimal sum = depotItemService.findAssembleByType(subType, mType, ProjectId, MId, MonthTime, isPrev);
...@@ -766,7 +766,7 @@ public class DepotItemController { ...@@ -766,7 +766,7 @@ public class DepotItemController {
* @param isPrev * @param isPrev
* @return * @return
*/ */
public BigDecimal sumPrice(String type, Integer ProjectId, Long MId, String MonthTime, Boolean isPrev) { public BigDecimal sumPrice(String type, Integer ProjectId, Long MId, String MonthTime, Boolean isPrev) throws Exception{
BigDecimal sumPrice = BigDecimal.ZERO; BigDecimal sumPrice = BigDecimal.ZERO;
try { try {
BigDecimal sum = depotItemService.findPriceByType(type, ProjectId, MId, MonthTime, isPrev); BigDecimal sum = depotItemService.findPriceByType(type, ProjectId, MId, MonthTime, isPrev);
...@@ -779,7 +779,7 @@ public class DepotItemController { ...@@ -779,7 +779,7 @@ public class DepotItemController {
return sumPrice; return sumPrice;
} }
public BigDecimal sumNumberBuyOrSale(String type, String subType, Long MId, String MonthTime) { public BigDecimal sumNumberBuyOrSale(String type, String subType, Long MId, String MonthTime)throws Exception {
BigDecimal sumNumber = BigDecimal.ZERO; BigDecimal sumNumber = BigDecimal.ZERO;
String sumType = "Number"; String sumType = "Number";
try { try {
...@@ -793,7 +793,7 @@ public class DepotItemController { ...@@ -793,7 +793,7 @@ public class DepotItemController {
return sumNumber; return sumNumber;
} }
public BigDecimal sumPriceBuyOrSale(String type, String subType, Long MId, String MonthTime) { public BigDecimal sumPriceBuyOrSale(String type, String subType, Long MId, String MonthTime)throws Exception {
BigDecimal sumPrice = BigDecimal.ZERO; BigDecimal sumPrice = BigDecimal.ZERO;
String sumType = "Price"; String sumType = "Price";
try { try {
......
...@@ -41,7 +41,7 @@ public class FunctionsController { ...@@ -41,7 +41,7 @@ public class FunctionsController {
@PostMapping(value = "/findMenu") @PostMapping(value = "/findMenu")
public JSONArray findMenu(@RequestParam(value="pNumber") String pNumber, public JSONArray findMenu(@RequestParam(value="pNumber") String pNumber,
@RequestParam(value="hasFunctions") String hasFunctions, @RequestParam(value="hasFunctions") String hasFunctions,
HttpServletRequest request) { HttpServletRequest request)throws Exception {
//存放数据json数组 //存放数据json数组
JSONArray dataArray = new JSONArray(); JSONArray dataArray = new JSONArray();
try { try {
...@@ -124,7 +124,7 @@ public class FunctionsController { ...@@ -124,7 +124,7 @@ public class FunctionsController {
*/ */
@PostMapping(value = "/findRoleFunctions") @PostMapping(value = "/findRoleFunctions")
public JSONArray findRoleFunctions(@RequestParam("UBType") String type, @RequestParam("UBKeyId") String keyId, public JSONArray findRoleFunctions(@RequestParam("UBType") String type, @RequestParam("UBKeyId") String keyId,
HttpServletRequest request) { HttpServletRequest request)throws Exception {
JSONArray arr = new JSONArray(); JSONArray arr = new JSONArray();
try { try {
List<Functions> dataListFun = functionsService.findRoleFunctions("0"); List<Functions> dataListFun = functionsService.findRoleFunctions("0");
...@@ -277,7 +277,7 @@ public class FunctionsController { ...@@ -277,7 +277,7 @@ public class FunctionsController {
*/ */
@GetMapping(value = "/findByIds") @GetMapping(value = "/findByIds")
public BaseResponseInfo findByIds(@RequestParam("functionsIds") String functionsIds, public BaseResponseInfo findByIds(@RequestParam("functionsIds") String functionsIds,
HttpServletRequest request) { HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
try { try {
List<Functions> dataList = functionsService.findByIds(functionsIds); List<Functions> dataList = functionsService.findByIds(functionsIds);
......
...@@ -35,7 +35,7 @@ public class InOutItemController { ...@@ -35,7 +35,7 @@ public class InOutItemController {
* @return * @return
*/ */
@GetMapping(value = "/findBySelect") @GetMapping(value = "/findBySelect")
public String findBySelect(@RequestParam("type") String type, HttpServletRequest request) { public String findBySelect(@RequestParam("type") String type, HttpServletRequest request) throws Exception{
String res = null; String res = null;
try { try {
List<InOutItem> dataList = inOutItemService.findBySelect(type); List<InOutItem> dataList = inOutItemService.findBySelect(type);
......
...@@ -35,7 +35,7 @@ public class MaterialCategoryController { ...@@ -35,7 +35,7 @@ public class MaterialCategoryController {
private MaterialCategoryService materialCategoryService; private MaterialCategoryService materialCategoryService;
@GetMapping(value = "/getAllList") @GetMapping(value = "/getAllList")
public BaseResponseInfo getAllList(@RequestParam("parentId") Long parentId, HttpServletRequest request) { public BaseResponseInfo getAllList(@RequestParam("parentId") Long parentId, HttpServletRequest request) throws Exception{
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
try { try {
List<MaterialCategory> materialCategoryList = materialCategoryService.getAllList(parentId); List<MaterialCategory> materialCategoryList = materialCategoryService.getAllList(parentId);
...@@ -56,7 +56,7 @@ public class MaterialCategoryController { ...@@ -56,7 +56,7 @@ public class MaterialCategoryController {
* @return * @return
*/ */
@RequestMapping(value = "/findById") @RequestMapping(value = "/findById")
public BaseResponseInfo findById(@RequestParam("id") Long id, HttpServletRequest request) { public BaseResponseInfo findById(@RequestParam("id") Long id, HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
try { try {
List<MaterialCategory> dataList = materialCategoryService.findById(id); List<MaterialCategory> dataList = materialCategoryService.findById(id);
......
...@@ -46,7 +46,7 @@ public class MaterialController { ...@@ -46,7 +46,7 @@ public class MaterialController {
@RequestParam("standard") String standard, @RequestParam("mfrs") String mfrs, @RequestParam("standard") String standard, @RequestParam("mfrs") String mfrs,
@RequestParam("otherField1") String otherField1, @RequestParam("otherField2") String otherField2, @RequestParam("otherField1") String otherField1, @RequestParam("otherField2") String otherField2,
@RequestParam("otherField3") String otherField3, @RequestParam("unit") String unit,@RequestParam("unitId") Long unitId, @RequestParam("otherField3") String otherField3, @RequestParam("unit") String unit,@RequestParam("unitId") Long unitId,
HttpServletRequest request) { HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<String, Object>(); Map<String, Object> objectMap = new HashMap<String, Object>();
int exist = materialService.checkIsExist(id, name, model, color, standard, mfrs, int exist = materialService.checkIsExist(id, name, model, color, standard, mfrs,
otherField1, otherField2, otherField3, unit, unitId); otherField1, otherField2, otherField3, unit, unitId);
...@@ -68,7 +68,7 @@ public class MaterialController { ...@@ -68,7 +68,7 @@ public class MaterialController {
@PostMapping(value = "/batchSetEnable") @PostMapping(value = "/batchSetEnable")
public String batchSetEnable(@RequestParam("enabled") Boolean enabled, public String batchSetEnable(@RequestParam("enabled") Boolean enabled,
@RequestParam("materialIDs") String materialIDs, @RequestParam("materialIDs") String materialIDs,
HttpServletRequest request) { HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<String, Object>(); Map<String, Object> objectMap = new HashMap<String, Object>();
int res = materialService.batchSetEnable(enabled, materialIDs); int res = materialService.batchSetEnable(enabled, materialIDs);
if(res > 0) { if(res > 0) {
...@@ -85,7 +85,7 @@ public class MaterialController { ...@@ -85,7 +85,7 @@ public class MaterialController {
* @return * @return
*/ */
@GetMapping(value = "/findById") @GetMapping(value = "/findById")
public BaseResponseInfo findById(@RequestParam("id") Long id, HttpServletRequest request) { public BaseResponseInfo findById(@RequestParam("id") Long id, HttpServletRequest request) throws Exception{
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
try { try {
List<MaterialVo4Unit> list = materialService.findById(id); List<MaterialVo4Unit> list = materialService.findById(id);
...@@ -106,7 +106,7 @@ public class MaterialController { ...@@ -106,7 +106,7 @@ public class MaterialController {
* @return * @return
*/ */
@GetMapping(value = "/findBySelect") @GetMapping(value = "/findBySelect")
public JSONArray findBySelect(@RequestParam("mpList") String mpList, HttpServletRequest request) { public JSONArray findBySelect(@RequestParam("mpList") String mpList, HttpServletRequest request) throws Exception{
JSONArray dataArray = new JSONArray(); JSONArray dataArray = new JSONArray();
try { try {
List<MaterialVo4Unit> dataList = materialService.findBySelect(); List<MaterialVo4Unit> dataList = materialService.findBySelect();
...@@ -163,7 +163,7 @@ public class MaterialController { ...@@ -163,7 +163,7 @@ public class MaterialController {
* @return * @return
*/ */
@GetMapping(value = "/findByOrder") @GetMapping(value = "/findByOrder")
public BaseResponseInfo findByOrder(HttpServletRequest request) { public BaseResponseInfo findByOrder(HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
try { try {
...@@ -203,7 +203,7 @@ public class MaterialController { ...@@ -203,7 +203,7 @@ public class MaterialController {
@RequestParam("model") String model, @RequestParam("model") String model,
@RequestParam("categoryId") Long categoryId, @RequestParam("categoryId") Long categoryId,
@RequestParam("categoryIds") String categoryIds, @RequestParam("categoryIds") String categoryIds,
HttpServletRequest request, HttpServletResponse response) { HttpServletRequest request, HttpServletResponse response)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
String message = "成功"; String message = "成功";
...@@ -303,7 +303,7 @@ public class MaterialController { ...@@ -303,7 +303,7 @@ public class MaterialController {
response.sendRedirect("../pages/materials/material.html"); response.sendRedirect("../pages/materials/material.html");
} }
public BigDecimal parseBigDecimalEx(String str){ public BigDecimal parseBigDecimalEx(String str)throws Exception{
if(!StringUtil.isEmpty(str)) { if(!StringUtil.isEmpty(str)) {
return new BigDecimal(str); return new BigDecimal(str);
} else { } else {
...@@ -313,7 +313,7 @@ public class MaterialController { ...@@ -313,7 +313,7 @@ public class MaterialController {
@RequestMapping(value = "/getMaterialEnableSerialNumberList") @RequestMapping(value = "/getMaterialEnableSerialNumberList")
public String getMaterialEnableSerialNumberList(@RequestParam(value = Constants.PAGE_SIZE, required = false) Integer pageSize, public String getMaterialEnableSerialNumberList(@RequestParam(value = Constants.PAGE_SIZE, required = false) Integer pageSize,
@RequestParam(value = Constants.CURRENT_PAGE, required = false) Integer currentPage, @RequestParam(value = Constants.CURRENT_PAGE, required = false) Integer currentPage,
@RequestParam(value = Constants.SEARCH, required = false) String search) { @RequestParam(value = Constants.SEARCH, required = false) String search)throws Exception {
Map<String, Object> parameterMap = new HashMap<String, Object>(); Map<String, Object> parameterMap = new HashMap<String, Object>();
//查询参数 //查询参数
JSONObject obj=JSON.parseObject(search); JSONObject obj=JSON.parseObject(search);
......
...@@ -30,7 +30,7 @@ public class PersonController { ...@@ -30,7 +30,7 @@ public class PersonController {
private PersonService personService; private PersonService personService;
@GetMapping(value = "/getAllList") @GetMapping(value = "/getAllList")
public BaseResponseInfo getAllList(HttpServletRequest request) { public BaseResponseInfo getAllList(HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
try { try {
...@@ -53,7 +53,8 @@ public class PersonController { ...@@ -53,7 +53,8 @@ public class PersonController {
* @return * @return
*/ */
@GetMapping(value = "/getPersonByIds") @GetMapping(value = "/getPersonByIds")
public BaseResponseInfo getPersonByIds(@RequestParam("personIDs") String personIDs, HttpServletRequest request) { public BaseResponseInfo getPersonByIds(@RequestParam("personIDs") String personIDs,
HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
try { try {
...@@ -76,7 +77,8 @@ public class PersonController { ...@@ -76,7 +77,8 @@ public class PersonController {
* @return * @return
*/ */
@GetMapping(value = "/getPersonByType") @GetMapping(value = "/getPersonByType")
public BaseResponseInfo getPersonByType(@RequestParam("type") String type, HttpServletRequest request) { public BaseResponseInfo getPersonByType(@RequestParam("type") String type,
HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
try { try {
...@@ -99,7 +101,8 @@ public class PersonController { ...@@ -99,7 +101,8 @@ public class PersonController {
* @return * @return
*/ */
@PostMapping(value = "/getPersonByNumType") @PostMapping(value = "/getPersonByNumType")
public JSONArray getPersonByNumType(@RequestParam("type") String typeNum, HttpServletRequest request) { public JSONArray getPersonByNumType(@RequestParam("type") String typeNum,
HttpServletRequest request)throws Exception {
JSONArray dataArray = new JSONArray(); JSONArray dataArray = new JSONArray();
try { try {
String type = ""; String type = "";
......
...@@ -4,13 +4,16 @@ import com.alibaba.fastjson.JSONObject; ...@@ -4,13 +4,16 @@ import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.BusinessConstants; import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.service.CommonQueryManager; import com.jsh.erp.service.CommonQueryManager;
import com.jsh.erp.utils.*; import com.jsh.erp.utils.*;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.*; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.jsh.erp.utils.ResponseJsonUtil.returnJson; import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
...@@ -25,7 +28,7 @@ public class ResourceController { ...@@ -25,7 +28,7 @@ public class ResourceController {
private CommonQueryManager configResourceManager; private CommonQueryManager configResourceManager;
@GetMapping(value = "/test/heart") @GetMapping(value = "/test/heart")
public JSONObject exitHeart(HttpServletRequest request) { public JSONObject exitHeart(HttpServletRequest request)throws Exception {
return JsonUtils.ok(); return JsonUtils.ok();
} }
...@@ -34,7 +37,7 @@ public class ResourceController { ...@@ -34,7 +37,7 @@ public class ResourceController {
@RequestParam(value = Constants.PAGE_SIZE, required = false) Integer pageSize, @RequestParam(value = Constants.PAGE_SIZE, required = false) Integer pageSize,
@RequestParam(value = Constants.CURRENT_PAGE, required = false) Integer currentPage, @RequestParam(value = Constants.CURRENT_PAGE, required = false) Integer currentPage,
@RequestParam(value = Constants.SEARCH, required = false) String search, @RequestParam(value = Constants.SEARCH, required = false) String search,
HttpServletRequest request) { HttpServletRequest request)throws Exception {
Map<String, String> parameterMap = ParamUtils.requestToMap(request); Map<String, String> parameterMap = ParamUtils.requestToMap(request);
parameterMap.put(Constants.SEARCH, search); parameterMap.put(Constants.SEARCH, search);
PageQueryInfo queryInfo = new PageQueryInfo(); PageQueryInfo queryInfo = new PageQueryInfo();
...@@ -60,7 +63,7 @@ public class ResourceController { ...@@ -60,7 +63,7 @@ public class ResourceController {
@PostMapping(value = "/{apiName}/add", produces = {"application/javascript", "application/json"}) @PostMapping(value = "/{apiName}/add", produces = {"application/javascript", "application/json"})
public String addResource(@PathVariable("apiName") String apiName, public String addResource(@PathVariable("apiName") String apiName,
@RequestParam("info") String beanJson, HttpServletRequest request) { @RequestParam("info") String beanJson, HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<String, Object>(); Map<String, Object> objectMap = new HashMap<String, Object>();
int insert = configResourceManager.insert(apiName, beanJson, request); int insert = configResourceManager.insert(apiName, beanJson, request);
if(insert > 0) { if(insert > 0) {
...@@ -73,7 +76,7 @@ public class ResourceController { ...@@ -73,7 +76,7 @@ public class ResourceController {
@PostMapping(value = "/{apiName}/update", produces = {"application/javascript", "application/json"}) @PostMapping(value = "/{apiName}/update", produces = {"application/javascript", "application/json"})
public String updateResource(@PathVariable("apiName") String apiName, public String updateResource(@PathVariable("apiName") String apiName,
@RequestParam("info") String beanJson, @RequestParam("info") String beanJson,
@RequestParam("id") Long id, HttpServletRequest request) { @RequestParam("id") Long id, HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<String, Object>(); Map<String, Object> objectMap = new HashMap<String, Object>();
int update = configResourceManager.update(apiName, beanJson, id, request); int update = configResourceManager.update(apiName, beanJson, id, request);
if(update > 0) { if(update > 0) {
...@@ -85,7 +88,7 @@ public class ResourceController { ...@@ -85,7 +88,7 @@ public class ResourceController {
@PostMapping(value = "/{apiName}/{id}/delete", produces = {"application/javascript", "application/json"}) @PostMapping(value = "/{apiName}/{id}/delete", produces = {"application/javascript", "application/json"})
public String deleteResource(@PathVariable("apiName") String apiName, public String deleteResource(@PathVariable("apiName") String apiName,
@PathVariable Long id, HttpServletRequest request) { @PathVariable Long id, HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<String, Object>(); Map<String, Object> objectMap = new HashMap<String, Object>();
int delete = configResourceManager.delete(apiName, id, request); int delete = configResourceManager.delete(apiName, id, request);
if(delete > 0) { if(delete > 0) {
...@@ -97,7 +100,7 @@ public class ResourceController { ...@@ -97,7 +100,7 @@ public class ResourceController {
@PostMapping(value = "/{apiName}/batchDelete", produces = {"application/javascript", "application/json"}) @PostMapping(value = "/{apiName}/batchDelete", produces = {"application/javascript", "application/json"})
public String batchDeleteResource(@PathVariable("apiName") String apiName, public String batchDeleteResource(@PathVariable("apiName") String apiName,
@RequestParam("ids") String ids, HttpServletRequest request) { @RequestParam("ids") String ids, HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<String, Object>(); Map<String, Object> objectMap = new HashMap<String, Object>();
int delete = configResourceManager.batchDelete(apiName, ids, request); int delete = configResourceManager.batchDelete(apiName, ids, request);
if(delete > 0) { if(delete > 0) {
...@@ -110,7 +113,7 @@ public class ResourceController { ...@@ -110,7 +113,7 @@ public class ResourceController {
@GetMapping(value = "/{apiName}/checkIsNameExist") @GetMapping(value = "/{apiName}/checkIsNameExist")
public String checkIsNameExist(@PathVariable("apiName") String apiName, public String checkIsNameExist(@PathVariable("apiName") String apiName,
@RequestParam Long id, @RequestParam(value ="name", required = false) String name, @RequestParam Long id, @RequestParam(value ="name", required = false) String name,
HttpServletRequest request) { HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<String, Object>(); Map<String, Object> objectMap = new HashMap<String, Object>();
int exist = configResourceManager.checkIsNameExist(apiName, id, name); int exist = configResourceManager.checkIsNameExist(apiName, id, name);
if(exist > 0) { if(exist > 0) {
......
...@@ -37,7 +37,7 @@ public class RoleController { ...@@ -37,7 +37,7 @@ public class RoleController {
*/ */
@PostMapping(value = "/findUserRole") @PostMapping(value = "/findUserRole")
public JSONArray findUserRole(@RequestParam("UBType") String type, @RequestParam("UBKeyId") String keyId, public JSONArray findUserRole(@RequestParam("UBType") String type, @RequestParam("UBKeyId") String keyId,
HttpServletRequest request) { HttpServletRequest request)throws Exception {
JSONArray arr = new JSONArray(); JSONArray arr = new JSONArray();
try { try {
List<Role> dataList = roleService.findUserRole(); List<Role> dataList = roleService.findUserRole();
...@@ -76,7 +76,7 @@ public class RoleController { ...@@ -76,7 +76,7 @@ public class RoleController {
} }
@PostMapping(value = "/list") @PostMapping(value = "/list")
public List<Role> list(HttpServletRequest request) { public List<Role> list(HttpServletRequest request)throws Exception {
return roleService.getRole(); return roleService.getRole();
} }
......
...@@ -61,7 +61,7 @@ public class SerialNumberController { ...@@ -61,7 +61,7 @@ public class SerialNumberController {
*/ */
@PostMapping("/serialNumber/addSerialNumber") @PostMapping("/serialNumber/addSerialNumber")
@ResponseBody @ResponseBody
public Object addSerialNumber(@RequestParam("info") String beanJson){ public Object addSerialNumber(@RequestParam("info") String beanJson)throws Exception{
JSONObject result = ExceptionConstants.standardSuccess(); JSONObject result = ExceptionConstants.standardSuccess();
SerialNumberEx sne= JSON.parseObject(beanJson, SerialNumberEx.class); SerialNumberEx sne= JSON.parseObject(beanJson, SerialNumberEx.class);
serialNumberService.addSerialNumber(sne); serialNumberService.addSerialNumber(sne);
...@@ -78,7 +78,7 @@ public class SerialNumberController { ...@@ -78,7 +78,7 @@ public class SerialNumberController {
*/ */
@PostMapping("/serialNumber/updateSerialNumber") @PostMapping("/serialNumber/updateSerialNumber")
@ResponseBody @ResponseBody
public Object updateSerialNumber(@RequestParam("info") String beanJson){ public Object updateSerialNumber(@RequestParam("info") String beanJson)throws Exception{
JSONObject result = ExceptionConstants.standardSuccess(); JSONObject result = ExceptionConstants.standardSuccess();
SerialNumberEx sne= JSON.parseObject(beanJson, SerialNumberEx.class); SerialNumberEx sne= JSON.parseObject(beanJson, SerialNumberEx.class);
...@@ -100,7 +100,7 @@ public class SerialNumberController { ...@@ -100,7 +100,7 @@ public class SerialNumberController {
@PostMapping("/serialNumber/batAddSerialNumber") @PostMapping("/serialNumber/batAddSerialNumber")
@ResponseBody @ResponseBody
public Object batAddSerialNumber(@RequestParam("materialName") String materialName, @RequestParam("serialNumberPrefix") String serialNumberPrefix, public Object batAddSerialNumber(@RequestParam("materialName") String materialName, @RequestParam("serialNumberPrefix") String serialNumberPrefix,
@RequestParam("batAddTotal") Integer batAddTotal,@RequestParam("remark") String remark){ @RequestParam("batAddTotal") Integer batAddTotal,@RequestParam("remark") String remark)throws Exception{
JSONObject result = ExceptionConstants.standardSuccess(); JSONObject result = ExceptionConstants.standardSuccess();
serialNumberService.batAddSerialNumber(materialName,serialNumberPrefix,batAddTotal,remark); serialNumberService.batAddSerialNumber(materialName,serialNumberPrefix,batAddTotal,remark);
......
...@@ -57,7 +57,7 @@ public class SupplierController { ...@@ -57,7 +57,7 @@ public class SupplierController {
@PostMapping(value = "/updateAdvanceIn") @PostMapping(value = "/updateAdvanceIn")
public String updateAdvanceIn(@RequestParam("supplierId") Long supplierId, public String updateAdvanceIn(@RequestParam("supplierId") Long supplierId,
@RequestParam("advanceIn") BigDecimal advanceIn, @RequestParam("advanceIn") BigDecimal advanceIn,
HttpServletRequest request) { HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<String, Object>(); Map<String, Object> objectMap = new HashMap<String, Object>();
int res = supplierService.updateAdvanceIn(supplierId, advanceIn); int res = supplierService.updateAdvanceIn(supplierId, advanceIn);
if(res > 0) { if(res > 0) {
...@@ -73,7 +73,7 @@ public class SupplierController { ...@@ -73,7 +73,7 @@ public class SupplierController {
* @return * @return
*/ */
@PostMapping(value = "/findBySelect_cus") @PostMapping(value = "/findBySelect_cus")
public JSONArray findBySelectCus(HttpServletRequest request) { public JSONArray findBySelectCus(HttpServletRequest request)throws Exception {
JSONArray arr = new JSONArray(); JSONArray arr = new JSONArray();
try { try {
List<Supplier> supplierList = supplierService.findBySelectCus(); List<Supplier> supplierList = supplierService.findBySelectCus();
...@@ -108,7 +108,7 @@ public class SupplierController { ...@@ -108,7 +108,7 @@ public class SupplierController {
* @return * @return
*/ */
@PostMapping(value = "/findBySelect_sup") @PostMapping(value = "/findBySelect_sup")
public JSONArray findBySelectSup(HttpServletRequest request) { public JSONArray findBySelectSup(HttpServletRequest request) throws Exception{
JSONArray arr = new JSONArray(); JSONArray arr = new JSONArray();
try { try {
List<Supplier> supplierList = supplierService.findBySelectSup(); List<Supplier> supplierList = supplierService.findBySelectSup();
...@@ -135,7 +135,7 @@ public class SupplierController { ...@@ -135,7 +135,7 @@ public class SupplierController {
* @return * @return
*/ */
@PostMapping(value = "/findBySelect_retail") @PostMapping(value = "/findBySelect_retail")
public JSONArray findBySelectRetail(HttpServletRequest request) { public JSONArray findBySelectRetail(HttpServletRequest request)throws Exception {
JSONArray arr = new JSONArray(); JSONArray arr = new JSONArray();
try { try {
List<Supplier> supplierList = supplierService.findBySelectRetail(); List<Supplier> supplierList = supplierService.findBySelectRetail();
...@@ -165,7 +165,7 @@ public class SupplierController { ...@@ -165,7 +165,7 @@ public class SupplierController {
*/ */
@GetMapping(value = "/findById") @GetMapping(value = "/findById")
public BaseResponseInfo findById(@RequestParam("supplierId") Long supplierId, public BaseResponseInfo findById(@RequestParam("supplierId") Long supplierId,
HttpServletRequest request) { HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
try { try {
JSONArray dataArray = new JSONArray(); JSONArray dataArray = new JSONArray();
...@@ -221,7 +221,7 @@ public class SupplierController { ...@@ -221,7 +221,7 @@ public class SupplierController {
@PostMapping(value = "/batchSetEnable") @PostMapping(value = "/batchSetEnable")
public String batchSetEnable(@RequestParam("enabled") Boolean enabled, public String batchSetEnable(@RequestParam("enabled") Boolean enabled,
@RequestParam("supplierIDs") String supplierIDs, @RequestParam("supplierIDs") String supplierIDs,
HttpServletRequest request) { HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<String, Object>(); Map<String, Object> objectMap = new HashMap<String, Object>();
int res = supplierService.batchSetEnable(enabled, supplierIDs); int res = supplierService.batchSetEnable(enabled, supplierIDs);
if(res > 0) { if(res > 0) {
...@@ -240,7 +240,7 @@ public class SupplierController { ...@@ -240,7 +240,7 @@ public class SupplierController {
*/ */
@PostMapping(value = "/findUserCustomer") @PostMapping(value = "/findUserCustomer")
public JSONArray findUserCustomer(@RequestParam("UBType") String type, @RequestParam("UBKeyId") String keyId, public JSONArray findUserCustomer(@RequestParam("UBType") String type, @RequestParam("UBKeyId") String keyId,
HttpServletRequest request) { HttpServletRequest request) throws Exception{
JSONArray arr = new JSONArray(); JSONArray arr = new JSONArray();
try { try {
List<Supplier> dataList = supplierService.findUserCustomer(); List<Supplier> dataList = supplierService.findUserCustomer();
...@@ -295,7 +295,7 @@ public class SupplierController { ...@@ -295,7 +295,7 @@ public class SupplierController {
@RequestParam("phonenum") String phonenum, @RequestParam("phonenum") String phonenum,
@RequestParam("telephone") String telephone, @RequestParam("telephone") String telephone,
@RequestParam("description") String description, @RequestParam("description") String description,
HttpServletRequest request, HttpServletResponse response) { HttpServletRequest request, HttpServletResponse response)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
String message = "成功"; String message = "成功";
...@@ -382,7 +382,7 @@ public class SupplierController { ...@@ -382,7 +382,7 @@ public class SupplierController {
importFun(supplierFile); importFun(supplierFile);
response.sendRedirect("../pages/manage/member.html"); response.sendRedirect("../pages/manage/member.html");
} }
public String importFun(MultipartFile supplierFile){ public String importFun(MultipartFile supplierFile)throws Exception{
BaseResponseInfo info = new BaseResponseInfo(); BaseResponseInfo info = new BaseResponseInfo();
Map<String, Object> data = new HashMap<String, Object>(); Map<String, Object> data = new HashMap<String, Object>();
...@@ -436,7 +436,7 @@ public class SupplierController { ...@@ -436,7 +436,7 @@ public class SupplierController {
return null; return null;
} }
public BigDecimal parseBigDecimalEx(String str){ public BigDecimal parseBigDecimalEx(String str)throws Exception{
if(!StringUtil.isEmpty(str)) { if(!StringUtil.isEmpty(str)) {
return new BigDecimal(str); return new BigDecimal(str);
} else { } else {
......
...@@ -36,7 +36,7 @@ public class UserBusinessController { ...@@ -36,7 +36,7 @@ public class UserBusinessController {
@GetMapping(value = "/getBasicData") @GetMapping(value = "/getBasicData")
public BaseResponseInfo getBasicData(@RequestParam(value = "KeyId") String keyId, public BaseResponseInfo getBasicData(@RequestParam(value = "KeyId") String keyId,
@RequestParam(value = "Type") String type, @RequestParam(value = "Type") String type,
HttpServletRequest request) { HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
try { try {
List<UserBusiness> list = userBusinessService.getBasicData(keyId, type); List<UserBusiness> list = userBusinessService.getBasicData(keyId, type);
...@@ -55,7 +55,7 @@ public class UserBusinessController { ...@@ -55,7 +55,7 @@ public class UserBusinessController {
@GetMapping(value = "/checkIsValueExist") @GetMapping(value = "/checkIsValueExist")
public String checkIsValueExist(@RequestParam(value ="type", required = false) String type, public String checkIsValueExist(@RequestParam(value ="type", required = false) String type,
@RequestParam(value ="keyId", required = false) String keyId, @RequestParam(value ="keyId", required = false) String keyId,
HttpServletRequest request) { HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<String, Object>(); Map<String, Object> objectMap = new HashMap<String, Object>();
Long id = userBusinessService.checkIsValueExist(type, keyId); Long id = userBusinessService.checkIsValueExist(type, keyId);
if(id != null) { if(id != null) {
...@@ -76,7 +76,7 @@ public class UserBusinessController { ...@@ -76,7 +76,7 @@ public class UserBusinessController {
@PostMapping(value = "/updateBtnStr") @PostMapping(value = "/updateBtnStr")
public BaseResponseInfo updateBtnStr(@RequestParam(value ="userBusinessId", required = false) Long userBusinessId, public BaseResponseInfo updateBtnStr(@RequestParam(value ="userBusinessId", required = false) Long userBusinessId,
@RequestParam(value ="btnStr", required = false) String btnStr, @RequestParam(value ="btnStr", required = false) String btnStr,
HttpServletRequest request) { HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
try { try {
int back = userBusinessService.updateBtnStr(userBusinessId, btnStr); int back = userBusinessService.updateBtnStr(userBusinessId, btnStr);
......
...@@ -59,7 +59,7 @@ public class UserController { ...@@ -59,7 +59,7 @@ public class UserController {
@PostMapping(value = "/login") @PostMapping(value = "/login")
public BaseResponseInfo login(@RequestParam(value = "loginame", required = false) String loginame, public BaseResponseInfo login(@RequestParam(value = "loginame", required = false) String loginame,
@RequestParam(value = "password", required = false) String password, @RequestParam(value = "password", required = false) String password,
HttpServletRequest request) { HttpServletRequest request)throws Exception {
logger.info("============用户登录 login 方法调用开始=============="); logger.info("============用户登录 login 方法调用开始==============");
String msgTip = ""; String msgTip = "";
User user=null; User user=null;
...@@ -150,7 +150,7 @@ public class UserController { ...@@ -150,7 +150,7 @@ public class UserController {
} }
@GetMapping(value = "/getUserSession") @GetMapping(value = "/getUserSession")
public BaseResponseInfo getSessionUser(HttpServletRequest request) { public BaseResponseInfo getSessionUser(HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
try { try {
Map<String, Object> data = new HashMap<String, Object>(); Map<String, Object> data = new HashMap<String, Object>();
...@@ -171,7 +171,7 @@ public class UserController { ...@@ -171,7 +171,7 @@ public class UserController {
} }
@GetMapping(value = "/logout") @GetMapping(value = "/logout")
public BaseResponseInfo logout(HttpServletRequest request, HttpServletResponse response) { public BaseResponseInfo logout(HttpServletRequest request, HttpServletResponse response)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
try { try {
request.getSession().removeAttribute("user"); request.getSession().removeAttribute("user");
...@@ -192,7 +192,7 @@ public class UserController { ...@@ -192,7 +192,7 @@ public class UserController {
@PostMapping(value = "/resetPwd") @PostMapping(value = "/resetPwd")
public String resetPwd(@RequestParam("id") Long id, public String resetPwd(@RequestParam("id") Long id,
HttpServletRequest request) throws NoSuchAlgorithmException { HttpServletRequest request) throws Exception {
Map<String, Object> objectMap = new HashMap<String, Object>(); Map<String, Object> objectMap = new HashMap<String, Object>();
String password = "123456"; String password = "123456";
String md5Pwd = Tools.md5Encryp(password); String md5Pwd = Tools.md5Encryp(password);
...@@ -206,7 +206,7 @@ public class UserController { ...@@ -206,7 +206,7 @@ public class UserController {
@PostMapping(value = "/updatePwd") @PostMapping(value = "/updatePwd")
public String updatePwd(@RequestParam("userId") Long userId, @RequestParam("password") String password, public String updatePwd(@RequestParam("userId") Long userId, @RequestParam("password") String password,
@RequestParam("oldpwd") String oldpwd, HttpServletRequest request) { @RequestParam("oldpwd") String oldpwd, HttpServletRequest request)throws Exception {
Integer flag = 0; Integer flag = 0;
Map<String, Object> objectMap = new HashMap<String, Object>(); Map<String, Object> objectMap = new HashMap<String, Object>();
try { try {
...@@ -242,7 +242,7 @@ public class UserController { ...@@ -242,7 +242,7 @@ public class UserController {
* @return * @return
*/ */
@GetMapping(value = "/getAllList") @GetMapping(value = "/getAllList")
public BaseResponseInfo getAllList(HttpServletRequest request) { public BaseResponseInfo getAllList(HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
try { try {
Map<String, Object> data = new HashMap<String, Object>(); Map<String, Object> data = new HashMap<String, Object>();
...@@ -425,7 +425,7 @@ public class UserController { ...@@ -425,7 +425,7 @@ public class UserController {
} }
@GetMapping("/getTenantStatus") @GetMapping("/getTenantStatus")
public BaseResponseInfo getTenantStatus(HttpServletRequest request) { public BaseResponseInfo getTenantStatus(HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
try { try {
Map<String, Object> data = new HashMap<String, Object>(); Map<String, Object> data = new HashMap<String, Object>();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment