给单据等其它模块优化接口

This commit is contained in:
jishenghua 2025-02-24 00:49:03 +08:00
parent e589d5f9cd
commit 1122598771
63 changed files with 540 additions and 2197 deletions

View File

@ -1,27 +1,31 @@
package com.jsh.erp.controller;
import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.base.BaseController;
import com.jsh.erp.base.TableDataInfo;
import com.jsh.erp.constants.ExceptionConstants;
import com.jsh.erp.datasource.entities.AccountHead;
import com.jsh.erp.datasource.entities.AccountHeadVo4Body;
import com.jsh.erp.datasource.entities.AccountHeadVo4ListEx;
import com.jsh.erp.service.accountHead.AccountHeadService;
import com.jsh.erp.utils.BaseResponseInfo;
import com.jsh.erp.utils.Constants;
import com.jsh.erp.utils.ErpInfo;
import com.jsh.erp.utils.StringUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
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.returnStr;
/**
* @author jishenghua 752*718*920
@ -29,12 +33,62 @@ import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
@RestController
@RequestMapping(value = "/accountHead")
@Api(tags = {"财务管理"})
public class AccountHeadController {
public class AccountHeadController extends BaseController {
private Logger logger = LoggerFactory.getLogger(AccountHeadController.class);
@Resource
private AccountHeadService accountHeadService;
@GetMapping(value = "/info")
@ApiOperation(value = "根据id获取信息")
public String getList(@RequestParam("id") Long id,
HttpServletRequest request) throws Exception {
AccountHead accountHead = accountHeadService.getAccountHead(id);
Map<String, Object> objectMap = new HashMap<>();
if(accountHead != null) {
objectMap.put("info", accountHead);
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
} else {
return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code);
}
}
@GetMapping(value = "/list")
@ApiOperation(value = "获取信息列表")
public TableDataInfo getList(@RequestParam(value = Constants.SEARCH, required = false) String search,
HttpServletRequest request)throws Exception {
String type = StringUtil.getInfo(search, "type");
String billNo = StringUtil.getInfo(search, "billNo");
String beginTime = StringUtil.getInfo(search, "beginTime");
String endTime = StringUtil.getInfo(search, "endTime");
Long organId = StringUtil.parseStrLong(StringUtil.getInfo(search, "organId"));
Long creator = StringUtil.parseStrLong(StringUtil.getInfo(search, "creator"));
Long handsPersonId = StringUtil.parseStrLong(StringUtil.getInfo(search, "handsPersonId"));
Long accountId = StringUtil.parseStrLong(StringUtil.getInfo(search, "accountId"));
String status = StringUtil.getInfo(search, "status");
String remark = StringUtil.getInfo(search, "remark");
String number = StringUtil.getInfo(search, "number");
List<AccountHeadVo4ListEx> list = accountHeadService.select(type, billNo, beginTime, endTime, organId, creator,
handsPersonId, accountId, status, remark, number);
return getDataTable(list);
}
@DeleteMapping(value = "/delete")
@ApiOperation(value = "删除")
public String deleteResource(@RequestParam("id") Long id, HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<>();
int delete = accountHeadService.deleteAccountHead(id, request);
return returnStr(objectMap, delete);
}
@DeleteMapping(value = "/deleteBatch")
@ApiOperation(value = "批量删除")
public String batchDeleteResource(@RequestParam("ids") String ids, HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<>();
int delete = accountHeadService.batchDeleteAccountHead(ids, request);
return returnStr(objectMap, delete);
}
/**
* 批量设置状态-审核或者反审核
* @param jsonObject

View File

@ -2,6 +2,8 @@ package com.jsh.erp.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.base.BaseController;
import com.jsh.erp.base.TableDataInfo;
import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.constants.ExceptionConstants;
import com.jsh.erp.datasource.entities.DepotHead;
@ -32,6 +34,7 @@ import java.util.List;
import java.util.Map;
import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
import static com.jsh.erp.utils.ResponseJsonUtil.returnStr;
/**
* @author ji-sheng-hua 752*718*920
@ -39,7 +42,7 @@ import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
@RestController
@RequestMapping(value = "/depotHead")
@Api(tags = {"单据管理"})
public class DepotHeadController {
public class DepotHeadController extends BaseController {
private Logger logger = LoggerFactory.getLogger(DepotHeadController.class);
@Resource
@ -57,6 +60,61 @@ public class DepotHeadController {
@Resource
private UserService userService;
@GetMapping(value = "/info")
@ApiOperation(value = "根据id获取信息")
public String getList(@RequestParam("id") Long id,
HttpServletRequest request) throws Exception {
DepotHead depotHead = depotHeadService.getDepotHead(id);
Map<String, Object> objectMap = new HashMap<>();
if(depotHead != null) {
objectMap.put("info", depotHead);
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
} else {
return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code);
}
}
@GetMapping(value = "/list")
@ApiOperation(value = "获取信息列表")
public TableDataInfo getList(@RequestParam(value = Constants.SEARCH, required = false) String search,
HttpServletRequest request)throws Exception {
String type = StringUtil.getInfo(search, "type");
String subType = StringUtil.getInfo(search, "subType");
String hasDebt = StringUtil.getInfo(search, "hasDebt");
String status = StringUtil.getInfo(search, "status");
String purchaseStatus = StringUtil.getInfo(search, "purchaseStatus");
String number = StringUtil.getInfo(search, "number");
String linkApply = StringUtil.getInfo(search, "linkApply");
String linkNumber = StringUtil.getInfo(search, "linkNumber");
String beginTime = StringUtil.getInfo(search, "beginTime");
String endTime = StringUtil.getInfo(search, "endTime");
String materialParam = StringUtil.getInfo(search, "materialParam");
Long organId = StringUtil.parseStrLong(StringUtil.getInfo(search, "organId"));
Long creator = StringUtil.parseStrLong(StringUtil.getInfo(search, "creator"));
Long depotId = StringUtil.parseStrLong(StringUtil.getInfo(search, "depotId"));
Long accountId = StringUtil.parseStrLong(StringUtil.getInfo(search, "accountId"));
String remark = StringUtil.getInfo(search, "remark");
List<DepotHeadVo4List> list = depotHeadService.select(type, subType, hasDebt, status, purchaseStatus, number, linkApply, linkNumber,
beginTime, endTime, materialParam, organId, creator, depotId, accountId, remark);
return getDataTable(list);
}
@DeleteMapping(value = "/delete")
@ApiOperation(value = "删除")
public String deleteResource(@RequestParam("id") Long id, HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<>();
int delete = depotHeadService.deleteDepotHead(id, request);
return returnStr(objectMap, delete);
}
@DeleteMapping(value = "/deleteBatch")
@ApiOperation(value = "批量删除")
public String batchDeleteResource(@RequestParam("ids") String ids, HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<>();
int delete = depotHeadService.batchDeleteDepotHead(ids, request);
return returnStr(objectMap, delete);
}
/**
* 批量设置状态-审核或者反审核
* @param jsonObject

View File

@ -1,130 +0,0 @@
package com.jsh.erp.controller;
import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.service.CommonQueryManager;
import com.jsh.erp.utils.Constants;
import com.jsh.erp.utils.ErpInfo;
import com.jsh.erp.utils.ParamUtils;
import com.jsh.erp.utils.StringUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
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.returnStr;
/**
* by jishenghua 2018-9-12 23:58:10 管伊佳erp
*/
@RestController
@Api(tags = {"资源接口"})
public class ResourceController {
@Resource
private CommonQueryManager configResourceManager;
@GetMapping(value = "/{apiName}/info")
@ApiOperation(value = "根据id获取信息")
public String getList(@PathVariable("apiName") String apiName,
@RequestParam("id") Long id,
HttpServletRequest request) throws Exception {
Object obj = configResourceManager.selectOne(apiName, id);
Map<String, Object> objectMap = new HashMap<String, Object>();
if(obj != null) {
objectMap.put("info", obj);
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
} else {
return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code);
}
}
@GetMapping(value = "/{apiName}/list")
@ApiOperation(value = "获取信息列表")
public String getList(@PathVariable("apiName") String apiName,
@RequestParam(value = Constants.PAGE_SIZE, required = false) Integer pageSize,
@RequestParam(value = Constants.CURRENT_PAGE, required = false) Integer currentPage,
@RequestParam(value = Constants.SEARCH, required = false) String search,
HttpServletRequest request)throws Exception {
Map<String, String> parameterMap = ParamUtils.requestToMap(request);
parameterMap.put(Constants.SEARCH, search);
Map<String, Object> objectMap = new HashMap<String, Object>();
if (pageSize != null && pageSize <= 0) {
pageSize = 10;
}
String offset = ParamUtils.getPageOffset(currentPage, pageSize);
if (StringUtil.isNotEmpty(offset)) {
parameterMap.put(Constants.OFFSET, offset);
}
List<?> list = configResourceManager.select(apiName, parameterMap);
if (list != null) {
objectMap.put("total", configResourceManager.counts(apiName, parameterMap));
objectMap.put("rows", list);
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
} else {
objectMap.put("total", BusinessConstants.DEFAULT_LIST_NULL_NUMBER);
objectMap.put("rows", new ArrayList<Object>());
return returnJson(objectMap, "查找不到数据", ErpInfo.OK.code);
}
}
@PostMapping(value = "/{apiName}/add", produces = {"application/javascript", "application/json"})
@ApiOperation(value = "新增")
public String addResource(@PathVariable("apiName") String apiName,
@RequestBody JSONObject obj, HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<String, Object>();
int insert = configResourceManager.insert(apiName, obj, request);
return returnStr(objectMap, insert);
}
@PutMapping(value = "/{apiName}/update", produces = {"application/javascript", "application/json"})
@ApiOperation(value = "修改")
public String updateResource(@PathVariable("apiName") String apiName,
@RequestBody JSONObject obj, HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<String, Object>();
int update = configResourceManager.update(apiName, obj, request);
return returnStr(objectMap, update);
}
@DeleteMapping(value = "/{apiName}/delete", produces = {"application/javascript", "application/json"})
@ApiOperation(value = "删除")
public String deleteResource(@PathVariable("apiName") String apiName,
@RequestParam("id") Long id, HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<String, Object>();
int delete = configResourceManager.delete(apiName, id, request);
return returnStr(objectMap, delete);
}
@DeleteMapping(value = "/{apiName}/deleteBatch", produces = {"application/javascript", "application/json"})
@ApiOperation(value = "批量删除")
public String batchDeleteResource(@PathVariable("apiName") String apiName,
@RequestParam("ids") String ids, HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<String, Object>();
int delete = configResourceManager.deleteBatch(apiName, ids, request);
return returnStr(objectMap, delete);
}
@GetMapping(value = "/{apiName}/checkIsNameExist")
@ApiOperation(value = "检查名称是否存在")
public String checkIsNameExist(@PathVariable("apiName") String apiName,
@RequestParam Long id, @RequestParam(value ="name", required = false) String name,
HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<String, Object>();
int exist = configResourceManager.checkIsNameExist(apiName, id, name);
if(exist > 0) {
objectMap.put("status", true);
} else {
objectMap.put("status", false);
}
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
}
}

View File

@ -4,14 +4,12 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.base.BaseController;
import com.jsh.erp.base.TableDataInfo;
import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.datasource.entities.Role;
import com.jsh.erp.datasource.entities.RoleEx;
import com.jsh.erp.service.role.RoleService;
import com.jsh.erp.service.userBusiness.UserBusinessService;
import com.jsh.erp.utils.Constants;
import com.jsh.erp.utils.ErpInfo;
import com.jsh.erp.utils.ParamUtils;
import com.jsh.erp.utils.StringUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -21,7 +19,6 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

View File

