给接口增加swagger描述

This commit is contained in:
季圣华
2021-11-08 23:14:21 +08:00
parent 744691d916
commit a923700c0e
30 changed files with 383 additions and 12 deletions

View File

@@ -33,11 +33,11 @@ public class Swagger2Config {
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("Mybatis-Plus Plugin Example RESTful APIs")
.description("集成Mybatis-Plus模块接口描述")
.title("华夏ERP Restful Api")
.description("华夏ERP接口描述")
.termsOfServiceUrl("http://127.0.0.1")
.contact(new Contact("jishenghua", "", ""))
.version("2.1.1")
.version("3.0")
.build();
}

View File

@@ -11,8 +11,11 @@ import com.jsh.erp.exception.BusinessRunTimeException;
import com.jsh.erp.service.account.AccountService;
import com.jsh.erp.utils.BaseResponseInfo;
import com.jsh.erp.utils.ErpInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Description;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@@ -29,6 +32,7 @@ import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
*/
@RestController
@RequestMapping(value = "/account")
@Api(tags = {"账户管理"})
public class AccountController {
private Logger logger = LoggerFactory.getLogger(AccountController.class);
@@ -41,6 +45,7 @@ public class AccountController {
* @return
*/
@GetMapping(value = "/findBySelect")
@ApiOperation(value = "查找结算账户信息-下拉框")
public String findBySelect(HttpServletRequest request) throws Exception {
String res = null;
try {
@@ -70,6 +75,7 @@ public class AccountController {
* @return
*/
@GetMapping(value = "/getAccount")
@ApiOperation(value = "获取所有结算账户")
public BaseResponseInfo getAccount(HttpServletRequest request) throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>();
@@ -96,6 +102,7 @@ public class AccountController {
* @return
*/
@GetMapping(value = "/findAccountInOutList")
@ApiOperation(value = "账户流水信息")
public BaseResponseInfo findAccountInOutList(@RequestParam("currentPage") Integer currentPage,
@RequestParam("pageSize") Integer pageSize,
@RequestParam("accountId") Long accountId,
@@ -130,7 +137,15 @@ public class AccountController {
return res;
}
/**
* 更新默认账户
* @param object
* @param request
* @return
* @throws Exception
*/
@PostMapping(value = "/updateIsDefault")
@ApiOperation(value = "更新默认账户")
public String updateIsDefault(@RequestBody JSONObject object,
HttpServletRequest request) throws Exception{
Long accountId = object.getLong("id");
@@ -149,6 +164,7 @@ public class AccountController {
* @return
*/
@GetMapping(value = "/getStatistics")
@ApiOperation(value = "结算账户的统计")
public BaseResponseInfo getStatistics(@RequestParam("name") String name,
@RequestParam("serialNo") String serialNo,
HttpServletRequest request) throws Exception {

View File

@@ -8,6 +8,8 @@ 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.ErpInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;
@@ -25,6 +27,7 @@ import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
*/
@RestController
@RequestMapping(value = "/accountHead")
@Api(tags = {"财务管理"})
public class AccountHeadController {
private Logger logger = LoggerFactory.getLogger(AccountHeadController.class);
@@ -38,6 +41,7 @@ public class AccountHeadController {
* @return
*/
@PostMapping(value = "/batchSetStatus")
@ApiOperation(value = "批量设置状态-审核或者反审核")
public String batchSetStatus(@RequestBody JSONObject jsonObject,
HttpServletRequest request) throws Exception{
Map<String, Object> objectMap = new HashMap<>();
@@ -59,6 +63,7 @@ public class AccountHeadController {
* @throws Exception
*/
@PostMapping(value = "/addAccountHeadAndDetail")
@ApiOperation(value = "新增财务主表及财务子表信息")
public Object addAccountHeadAndDetail(@RequestBody AccountHeadVo4Body body, HttpServletRequest request) throws Exception{
JSONObject result = ExceptionConstants.standardSuccess();
String beanJson = body.getInfo();
@@ -75,6 +80,7 @@ public class AccountHeadController {
* @throws Exception
*/
@PutMapping(value = "/updateAccountHeadAndDetail")
@ApiOperation(value = "更新财务主表及财务子表信息")
public Object updateAccountHeadAndDetail(@RequestBody AccountHeadVo4Body body, HttpServletRequest request) throws Exception{
JSONObject result = ExceptionConstants.standardSuccess();
String beanJson = body.getInfo();
@@ -90,6 +96,7 @@ public class AccountHeadController {
* @return
*/
@GetMapping(value = "/getDetailByNumber")
@ApiOperation(value = "根据编号查询单据信息")
public BaseResponseInfo getDetailByNumber(@RequestParam("billNo") String billNo,
HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();

View File

@@ -5,6 +5,8 @@ import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.datasource.vo.AccountItemVo4List;
import com.jsh.erp.service.accountItem.AccountItemService;
import com.jsh.erp.utils.BaseResponseInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
@@ -25,6 +27,7 @@ import java.util.Map;
*/
@RestController
@RequestMapping(value = "/accountItem")
@Api(tags = {"财务明细"})
public class AccountItemController {
private Logger logger = LoggerFactory.getLogger(AccountItemController.class);
@@ -32,6 +35,7 @@ public class AccountItemController {
private AccountItemService accountItemService;
@GetMapping(value = "/getDetailList")
@ApiOperation(value = "明细列表")
public BaseResponseInfo getDetailList(@RequestParam("headerId") Long headerId,
HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();

View File

@@ -15,6 +15,8 @@ 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.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.dao.DataAccessException;
@@ -33,6 +35,7 @@ import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
*/
@RestController
@RequestMapping(value = "/depot")
@Api(tags = {"仓库管理"})
public class DepotController {
private Logger logger = LoggerFactory.getLogger(DepotController.class);
@@ -45,7 +48,14 @@ public class DepotController {
@Resource
private MaterialService materialService;
/**
* 仓库列表
* @param request
* @return
* @throws Exception
*/
@GetMapping(value = "/getAllList")
@ApiOperation(value = "仓库列表")
public BaseResponseInfo getAllList(HttpServletRequest request) throws Exception{
BaseResponseInfo res = new BaseResponseInfo();
try {
@@ -68,6 +78,7 @@ public class DepotController {
* @return
*/
@GetMapping(value = "/findUserDepot")
@ApiOperation(value = "用户对应仓库显示")
public JSONArray findUserDepot(@RequestParam("UBType") String type, @RequestParam("UBKeyId") String keyId,
HttpServletRequest request) throws Exception{
JSONArray arr = new JSONArray();
@@ -114,6 +125,7 @@ public class DepotController {
* @throws Exception
*/
@GetMapping(value = "/findDepotByCurrentUser")
@ApiOperation(value = "获取当前用户拥有权限的仓库列表")
public BaseResponseInfo findDepotByCurrentUser(HttpServletRequest request) throws Exception{
BaseResponseInfo res = new BaseResponseInfo();
try {
@@ -128,7 +140,15 @@ public class DepotController {
return res;
}
/**
* 更新默认仓库
* @param object
* @param request
* @return
* @throws Exception
*/
@PostMapping(value = "/updateIsDefault")
@ApiOperation(value = "更新默认仓库")
public String updateIsDefault(@RequestBody JSONObject object,
HttpServletRequest request) throws Exception{
Long depotId = object.getLong("id");
@@ -141,7 +161,14 @@ public class DepotController {
}
}
/**
* 仓库列表-带库存
* @param mId
* @param request
* @return
*/
@GetMapping(value = "/getAllListWithStock")
@ApiOperation(value = "仓库列表-带库存")
public BaseResponseInfo getAllList(@RequestParam("mId") Long mId,
HttpServletRequest request) {
BaseResponseInfo res = new BaseResponseInfo();

View File

@@ -18,6 +18,8 @@ import com.jsh.erp.service.log.LogService;
import com.jsh.erp.service.redis.RedisService;
import com.jsh.erp.service.supplier.SupplierService;
import com.jsh.erp.utils.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
@@ -41,6 +43,7 @@ import static com.jsh.erp.utils.Tools.getNow3;
*/
@RestController
@RequestMapping(value = "/depotHead")
@Api(tags = {"单据管理"})
public class DepotHeadController {
private Logger logger = LoggerFactory.getLogger(DepotHeadController.class);
@@ -63,6 +66,7 @@ public class DepotHeadController {
* @return
*/
@PostMapping(value = "/batchSetStatus")
@ApiOperation(value = "批量设置状态-审核或者反审核")
public String batchSetStatus(@RequestBody JSONObject jsonObject,
HttpServletRequest request) throws Exception{
Map<String, Object> objectMap = new HashMap<>();
@@ -90,6 +94,7 @@ public class DepotHeadController {
* @return
*/
@GetMapping(value = "/findInDetail")
@ApiOperation(value = "入库出库明细接口")
public BaseResponseInfo findInDetail(@RequestParam("currentPage") Integer currentPage,
@RequestParam("pageSize") Integer pageSize,
@RequestParam("organId") Integer oId,
@@ -139,6 +144,7 @@ public class DepotHeadController {
* @return
*/
@GetMapping(value = "/findInOutMaterialCount")
@ApiOperation(value = "入库出库统计接口")
public BaseResponseInfo findInOutMaterialCount(@RequestParam("currentPage") Integer currentPage,
@RequestParam("pageSize") Integer pageSize,
@RequestParam("organId") Integer oId,
@@ -175,6 +181,7 @@ public class DepotHeadController {
}
/**
* 调拨明细统计
* @param currentPage
* @param pageSize
* @param oId
@@ -188,6 +195,7 @@ public class DepotHeadController {
* @return
*/
@GetMapping(value = "/findAllocationDetail")
@ApiOperation(value = "调拨明细统计")
public BaseResponseInfo findallocationDetail(@RequestParam("currentPage") Integer currentPage,
@RequestParam("pageSize") Integer pageSize,
@RequestParam("organId") Integer oId,
@@ -229,6 +237,7 @@ public class DepotHeadController {
* @return
*/
@GetMapping(value = "/findStatementAccount")
@ApiOperation(value = "对账单接口")
public BaseResponseInfo findStatementAccount(@RequestParam("currentPage") Integer currentPage,
@RequestParam("pageSize") Integer pageSize,
@RequestParam("beginTime") String beginTime,
@@ -281,6 +290,7 @@ public class DepotHeadController {
* @return
*/
@GetMapping(value = "/getDetailByNumber")
@ApiOperation(value = "根据编号查询单据信息")
public BaseResponseInfo getDetailByNumber(@RequestParam("number") String number,
HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
@@ -308,6 +318,7 @@ public class DepotHeadController {
* @throws Exception
*/
@PostMapping(value = "/addDepotHeadAndDetail")
@ApiOperation(value = "新增单据主表及单据子表信息")
public Object addDepotHeadAndDetail(@RequestBody DepotHeadVo4Body body, HttpServletRequest request) throws Exception{
JSONObject result = ExceptionConstants.standardSuccess();
String beanJson = body.getInfo();
@@ -324,6 +335,7 @@ public class DepotHeadController {
* @throws Exception
*/
@PutMapping(value = "/updateDepotHeadAndDetail")
@ApiOperation(value = "更新单据主表及单据子表信息")
public Object updateDepotHeadAndDetail(@RequestBody DepotHeadVo4Body body, HttpServletRequest request) throws Exception{
JSONObject result = ExceptionConstants.standardSuccess();
String beanJson = body.getInfo();
@@ -338,6 +350,7 @@ public class DepotHeadController {
* @return
*/
@GetMapping(value = "/getBuyAndSaleStatistics")
@ApiOperation(value = "统计今日销售额、今日进货额、本月销售额、本月进货额")
public BaseResponseInfo getBuyAndSaleStatistics(HttpServletRequest request) {
BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>();
@@ -377,6 +390,7 @@ public class DepotHeadController {
* @return
*/
@GetMapping(value = "/getCreatorByCurrentUser")
@ApiOperation(value = "根据当前用户获取操作员数组")
public BaseResponseInfo getCreatorByRoleType(HttpServletRequest request) {
BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>();
@@ -404,6 +418,7 @@ public class DepotHeadController {
* @throws Exception
*/
@GetMapping(value = "/debtList")
@ApiOperation(value = "查询存在欠款的单据")
public String debtList(@RequestParam(value = Constants.SEARCH, required = false) String search,
HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<>();

View File

@@ -14,6 +14,8 @@ import com.jsh.erp.service.material.MaterialService;
import com.jsh.erp.service.redis.RedisService;
import com.jsh.erp.service.unit.UnitService;
import com.jsh.erp.utils.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;
@@ -35,6 +37,7 @@ import static com.jsh.erp.utils.Tools.getCenternTime;
*/
@RestController
@RequestMapping(value = "/depotItem")
@Api(tags = {"单据明细"})
public class DepotItemController {
private Logger logger = LoggerFactory.getLogger(DepotItemController.class);
@@ -60,6 +63,7 @@ public class DepotItemController {
* @return
*/
@GetMapping(value = "/findDetailByTypeAndMaterialId")
@ApiOperation(value = "只根据商品id查询单据列表")
public String findDetailByTypeAndMaterialId(
@RequestParam(value = Constants.PAGE_SIZE, required = false) Integer pageSize,
@RequestParam(value = Constants.CURRENT_PAGE, required = false) Integer currentPage,
@@ -114,6 +118,7 @@ public class DepotItemController {
* @throws Exception
*/
@GetMapping(value = "/findStockByDepotAndBarCode")
@ApiOperation(value = "根据商品条码和仓库id查询库存数量")
public BaseResponseInfo findStockByDepotAndBarCode(
@RequestParam("depotId") Long depotId,
@RequestParam("barCode") String barCode,
@@ -154,7 +159,16 @@ public class DepotItemController {
return res;
}
/**
* 单据明细列表
* @param headerId
* @param mpList
* @param request
* @return
* @throws Exception
*/
@GetMapping(value = "/getDetailList")
@ApiOperation(value = "单据明细列表")
public BaseResponseInfo getDetailList(@RequestParam("headerId") Long headerId,
@RequestParam("mpList") String mpList,
HttpServletRequest request)throws Exception {
@@ -272,6 +286,7 @@ public class DepotItemController {
* @throws Exception
*/
@GetMapping(value = "/findByAll")
@ApiOperation(value = "查找所有的明细")
public BaseResponseInfo findByAll(@RequestParam("currentPage") Integer currentPage,
@RequestParam("pageSize") Integer pageSize,
@RequestParam("depotId") Long depotId,
@@ -346,6 +361,7 @@ public class DepotItemController {
* @return
*/
@GetMapping(value = "/totalCountMoney")
@ApiOperation(value = "统计总计金额")
public BaseResponseInfo totalCountMoney(@RequestParam("depotId") Long depotId,
@RequestParam("monthTime") String monthTime,
@RequestParam("materialParam") String materialParam,
@@ -390,6 +406,7 @@ public class DepotItemController {
* @return
*/
@GetMapping(value = "/buyIn")
@ApiOperation(value = "进货统计")
public BaseResponseInfo buyIn(@RequestParam("currentPage") Integer currentPage,
@RequestParam("pageSize") Integer pageSize,
@RequestParam("monthTime") String monthTime,
@@ -453,6 +470,7 @@ public class DepotItemController {
* @return
*/
@GetMapping(value = "/saleOut")
@ApiOperation(value = "销售统计")
public BaseResponseInfo saleOut(@RequestParam("currentPage") Integer currentPage,
@RequestParam("pageSize") Integer pageSize,
@RequestParam("monthTime") String monthTime,
@@ -534,6 +552,7 @@ public class DepotItemController {
* @return
*/
@GetMapping(value = "/findStockWarningCount")
@ApiOperation(value = "库存预警报表")
public BaseResponseInfo findStockWarningCount(@RequestParam("currentPage") Integer currentPage,
@RequestParam("pageSize") Integer pageSize,
@RequestParam("materialParam") String materialParam,
@@ -585,6 +604,7 @@ public class DepotItemController {
* @throws Exception
*/
@GetMapping(value = "/buyOrSalePrice")
@ApiOperation(value = "统计采购或销售的总金额")
public BaseResponseInfo buyOrSalePrice(HttpServletRequest request, HttpServletResponse response)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>();
@@ -627,6 +647,7 @@ public class DepotItemController {
* @return
*/
@GetMapping(value = "/getBatchNumberList")
@ApiOperation(value = "获取批次商品列表信息")
public BaseResponseInfo getBatchNumberList(@RequestParam("name") String name,
@RequestParam("depotId") Long depotId,
@RequestParam("barCode") String barCode,

View File

@@ -12,6 +12,8 @@ import com.jsh.erp.service.userBusiness.UserBusinessService;
import com.jsh.erp.utils.BaseResponseInfo;
import com.jsh.erp.utils.StringUtil;
import com.jsh.erp.utils.Tools;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.dao.DataAccessException;
@@ -29,6 +31,7 @@ import java.util.Map;
*/
@RestController
@RequestMapping(value = "/function")
@Api(tags = {"功能管理"})
public class FunctionController {
private Logger logger = LoggerFactory.getLogger(FunctionController.class);
@@ -38,7 +41,15 @@ public class FunctionController {
@Resource
private UserBusinessService userBusinessService;
/**
* 根据父编号查询菜单
* @param jsonObject
* @param request
* @return
* @throws Exception
*/
@PostMapping(value = "/findMenuByPNumber")
@ApiOperation(value = "根据父编号查询菜单")
public JSONArray findMenuByPNumber(@RequestBody JSONObject jsonObject,
HttpServletRequest request)throws Exception {
String pNumber = jsonObject.getString("pNumber");
@@ -110,6 +121,7 @@ public class FunctionController {
* @return
*/
@GetMapping(value = "/findRoleFunction")
@ApiOperation(value = "角色对应功能显示")
public JSONArray findRoleFunction(@RequestParam("UBType") String type, @RequestParam("UBKeyId") String keyId,
HttpServletRequest request)throws Exception {
JSONArray arr = new JSONArray();
@@ -183,6 +195,7 @@ public class FunctionController {
* @return
*/
@GetMapping(value = "/findRoleFunctionsById")
@ApiOperation(value = "根据id列表查找功能信息")
public BaseResponseInfo findByIds(@RequestParam("roleId") Long roleId,
HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();

View File

@@ -8,6 +8,8 @@ import com.jsh.erp.datasource.entities.InOutItem;
import com.jsh.erp.exception.BusinessRunTimeException;
import com.jsh.erp.service.inOutItem.InOutItemService;
import com.jsh.erp.utils.BaseResponseInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;
@@ -23,6 +25,7 @@ import java.util.Map;
*/
@RestController
@RequestMapping(value = "/inOutItem")
@Api(tags = {"收支项目"})
public class InOutItemController {
private Logger logger = LoggerFactory.getLogger(InOutItemController.class);
@@ -35,6 +38,7 @@ public class InOutItemController {
* @return
*/
@GetMapping(value = "/findBySelect")
@ApiOperation(value = "查找收支项目信息")
public String findBySelect(@RequestParam("type") String type, HttpServletRequest request) throws Exception{
String res = null;
try {

View File

@@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.datasource.entities.MaterialAttribute;
import com.jsh.erp.service.materialAttribute.MaterialAttributeService;
import com.jsh.erp.utils.BaseResponseInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
@@ -20,13 +22,21 @@ import java.util.List;
*/
@RestController
@RequestMapping(value = "/materialAttribute")
@Api(tags = {"商品属性"})
public class MaterialAttributeController {
private Logger logger = LoggerFactory.getLogger(MaterialAttributeController.class);
@Resource
private MaterialAttributeService materialAttributeService;
/**
* 获取全部商品属性
* @param request
* @return
* @throws Exception
*/
@GetMapping("/getAll")
@ApiOperation(value = "获取全部商品属性")
public BaseResponseInfo getAll(HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
try {

View File

@@ -11,6 +11,8 @@ import com.jsh.erp.datasource.vo.TreeNode;
import com.jsh.erp.exception.BusinessRunTimeException;
import com.jsh.erp.service.materialCategory.MaterialCategoryService;
import com.jsh.erp.utils.BaseResponseInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;
@@ -24,13 +26,22 @@ import java.util.List;
*/
@RestController
@RequestMapping(value = "/materialCategory")
@Api(tags = {"商品类别"})
public class MaterialCategoryController {
private Logger logger = LoggerFactory.getLogger(MaterialCategoryController.class);
@Resource
private MaterialCategoryService materialCategoryService;
/**
* 获取全部商品类别
* @param parentId
* @param request
* @return
* @throws Exception
*/
@GetMapping(value = "/getAllList")
@ApiOperation(value = "获取全部商品类别")
public BaseResponseInfo getAllList(@RequestParam("parentId") Long parentId, HttpServletRequest request) throws Exception{
BaseResponseInfo res = new BaseResponseInfo();
try {
@@ -52,6 +63,7 @@ public class MaterialCategoryController {
* @return
*/
@GetMapping(value = "/findById")
@ApiOperation(value = "根据id来查询商品名称")
public BaseResponseInfo findById(@RequestParam("id") Long id, HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
try {
@@ -89,6 +101,7 @@ public class MaterialCategoryController {
* @return com.alibaba.fastjson.JSONArray
*/
@RequestMapping(value = "/getMaterialCategoryTree")
@ApiOperation(value = "获取商品类别树数据")
public JSONArray getMaterialCategoryTree(@RequestParam("id") Long id) throws Exception{
JSONArray arr=new JSONArray();
List<TreeNode> materialCategoryTree = materialCategoryService.getMaterialCategoryTree(id);
@@ -110,6 +123,7 @@ public class MaterialCategoryController {
* @return java.lang.Object
*/
@RequestMapping(value = "/addMaterialCategory")
@ApiOperation(value = "新增商品类别数据")
public Object addMaterialCategory(@RequestParam("info") String beanJson) throws Exception {
JSONObject result = ExceptionConstants.standardSuccess();
MaterialCategory mc= JSON.parseObject(beanJson, MaterialCategory.class);
@@ -129,6 +143,7 @@ public class MaterialCategoryController {
* @return java.lang.Object
*/
@RequestMapping(value = "/editMaterialCategory")
@ApiOperation(value = "修改商品类别数据")
public Object editMaterialCategory(@RequestParam("info") String beanJson) throws Exception {
JSONObject result = ExceptionConstants.standardSuccess();
MaterialCategory mc= JSON.parseObject(beanJson, MaterialCategory.class);

View File

@@ -13,6 +13,8 @@ import com.jsh.erp.service.material.MaterialService;
import com.jsh.erp.service.redis.RedisService;
import com.jsh.erp.service.unit.UnitService;
import com.jsh.erp.utils.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import jxl.Sheet;
import jxl.Workbook;
import org.slf4j.Logger;
@@ -34,6 +36,7 @@ import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
*/
@RestController
@RequestMapping(value = "/material")
@Api(tags = {"商品管理"})
public class MaterialController {
private Logger logger = LoggerFactory.getLogger(MaterialController.class);
@@ -52,7 +55,25 @@ public class MaterialController {
@Resource
private RedisService redisService;
/**
* 检查商品是否存在
* @param id
* @param name
* @param model
* @param color
* @param standard
* @param mfrs
* @param otherField1
* @param otherField2
* @param otherField3
* @param unit
* @param unitId
* @param request
* @return
* @throws Exception
*/
@GetMapping(value = "/checkIsExist")
@ApiOperation(value = "检查商品是否存在")
public String checkIsExist(@RequestParam("id") Long id, @RequestParam("name") String name,
@RequestParam("model") String model, @RequestParam("color") String color,
@RequestParam("standard") String standard, @RequestParam("mfrs") String mfrs,
@@ -79,6 +100,7 @@ public class MaterialController {
* @throws Exception
*/
@PostMapping(value = "/batchSetStatus")
@ApiOperation(value = "批量设置状态-启用或者禁用")
public String batchSetStatus(@RequestBody JSONObject jsonObject,
HttpServletRequest request)throws Exception {
Boolean status = jsonObject.getBoolean("status");
@@ -99,6 +121,7 @@ public class MaterialController {
* @return
*/
@GetMapping(value = "/findById")
@ApiOperation(value = "根据id来查询商品名称")
public BaseResponseInfo findById(@RequestParam("id") Long id, HttpServletRequest request) throws Exception{
BaseResponseInfo res = new BaseResponseInfo();
try {
@@ -120,6 +143,7 @@ public class MaterialController {
* @return
*/
@GetMapping(value = "/findByIdWithBarCode")
@ApiOperation(value = "根据meId来查询商品名称")
public BaseResponseInfo findByIdWithBarCode(@RequestParam("meId") Long meId,
@RequestParam("mpList") String mpList,
HttpServletRequest request) throws Exception{
@@ -164,6 +188,7 @@ public class MaterialController {
* @return
*/
@GetMapping(value = "/findBySelect")
@ApiOperation(value = "查找商品信息")
public JSONObject findBySelect(@RequestParam(value = "categoryId", required = false) Long categoryId,
@RequestParam(value = "q", required = false) String q,
@RequestParam("mpList") String mpList,
@@ -251,6 +276,7 @@ public class MaterialController {
* @throws Exception
*/
@GetMapping(value = "/getMaterialByMeId")
@ApiOperation(value = "根据商品id查找商品信息")
public JSONObject getMaterialByMeId(@RequestParam(value = "meId", required = false) Long meId,
@RequestParam("mpList") String mpList,
HttpServletRequest request) throws Exception{
@@ -317,6 +343,7 @@ public class MaterialController {
* @param response
*/
@GetMapping(value = "/exportExcel")
@ApiOperation(value = "生成excel表格")
public void exportExcel(@RequestParam("categoryId") String categoryId,
@RequestParam("barCode") String barCode,
@RequestParam("name") String name,
@@ -361,6 +388,7 @@ public class MaterialController {
* @return
*/
@PostMapping(value = "/importExcel")
@ApiOperation(value = "excel表格导入产品")
public BaseResponseInfo importExcel(MultipartFile file,
HttpServletRequest request, HttpServletResponse response) throws Exception{
BaseResponseInfo res = new BaseResponseInfo();
@@ -387,7 +415,19 @@ public class MaterialController {
return null;
}
}
/**
* 获取商品序列号
* @param q
* @param currentPage
* @param pageSize
* @param request
* @param response
* @return
* @throws Exception
*/
@GetMapping(value = "/getMaterialEnableSerialNumberList")
@ApiOperation(value = "获取商品序列号")
public JSONObject getMaterialEnableSerialNumberList(
@RequestParam(value = "q", required = false) String q,
@RequestParam("page") Integer currentPage,
@@ -406,7 +446,13 @@ public class MaterialController {
return object;
}
/**
* 获取最大条码
* @return
* @throws Exception
*/
@GetMapping(value = "/getMaxBarCode")
@ApiOperation(value = "获取最大条码")
public BaseResponseInfo getMaxBarCode() throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>();
@@ -423,6 +469,7 @@ public class MaterialController {
* @throws Exception
*/
@GetMapping(value = "/getMaterialNameList")
@ApiOperation(value = "商品名称模糊匹配")
public JSONArray getMaterialNameList() throws Exception {
JSONArray arr = new JSONArray();
try {
@@ -445,6 +492,7 @@ public class MaterialController {
* @throws Exception
*/
@GetMapping(value = "/getMaterialByBarCode")
@ApiOperation(value = "根据条码查询商品信息")
public BaseResponseInfo getMaterialByBarCode(@RequestParam("barCode") String barCode,
@RequestParam("mpList") String mpList,
@RequestParam(required = false, value = "prefixNo") String prefixNo,
@@ -541,6 +589,7 @@ public class MaterialController {
* @throws Exception
*/
@GetMapping(value = "/getListWithStock")
@ApiOperation(value = "商品库存查询")
public BaseResponseInfo getListWithStock(@RequestParam("currentPage") Integer currentPage,
@RequestParam("pageSize") Integer pageSize,
@RequestParam("depotId") Long depotId,
@@ -585,6 +634,7 @@ public class MaterialController {
* @throws Exception
*/
@PostMapping(value = "/batchSetMaterialCurrentStock")
@ApiOperation(value = "批量设置商品当前的实时库存(按每个仓库)")
public String batchSetMaterialCurrentStock(@RequestBody JSONObject jsonObject,
HttpServletRequest request)throws Exception {
String ids = jsonObject.getString("ids");

View File

@@ -7,6 +7,8 @@ import com.jsh.erp.datasource.vo.MaterialExtendVo4List;
import com.jsh.erp.service.materialExtend.MaterialExtendService;
import com.jsh.erp.utils.BaseResponseInfo;
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.*;
@@ -23,12 +25,14 @@ import java.util.Map;
*/
@RestController
@RequestMapping(value = "/materialsExtend")
@Api(tags = {"商品价格扩展"})
public class MaterialExtendController {
private Logger logger = LoggerFactory.getLogger(MaterialExtendController.class);
@Resource
private MaterialExtendService materialExtendService;
@GetMapping(value = "/getDetailList")
@ApiOperation(value = "价格信息列表")
public BaseResponseInfo getDetailList(@RequestParam("materialId") Long materialId,
HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
@@ -69,7 +73,15 @@ public class MaterialExtendController {
return res;
}
/**
* 根据条码查询商品信息
* @param barCode
* @param request
* @return
* @throws Exception
*/
@GetMapping(value = "/getInfoByBarCode")
@ApiOperation(value = "根据条码查询商品信息")
public BaseResponseInfo getInfoByBarCode(@RequestParam("barCode") String barCode,
HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
@@ -86,7 +98,16 @@ public class MaterialExtendController {
return res;
}
/**
* 校验条码是否存在
* @param id
* @param barCode
* @param request
* @return
* @throws Exception
*/
@GetMapping(value = "/checkIsBarCodeExist")
@ApiOperation(value = "校验条码是否存在")
public BaseResponseInfo checkIsBarCodeExist(@RequestParam("id") Long id,
@RequestParam("barCode") String barCode,
HttpServletRequest request)throws Exception {

View File

@@ -5,6 +5,7 @@ import com.jsh.erp.constants.ExceptionConstants;
import com.jsh.erp.exception.BusinessRunTimeException;
import com.jsh.erp.service.material.MaterialService;
import com.jsh.erp.service.materialProperty.MaterialPropertyService;
import io.swagger.annotations.Api;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.PostMapping;
@@ -22,6 +23,7 @@ import javax.annotation.Resource;
*/
@RestController
@RequestMapping(value = "/materialProperty")
@Api(tags = {"商品扩展字段"})
public class MaterialPropertyController {

View File

@@ -3,6 +3,8 @@ package com.jsh.erp.controller;
import com.jsh.erp.datasource.entities.Msg;
import com.jsh.erp.service.msg.MsgService;
import com.jsh.erp.utils.BaseResponseInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;
@@ -18,13 +20,22 @@ import java.util.Map;
*/
@RestController
@RequestMapping(value = "/msg")
@Api(tags = {"消息管理"})
public class MsgController {
private Logger logger = LoggerFactory.getLogger(MsgController.class);
@Resource
private MsgService msgService;
/**
* 根据状态查询消息
* @param status
* @param request
* @return
* @throws Exception
*/
@GetMapping("/getMsgByStatus")
@ApiOperation(value = "根据状态查询消息")
public BaseResponseInfo getMsgByStatus(@RequestParam("status") String status,
HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
@@ -40,7 +51,16 @@ public class MsgController {
return res;
}
/**
* 批量更新状态
* @param ids
* @param status
* @param request
* @return
* @throws Exception
*/
@PostMapping("/batchUpdateStatus")
@ApiOperation(value = "批量更新状态")
public BaseResponseInfo batchUpdateStatus(@RequestParam("ids") String ids,
@RequestParam("status") String status,
HttpServletRequest request)throws Exception {
@@ -57,7 +77,15 @@ public class MsgController {
return res;
}
/**
* 根据状态查询数量
* @param status
* @param request
* @return
* @throws Exception
*/
@GetMapping("/getMsgCountByStatus")
@ApiOperation(value = "根据状态查询数量")
public BaseResponseInfo getMsgCountByStatus(@RequestParam("status") String status,
HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();

View File

@@ -11,6 +11,8 @@ import com.jsh.erp.exception.BusinessRunTimeException;
import com.jsh.erp.service.materialCategory.MaterialCategoryService;
import com.jsh.erp.service.organization.OrganizationService;
import com.jsh.erp.utils.BaseResponseInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;
@@ -28,6 +30,7 @@ import java.util.List;
*/
@RestController
@RequestMapping(value = "/organization")
@Api(tags = {"机构管理"})
public class OrganizationController {
private Logger logger = LoggerFactory.getLogger(OrganizationController.class);
@@ -40,6 +43,7 @@ public class OrganizationController {
* @return
*/
@GetMapping(value = "/findById")
@ApiOperation(value = "根据id来查询机构信息")
public BaseResponseInfo findById(@RequestParam("id") Long id, HttpServletRequest request) throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@@ -80,6 +84,7 @@ public class OrganizationController {
* @return com.alibaba.fastjson.JSONArray
*/
@RequestMapping(value = "/getOrganizationTree")
@ApiOperation(value = "获取机构树数据")
public JSONArray getOrganizationTree(@RequestParam("id") Long id) throws Exception{
JSONArray arr=new JSONArray();
List<TreeNode> organizationTree= organizationService.getOrganizationTree(id);
@@ -101,6 +106,7 @@ public class OrganizationController {
* @return java.lang.Object
*/
@PostMapping(value = "/addOrganization")
@ApiOperation(value = "新增机构信息")
public Object addOrganization(@RequestParam("info") String beanJson) throws Exception {
JSONObject result = ExceptionConstants.standardSuccess();
Organization org= JSON.parseObject(beanJson, Organization.class);
@@ -120,6 +126,7 @@ public class OrganizationController {
* @return java.lang.Object
*/
@PostMapping(value = "/editOrganization")
@ApiOperation(value = "修改机构信息")
public Object editOrganization(@RequestParam("info") String beanJson) throws Exception {
JSONObject result = ExceptionConstants.standardSuccess();
Organization org= JSON.parseObject(beanJson, Organization.class);

View File

@@ -8,6 +8,8 @@ import com.jsh.erp.datasource.entities.Person;
import com.jsh.erp.exception.BusinessRunTimeException;
import com.jsh.erp.service.person.PersonService;
import com.jsh.erp.utils.BaseResponseInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;
@@ -23,13 +25,21 @@ import java.util.Map;
*/
@RestController
@RequestMapping(value = "/person")
@Api(tags = {"经手人管理"})
public class PersonController {
private Logger logger = LoggerFactory.getLogger(PersonController.class);
@Resource
private PersonService personService;
/**
* 全部数据列表
* @param request
* @return
* @throws Exception
*/
@GetMapping(value = "/getAllList")
@ApiOperation(value = "全部数据列表")
public BaseResponseInfo getAllList(HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>();
@@ -53,6 +63,7 @@ public class PersonController {
* @return
*/
@GetMapping(value = "/getPersonByIds")
@ApiOperation(value = "根据Id获取经手人信息")
public BaseResponseInfo getPersonByIds(@RequestParam("personIds") String personIds,
HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
@@ -78,6 +89,7 @@ public class PersonController {
* @return
*/
@GetMapping(value = "/getPersonByType")
@ApiOperation(value = "根据类型获取经手人信息")
public BaseResponseInfo getPersonByType(@RequestParam("type") String type,
HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
@@ -102,6 +114,7 @@ public class PersonController {
* @return
*/
@GetMapping(value = "/getPersonByNumType")
@ApiOperation(value = "根据类型获取经手人信息1-业务员2-仓管员3-财务员")
public JSONArray getPersonByNumType(@RequestParam("type") String typeNum,
HttpServletRequest request)throws Exception {
JSONArray dataArray = new JSONArray();

View File

@@ -7,6 +7,8 @@ import com.jsh.erp.service.platformConfig.PlatformConfigService;
import com.jsh.erp.service.user.UserService;
import com.jsh.erp.utils.BaseResponseInfo;
import com.jsh.erp.utils.ErpInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
@@ -24,6 +26,7 @@ import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
*/
@RestController
@RequestMapping(value = "/platformConfig")
@Api(tags = {"平台参数"})
public class PlatformConfigController {
private Logger logger = LoggerFactory.getLogger(PlatformConfigController.class);
@@ -44,6 +47,7 @@ public class PlatformConfigController {
* @return
*/
@GetMapping(value = "/getPlatform/name")
@ApiOperation(value = "获取平台名称")
public String getPlatformName(HttpServletRequest request)throws Exception {
String res;
try {
@@ -63,6 +67,7 @@ public class PlatformConfigController {
* @return
*/
@GetMapping(value = "/getPlatform/url")
@ApiOperation(value = "获取官方网站地址")
public String getPlatformUrl(HttpServletRequest request)throws Exception {
String res;
try {
@@ -83,6 +88,7 @@ public class PlatformConfigController {
* @return
*/
@PostMapping(value = "/updatePlatformConfigByKey")
@ApiOperation(value = "根据platformKey更新platformValue")
public String updatePlatformConfigByKey(@RequestBody JSONObject object,
HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<>();
@@ -103,6 +109,7 @@ public class PlatformConfigController {
* @return
*/
@GetMapping(value = "/getPlatformConfigByKey")
@ApiOperation(value = "根据platformKey查询信息")
public BaseResponseInfo getPlatformConfigByKey(@RequestParam("platformKey") String platformKey,
HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();

View File

@@ -6,6 +6,8 @@ import com.gitee.starblues.integration.operator.module.PluginInfo;
import com.jsh.erp.utils.BaseResponseInfo;
import com.jsh.erp.utils.ComputerInfo;
import com.jsh.erp.utils.StringUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.DigestUtils;
import org.springframework.web.bind.annotation.*;
@@ -23,6 +25,7 @@ import java.util.*;
*/
@RestController
@RequestMapping("/plugin")
@Api(tags = {"插件管理"})
public class PluginController {
@@ -37,6 +40,7 @@ public class PluginController {
* @return 返回插件信息
*/
@GetMapping(value = "/list")
@ApiOperation(value = "获取插件信息")
public BaseResponseInfo getPluginInfo(@RequestParam(value = "name",required = false) String name,
@RequestParam("currentPage") Integer currentPage,
@RequestParam("pageSize") Integer pageSize,
@@ -73,6 +77,7 @@ public class PluginController {
* @return 获取插件文件名。只在生产环境显示
*/
@GetMapping("/files")
@ApiOperation(value = "获取插件jar文件名")
public Set<String> getPluginFilePaths(){
try {
return pluginOperator.getPluginFilePaths();
@@ -89,6 +94,7 @@ public class PluginController {
* @return 返回操作结果
*/
@PostMapping("/stop/{id}")
@ApiOperation(value = "根据插件id停止插件")
public BaseResponseInfo stop(@PathVariable("id") String id){
BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>();
@@ -117,6 +123,7 @@ public class PluginController {
* @return 返回操作结果
*/
@PostMapping("/start/{id}")
@ApiOperation(value = "根据插件id启动插件")
public BaseResponseInfo start(@PathVariable("id") String id){
BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>();
@@ -146,6 +153,7 @@ public class PluginController {
* @return 返回操作结果
*/
@PostMapping("/uninstall/{id}")
@ApiOperation(value = "根据插件id卸载插件")
public BaseResponseInfo uninstall(@PathVariable("id") String id){
BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>();
@@ -175,6 +183,7 @@ public class PluginController {
* @return 操作结果
*/
@PostMapping("/installByPath")
@ApiOperation(value = "根据插件路径安装插件")
public String install(@RequestParam("path") String path){
try {
if(pluginOperator.install(Paths.get(path))){
@@ -195,6 +204,7 @@ public class PluginController {
* @return 操作结果
*/
@PostMapping("/uploadInstallPluginJar")
@ApiOperation(value = "上传并安装插件")
public BaseResponseInfo install(MultipartFile file, HttpServletRequest request, HttpServletResponse response){
BaseResponseInfo res = new BaseResponseInfo();
try {
@@ -215,6 +225,7 @@ public class PluginController {
* @return 操作结果
*/
@PostMapping("/uploadPluginConfigFile")
@ApiOperation(value = "上传插件的配置文件")
public String uploadConfig(@RequestParam("configFile") MultipartFile multipartFile){
try {
if(pluginOperator.uploadConfigFile(multipartFile)){
@@ -235,6 +246,7 @@ public class PluginController {
* @return 操作结果
*/
@PostMapping("/back/{pluginId}")
@ApiOperation(value = "备份插件")
public String backupPlugin(@PathVariable("pluginId") String pluginId){
try {
if(pluginOperator.backupPlugin(pluginId, "testBack")){
@@ -253,6 +265,7 @@ public class PluginController {
* @return
*/
@GetMapping("/getMacWithSecret")
@ApiOperation(value = "获取加密后的mac")
public BaseResponseInfo getMacWithSecret(){
BaseResponseInfo res = new BaseResponseInfo();
try {

View File

@@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.service.CommonQueryManager;
import com.jsh.erp.utils.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;
@@ -21,12 +23,14 @@ import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
* 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 {
@@ -41,6 +45,7 @@ public class ResourceController {
}
@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,
@@ -69,6 +74,7 @@ public class ResourceController {
}
@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>();
@@ -83,6 +89,7 @@ public class ResourceController {
}
@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>();
@@ -97,6 +104,7 @@ public class ResourceController {
}
@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>();
@@ -111,6 +119,7 @@ public class ResourceController {
}
@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>();
@@ -125,6 +134,7 @@ public class ResourceController {
}
@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 {

View File

@@ -8,6 +8,8 @@ import com.jsh.erp.exception.BusinessRunTimeException;
import com.jsh.erp.service.role.RoleService;
import com.jsh.erp.service.user.UserService;
import com.jsh.erp.service.userBusiness.UserBusinessService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;
@@ -21,6 +23,7 @@ import java.util.List;
*/
@RestController
@RequestMapping(value = "/role")
@Api(tags = {"角色管理"})
public class RoleController {
private Logger logger = LoggerFactory.getLogger(RoleController.class);
@@ -36,6 +39,7 @@ public class RoleController {
* @return
*/
@GetMapping(value = "/findUserRole")
@ApiOperation(value = "查询用户的角色")
public JSONArray findUserRole(@RequestParam("UBType") String type, @RequestParam("UBKeyId") String keyId,
HttpServletRequest request)throws Exception {
JSONArray arr = new JSONArray();
@@ -62,6 +66,7 @@ public class RoleController {
}
@GetMapping(value = "/allList")
@ApiOperation(value = "查询全部角色列表")
public List<Role> allList(HttpServletRequest request)throws Exception {
return roleService.allList();
}

View File

@@ -3,6 +3,8 @@ package com.jsh.erp.controller;
import com.jsh.erp.service.depotHead.DepotHeadService;
import com.jsh.erp.service.sequence.SequenceService;
import com.jsh.erp.utils.BaseResponseInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
@@ -19,6 +21,7 @@ import java.util.Map;
*/
@RestController
@RequestMapping(value = "/sequence")
@Api(tags = {"单据编号"})
public class SequenceController {
private Logger logger = LoggerFactory.getLogger(SequenceController.class);
@@ -31,6 +34,7 @@ public class SequenceController {
* @return
*/
@GetMapping(value = "/buildNumber")
@ApiOperation(value = "单据编号生成接口")
public BaseResponseInfo buildNumber(HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>();

View File

@@ -12,6 +12,8 @@ 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.*;
@@ -31,6 +33,8 @@ import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
* @Date: 2019/1/22 10:29
*/
@RestController
@RequestMapping(value = "/serialNumber")
@Api(tags = {"序列号管理"})
public class SerialNumberController {
private Logger logger = LoggerFactory.getLogger(SerialNumberController.class);
@@ -43,13 +47,13 @@ public class SerialNumberController {
*批量添加序列号
* create time: 2019/1/29 15:11
* @Param: materialName
 * @Param: serialNumberPrefix
 * @Param: batAddTotal
 * @Param: remark
* @Param: serialNumberPrefix
* @Param: batAddTotal
* @Param: remark
* @return java.lang.Object
*/
@PostMapping("/serialNumber/batAddSerialNumber")
@ResponseBody
@PostMapping("/batAddSerialNumber")
@ApiOperation(value = "批量添加序列号")
public String batAddSerialNumber(@RequestBody JSONObject jsonObject, HttpServletRequest request)throws Exception{
Map<String, Object> objectMap = new HashMap<>();
String materialCode = jsonObject.getString("materialCode");
@@ -77,7 +81,8 @@ public class SerialNumberController {
* @return
* @throws Exception
*/
@GetMapping(value = "/serialNumber/getEnableSerialNumberList")
@GetMapping(value = "/getEnableSerialNumberList")
@ApiOperation(value = "获取序列号商品")
public BaseResponseInfo getEnableSerialNumberList(@RequestParam("name") String name,
@RequestParam("depotId") Long depotId,
@RequestParam("barCode") String barCode,

View File

@@ -11,6 +11,8 @@ 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.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import jxl.Sheet;
import jxl.Workbook;
import org.slf4j.Logger;
@@ -37,6 +39,7 @@ import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
*/
@RestController
@RequestMapping(value = "/supplier")
@Api(tags = {"商家管理"})
public class SupplierController {
private Logger logger = LoggerFactory.getLogger(SupplierController.class);
@@ -58,6 +61,7 @@ public class SupplierController {
* @return
*/
@PostMapping(value = "/findBySelect_cus")
@ApiOperation(value = "查找客户信息")
public JSONArray findBySelectCus(HttpServletRequest request) {
JSONArray arr = new JSONArray();
try {
@@ -92,6 +96,7 @@ public class SupplierController {
* @return
*/
@PostMapping(value = "/findBySelect_sup")
@ApiOperation(value = "查找供应商信息")
public JSONArray findBySelectSup(HttpServletRequest request) throws Exception{
JSONArray arr = new JSONArray();
try {
@@ -119,6 +124,7 @@ public class SupplierController {
* @return
*/
@PostMapping(value = "/findBySelect_organ")
@ApiOperation(value = "查找往来单位,含供应商和客户信息")
public JSONArray findBySelectOrgan(HttpServletRequest request) throws Exception{
JSONArray arr = new JSONArray();
try {
@@ -163,6 +169,7 @@ public class SupplierController {
* @return
*/
@PostMapping(value = "/findBySelect_retail")
@ApiOperation(value = "查找会员信息")
public JSONArray findBySelectRetail(HttpServletRequest request)throws Exception {
JSONArray arr = new JSONArray();
try {
@@ -192,6 +199,7 @@ public class SupplierController {
* @return
*/
@PostMapping(value = "/batchSetStatus")
@ApiOperation(value = "批量设置状态")
public String batchSetStatus(@RequestBody JSONObject jsonObject,
HttpServletRequest request)throws Exception {
Boolean status = jsonObject.getBoolean("status");
@@ -213,6 +221,7 @@ public class SupplierController {
* @return
*/
@GetMapping(value = "/findUserCustomer")
@ApiOperation(value = "用户对应客户显示")
public JSONArray findUserCustomer(@RequestParam("UBType") String type, @RequestParam("UBKeyId") String keyId,
HttpServletRequest request) throws Exception{
JSONArray arr = new JSONArray();
@@ -260,6 +269,7 @@ public class SupplierController {
* @return
*/
@PostMapping(value = "/importExcel")
@ApiOperation(value = "导入excel表格")
public BaseResponseInfo importExcel(MultipartFile file,
HttpServletRequest request, HttpServletResponse response) throws Exception{
BaseResponseInfo res = new BaseResponseInfo();

View File

@@ -14,6 +14,8 @@ import com.jsh.erp.utils.BaseResponseInfo;
import com.jsh.erp.utils.FileUtils;
import com.jsh.erp.utils.StringUtil;
import com.jsh.erp.utils.Tools;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
@@ -38,6 +40,7 @@ import java.util.List;
*/
@RestController
@RequestMapping(value = "/systemConfig")
@Api(tags = {"系统参数"})
public class SystemConfigController {
private Logger logger = LoggerFactory.getLogger(SystemConfigController.class);
@@ -68,6 +71,7 @@ public class SystemConfigController {
* @return
*/
@GetMapping(value = "/getCurrentInfo")
@ApiOperation(value = "获取当前租户的配置信息")
public BaseResponseInfo getCurrentInfo(HttpServletRequest request) throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
try{
@@ -91,6 +95,7 @@ public class SystemConfigController {
* @throws Exception
*/
@GetMapping(value = "/fileSizeLimit")
@ApiOperation(value = "获取文件大小限制")
public BaseResponseInfo fileSizeLimit(HttpServletRequest request) throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
try{
@@ -117,6 +122,7 @@ public class SystemConfigController {
* @return
*/
@PostMapping(value = "/upload")
@ApiOperation(value = "文件上传统一方法")
public BaseResponseInfo upload(HttpServletRequest request, HttpServletResponse response) {
BaseResponseInfo res = new BaseResponseInfo();
try {
@@ -194,6 +200,7 @@ public class SystemConfigController {
* @param response
*/
@GetMapping(value = "/static/**")
@ApiOperation(value = "预览图片&下载文件")
public void view(HttpServletRequest request, HttpServletResponse response) {
// ISO-8859-1 ==> UTF-8 进行编码转换
String imgPath = extractPathFromPattern(request);

View File

@@ -15,6 +15,8 @@ import com.jsh.erp.service.redis.RedisService;
import com.jsh.erp.service.tenant.TenantService;
import com.jsh.erp.service.user.UserService;
import com.jsh.erp.utils.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
@@ -37,6 +39,7 @@ import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
*/
@RestController
@RequestMapping(value = "/tenant")
@Api(tags = {"租户管理"})
public class TenantController {
private Logger logger = LoggerFactory.getLogger(TenantController.class);
@@ -50,6 +53,7 @@ public class TenantController {
* @return
*/
@PostMapping(value = "/batchSetStatus")
@ApiOperation(value = "批量设置状态")
public String batchSetStatus(@RequestBody JSONObject jsonObject,
HttpServletRequest request)throws Exception {
Boolean status = jsonObject.getBoolean("status");

View File

@@ -5,6 +5,7 @@ import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.constants.ExceptionConstants;
import com.jsh.erp.exception.BusinessRunTimeException;
import com.jsh.erp.service.unit.UnitService;
import io.swagger.annotations.Api;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.PostMapping;
@@ -22,6 +23,7 @@ import javax.annotation.Resource;
*/
@RestController
@RequestMapping(value = "/unit")
@Api(tags = {"单位管理"})
public class UnitController {
}

View File

@@ -9,6 +9,8 @@ import com.jsh.erp.service.userBusiness.UserBusinessService;
import com.jsh.erp.utils.BaseResponseInfo;
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.*;
@@ -26,6 +28,7 @@ import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
*/
@RestController
@RequestMapping(value = "/userBusiness")
@Api(tags = {"用户角色模块的关系"})
public class UserBusinessController {
private Logger logger = LoggerFactory.getLogger(UserBusinessController.class);
@@ -34,7 +37,16 @@ public class UserBusinessController {
@Resource
private UserService userService;
/**
* 获取信息
* @param keyId
* @param type
* @param request
* @return
* @throws Exception
*/
@GetMapping(value = "/getBasicData")
@ApiOperation(value = "获取信息")
public BaseResponseInfo getBasicData(@RequestParam(value = "KeyId") String keyId,
@RequestParam(value = "Type") String type,
HttpServletRequest request)throws Exception {
@@ -53,7 +65,16 @@ public class UserBusinessController {
return res;
}
/**
* 校验存在
* @param type
* @param keyId
* @param request
* @return
* @throws Exception
*/
@GetMapping(value = "/checkIsValueExist")
@ApiOperation(value = "校验存在")
public String checkIsValueExist(@RequestParam(value ="type", required = false) String type,
@RequestParam(value ="keyId", required = false) String keyId,
HttpServletRequest request)throws Exception {
@@ -74,6 +95,7 @@ public class UserBusinessController {
* @return
*/
@PostMapping(value = "/updateBtnStr")
@ApiOperation(value = "更新角色的按钮权限")
public BaseResponseInfo updateBtnStr(@RequestBody JSONObject jsonObject,
HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();

View File

@@ -16,6 +16,8 @@ import com.jsh.erp.service.redis.RedisService;
import com.jsh.erp.service.tenant.TenantService;
import com.jsh.erp.service.user.UserService;
import com.jsh.erp.utils.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
@@ -39,6 +41,7 @@ import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
*/
@RestController
@RequestMapping(value = "/user")
@Api(tags = {"用户管理"})
public class UserController {
private Logger logger = LoggerFactory.getLogger(UserController.class);
@@ -68,6 +71,7 @@ public class UserController {
private static final String BASE_CHECK_CODES = "qwertyuiplkjhgfdsazxcvbnmQWERTYUPLKJHGFDSAZXCVBNM1234567890";
@PostMapping(value = "/login")
@ApiOperation(value = "登录")
public BaseResponseInfo login(@RequestBody User userParam,
HttpServletRequest request)throws Exception {
logger.info("============用户登录 login 方法调用开始==============");
@@ -166,6 +170,7 @@ public class UserController {
}
@GetMapping(value = "/getUserSession")
@ApiOperation(value = "获取用户信息")
public BaseResponseInfo getSessionUser(HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
try {
@@ -185,6 +190,7 @@ public class UserController {
}
@GetMapping(value = "/logout")
@ApiOperation(value = "退出")
public BaseResponseInfo logout(HttpServletRequest request, HttpServletResponse response)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
try {
@@ -199,6 +205,7 @@ public class UserController {
}
@PostMapping(value = "/resetPwd")
@ApiOperation(value = "重置密码")
public String resetPwd(@RequestBody JSONObject jsonObject,
HttpServletRequest request) throws Exception {
Map<String, Object> objectMap = new HashMap<>();
@@ -214,6 +221,7 @@ public class UserController {
}
@PutMapping(value = "/updatePwd")
@ApiOperation(value = "更新密码")
public String updatePwd(@RequestBody JSONObject jsonObject, HttpServletRequest request)throws Exception {
Integer flag = 0;
Map<String, Object> objectMap = new HashMap<String, Object>();
@@ -255,6 +263,7 @@ public class UserController {
* @return
*/
@GetMapping(value = "/getAllList")
@ApiOperation(value = "获取全部用户数据列表")
public BaseResponseInfo getAllList(HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
try {
@@ -280,6 +289,7 @@ public class UserController {
* @throws Exception
*/
@GetMapping(value = "/getUserList")
@ApiOperation(value = "用户列表")
public JSONArray getUserList(HttpServletRequest request)throws Exception {
JSONArray dataArray = new JSONArray();
try {
@@ -307,6 +317,7 @@ public class UserController {
* @return java.lang.Object
*/
@PostMapping("/addUser")
@ApiOperation(value = "新增用户")
@ResponseBody
public Object addUser(@RequestBody JSONObject obj, HttpServletRequest request)throws Exception{
JSONObject result = ExceptionConstants.standardSuccess();
@@ -331,6 +342,7 @@ public class UserController {
* @return java.lang.Object
*/
@PutMapping("/updateUser")
@ApiOperation(value = "修改用户")
@ResponseBody
public Object updateUser(@RequestBody JSONObject obj, HttpServletRequest request)throws Exception{
JSONObject result = ExceptionConstants.standardSuccess();
@@ -346,6 +358,7 @@ public class UserController {
* @throws Exception
*/
@PostMapping(value = "/registerUser")
@ApiOperation(value = "注册用户")
public Object registerUser(@RequestBody UserEx ue,
HttpServletRequest request)throws Exception{
JSONObject result = ExceptionConstants.standardSuccess();
@@ -355,7 +368,13 @@ public class UserController {
return result;
}
/**
* 获取机构用户树
* @return
* @throws Exception
*/
@RequestMapping("/getOrganizationUserTree")
@ApiOperation(value = "获取机构用户树")
public JSONArray getOrganizationUserTree()throws Exception{
JSONArray arr=new JSONArray();
List<TreeNodeEx> organizationUserTree= userService.getOrganizationUserTree();
@@ -375,6 +394,7 @@ public class UserController {
* @return
*/
@GetMapping("/getRoleTypeByCurrentUser")
@ApiOperation(value = "获取当前用户的角色类型")
public BaseResponseInfo getRoleTypeByCurrentUser(HttpServletRequest request) {
BaseResponseInfo res = new BaseResponseInfo();
try {
@@ -391,7 +411,14 @@ public class UserController {
return res;
}
/**
* 获取随机校验码
* @param response
* @param key
* @return
*/
@GetMapping(value = "/randomImage/{key}")
@ApiOperation(value = "获取随机校验码")
public BaseResponseInfo randomImage(HttpServletResponse response,@PathVariable String key){
BaseResponseInfo res = new BaseResponseInfo();
try {
@@ -417,6 +444,7 @@ public class UserController {
* @return
*/
@PostMapping(value = "/batchSetStatus")
@ApiOperation(value = "批量设置状态")
public String batchSetStatus(@RequestBody JSONObject jsonObject,
HttpServletRequest request)throws Exception {
Byte status = jsonObject.getByte("status");
@@ -436,6 +464,7 @@ public class UserController {
* @return
*/
@GetMapping(value = "/infoWithTenant")
@ApiOperation(value = "获取当前用户的用户数量和租户信息")
public BaseResponseInfo randomImage(HttpServletRequest request){
BaseResponseInfo res = new BaseResponseInfo();
try {

View File

@@ -278,9 +278,9 @@ public class SerialNumberService {
* 卖出序列号
* create time: 2019/1/25 9:17
* @Param: materialId
 * @Param: depotheadId
 * @Param: isSell 卖出'1'
 * @Param: Count 卖出或者赎回的数量
* @Param: depotheadId
* @Param: isSell 卖出'1'
* @Param: Count 卖出或者赎回的数量
* @return com.jsh.erp.datasource.entities.SerialNumberEx
*/
@Transactional(value = "transactionManager", rollbackFor = Exception.class)