@ -24,8 +24,7 @@ import static com.jsh.erp.utils.ResponseJsonUtil.returnStr;
/**
* Description
*
* @Author: cjl
* @Author: jsh
* @Date: 2019/1/22 10:29
*/
@RestController
@ -42,14 +41,7 @@ public class SerialNumberController {
private DepotItemService depotItemService;
/**
* create by: cjl
* description:
*批量添加序列号
* create time: 2019/1/29 15:11
* @Param: materialName
* @Param: serialNumberPrefix
* @Param: batAddTotal
* @Param: remark
* create by: jsh
* @return java.lang.Object
*/
@PostMapping("/batAddSerialNumber")

View File

@ -2,14 +2,14 @@ package com.jsh.erp.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.base.BaseController;
import com.jsh.erp.base.TableDataInfo;
import com.jsh.erp.datasource.entities.Supplier;
import com.jsh.erp.service.supplier.SupplierService;
import com.jsh.erp.service.systemConfig.SystemConfigService;
import com.jsh.erp.service.user.UserService;
import com.jsh.erp.service.userBusiness.UserBusinessService;
import com.jsh.erp.utils.BaseResponseInfo;
import com.jsh.erp.utils.ErpInfo;
import com.jsh.erp.utils.ExcelUtils;
import com.jsh.erp.utils.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
@ -26,6 +26,7 @@ import java.util.List;
import java.util.Map;
import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
import static com.jsh.erp.utils.ResponseJsonUtil.returnStr;
/**
* @author ji|sheng|hua 管伊佳erp
@ -33,7 +34,7 @@ import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
@RestController
@RequestMapping(value = "/supplier")
@Api(tags = {"商家管理"})
public class SupplierController {
public class SupplierController extends BaseController {
private Logger logger = LoggerFactory.getLogger(SupplierController.class);
@Resource
@ -48,6 +49,78 @@ public class SupplierController {
@Resource
private UserService userService;
@GetMapping(value = "/info")
@ApiOperation(value = "根据id获取信息")
public String getList(@RequestParam("id") Long id,
HttpServletRequest request) throws Exception {
Supplier supplier = supplierService.getSupplier(id);
Map<String, Object> objectMap = new HashMap<>();
if(supplier != null) {
objectMap.put("info", supplier);
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
} else {
return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code);
}
}
@GetMapping(value = "/list")
@ApiOperation(value = "获取信息列表")
public TableDataInfo getList(@RequestParam(value = Constants.SEARCH, required = false) String search,
HttpServletRequest request)throws Exception {
String supplier = StringUtil.getInfo(search, "supplier");
String type = StringUtil.getInfo(search, "type");
String phonenum = StringUtil.getInfo(search, "phonenum");
String telephone = StringUtil.getInfo(search, "telephone");
List<Supplier> list = supplierService.select(supplier, type, phonenum, telephone);
return getDataTable(list);
}
@PostMapping(value = "/add")
@ApiOperation(value = "新增")
public String addResource(@RequestBody JSONObject obj, HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<>();
int insert = supplierService.insertSupplier(obj, request);
return returnStr(objectMap, insert);
}
@PutMapping(value = "/update")
@ApiOperation(value = "修改")
public String updateResource(@RequestBody JSONObject obj, HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<>();
int update = supplierService.updateSupplier(obj, request);
return returnStr(objectMap, update);
}
@DeleteMapping(value = "/delete")
@ApiOperation(value = "删除")
public String deleteResource(@RequestParam("id") Long id, HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<>();
int delete = supplierService.deleteSupplier(id, request);
return returnStr(objectMap, delete);
}
@DeleteMapping(value = "/deleteBatch")
@ApiOperation(value = "批量删除")
public String batchDeleteResource(@RequestParam("ids") String ids, HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<>();
int delete = supplierService.batchDeleteSupplier(ids, request);
return returnStr(objectMap, delete);
}
@GetMapping(value = "/checkIsNameExist")
@ApiOperation(value = "检查名称是否存在")
public String checkIsNameExist(@RequestParam Long id, @RequestParam(value ="name", required = false) String name,
HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<>();
int exist = supplierService.checkIsNameExist(id, name);
if(exist > 0) {
objectMap.put("status", true);
} else {
objectMap.put("status", false);
}
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
}
@GetMapping(value = "/checkIsNameAndTypeExist")
@ApiOperation(value = "检查名称和类型是否存在")
public String checkIsNameAndTypeExist(@RequestParam Long id,

View File

@ -2,14 +2,15 @@ package com.jsh.erp.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.base.BaseController;
import com.jsh.erp.base.TableDataInfo;
import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.datasource.entities.SystemConfig;
import com.jsh.erp.service.depot.DepotService;
import com.jsh.erp.service.systemConfig.SystemConfigService;
import com.jsh.erp.service.user.UserService;
import com.jsh.erp.service.userBusiness.UserBusinessService;
import com.jsh.erp.utils.BaseResponseInfo;
import com.jsh.erp.utils.FileUtils;
import com.jsh.erp.utils.StringUtil;
import com.jsh.erp.utils.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
@ -29,7 +30,13 @@ import java.awt.image.BufferedImage;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
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.returnStr;
/**
* Description
@ -39,18 +46,9 @@ import java.util.List;
@RestController
@RequestMapping(value = "/systemConfig")
@Api(tags = {"系统参数"})
public class SystemConfigController {
public class SystemConfigController extends BaseController {
private Logger logger = LoggerFactory.getLogger(SystemConfigController.class);
@Resource
private UserService userService;
@Resource
private DepotService depotService;
@Resource
private UserBusinessService userBusinessService;
@Resource
private SystemConfigService systemConfigService;
@ -66,6 +64,75 @@ public class SystemConfigController {
@Value(value="${spring.servlet.multipart.max-request-size}")
private Long maxRequestSize;
@GetMapping(value = "/info")
@ApiOperation(value = "根据id获取信息")
public String getList(@RequestParam("id") Long id,
HttpServletRequest request) throws Exception {
SystemConfig systemConfig = systemConfigService.getSystemConfig(id);
Map<String, Object> objectMap = new HashMap<>();
if(systemConfig != null) {
objectMap.put("info", systemConfig);
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
} else {
return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code);
}
}
@GetMapping(value = "/list")
@ApiOperation(value = "获取信息列表")
public TableDataInfo getList(@RequestParam(value = Constants.SEARCH, required = false) String search,
HttpServletRequest request)throws Exception {
String companyName = StringUtil.getInfo(search, "companyName");
List<SystemConfig> list = systemConfigService.select(companyName);
return getDataTable(list);
}
@PostMapping(value = "/add")
@ApiOperation(value = "新增")
public String addResource(@RequestBody JSONObject obj, HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<>();
int insert = systemConfigService.insertSystemConfig(obj, request);
return returnStr(objectMap, insert);
}
@PutMapping(value = "/update")
@ApiOperation(value = "修改")
public String updateResource(@RequestBody JSONObject obj, HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<>();
int update = systemConfigService.updateSystemConfig(obj, request);
return returnStr(objectMap, update);
}
@DeleteMapping(value = "/delete")
@ApiOperation(value = "删除")
public String deleteResource(@RequestParam("id") Long id, HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<>();
int delete = systemConfigService.deleteSystemConfig(id, request);
return returnStr(objectMap, delete);
}
@DeleteMapping(value = "/deleteBatch")
@ApiOperation(value = "批量删除")
public String batchDeleteResource(@RequestParam("ids") String ids, HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<>();
int delete = systemConfigService.batchDeleteSystemConfig(ids, request);
return returnStr(objectMap, delete);
}
@GetMapping(value = "/checkIsNameExist")
@ApiOperation(value = "检查名称是否存在")
public String checkIsNameExist(@RequestParam Long id, @RequestParam(value ="name", required = false) String name,
HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<>();
int exist = systemConfigService.checkIsNameExist(id, name);
if(exist > 0) {
objectMap.put("status", true);
} else {
objectMap.put("status", false);
}
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
}
/**
* 获取当前租户的配置信息
* @param request

View File

@ -1,10 +1,12 @@
package com.jsh.erp.controller;
import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.base.BaseController;
import com.jsh.erp.base.TableDataInfo;
import com.jsh.erp.constants.BusinessConstants;
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 com.jsh.erp.utils.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
@ -13,11 +15,13 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
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.returnStr;
/**
* Description
@ -28,12 +32,81 @@ import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
@RestController
@RequestMapping(value = "/unit")
@Api(tags = {"单位管理"})
public class UnitController {
public class UnitController extends BaseController {
private Logger logger = LoggerFactory.getLogger(UnitController.class);
@Resource
private UnitService unitService;
@GetMapping(value = "/info")
@ApiOperation(value = "根据id获取信息")
public String getList(@RequestParam("id") Long id,
HttpServletRequest request) throws Exception {
Unit unit = unitService.getUnit(id);
Map<String, Object> objectMap = new HashMap<>();
if(unit != null) {
objectMap.put("info", unit);
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
} else {
return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code);
}
}
@GetMapping(value = "/list")
@ApiOperation(value = "获取信息列表")
public TableDataInfo getList(@RequestParam(value = Constants.SEARCH, required = false) String search,
HttpServletRequest request)throws Exception {
String name = StringUtil.getInfo(search, "name");
List<Unit> list = unitService.select(name);
return getDataTable(list);
}
@PostMapping(value = "/add")
@ApiOperation(value = "新增")
public String addResource(@RequestBody JSONObject obj, HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<>();
int insert = unitService.insertUnit(obj, request);
return returnStr(objectMap, insert);
}
@PutMapping(value = "/update")
@ApiOperation(value = "修改")
public String updateResource(@RequestBody JSONObject obj, HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<>();
int update = unitService.updateUnit(obj, request);
return returnStr(objectMap, update);
}
@DeleteMapping(value = "/delete")
@ApiOperation(value = "删除")
public String deleteResource(@RequestParam("id") Long id, HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<>();
int delete = unitService.deleteUnit(id, request);
return returnStr(objectMap, delete);
}
@DeleteMapping(value = "/deleteBatch")
@ApiOperation(value = "批量删除")
public String batchDeleteResource(@RequestParam("ids") String ids, HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<>();
int delete = unitService.batchDeleteUnit(ids, request);
return returnStr(objectMap, delete);
}
@GetMapping(value = "/checkIsNameExist")
@ApiOperation(value = "检查名称是否存在")
public String checkIsNameExist(@RequestParam Long id, @RequestParam(value ="name", required = false) String name,
HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<>();
int exist = unitService.checkIsNameExist(id, name);
if(exist > 0) {
objectMap.put("status", true);
} else {
objectMap.put("status", false);
}
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
}
/**
* 单位列表
* @param request

View File

@ -18,6 +18,7 @@ import java.util.List;
import java.util.Map;
import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
import static com.jsh.erp.utils.ResponseJsonUtil.returnStr;
/**
* @author ji_sheng_hua jshERP
@ -31,6 +32,66 @@ public class UserBusinessController {
@Resource
private UserBusinessService userBusinessService;
@GetMapping(value = "/info")
@ApiOperation(value = "根据id获取信息")
public String getList(@RequestParam("id") Long id,
HttpServletRequest request) throws Exception {
UserBusiness userBusiness = userBusinessService.getUserBusiness(id);
Map<String, Object> objectMap = new HashMap<>();
if(userBusiness != null) {
objectMap.put("info", userBusiness);
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
} else {
return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code);
}
}
@PostMapping(value = "/add")
@ApiOperation(value = "新增")
public String addResource(@RequestBody JSONObject obj, HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<>();
int insert = userBusinessService.insertUserBusiness(obj, request);
return returnStr(objectMap, insert);
}
@PutMapping(value = "/update")
@ApiOperation(value = "修改")
public String updateResource(@RequestBody JSONObject obj, HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<>();
int update = userBusinessService.updateUserBusiness(obj, request);
return returnStr(objectMap, update);
}
@DeleteMapping(value = "/delete")
@ApiOperation(value = "删除")
public String deleteResource(@RequestParam("id") Long id, HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<>();
int delete = userBusinessService.deleteUserBusiness(id, request);
return returnStr(objectMap, delete);
}
@DeleteMapping(value = "/deleteBatch")
@ApiOperation(value = "批量删除")
public String batchDeleteResource(@RequestParam("ids") String ids, HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<>();
int delete = userBusinessService.batchDeleteUserBusiness(ids, request);
return returnStr(objectMap, delete);
}
@GetMapping(value = "/checkIsNameExist")
@ApiOperation(value = "检查名称是否存在")
public String checkIsNameExist(@RequestParam Long id, @RequestParam(value ="name", required = false) String name,
HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<>();
int exist = userBusinessService.checkIsNameExist(id, name);
if(exist > 0) {
objectMap.put("status", true);
} else {
objectMap.put("status", false);
}
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
}
/**
* 获取信息
* @param keyId

View File

@ -3,6 +3,8 @@ package com.jsh.erp.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.base.BaseController;
import com.jsh.erp.base.TableDataInfo;
import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.constants.ExceptionConstants;
import com.jsh.erp.datasource.entities.Tenant;
@ -15,10 +17,7 @@ import com.jsh.erp.service.redis.RedisService;
import com.jsh.erp.service.role.RoleService;
import com.jsh.erp.service.tenant.TenantService;
import com.jsh.erp.service.user.UserService;
import com.jsh.erp.utils.BaseResponseInfo;
import com.jsh.erp.utils.ErpInfo;
import com.jsh.erp.utils.RandImageUtil;
import com.jsh.erp.utils.Tools;
import com.jsh.erp.utils.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
@ -29,12 +28,10 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.*;
import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
import static com.jsh.erp.utils.ResponseJsonUtil.returnStr;
/**
* @author ji_sheng_hua 管伊佳erp
@ -42,7 +39,7 @@ import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
@RestController
@RequestMapping(value = "/user")
@Api(tags = {"用户管理"})
public class UserController {
public class UserController extends BaseController {
private Logger logger = LoggerFactory.getLogger(UserController.class);
@Value("${manage.roleId}")
@ -63,6 +60,76 @@ public class UserController {
private static String SUCCESS = "操作成功";
private static String ERROR = "操作失败";
@GetMapping(value = "/info")
@ApiOperation(value = "根据id获取信息")
public String getList(@RequestParam("id") Long id,
HttpServletRequest request) throws Exception {
User user = userService.getUser(id);
Map<String, Object> objectMap = new HashMap<>();
if(user != null) {
objectMap.put("info", user);
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
} else {
return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code);
}
}
@GetMapping(value = "/list")
@ApiOperation(value = "获取信息列表")
public TableDataInfo getList(@RequestParam(value = Constants.SEARCH, required = false) String search,
HttpServletRequest request)throws Exception {
String userName = StringUtil.getInfo(search, "userName");
String loginName = StringUtil.getInfo(search, "loginName");
List<UserEx> list = userService.select(userName, loginName);
return getDataTable(list);
}
@PostMapping(value = "/add")
@ApiOperation(value = "新增")
public String addResource(@RequestBody JSONObject obj, HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<>();
int insert = userService.insertUser(obj, request);
return returnStr(objectMap, insert);
}
@PutMapping(value = "/update")
@ApiOperation(value = "修改")
public String updateResource(@RequestBody JSONObject obj, HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<>();
int update = userService.updateUser(obj, request);
return returnStr(objectMap, update);
}
@DeleteMapping(value = "/delete")
@ApiOperation(value = "删除")
public String deleteResource(@RequestParam("id") Long id, HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<>();
int delete = userService.deleteUser(id, request);
return returnStr(objectMap, delete);
}
@DeleteMapping(value = "/deleteBatch")
@ApiOperation(value = "批量删除")
public String batchDeleteResource(@RequestParam("ids") String ids, HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<>();
int delete = userService.batchDeleteUser(ids, request);
return returnStr(objectMap, delete);
}
@GetMapping(value = "/checkIsNameExist")
@ApiOperation(value = "检查名称是否存在")
public String checkIsNameExist(@RequestParam Long id, @RequestParam(value ="name", required = false) String name,
HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<>();
int exist = userService.checkIsNameExist(id, name);
if(exist > 0) {
objectMap.put("status", true);
} else {
objectMap.put("status", false);
}
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
}
@PostMapping(value = "/login")
@ApiOperation(value = "登录")
public BaseResponseInfo login(@RequestBody UserEx userParam, HttpServletRequest request)throws Exception {

View File

@ -13,22 +13,6 @@ import java.util.List;
public interface AccountHeadMapperEx {
List<AccountHeadVo4ListEx> selectByConditionAccountHead(
@Param("type") String type,
@Param("creatorArray") String[] creatorArray,
@Param("billNo") String billNo,
@Param("beginTime") String beginTime,
@Param("endTime") String endTime,
@Param("organId") Long organId,
@Param("creator") Long creator,
@Param("handsPersonId") Long handsPersonId,
@Param("accountId") Long accountId,
@Param("status") String status,
@Param("remark") String remark,
@Param("number") String number,
@Param("offset") Integer offset,
@Param("rows") Integer rows);
Long countsByAccountHead(
@Param("type") String type,
@Param("creatorArray") String[] creatorArray,
@Param("billNo") String billNo,

View File

@ -16,29 +16,6 @@ import java.util.List;
*/
public interface DepotHeadMapperEx {
List<DepotHeadVo4List> selectByConditionDepotHead(
@Param("type") String type,
@Param("subType") String subType,
@Param("creatorArray") String[] creatorArray,
@Param("hasDebt") String hasDebt,
@Param("statusArray") String[] statusArray,
@Param("purchaseStatusArray") String[] purchaseStatusArray,
@Param("number") String number,
@Param("linkApply") String linkApply,
@Param("linkNumber") String linkNumber,
@Param("beginTime") String beginTime,
@Param("endTime") String endTime,
@Param("materialParam") String materialParam,
@Param("organId") Long organId,
@Param("organArray") String[] organArray,
@Param("creator") Long creator,
@Param("depotId") Long depotId,
@Param("depotArray") String[] depotArray,
@Param("accountId") Long accountId,
@Param("remark") String remark,
@Param("offset") Integer offset,
@Param("rows") Integer rows);
Long countsByDepotHead(
@Param("type") String type,
@Param("subType") String subType,
@Param("creatorArray") String[] creatorArray,

View File

@ -42,8 +42,6 @@ public interface SerialNumberMapperEx {
* */
int batAddSerialNumber(@Param("list") List<SerialNumberEx> list);
int batchDeleteSerialNumberByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]);
List<SerialNumberEx> getEnableSerialNumberList(@Param("number") String number,
@Param("name") String name,
@Param("depotId") Long depotId,

View File

@ -10,15 +10,6 @@ import java.util.List;
public interface SupplierMapperEx {
List<Supplier> selectByConditionSupplier(
@Param("supplier") String supplier,
@Param("type") String type,
@Param("phonenum") String phonenum,
@Param("telephone") String telephone,
@Param("creatorArray") String[] creatorArray,
@Param("offset") Integer offset,
@Param("rows") Integer rows);
Long countsBySupplier(
@Param("supplier") String supplier,
@Param("type") String type,
@Param("phonenum") String phonenum,

View File

@ -10,11 +10,6 @@ import java.util.List;
public interface SystemConfigMapperEx {
List<SystemConfig> selectByConditionSystemConfig(
@Param("companyName") String companyName,
@Param("offset") Integer offset,
@Param("rows") Integer rows);
Long countsBySystemConfig(
@Param("companyName") String companyName);
int batchDeleteSystemConfigByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]);

View File

@ -10,11 +10,6 @@ import java.util.List;
public interface UnitMapperEx {
List<Unit> selectByConditionUnit(
@Param("name") String name,
@Param("offset") Integer offset,
@Param("rows") Integer rows);
Long countsByUnit(
@Param("name") String name);
int batchDeleteUnitByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]);

View File

@ -15,9 +15,7 @@ public interface UserMapperEx {
List<UserEx> selectByConditionUser(
@Param("userName") String userName,
@Param("loginName") String loginName,
@Param("offset") Integer offset,
@Param("rows") Integer rows);
@Param("loginName") String loginName);
Long countsByUser(
@Param("userName") String userName,

View File

@ -1,137 +0,0 @@
package com.jsh.erp.service;
import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.service.log.LogService;
import com.jsh.erp.utils.StringUtil;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* @author jishenghua 752718920 2018-10-7 15:25:58
*/
@Service
public class CommonQueryManager {
@Resource
private InterfaceContainer container;
@Resource
private LogService logService;
/**
* 查询单条
*
* @param apiName 接口名称
* @param id ID
*/
public Object selectOne(String apiName, Long id) throws Exception {
if (StringUtil.isNotEmpty(apiName) && id!=null) {
return container.getCommonQuery(apiName).selectOne(id);
}
return null;
}
/**
* 查询
* @param apiName
* @param parameterMap
* @return
*/
public List<?> select(String apiName, Map<String, String> parameterMap)throws Exception {
if (StringUtil.isNotEmpty(apiName)) {
return container.getCommonQuery(apiName).select(parameterMap);
}
return new ArrayList<Object>();
}
/**
* 计数
* @param apiName
* @param parameterMap
* @return
*/
public Long counts(String apiName, Map<String, String> parameterMap)throws Exception {
if (StringUtil.isNotEmpty(apiName)) {
return container.getCommonQuery(apiName).counts(parameterMap);
}
return BusinessConstants.DEFAULT_LIST_NULL_NUMBER;
}
/**
* 插入
* @param apiName
* @param obj
* @return
*/
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int insert(String apiName, JSONObject obj, HttpServletRequest request) throws Exception{
if (StringUtil.isNotEmpty(apiName)) {
return container.getCommonQuery(apiName).insert(obj, request);
}
return 0;
}
/**
* 更新
* @param apiName
* @param obj
* @return
*/
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int update(String apiName, JSONObject obj, HttpServletRequest request)throws Exception {
if (StringUtil.isNotEmpty(apiName)) {
return container.getCommonQuery(apiName).update(obj, request);
}
return 0;
}
/**
* 删除
* @param apiName
* @param id
* @return
*/
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int delete(String apiName, Long id, HttpServletRequest request)throws Exception {
if (StringUtil.isNotEmpty(apiName)) {
return container.getCommonQuery(apiName).delete(id, request);
}
return 0;
}
/**
* 批量删除
* @param apiName
* @param ids
* @return
*/
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int deleteBatch(String apiName, String ids, HttpServletRequest request)throws Exception {
if (StringUtil.isNotEmpty(apiName)) {
return container.getCommonQuery(apiName).deleteBatch(ids, request);
}
return 0;
}
/**
* 判断是否存在
* @param apiName
* @param id
* @param name
* @return
*/
public int checkIsNameExist(String apiName, Long id, String name) throws Exception{
if (StringUtil.isNotEmpty(apiName) && name!=null) {
return container.getCommonQuery(apiName).checkIsNameExist(id, name);
}
return 0;
}
}

View File

@ -1,80 +0,0 @@
package com.jsh.erp.service;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
/**
* 通用查询接口
* 功能1单条查询 2分页+搜索 3查询数量
*
* @author jishenghua
* @version 1.0
*/
public interface ICommonQuery {
/**
* 根据id查询明细
*
* @param id 资源id
* @return 资源
*/
Object selectOne(Long id) throws Exception;
/**
* 自定义查询
*
* @param parameterMap 查询参数
* @return 查询结果
*/
List<?> select(Map<String, String> parameterMap) throws Exception;
/**
* 查询数量
*
* @param parameterMap 查询参数
* @return 查询结果
*/
Long counts(Map<String, String> parameterMap) throws Exception;
/**
* 新增数据
*
* @param obj
* @return
*/
int insert(JSONObject obj, HttpServletRequest request) throws Exception;
/**
* 更新数据
*
* @param obj
* @return
*/
int update(JSONObject obj, HttpServletRequest request) throws Exception;
/**
* 删除数据
*
* @param id
* @return
*/
int delete(Long id, HttpServletRequest request) throws Exception;
/**
* 批量删除数据
*
* @param ids
* @return
*/
int deleteBatch(String ids, HttpServletRequest request) throws Exception;
/**
* 查询名称是否存在
*
* @param id
* @return
*/
int checkIsNameExist(Long id, String name) throws Exception;
}

View File

@ -1,31 +0,0 @@
package com.jsh.erp.service;
import com.jsh.erp.utils.AnnotationUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;
import java.util.HashMap;
import java.util.Map;
/**
* @author jishenghua 2018-10-7 15:25:09
*/
@Service
public class InterfaceContainer {
private final Map<String, ICommonQuery> configComponentMap = new HashMap<>();
@Autowired(required = false)
private synchronized void init(ICommonQuery[] configComponents) {
for (ICommonQuery configComponent : configComponents) {
ResourceInfo info = AnnotationUtils.getAnnotation(configComponent, ResourceInfo.class);
if (info != null) {
configComponentMap.put(info.value(), configComponent);
}
}
}
public ICommonQuery getCommonQuery(String apiName) {
return configComponentMap.get(apiName);
}
}

View File

@ -1,14 +0,0 @@
package com.jsh.erp.service;
import java.lang.annotation.*;
/**
* @author jishenghua 2018-10-7 15:25:39
*/
@Target({ElementType.TYPE, ElementType.ANNOTATION_TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@Documented
public @interface ResourceInfo {
String value();
}

View File

@ -1,92 +0,0 @@
package com.jsh.erp.service.accountHead;
import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.service.ICommonQuery;
import com.jsh.erp.utils.Constants;
import com.jsh.erp.utils.QueryUtils;
import com.jsh.erp.utils.StringUtil;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
@Service(value = "accountHead_component")
@AccountHeadResource
public class AccountHeadComponent implements ICommonQuery {
@Resource
private AccountHeadService accountHeadService;
@Override
public Object selectOne(Long id) throws Exception {
return accountHeadService.getAccountHead(id);
}
@Override
public List<?> select(Map<String, String> map)throws Exception {
return getAccountHeadList(map);
}
private List<?> getAccountHeadList(Map<String, String> map)throws Exception {
String search = map.get(Constants.SEARCH);
String type = StringUtil.getInfo(search, "type");
String billNo = StringUtil.getInfo(search, "billNo");
String beginTime = StringUtil.getInfo(search, "beginTime");
String endTime = StringUtil.getInfo(search, "endTime");
Long organId = StringUtil.parseStrLong(StringUtil.getInfo(search, "organId"));
Long creator = StringUtil.parseStrLong(StringUtil.getInfo(search, "creator"));
Long handsPersonId = StringUtil.parseStrLong(StringUtil.getInfo(search, "handsPersonId"));
Long accountId = StringUtil.parseStrLong(StringUtil.getInfo(search, "accountId"));
String status = StringUtil.getInfo(search, "status");
String remark = StringUtil.getInfo(search, "remark");
String number = StringUtil.getInfo(search, "number");
return accountHeadService.select(type, billNo, beginTime, endTime, organId, creator, handsPersonId,
accountId, status, remark, number, QueryUtils.offset(map), QueryUtils.rows(map));
}
@Override
public Long counts(Map<String, String> map)throws Exception {
String search = map.get(Constants.SEARCH);
String type = StringUtil.getInfo(search, "type");
String billNo = StringUtil.getInfo(search, "billNo");
String beginTime = StringUtil.getInfo(search, "beginTime");
String endTime = StringUtil.getInfo(search, "endTime");
Long organId = StringUtil.parseStrLong(StringUtil.getInfo(search, "organId"));
Long creator = StringUtil.parseStrLong(StringUtil.getInfo(search, "creator"));
Long handsPersonId = StringUtil.parseStrLong(StringUtil.getInfo(search, "handsPersonId"));
Long accountId = StringUtil.parseStrLong(StringUtil.getInfo(search, "accountId"));
String status = StringUtil.getInfo(search, "status");
String remark = StringUtil.getInfo(search, "remark");
String number = StringUtil.getInfo(search, "number");
return accountHeadService.countAccountHead(type, billNo, beginTime, endTime, organId, creator, handsPersonId,
accountId, status, remark, number);
}
@Override
public int insert(JSONObject obj, HttpServletRequest request) throws Exception{
return accountHeadService.insertAccountHead(obj, request);
}
@Override
public int update(JSONObject obj, HttpServletRequest request)throws Exception {
return accountHeadService.updateAccountHead(obj, request);
}
@Override
public int delete(Long id, HttpServletRequest request)throws Exception {
return accountHeadService.deleteAccountHead(id, request);
}
@Override
public int deleteBatch(String ids, HttpServletRequest request)throws Exception {
return accountHeadService.batchDeleteAccountHead(ids, request);
}
@Override
public int checkIsNameExist(Long id, String name)throws Exception {
return 0;
}
}

View File

@ -1,15 +0,0 @@
package com.jsh.erp.service.accountHead;
import com.jsh.erp.service.ResourceInfo;
import java.lang.annotation.*;
/**
* @author jishenghua qq752718920 2018-10-7 15:26:27
*/
@ResourceInfo(value = "accountHead")
@Inherited
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface AccountHeadResource {
}

View File

@ -12,12 +12,12 @@ import com.jsh.erp.datasource.mappers.AccountMapper;
import com.jsh.erp.exception.BusinessRunTimeException;
import com.jsh.erp.exception.JshException;
import com.jsh.erp.service.accountItem.AccountItemService;
import com.jsh.erp.service.depotHead.DepotHeadService;
import com.jsh.erp.service.log.LogService;
import com.jsh.erp.service.orgaUserRel.OrgaUserRelService;
import com.jsh.erp.service.supplier.SupplierService;
import com.jsh.erp.service.systemConfig.SystemConfigService;
import com.jsh.erp.service.user.UserService;
import com.jsh.erp.utils.PageUtils;
import com.jsh.erp.utils.StringUtil;
import com.jsh.erp.utils.Tools;
import org.slf4j.Logger;
@ -96,14 +96,15 @@ public class AccountHeadService {
public List<AccountHeadVo4ListEx> select(String type, String billNo, String beginTime, String endTime,
Long organId, Long creator, Long handsPersonId, Long accountId, String status,
String remark, String number, int offset, int rows) throws Exception{
List<AccountHeadVo4ListEx> resList = new ArrayList<>();
String remark, String number) throws Exception{
List<AccountHeadVo4ListEx> list = new ArrayList<>();
try{
String [] creatorArray = getCreatorArray();
beginTime = Tools.parseDayToTime(beginTime,BusinessConstants.DAY_FIRST_TIME);
endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME);
List<AccountHeadVo4ListEx> list = accountHeadMapperEx.selectByConditionAccountHead(type, creatorArray, billNo,
beginTime, endTime, organId, creator, handsPersonId, accountId, status, remark, number, offset, rows);
PageUtils.startPage();
list = accountHeadMapperEx.selectByConditionAccountHead(type, creatorArray, billNo,
beginTime, endTime, organId, creator, handsPersonId, accountId, status, remark, number);
if (null != list) {
for (AccountHeadVo4ListEx ah : list) {
if(ah.getChangeAmount() != null) {
@ -127,29 +128,12 @@ public class AccountHeadService {
if(ah.getBillTime() !=null) {
ah.setBillTimeStr(getCenternTime(ah.getBillTime()));
}
resList.add(ah);
}
}
}catch(Exception e){
} catch(Exception e){
JshException.readFail(logger, e);
}
return resList;
}
public Long countAccountHead(String type, String billNo, String beginTime, String endTime,
Long organId, Long creator, Long handsPersonId, Long accountId, String status,
String remark, String number) throws Exception{
Long result=null;
try{
String [] creatorArray = getCreatorArray();
beginTime = Tools.parseDayToTime(beginTime,BusinessConstants.DAY_FIRST_TIME);
endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME);
result = accountHeadMapperEx.countsByAccountHead(type, creatorArray, billNo,
beginTime, endTime, organId, creator, handsPersonId, accountId, status, remark, number);
}catch(Exception e){
JshException.readFail(logger, e);
}
return result;
return list;
}
/**

View File

@ -1,75 +0,0 @@
package com.jsh.erp.service.accountItem;
import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.service.ICommonQuery;
import com.jsh.erp.utils.Constants;
import com.jsh.erp.utils.QueryUtils;
import com.jsh.erp.utils.StringUtil;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
@Service(value = "accountItem_component")
@AccountItemResource
public class AccountItemComponent implements ICommonQuery {
@Resource
private AccountItemService accountItemService;
@Override
public Object selectOne(Long id) throws Exception {
return accountItemService.getAccountItem(id);
}
@Override
public List<?> select(Map<String, String> map)throws Exception {
return getAccountItemList(map);
}
private List<?> getAccountItemList(Map<String, String> map) throws Exception{
String search = map.get(Constants.SEARCH);
String name = StringUtil.getInfo(search, "name");
Integer type = StringUtil.parseInteger(StringUtil.getInfo(search, "type"));
String remark = StringUtil.getInfo(search, "remark");
String order = QueryUtils.order(map);
return accountItemService.select(name, type, remark, QueryUtils.offset(map), QueryUtils.rows(map));
}
@Override
public Long counts(Map<String, String> map)throws Exception {
String search = map.get(Constants.SEARCH);
String name = StringUtil.getInfo(search, "name");
Integer type = StringUtil.parseInteger(StringUtil.getInfo(search, "type"));
String remark = StringUtil.getInfo(search, "remark");
return accountItemService.countAccountItem(name, type, remark);
}
@Override
public int insert(JSONObject obj, HttpServletRequest request) throws Exception{
return accountItemService.insertAccountItem(obj, request);
}
@Override
public int update(JSONObject obj, HttpServletRequest request)throws Exception {
return accountItemService.updateAccountItem(obj, request);
}
@Override
public int delete(Long id, HttpServletRequest request)throws Exception {
return accountItemService.deleteAccountItem(id, request);
}
@Override
public int deleteBatch(String ids, HttpServletRequest request)throws Exception {
return accountItemService.batchDeleteAccountItem(ids, request);
}
@Override
public int checkIsNameExist(Long id, String name)throws Exception {
return accountItemService.checkIsNameExist(id, name);
}
}

View File

@ -1,15 +0,0 @@
package com.jsh.erp.service.accountItem;
import com.jsh.erp.service.ResourceInfo;
import java.lang.annotation.*;
/**
* @author jishenghua qq752718920 2018-10-7 15:26:27
*/
@ResourceInfo(value = "accountItem")
@Inherited
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface AccountItemResource {
}

View File

@ -46,16 +46,6 @@ public class AccountItemService {
@Resource
private DepotHeadService depotHeadService;
public AccountItem getAccountItem(long id)throws Exception {
AccountItem result=null;
try{
result=accountItemMapper.selectByPrimaryKey(id);
}catch(Exception e){
JshException.readFail(logger, e);
}
return result;
}
public List<AccountItem> getAccountItem()throws Exception {
AccountItemExample example = new AccountItemExample();
example.createCriteria().andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
@ -78,71 +68,6 @@ public class AccountItemService {
return list;
}
public Long countAccountItem(String name, Integer type, String remark)throws Exception {
Long result=null;
try{
result = accountItemMapperEx.countsByAccountItem(name, type, remark);
}catch(Exception e){
JshException.readFail(logger, e);
}
return result;
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int insertAccountItem(JSONObject obj, HttpServletRequest request) throws Exception{
AccountItem accountItem = JSONObject.parseObject(obj.toJSONString(), AccountItem.class);
int result=0;
try{
result = accountItemMapper.insertSelective(accountItem);
logService.insertLog("财务明细", BusinessConstants.LOG_OPERATION_TYPE_ADD, request);
}catch(Exception e){
JshException.writeFail(logger, e);
}
return result;
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int updateAccountItem(JSONObject obj, HttpServletRequest request)throws Exception {
AccountItem accountItem = JSONObject.parseObject(obj.toJSONString(), AccountItem.class);
int result=0;
try{
result = accountItemMapper.updateByPrimaryKeySelective(accountItem);
logService.insertLog("财务明细",
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(accountItem.getId()).toString(), request);
}catch(Exception e){
JshException.writeFail(logger, e);
}
return result;
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int deleteAccountItem(Long id, HttpServletRequest request)throws Exception {
int result=0;
try{
result = accountItemMapper.deleteByPrimaryKey(id);
logService.insertLog("财务明细",
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(id).toString(), request);
}catch(Exception e){
JshException.writeFail(logger, e);
}
return result;
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int batchDeleteAccountItem(String ids, HttpServletRequest request)throws Exception {
List<Long> idList = StringUtil.strToLongList(ids);
AccountItemExample example = new AccountItemExample();
example.createCriteria().andIdIn(idList);
int result=0;
try{
result = accountItemMapper.deleteByExample(example);
logService.insertLog("财务明细", "批量删除,id集:" + ids, request);
}catch(Exception e){
JshException.writeFail(logger, e);
}
return result;
}
public int checkIsNameExist(Long id, String name)throws Exception {
AccountItemExample example = new AccountItemExample();
example.createCriteria().andIdNotEqualTo(id).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);

View File

@ -1,102 +0,0 @@
package com.jsh.erp.service.depotHead;
import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.service.ICommonQuery;
import com.jsh.erp.utils.Constants;
import com.jsh.erp.utils.QueryUtils;
import com.jsh.erp.utils.StringUtil;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
@Service(value = "depotHead_component")
@DepotHeadResource
public class DepotHeadComponent implements ICommonQuery {
@Resource
private DepotHeadService depotHeadService;
@Override
public Object selectOne(Long id) throws Exception {
return depotHeadService.getDepotHead(id);
}
@Override
public List<?> select(Map<String, String> map)throws Exception {
return getDepotHeadList(map);
}
private List<?> getDepotHeadList(Map<String, String> map)throws Exception {
String search = map.get(Constants.SEARCH);
String type = StringUtil.getInfo(search, "type");
String subType = StringUtil.getInfo(search, "subType");
String hasDebt = StringUtil.getInfo(search, "hasDebt");
String status = StringUtil.getInfo(search, "status");
String purchaseStatus = StringUtil.getInfo(search, "purchaseStatus");
String number = StringUtil.getInfo(search, "number");
String linkApply = StringUtil.getInfo(search, "linkApply");
String linkNumber = StringUtil.getInfo(search, "linkNumber");
String beginTime = StringUtil.getInfo(search, "beginTime");
String endTime = StringUtil.getInfo(search, "endTime");
String materialParam = StringUtil.getInfo(search, "materialParam");
Long organId = StringUtil.parseStrLong(StringUtil.getInfo(search, "organId"));
Long creator = StringUtil.parseStrLong(StringUtil.getInfo(search, "creator"));
Long depotId = StringUtil.parseStrLong(StringUtil.getInfo(search, "depotId"));
Long accountId = StringUtil.parseStrLong(StringUtil.getInfo(search, "accountId"));
String remark = StringUtil.getInfo(search, "remark");
return depotHeadService.select(type, subType, hasDebt, status, purchaseStatus, number, linkApply, linkNumber,
beginTime, endTime, materialParam, organId, creator, depotId, accountId, remark, QueryUtils.offset(map), QueryUtils.rows(map));
}
@Override
public Long counts(Map<String, String> map)throws Exception {
String search = map.get(Constants.SEARCH);
String type = StringUtil.getInfo(search, "type");
String subType = StringUtil.getInfo(search, "subType");
String hasDebt = StringUtil.getInfo(search, "hasDebt");
String status = StringUtil.getInfo(search, "status");
String purchaseStatus = StringUtil.getInfo(search, "purchaseStatus");
String number = StringUtil.getInfo(search, "number");
String linkApply = StringUtil.getInfo(search, "linkApply");
String linkNumber = StringUtil.getInfo(search, "linkNumber");
String beginTime = StringUtil.getInfo(search, "beginTime");
String endTime = StringUtil.getInfo(search, "endTime");
String materialParam = StringUtil.getInfo(search, "materialParam");
Long organId = StringUtil.parseStrLong(StringUtil.getInfo(search, "organId"));
Long creator = StringUtil.parseStrLong(StringUtil.getInfo(search, "creator"));
Long depotId = StringUtil.parseStrLong(StringUtil.getInfo(search, "depotId"));
Long accountId = StringUtil.parseStrLong(StringUtil.getInfo(search, "accountId"));
String remark = StringUtil.getInfo(search, "remark");
return depotHeadService.countDepotHead(type, subType, hasDebt, status, purchaseStatus, number, linkApply, linkNumber,
beginTime, endTime, materialParam, organId, creator, depotId, accountId, remark);
}
@Override
public int insert(JSONObject obj, HttpServletRequest request) throws Exception{
return depotHeadService.insertDepotHead(obj, request);
}
@Override
public int update(JSONObject obj, HttpServletRequest request)throws Exception {
return depotHeadService.updateDepotHead(obj, request);
}
@Override
public int delete(Long id, HttpServletRequest request)throws Exception {
return depotHeadService.deleteDepotHead(id, request);
}
@Override
public int deleteBatch(String ids, HttpServletRequest request)throws Exception {
return depotHeadService.batchDeleteDepotHead(ids, request);
}
@Override
public int checkIsNameExist(Long id, String name)throws Exception {
return 0;
}
}

View File

@ -1,15 +0,0 @@
package com.jsh.erp.service.depotHead;
import com.jsh.erp.service.ResourceInfo;
import java.lang.annotation.*;
/**
* @author jishenghua qq752718920 2018-10-7 15:26:27
*/
@ResourceInfo(value = "depotHead")
@Inherited
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface DepotHeadResource {
}

View File

@ -27,6 +27,7 @@ import com.jsh.erp.service.systemConfig.SystemConfigService;
import com.jsh.erp.service.user.UserService;
import com.jsh.erp.service.userBusiness.UserBusinessService;
import com.jsh.erp.utils.ExcelUtils;
import com.jsh.erp.utils.PageUtils;
import com.jsh.erp.utils.StringUtil;
import com.jsh.erp.utils.Tools;
import jxl.Workbook;
@ -114,8 +115,8 @@ public class DepotHeadService {
}
public List<DepotHeadVo4List> select(String type, String subType, String hasDebt, String status, String purchaseStatus, String number, String linkApply, String linkNumber,
String beginTime, String endTime, String materialParam, Long organId, Long creator, Long depotId, Long accountId, String remark, int offset, int rows) throws Exception {
List<DepotHeadVo4List> resList = new ArrayList<>();
String beginTime, String endTime, String materialParam, Long organId, Long creator, Long depotId, Long accountId, String remark) throws Exception {
List<DepotHeadVo4List> list = new ArrayList<>();
try{
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
Long userId = userService.getUserId(request);
@ -132,9 +133,10 @@ public class DepotHeadService {
Map<Long,String> accountMap = accountService.getAccountMap();
beginTime = Tools.parseDayToTime(beginTime,BusinessConstants.DAY_FIRST_TIME);
endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME);
List<DepotHeadVo4List> list = depotHeadMapperEx.selectByConditionDepotHead(type, subType, creatorArray, hasDebt,
PageUtils.startPage();
list = depotHeadMapperEx.selectByConditionDepotHead(type, subType, creatorArray, hasDebt,
statusArray, purchaseStatusArray, number, linkApply, linkNumber, beginTime, endTime,
materialParam, organId, organArray, creator, depotId, depotArray, accountId, remark, offset, rows);
materialParam, organId, organArray, creator, depotId, depotArray, accountId, remark);
if (null != list) {
List<Long> idList = new ArrayList<>();
List<String> numberList = new ArrayList<>();
@ -221,35 +223,12 @@ public class DepotHeadService {
dh.setTotalPrice(null);
dh.setDiscountLastMoney(null);
}
resList.add(dh);
}
}
}catch(Exception e){
} catch(Exception e){
JshException.readFail(logger, e);
}
return resList;
}
public Long countDepotHead(String type, String subType, String hasDebt, String status, String purchaseStatus, String number, String linkApply, String linkNumber,
String beginTime, String endTime, String materialParam, Long organId, Long creator, Long depotId, Long accountId, String remark) throws Exception{
Long result=null;
try{
String [] depotArray = getDepotArray(subType);
String [] creatorArray = getCreatorArray();
String [] statusArray = StringUtil.isNotEmpty(status) ? status.split(",") : null;
String [] purchaseStatusArray = StringUtil.isNotEmpty(purchaseStatus) ? purchaseStatus.split(",") : null;
String [] organArray = getOrganArray(subType, purchaseStatus);
//以销定购查看全部数据
creatorArray = StringUtil.isNotEmpty(purchaseStatus) ? null: creatorArray;
beginTime = Tools.parseDayToTime(beginTime,BusinessConstants.DAY_FIRST_TIME);
endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME);
result=depotHeadMapperEx.countsByDepotHead(type, subType, creatorArray, hasDebt,
statusArray, purchaseStatusArray, number, linkApply, linkNumber, beginTime, endTime,
materialParam, organId, organArray, creator, depotId, depotArray, accountId, remark);
}catch(Exception e){
JshException.readFail(logger, e);
}
return result;
return list;
}
/**

View File

@ -1,75 +0,0 @@
package com.jsh.erp.service.depotItem;
import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.service.ICommonQuery;
import com.jsh.erp.utils.Constants;
import com.jsh.erp.utils.QueryUtils;
import com.jsh.erp.utils.StringUtil;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
@Service(value = "depotItem_component")
@DepotItemResource
public class DepotItemComponent implements ICommonQuery {
@Resource
private DepotItemService depotItemService;
@Override
public Object selectOne(Long id) throws Exception {
return depotItemService.getDepotItem(id);
}
@Override
public List<?> select(Map<String, String> map)throws Exception {
return getDepotItemList(map);
}
private List<?> getDepotItemList(Map<String, String> map)throws Exception {
String search = map.get(Constants.SEARCH);
String name = StringUtil.getInfo(search, "name");
Integer type = StringUtil.parseInteger(StringUtil.getInfo(search, "type"));
String remark = StringUtil.getInfo(search, "remark");
String order = QueryUtils.order(map);
return depotItemService.select(name, type, remark, QueryUtils.offset(map), QueryUtils.rows(map));
}
@Override
public Long counts(Map<String, String> map)throws Exception {
String search = map.get(Constants.SEARCH);
String name = StringUtil.getInfo(search, "name");
Integer type = StringUtil.parseInteger(StringUtil.getInfo(search, "type"));
String remark = StringUtil.getInfo(search, "remark");
return depotItemService.countDepotItem(name, type, remark);
}
@Override
public int insert(JSONObject obj, HttpServletRequest request)throws Exception {
return depotItemService.insertDepotItem(obj, request);
}
@Override
public int update(JSONObject obj, HttpServletRequest request)throws Exception {
return depotItemService.updateDepotItem(obj, request);
}
@Override
public int delete(Long id, HttpServletRequest request)throws Exception {
return depotItemService.deleteDepotItem(id, request);
}
@Override
public int deleteBatch(String ids, HttpServletRequest request)throws Exception {
return depotItemService.batchDeleteDepotItem(ids, request);
}
@Override
public int checkIsNameExist(Long id, String name)throws Exception {
return depotItemService.checkIsNameExist(id, name);
}
}

View File

@ -1,15 +0,0 @@
package com.jsh.erp.service.depotItem;
import com.jsh.erp.service.ResourceInfo;
import java.lang.annotation.*;
/**
* @author jishenghua qq752718920 2018-10-7 15:26:27
*/
@ResourceInfo(value = "depotItem")
@Inherited
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface DepotItemResource {
}

View File

@ -125,8 +125,7 @@ public class MaterialService {
if(StringUtil.isNotEmpty(mpList)){
mpArr= mpList.split(",");
}
List<MaterialVo4Unit> resList = new ArrayList<>();
List<MaterialVo4Unit> list =null;
List<MaterialVo4Unit> list = new ArrayList<>();
try{
List<Long> idList = new ArrayList<>();
if(StringUtil.isNotEmpty(categoryId)){
@ -148,13 +147,12 @@ public class MaterialService {
m.setBigUnitInitialStock(getBigUnitStock(m.getInitialStock(), m.getUnitId()));
m.setStock(currentStockMap.get(m.getId())!=null? currentStockMap.get(m.getId()): BigDecimal.ZERO);
m.setBigUnitStock(getBigUnitStock(m.getStock(), m.getUnitId()));
resList.add(m);
}
}
}catch(Exception e){
} catch(Exception e){
JshException.readFail(logger, e);
}
return resList;
return list;
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)

View File

@ -1,65 +0,0 @@
package com.jsh.erp.service.orgaUserRel;
import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.service.ICommonQuery;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
/**
* Description
*
* @Author: cjl
* @Date: 2019/3/11 18:10
*/
@Service(value = "orgaUserRel_component")
@OrgaUserRelResource
public class OrgaUserRelComponent implements ICommonQuery {
@Resource
private OrgaUserRelService orgaUserRelService;
@Override
public Object selectOne(Long id) throws Exception {
return orgaUserRelService.getOrgaUserRel(id);
}
@Override
public List<?> select(Map<String, String> parameterMap)throws Exception {
return getOrgaUserRelList(parameterMap);
}
private List<?> getOrgaUserRelList(Map<String, String> map)throws Exception {
return null;
}
@Override
public Long counts(Map<String, String> parameterMap)throws Exception {
return null;
}
@Override
public int insert(JSONObject obj, HttpServletRequest request)throws Exception {
return orgaUserRelService.insertOrgaUserRel(obj,request);
}
@Override
public int update(JSONObject obj, HttpServletRequest request)throws Exception {
return orgaUserRelService.updateOrgaUserRel(obj, request);
}
@Override
public int delete(Long id, HttpServletRequest request)throws Exception {
return orgaUserRelService.deleteOrgaUserRel(id, request);
}
@Override
public int deleteBatch(String ids, HttpServletRequest request)throws Exception {
return orgaUserRelService.batchDeleteOrgaUserRel(ids, request);
}
@Override
public int checkIsNameExist(Long id, String name)throws Exception {
return 0;
}
}

View File

@ -1,19 +0,0 @@
package com.jsh.erp.service.orgaUserRel;
import com.jsh.erp.service.ResourceInfo;
import java.lang.annotation.*;
/**
* Description
* 机构用户关系
* @Author: cjl
* @Date: 2019/3/11 18:11
*/
@ResourceInfo(value = "orgaUserRel")
@Inherited
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface OrgaUserRelResource {
}

View File

@ -1,74 +0,0 @@
package com.jsh.erp.service.sequence;
import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.service.ICommonQuery;
import com.jsh.erp.utils.Constants;
import com.jsh.erp.utils.QueryUtils;
import com.jsh.erp.utils.StringUtil;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
/**
* Description
*
* @Author: jishenghua
* @Date: 2021/3/16 16:33
*/
@Service(value = "sequence_component")
@SequenceResource
public class SequenceComponent implements ICommonQuery {
@Resource
private SequenceService sequenceService;
@Override
public Object selectOne(Long id) throws Exception {
return sequenceService.getSequence(id);
}
@Override
public List<?> select(Map<String, String> map)throws Exception {
return getSequenceList(map);
}
private List<?> getSequenceList(Map<String, String> map) throws Exception{
String search = map.get(Constants.SEARCH);
String name = StringUtil.getInfo(search, "name");
return sequenceService.select(name,QueryUtils.offset(map), QueryUtils.rows(map));
}
@Override
public Long counts(Map<String, String> map)throws Exception {
String search = map.get(Constants.SEARCH);
String name = StringUtil.getInfo(search, "name");
return sequenceService.countSequence(name);
}
@Override
public int insert(JSONObject obj, HttpServletRequest request)throws Exception {
return sequenceService.insertSequence(obj, request);
}
@Override
public int update(JSONObject obj, HttpServletRequest request)throws Exception {
return sequenceService.updateSequence(obj, request);
}
@Override
public int delete(Long id, HttpServletRequest request)throws Exception {
return sequenceService.deleteSequence(id, request);
}
@Override
public int deleteBatch(String ids, HttpServletRequest request)throws Exception {
return sequenceService.batchDeleteSequence(ids, request);
}
@Override
public int checkIsNameExist(Long id, String name) throws Exception{
return sequenceService.checkIsNameExist(id, name);
}
}

View File

@ -1,18 +0,0 @@
package com.jsh.erp.service.sequence;
import com.jsh.erp.service.ResourceInfo;
import java.lang.annotation.*;
/**
* Description
*
* @Author: jishenghua
* @Date: 2021/3/16 16:33
*/
@ResourceInfo(value = "sequence")
@Inherited
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface SequenceResource {
}

View File

@ -1,76 +0,0 @@
package com.jsh.erp.service.serialNumber;
import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.service.ICommonQuery;
import com.jsh.erp.utils.Constants;
import com.jsh.erp.utils.QueryUtils;
import com.jsh.erp.utils.StringUtil;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
/**
* Description
*
* @Author: cjl
* @Date: 2019/1/21 16:33
*/
@Service(value = "serialNumber_component")
@SerialNumberResource
public class SerialNumberComponent implements ICommonQuery {
@Resource
private SerialNumberService serialNumberService;
@Override
public Object selectOne(Long id) throws Exception {
return serialNumberService.getSerialNumber(id);
}
@Override
public List<?> select(Map<String, String> map)throws Exception {
return getSerialNumberList(map);
}
private List<?> getSerialNumberList(Map<String, String> map) throws Exception{
String search = map.get(Constants.SEARCH);
String serialNumber = StringUtil.getInfo(search, "serialNumber");
String materialName = StringUtil.getInfo(search, "materialName");
return serialNumberService.select(serialNumber,materialName,QueryUtils.offset(map), QueryUtils.rows(map));
}
@Override
public Long counts(Map<String, String> map)throws Exception {
String search = map.get(Constants.SEARCH);
String serialNumber = StringUtil.getInfo(search, "serialNumber");
String materialName = StringUtil.getInfo(search, "materialName");
return serialNumberService.countSerialNumber(serialNumber, materialName);
}
@Override
public int insert(JSONObject obj, HttpServletRequest request)throws Exception {
return serialNumberService.insertSerialNumber(obj, request);
}
@Override
public int update(JSONObject obj, HttpServletRequest request)throws Exception {
return serialNumberService.updateSerialNumber(obj, request);
}
@Override
public int delete(Long id, HttpServletRequest request)throws Exception {
return serialNumberService.deleteSerialNumber(id, request);
}
@Override
public int deleteBatch(String ids, HttpServletRequest request)throws Exception {
return serialNumberService.batchDeleteSerialNumber(ids, request);
}
@Override
public int checkIsNameExist(Long id, String serialNumber) throws Exception{
return serialNumberService.checkIsNameExist(id, serialNumber);
}
}

View File

@ -1,18 +0,0 @@
package com.jsh.erp.service.serialNumber;
import com.jsh.erp.service.ResourceInfo;
import java.lang.annotation.*;
/**
* Description
*
* @Author: jishenghua
* @Date: 2019/1/21 16:33
*/
@ResourceInfo(value = "serialNumber")
@Inherited
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface SerialNumberResource {
}

View File

@ -42,7 +42,6 @@ public class SerialNumberService {
@Resource
private LogService logService;
public SerialNumber getSerialNumber(long id)throws Exception {
SerialNumber result=null;
try{
@ -79,141 +78,30 @@ public class SerialNumberService {
public List<SerialNumberEx> select(String serialNumber, String materialName, Integer offset, Integer rows)throws Exception {
return null;
}
public Long countSerialNumber(String serialNumber,String materialName)throws Exception {
return null;
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int insertSerialNumber(JSONObject obj, HttpServletRequest request)throws Exception {
int result=0;
try{
SerialNumberEx serialNumberEx = JSONObject.parseObject(obj.toJSONString(), SerialNumberEx.class);
/**处理商品id*/
serialNumberEx.setMaterialId(getSerialNumberMaterialIdByBarCode(serialNumberEx.getMaterialCode()));
//删除标记,默认未删除
serialNumberEx.setDeleteFlag(BusinessConstants.DELETE_FLAG_EXISTS);
//已卖出默认未否
serialNumberEx.setIsSell(BusinessConstants.IS_SELL_HOLD);
Date date=new Date();
serialNumberEx.setCreateTime(date);
serialNumberEx.setUpdateTime(date);
User userInfo=userService.getCurrentUser();
serialNumberEx.setCreator(userInfo==null?null:userInfo.getId());
serialNumberEx.setUpdater(userInfo==null?null:userInfo.getId());
result = serialNumberMapperEx.addSerialNumber(serialNumberEx);
logService.insertLog("序列号",BusinessConstants.LOG_OPERATION_TYPE_ADD,
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
}catch(Exception e){
JshException.writeFail(logger, e);
}
return result;
return 0;
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int updateSerialNumber(JSONObject obj, HttpServletRequest request) throws Exception{
SerialNumberEx serialNumberEx = JSONObject.parseObject(obj.toJSONString(), SerialNumberEx.class);
int result=0;
try{
serialNumberEx.setMaterialId(getSerialNumberMaterialIdByBarCode(serialNumberEx.getMaterialCode()));
Date date=new Date();
serialNumberEx.setUpdateTime(date);
User userInfo=userService.getCurrentUser();
serialNumberEx.setUpdater(userInfo==null?null:userInfo.getId());
result = serialNumberMapperEx.updateSerialNumber(serialNumberEx);
logService.insertLog("序列号",
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(serialNumberEx.getId()).toString(),
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
}catch(Exception e){
JshException.writeFail(logger, e);
}
return result;
return 0;
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int deleteSerialNumber(Long id, HttpServletRequest request)throws Exception {
return batchDeleteSerialNumberByIds(id.toString());
return 0;
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int batchDeleteSerialNumber(String ids, HttpServletRequest request)throws Exception {
return batchDeleteSerialNumberByIds(ids);
}
/**
* 逻辑删除序列号信息
* create time: 2019/3/27 17:43
* @Param: ids
* @return
*/
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int batchDeleteSerialNumberByIds(String ids) throws Exception{
StringBuffer sb = new StringBuffer();
sb.append(BusinessConstants.LOG_OPERATION_TYPE_DELETE);
List<SerialNumber> list = getSerialNumberListByIds(ids);
for(SerialNumber serialNumber: list){
sb.append("[").append(serialNumber.getSerialNumber()).append("]");
}
logService.insertLog("序列号", sb.toString(),
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
User userInfo=userService.getCurrentUser();
String [] idArray=ids.split(",");
int result=0;
try{
result = serialNumberMapperEx.batchDeleteSerialNumberByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
}catch(Exception e){
JshException.writeFail(logger, e);
}
return result;
return 0;
}
public int checkIsNameExist(Long id, String serialNumber)throws Exception {
SerialNumberExample example = new SerialNumberExample();
example.createCriteria().andIdNotEqualTo(id).andSerialNumberEqualTo(serialNumber).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
List<SerialNumber> list=null;
try{
list=serialNumberMapper.selectByExample(example);
}catch(Exception e){
JshException.readFail(logger, e);
}
return list==null?0:list.size();
}
/**
* 根据商品名称判断商品名称是否有效
* @Param: materialName
* @return Long 满足使用条件的商品的id
*/
public Long checkMaterialName(String materialName)throws Exception{
if(StringUtil.isNotEmpty(materialName)) {
List<Material> mlist=null;
try{
mlist = materialMapperEx.findByMaterialName(materialName);
}catch(Exception e){
JshException.readFail(logger, e);
}
if (mlist == null || mlist.size() < 1) {
//商品名称不存在
throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_NOT_EXISTS_CODE,
ExceptionConstants.MATERIAL_NOT_EXISTS_MSG);
}
if (mlist.size() > 1) {
//商品信息不唯一
throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_NOT_ONLY_CODE,
ExceptionConstants.MATERIAL_NOT_ONLY_MSG);
}
//获得唯一商品
if (BusinessConstants.ENABLE_SERIAL_NUMBER_NOT_ENABLED.equals(mlist.get(0).getEnableSerialNumber())) {
//商品未开启序列号
throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_NOT_ENABLE_SERIAL_NUMBER_CODE,
ExceptionConstants.MATERIAL_NOT_ENABLE_SERIAL_NUMBER_MSG);
}
return mlist.get(0).getId();
}
return null;
return 0;
}
/**

View File

@ -1,76 +0,0 @@
package com.jsh.erp.service.supplier;
import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.service.ICommonQuery;
import com.jsh.erp.utils.Constants;
import com.jsh.erp.utils.QueryUtils;
import com.jsh.erp.utils.StringUtil;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
@Service(value = "supplier_component")
@SupplierResource
public class SupplierComponent implements ICommonQuery {
@Resource
private SupplierService supplierService;
@Override
public Object selectOne(Long id) throws Exception {
return supplierService.getSupplier(id);
}
@Override
public List<?> select(Map<String, String> map)throws Exception {
return getSupplierList(map);
}
private List<?> getSupplierList(Map<String, String> map)throws Exception {
String search = map.get(Constants.SEARCH);
String supplier = StringUtil.getInfo(search, "supplier");
String type = StringUtil.getInfo(search, "type");
String phonenum = StringUtil.getInfo(search, "phonenum");
String telephone = StringUtil.getInfo(search, "telephone");
return supplierService.select(supplier, type, phonenum, telephone, QueryUtils.offset(map), QueryUtils.rows(map));
}
@Override
public Long counts(Map<String, String> map)throws Exception {
String search = map.get(Constants.SEARCH);
String supplier = StringUtil.getInfo(search, "supplier");
String type = StringUtil.getInfo(search, "type");
String phonenum = StringUtil.getInfo(search, "phonenum");
String telephone = StringUtil.getInfo(search, "telephone");
return supplierService.countSupplier(supplier, type, phonenum, telephone);
}
@Override
public int insert(JSONObject obj, HttpServletRequest request)throws Exception {
return supplierService.insertSupplier(obj, request);
}
@Override
public int update(JSONObject obj, HttpServletRequest request)throws Exception {
return supplierService.updateSupplier(obj, request);
}
@Override
public int delete(Long id, HttpServletRequest request)throws Exception {
return supplierService.deleteSupplier(id, request);
}
@Override
public int deleteBatch(String ids, HttpServletRequest request)throws Exception {
return supplierService.batchDeleteSupplier(ids, request);
}
@Override
public int checkIsNameExist(Long id, String name)throws Exception {
return supplierService.checkIsNameExist(id, name);
}
}

View File

@ -1,15 +0,0 @@
package com.jsh.erp.service.supplier;
import com.jsh.erp.service.ResourceInfo;
import java.lang.annotation.*;
/**
* @author jishenghua qq752718920 2018-10-7 15:26:27
*/
@ResourceInfo(value = "supplier")
@Inherited
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface SupplierResource {
}

View File

@ -8,16 +8,11 @@ import com.jsh.erp.datasource.mappers.*;
import com.jsh.erp.datasource.vo.DepotHeadVo4StatementAccount;
import com.jsh.erp.exception.BusinessRunTimeException;
import com.jsh.erp.exception.JshException;
import com.jsh.erp.service.accountHead.AccountHeadService;
import com.jsh.erp.service.depotHead.DepotHeadService;
import com.jsh.erp.service.log.LogService;
import com.jsh.erp.service.systemConfig.SystemConfigService;
import com.jsh.erp.service.user.UserService;
import com.jsh.erp.service.userBusiness.UserBusinessService;
import com.jsh.erp.utils.BaseResponseInfo;
import com.jsh.erp.utils.ExcelUtils;
import com.jsh.erp.utils.StringUtil;
import com.jsh.erp.utils.Tools;
import com.jsh.erp.utils.*;
import jxl.Sheet;
import jxl.Workbook;
import org.slf4j.Logger;
@ -96,11 +91,12 @@ public class SupplierService {
return list;
}
public List<Supplier> select(String supplier, String type, String phonenum, String telephone, int offset, int rows) throws Exception{
List<Supplier> resList = new ArrayList<Supplier>();
public List<Supplier> select(String supplier, String type, String phonenum, String telephone) throws Exception{
List<Supplier> list = new ArrayList<>();
try{
String [] creatorArray = depotHeadService.getCreatorArray();
List<Supplier> list = supplierMapperEx.selectByConditionSupplier(supplier, type, phonenum, telephone, creatorArray, offset, rows);
PageUtils.startPage();
list = supplierMapperEx.selectByConditionSupplier(supplier, type, phonenum, telephone, creatorArray);
for(Supplier s : list) {
Integer supplierId = s.getId().intValue();
String beginTime = Tools.getYearBegin();
@ -144,23 +140,11 @@ public class SupplierService {
} else if(("供应商").equals(s.getType())) {
s.setAllNeedPay(sum);
}
resList.add(s);
}
}catch(Exception e){
} catch(Exception e){
JshException.readFail(logger, e);
}
return resList;
}
public Long countSupplier(String supplier, String type, String phonenum, String telephone) throws Exception{
Long result=null;
try{
String [] creatorArray = depotHeadService.getCreatorArray();
result=supplierMapperEx.countsBySupplier(supplier, type, phonenum, telephone, creatorArray);
}catch(Exception e){
JshException.readFail(logger, e);
}
return result;
return list;
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)

View File

@ -1,73 +0,0 @@
package com.jsh.erp.service.systemConfig;
import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.service.ICommonQuery;
import com.jsh.erp.service.systemConfig.SystemConfigResource;
import com.jsh.erp.service.systemConfig.SystemConfigService;
import com.jsh.erp.utils.Constants;
import com.jsh.erp.utils.QueryUtils;
import com.jsh.erp.utils.StringUtil;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
@Service(value = "systemConfig_component")
@SystemConfigResource
public class SystemConfigComponent implements ICommonQuery {
@Resource
private SystemConfigService systemConfigService;
@Override
public Object selectOne(Long id) throws Exception {
return systemConfigService.getSystemConfig(id);
}
@Override
public List<?> select(Map<String, String> map)throws Exception {
return getSystemConfigList(map);
}
private List<?> getSystemConfigList(Map<String, String> map)throws Exception {
String search = map.get(Constants.SEARCH);
String companyName = StringUtil.getInfo(search, "companyName");
String order = QueryUtils.order(map);
return systemConfigService.select(companyName, QueryUtils.offset(map), QueryUtils.rows(map));
}
@Override
public Long counts(Map<String, String> map)throws Exception {
String search = map.get(Constants.SEARCH);
String companyName = StringUtil.getInfo(search, "companyName");
return systemConfigService.countSystemConfig(companyName);
}
@Override
public int insert(JSONObject obj, HttpServletRequest request)throws Exception {
return systemConfigService.insertSystemConfig(obj, request);
}
@Override
public int update(JSONObject obj, HttpServletRequest request)throws Exception {
return systemConfigService.updateSystemConfig(obj, request);
}
@Override
public int delete(Long id, HttpServletRequest request)throws Exception {
return systemConfigService.deleteSystemConfig(id, request);
}
@Override
public int deleteBatch(String ids, HttpServletRequest request)throws Exception {
return systemConfigService.batchDeleteSystemConfig(ids, request);
}
@Override
public int checkIsNameExist(Long id, String name)throws Exception {
return systemConfigService.checkIsNameExist(id, name);
}
}

View File

@ -1,15 +0,0 @@
package com.jsh.erp.service.systemConfig;
import com.jsh.erp.service.ResourceInfo;
import java.lang.annotation.*;
/**
* @author jishenghua qq752718920 2018-10-7 15:26:27
*/
@ResourceInfo(value = "systemConfig")
@Inherited
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface SystemConfigResource {
}

View File

@ -8,7 +8,6 @@ import com.aliyun.oss.OSSClientBuilder;
import com.aliyun.oss.OSSException;
import com.aliyun.oss.model.CopyObjectResult;
import com.aliyun.oss.model.PutObjectRequest;
import com.aliyun.oss.model.PutObjectResult;
import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.datasource.entities.SystemConfig;
import com.jsh.erp.datasource.entities.SystemConfigExample;
@ -19,10 +18,7 @@ import com.jsh.erp.exception.JshException;
import com.jsh.erp.service.log.LogService;
import com.jsh.erp.service.platformConfig.PlatformConfigService;
import com.jsh.erp.service.user.UserService;
import com.jsh.erp.utils.ExcelUtils;
import com.jsh.erp.utils.FileUtils;
import com.jsh.erp.utils.StringUtil;
import com.jsh.erp.utils.Tools;
import com.jsh.erp.utils.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
@ -92,26 +88,17 @@ public class SystemConfigService {
}
return list;
}
public List<SystemConfig> select(String companyName, int offset, int rows)throws Exception {
public List<SystemConfig> select(String companyName)throws Exception {
List<SystemConfig> list=null;
try{
list=systemConfigMapperEx.selectByConditionSystemConfig(companyName, offset, rows);
PageUtils.startPage();
list=systemConfigMapperEx.selectByConditionSystemConfig(companyName);
}catch(Exception e){
JshException.readFail(logger, e);
}
return list;
}
public Long countSystemConfig(String companyName)throws Exception {
Long result=null;
try{
result=systemConfigMapperEx.countsBySystemConfig(companyName);
}catch(Exception e){
JshException.readFail(logger, e);
}
return result;
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int insertSystemConfig(JSONObject obj, HttpServletRequest request) throws Exception{
SystemConfig systemConfig = JSONObject.parseObject(obj.toJSONString(), SystemConfig.class);

View File

@ -1,71 +0,0 @@
package com.jsh.erp.service.unit;
import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.service.ICommonQuery;
import com.jsh.erp.utils.Constants;
import com.jsh.erp.utils.QueryUtils;
import com.jsh.erp.utils.StringUtil;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
@Service(value = "unit_component")
@UnitResource
public class UnitComponent implements ICommonQuery {
@Resource
private UnitService unitService;
@Override
public Object selectOne(Long id) throws Exception {
return unitService.getUnit(id);
}
@Override
public List<?> select(Map<String, String> map)throws Exception {
return getUnitList(map);
}
private List<?> getUnitList(Map<String, String> map)throws Exception {
String search = map.get(Constants.SEARCH);
String name = StringUtil.getInfo(search, "name");
String order = QueryUtils.order(map);
return unitService.select(name, QueryUtils.offset(map), QueryUtils.rows(map));
}
@Override
public Long counts(Map<String, String> map)throws Exception {
String search = map.get(Constants.SEARCH);
String name = StringUtil.getInfo(search, "name");
return unitService.countUnit(name);
}
@Override
public int insert(JSONObject obj, HttpServletRequest request)throws Exception {
return unitService.insertUnit(obj, request);
}
@Override
public int update(JSONObject obj, HttpServletRequest request)throws Exception {
return unitService.updateUnit(obj, request);
}
@Override
public int delete(Long id, HttpServletRequest request)throws Exception {
return unitService.deleteUnit(id, request);
}
@Override
public int deleteBatch(String ids, HttpServletRequest request)throws Exception {
return unitService.batchDeleteUnit(ids, request);
}
@Override
public int checkIsNameExist(Long id, String name)throws Exception {
return unitService.checkIsNameExist(id, name);
}
}

View File

@ -1,15 +0,0 @@
package com.jsh.erp.service.unit;
import com.jsh.erp.service.ResourceInfo;
import java.lang.annotation.*;
/**
* @author jishenghua qq752718920 2018-10-7 15:26:27
*/
@ResourceInfo(value = "unit")
@Inherited
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface UnitResource {
}

View File

@ -14,6 +14,7 @@ import com.jsh.erp.exception.BusinessRunTimeException;
import com.jsh.erp.exception.JshException;
import com.jsh.erp.service.log.LogService;
import com.jsh.erp.service.user.UserService;
import com.jsh.erp.utils.PageUtils;
import com.jsh.erp.utils.StringUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -80,26 +81,17 @@ public class UnitService {
return list;
}
public List<Unit> select(String name, int offset, int rows)throws Exception {
public List<Unit> select(String name)throws Exception {
List<Unit> list=null;
try{
list=unitMapperEx.selectByConditionUnit(name, offset, rows);
PageUtils.startPage();
list=unitMapperEx.selectByConditionUnit(name);
}catch(Exception e){
JshException.readFail(logger, e);
}
return list;
}
public Long countUnit(String name)throws Exception {
Long result=null;
try{
result=unitMapperEx.countsByUnit(name);
}catch(Exception e){
JshException.readFail(logger, e);
}
return result;
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int insertUnit(JSONObject obj, HttpServletRequest request)throws Exception {
Unit unit = JSONObject.parseObject(obj.toJSONString(), Unit.class);

View File

@ -1,73 +0,0 @@
package com.jsh.erp.service.user;
import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.service.ICommonQuery;
import com.jsh.erp.utils.Constants;
import com.jsh.erp.utils.QueryUtils;
import com.jsh.erp.utils.StringUtil;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.*;
@Service(value = "user_component")
@UserResource
public class UserComponent implements ICommonQuery {
@Resource
private UserService userService;
@Override
public Object selectOne(Long id) throws Exception {
return userService.getUser(id);
}
@Override
public List<?> select(Map<String, String> map)throws Exception {
return getUserList(map);
}
private List<?> getUserList(Map<String, String> map)throws Exception {
String search = map.get(Constants.SEARCH);
String userName = StringUtil.getInfo(search, "userName");
String loginName = StringUtil.getInfo(search, "loginName");
String order = QueryUtils.order(map);
String filter = QueryUtils.filter(map);
return userService.select(userName, loginName, QueryUtils.offset(map), QueryUtils.rows(map));
}
@Override
public Long counts(Map<String, String> map)throws Exception {
String search = map.get(Constants.SEARCH);
String userName = StringUtil.getInfo(search, "userName");
String loginName = StringUtil.getInfo(search, "loginName");
return userService.countUser(userName, loginName);
}
@Override
public int insert(JSONObject obj, HttpServletRequest request)throws Exception {
return userService.insertUser(obj, request);
}
@Override
public int update(JSONObject obj, HttpServletRequest request)throws Exception {
return userService.updateUser(obj, request);
}
@Override
public int delete(Long id, HttpServletRequest request)throws Exception {
return userService.deleteUser(id, request);
}
@Override
public int deleteBatch(String ids, HttpServletRequest request)throws Exception {
return userService.batchDeleteUser(ids, request);
}
@Override
public int checkIsNameExist(Long id, String name)throws Exception {
return userService.checkIsNameExist(id, name);
}
}

View File

@ -1,15 +0,0 @@
package com.jsh.erp.service.user;
import com.jsh.erp.service.ResourceInfo;
import java.lang.annotation.*;
/**
* @author jishenghua qq752718920 2018-10-7 15:26:27
*/
@ResourceInfo(value = "user")
@Inherited
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface UserResource {
}

View File

@ -7,7 +7,7 @@ import com.jsh.erp.service.functions.FunctionService;
import com.jsh.erp.service.platformConfig.PlatformConfigService;
import com.jsh.erp.service.redis.RedisService;
import com.jsh.erp.service.role.RoleService;
import com.jsh.erp.utils.HttpClient;
import com.jsh.erp.utils.*;
import org.springframework.util.StringUtils;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
@ -22,9 +22,6 @@ import com.jsh.erp.service.log.LogService;
import com.jsh.erp.service.orgaUserRel.OrgaUserRelService;
import com.jsh.erp.service.tenant.TenantService;
import com.jsh.erp.service.userBusiness.UserBusinessService;
import com.jsh.erp.utils.ExceptionCodeConstants;
import com.jsh.erp.utils.StringUtil;
import com.jsh.erp.utils.Tools;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
@ -112,14 +109,15 @@ public class UserService {
return list;
}
public List<UserEx> select(String userName, String loginName, int offset, int rows)throws Exception {
public List<UserEx> select(String userName, String loginName)throws Exception {
List<UserEx> list=null;
try {
//先校验是否登录然后才能查询用户数据
HttpServletRequest request = ((ServletRequestAttributes) Objects.requireNonNull(RequestContextHolder.getRequestAttributes())).getRequest();
Long userId = this.getUserId(request);
if(userId!=null) {
list = userMapperEx.selectByConditionUser(userName, loginName, offset, rows);
PageUtils.startPage();
list = userMapperEx.selectByConditionUser(userName, loginName);
for (UserEx ue : list) {
String userType = "";
if (ue.getId().equals(ue.getTenantId())) {
@ -155,15 +153,7 @@ public class UserService {
}
return result;
}
/**
* create by: cjl
* description:
* 添加事务控制
* create time: 2019/1/11 14:30
* @Param: beanJson
 * @Param: request
* @return int
*/
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int insertUser(JSONObject obj, HttpServletRequest request)throws Exception {
User user = JSONObject.parseObject(obj.toJSONString(), User.class);
@ -185,15 +175,7 @@ public class UserService {
}
return result;
}
/**
* create by: cjl
* description:
* 添加事务控制
* create time: 2019/1/11 14:31
* @Param: beanJson
 * @Param: id
* @return int
*/
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int updateUser(JSONObject obj, HttpServletRequest request) throws Exception{
User user = JSONObject.parseObject(obj.toJSONString(), User.class);
@ -207,14 +189,7 @@ public class UserService {
}
return result;
}
/**
* create by: cjl
* description:
* 添加事务控制
* create time: 2019/1/11 14:32
* @Param: user
* @return int
*/
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int updateUserByObj(User user) throws Exception{
logService.insertLog("用户",
@ -228,15 +203,7 @@ public class UserService {
}
return result;
}
/**
* create by: cjl
* description:
* 添加事务控制
* create time: 2019/1/11 14:33
* @Param: md5Pwd
 * @Param: id
* @return int
*/
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int resetPwd(String md5Pwd, Long id) throws Exception{
int result=0;

View File

@ -1,64 +0,0 @@
package com.jsh.erp.service.userBusiness;
import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.service.ICommonQuery;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
@Service(value = "userBusiness_component")
@UserBusinessResource
public class UserBusinessComponent implements ICommonQuery {
@Resource
private UserBusinessService userBusinessService;
@Override
public Object selectOne(Long id) throws Exception {
return userBusinessService.getUserBusiness(id);
}
@Override
public List<?> select(Map<String, String> map)throws Exception {
return getUserBusinessList(map);
}
private List<?> getUserBusinessList(Map<String, String> map)throws Exception {
return null;
}
@Override
public Long counts(Map<String, String> map)throws Exception {
return BusinessConstants.DEFAULT_LIST_NULL_NUMBER;
}
@Override
public int insert(JSONObject obj, HttpServletRequest request) throws Exception {
return userBusinessService.insertUserBusiness(obj, request);
}
@Override
public int update(JSONObject obj, HttpServletRequest request)throws Exception {
return userBusinessService.updateUserBusiness(obj, request);
}
@Override
public int delete(Long id, HttpServletRequest request)throws Exception {
return userBusinessService.deleteUserBusiness(id, request);
}
@Override
public int deleteBatch(String ids, HttpServletRequest request)throws Exception {
return userBusinessService.batchDeleteUserBusiness(ids, request);
}
@Override
public int checkIsNameExist(Long id, String name)throws Exception {
return userBusinessService.checkIsNameExist(id, name);
}
}

View File

@ -1,15 +0,0 @@
package com.jsh.erp.service.userBusiness;
import com.jsh.erp.service.ResourceInfo;
import java.lang.annotation.*;
/**
* @author jishenghua qq752718920 2018-10-7 15:26:27
*/
@ResourceInfo(value = "userBusiness")
@Inherited
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface UserBusinessResource {
}

View File

@ -69,68 +69,6 @@
</if>
and ifnull(ah.delete_flag,'0') !='1'
order by ah.id desc
<if test="offset != null and rows != null">
limit #{offset},#{rows}
</if>
</select>
<select id="countsByAccountHead" resultType="java.lang.Long">
SELECT
COUNT(1) from
(select distinct ah.* FROM jsh_account_head ah
left join jsh_account_item ai on ah.id=ai.header_id and ifnull(ai.delete_flag,'0') !='1'
left join jsh_depot_head dh on dh.id=ai.bill_id and ifnull(dh.delete_flag,'0') !='1'
WHERE 1=1
<if test="billNo != null">
<bind name="bindBillNo" value="'%'+billNo+'%'"/>
and ah.bill_no like #{bindBillNo}
</if>
<if test="type != null">
and ah.type=#{type}
</if>
<if test="beginTime != null">
and ah.bill_time &gt;= #{beginTime}
</if>
<if test="endTime != null">
and ah.bill_time &lt;= #{endTime}
</if>
<if test="organId != null">
and ah.organ_id=#{organId}
</if>
<if test="handsPersonId != null">
and ah.hands_person_id=#{handsPersonId}
</if>
<if test="creator != null">
and ah.creator=#{creator}
</if>
<if test="creatorArray != null">
and ah.creator in (
<foreach collection="creatorArray" item="creator" separator=",">
#{creator}
</foreach>
)
</if>
<if test="accountId != null">
and ah.account_id=#{accountId}
</if>
<if test="status != null and status != ''">
and ah.status=#{status}
</if>
<if test="remark != null and remark !=''">
<bind name="bindRemark" value="'%'+remark+'%'"/>
and ah.remark like #{bindRemark}
</if>
<if test="number != null and number !=''">
<if test="number == 'QiChu'">
and ai.bill_id is null
</if>
<if test="number != 'QiChu'">
<bind name="bindNumber" value="'%'+number+'%'"/>
and dh.number like #{bindNumber}
</if>
</if>
and ifnull(ah.delete_flag,'0') !='1') tb
</select>
<select id="getDetailByNumber" parameterType="com.jsh.erp.datasource.entities.AccountHeadExample" resultMap="ResultMapEx">

View File

@ -159,10 +159,7 @@
</if>
and ifnull(dh.delete_flag,'0') !='1'
group by dh.id
order by dh.id desc
<if test="offset != null and rows != null">
limit #{offset},#{rows}
</if>) tb
order by dh.id desc) tb
left join jsh_depot_head jdh on jdh.id=tb.id and ifnull(jdh.delete_flag,'0') !='1'
left join jsh_supplier s on jdh.organ_id=s.id and ifnull(s.delete_flag,'0') !='1'
left join jsh_user u on jdh.creator=u.id
@ -170,105 +167,6 @@
order by jdh.id desc
</select>
<select id="countsByDepotHead" resultType="java.lang.Long">
select
count(1) from
(select distinct dh.id from jsh_depot_head dh
left join jsh_depot_item di on dh.Id = di.header_id and ifnull(di.delete_flag,'0') !='1'
left join jsh_material m on di.material_id = m.Id and ifnull(m.delete_Flag,'0') !='1'
left join jsh_material_extend me on di.material_extend_id = me.id and ifnull(me.delete_flag,'0') !='1'
WHERE 1=1
<if test="type != null">
and dh.type=#{type}
</if>
<if test="subType != null">
and dh.sub_type=#{subType}
</if>
<if test="statusArray != null and statusArray !=''">
and dh.status in (
<foreach collection="statusArray" item="status" separator=",">
#{status}
</foreach>
)
</if>
<if test="purchaseStatusArray != null and purchaseStatusArray !=''">
and dh.purchase_status in (
<foreach collection="purchaseStatusArray" item="purchaseStatus" separator=",">
#{purchaseStatus}
</foreach>
)
</if>
<if test="number != null">
<bind name="bindNumber" value="'%'+number+'%'"/>
and dh.number like #{bindNumber}
</if>
<if test="linkApply != null">
<bind name="bindLinkApply" value="'%'+linkApply+'%'"/>
and dh.link_apply like #{bindLinkApply}
</if>
<if test="linkNumber != null">
<bind name="bindLinkNumber" value="'%'+linkNumber+'%'"/>
and dh.link_number like #{bindLinkNumber}
</if>
<if test="beginTime != null">
and dh.oper_time >= #{beginTime}
</if>
<if test="endTime != null">
and dh.oper_time &lt;= #{endTime}
</if>
<if test="materialParam != null and materialParam !=''">
<bind name="bindKey" value="'%'+materialParam+'%'"/>
and (me.bar_code like #{bindKey} or m.name like #{bindKey} or m.mnemonic like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey}
or m.color like #{bindKey} or m.mfrs like #{bindKey} or m.brand like #{bindKey} or m.other_field1 like #{bindKey}
or m.other_field2 like #{bindKey} or m.other_field3 like #{bindKey})
</if>
<if test="organId != null">
and dh.organ_id=#{organId}
</if>
<if test="organArray != null and organArray !=''">
and dh.organ_id in (
<foreach collection="organArray" item="organId" separator=",">
#{organId}
</foreach>
)
</if>
<if test="creator != null">
and dh.creator=#{creator}
</if>
<if test="depotId != null">
and di.depot_id=#{depotId}
</if>
<if test="depotArray != null and depotArray !=''">
and di.depot_id in (
<foreach collection="depotArray" item="depotId" separator=",">
#{depotId}
</foreach>
)
</if>
<if test="creatorArray != null">
and dh.creator in (
<foreach collection="creatorArray" item="creator" separator=",">
#{creator}
</foreach>
)
</if>
<if test="accountId != null">
<bind name="bindAccountId" value="'%'+accountId+'%'"/>
and (dh.account_id=#{accountId} or dh.account_id_list like #{bindAccountId})
</if>
<if test="hasDebt != null and hasDebt ==1">
and (ifnull(dh.discount_last_money,0)+ifnull(dh.other_money,0)-ifnull(dh.deposit,0)-abs(ifnull(dh.change_amount,0))>0)
</if>
<if test="hasDebt != null and hasDebt ==0">
and (ifnull(dh.discount_last_money,0)+ifnull(dh.other_money,0)-ifnull(dh.deposit,0)-abs(ifnull(dh.change_amount,0))=0)
</if>
<if test="remark != null and remark !=''">
<bind name="bindRemark" value="'%'+remark+'%'"/>
and (dh.remark like #{bindRemark} or di.remark like #{bindRemark})
</if>
and ifnull(dh.delete_Flag,'0') !='1') tb
</select>
<select id="findMaterialsListMapByHeaderIdList" resultType="com.jsh.erp.datasource.vo.MaterialsListVo">
select jsh_depot_item.header_id, group_concat(concat(jsh_material.name,' ',ifnull(jsh_material.standard,''),' ',
ifnull(jsh_material.model,''),' ',ifnull(jsh_material.color,''))) as materialsList

View File

@ -11,9 +11,6 @@
</if>
and ifnull(ma.delete_flag,'0') !='1'
order by ma.id desc
<if test="offset != null and rows != null">
limit #{offset},#{rows}
</if>
</select>
<update id="batchDeleteMaterialAttributeByIds">

View File

@ -147,16 +147,6 @@
)
</foreach>
</insert>
<update id="batchDeleteSerialNumberByIds">
update jsh_serial_number
set update_time=#{updateTime},updater=#{updater},delete_flag='1'
where 1=1
and id in (
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
)
</update>
<select id="getEnableSerialNumberList" resultType="com.jsh.erp.datasource.entities.SerialNumberEx">
select

View File

@ -29,38 +29,6 @@
</if>
and ifnull(delete_flag,'0') !='1'
order by sort asc, id desc
<if test="offset != null and rows != null">
limit #{offset},#{rows}
</if>
</select>
<select id="countsBySupplier" resultType="java.lang.Long">
SELECT
COUNT(id)
FROM jsh_supplier
WHERE 1=1
<if test="supplier != null and supplier !=''">
<bind name="bindSupplier" value="'%'+supplier+'%'"/>
and supplier like #{bindSupplier}
</if>
<if test="type != null and type !=''">
and type=#{type}
</if>
<if test="phonenum != null and phonenum !=''">
<bind name="bindPhoneNum" value="'%'+phonenum+'%'"/>
and phone_num like #{bindPhoneNum}
</if>
<if test="telephone != null and telephone !=''">
<bind name="bindTelephone" value="'%'+telephone+'%'"/>
and telephone like #{bindTelephone}
</if>
<if test="creatorArray != null">
and creator in (
<foreach collection="creatorArray" item="creator" separator=",">
#{creator}
</foreach>
)
</if>
and ifnull(delete_flag,'0') !='1'
</select>
<select id="findByAll" parameterType="com.jsh.erp.datasource.entities.SupplierExample" resultMap="com.jsh.erp.datasource.mappers.SupplierMapper.BaseResultMap">

View File

@ -10,21 +10,8 @@
and company_name like #{bindCompanyName}
</if>
and ifnull(delete_flag,'0') !='1'
<if test="offset != null and rows != null">
limit #{offset},#{rows}
</if>
</select>
<select id="countsBySystemConfig" resultType="java.lang.Long">
SELECT
COUNT(id)
FROM jsh_system_config
WHERE 1=1
<if test="companyName != null">
<bind name="bindCompanyName" value="'%'+companyName+'%'"/>
and company_name like #{bindCompanyName}
</if>
and ifnull(delete_flag,'0') !='1'
</select>
<update id="batchDeleteSystemConfigByIds">
update jsh_system_config
set delete_flag='1'

View File

@ -11,21 +11,8 @@
</if>
and ifnull(delete_flag,'0') !='1'
order by id desc
<if test="offset != null and rows != null">
limit #{offset},#{rows}
</if>
</select>
<select id="countsByUnit" resultType="java.lang.Long">
SELECT
COUNT(id)
FROM jsh_unit
WHERE 1=1
<if test="name != null">
<bind name="bindName" value="'%'+name+'%'"/>
and name like #{bindName}
</if>
and ifnull(delete_flag,'0') !='1'
</select>
<update id="batchDeleteUnitByIds">
update jsh_unit
set delete_flag='1'

View File

@ -36,11 +36,9 @@
and user.login_name like #{bindLoginName}
</if>
order by rel.user_blng_orga_dspl_seq,user.id desc
<if test="offset != null and rows != null">
limit #{offset},#{rows}
</if>
) tb
</select>
<select id="countsByUser" resultType="java.lang.Long">
select count(user.id)
FROM jsh_user user

View File

@ -64,9 +64,6 @@ const checkMaterialBarCode = (params)=>getAction("/materialsExtend/checkIsBarCod
const batchUpdateMaterial = (params)=>postAction("/material/batchUpdate",params);
const changeNameToPinYin = (params)=>postAction("/material/changeNameToPinYin",params);
//序列号
const addSerialNumber = (params)=>postAction("/serialNumber/add",params);
const editSerialNumber = (params)=>putAction("/serialNumber/update",params);
const checkSerialNumber = (params)=>getAction("/serialNumber/checkIsNameExist",params);
const batAddSerialNumber = (params)=>postAction("/serialNumber/batAddSerialNumber",params);
const getEnableSerialNumberList = (params)=>getAction("/serialNumber/getEnableSerialNumberList",params);
//多属性
@ -167,9 +164,6 @@ export {
checkMaterialBarCode,
batchUpdateMaterial,
changeNameToPinYin,
addSerialNumber,
editSerialNumber,
checkSerialNumber,
batAddSerialNumber,
getEnableSerialNumberList,
addMaterialAttribute,