Commit a923700c authored by 季圣华's avatar 季圣华
Browse files

给接口增加swagger描述

parent 744691d9
...@@ -33,11 +33,11 @@ public class Swagger2Config { ...@@ -33,11 +33,11 @@ public class Swagger2Config {
private ApiInfo apiInfo() { private ApiInfo apiInfo() {
return new ApiInfoBuilder() return new ApiInfoBuilder()
.title("Mybatis-Plus Plugin Example RESTful APIs") .title("华夏ERP Restful Api")
.description("集成Mybatis-Plus模块接口描述") .description("华夏ERP接口描述")
.termsOfServiceUrl("http://127.0.0.1") .termsOfServiceUrl("http://127.0.0.1")
.contact(new Contact("jishenghua", "", "")) .contact(new Contact("jishenghua", "", ""))
.version("2.1.1") .version("3.0")
.build(); .build();
} }
......
...@@ -11,8 +11,11 @@ import com.jsh.erp.exception.BusinessRunTimeException; ...@@ -11,8 +11,11 @@ import com.jsh.erp.exception.BusinessRunTimeException;
import com.jsh.erp.service.account.AccountService; import com.jsh.erp.service.account.AccountService;
import com.jsh.erp.utils.BaseResponseInfo; import com.jsh.erp.utils.BaseResponseInfo;
import com.jsh.erp.utils.ErpInfo; import com.jsh.erp.utils.ErpInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Description;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
...@@ -29,6 +32,7 @@ import static com.jsh.erp.utils.ResponseJsonUtil.returnJson; ...@@ -29,6 +32,7 @@ import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
*/ */
@RestController @RestController
@RequestMapping(value = "/account") @RequestMapping(value = "/account")
@Api(tags = {"账户管理"})
public class AccountController { public class AccountController {
private Logger logger = LoggerFactory.getLogger(AccountController.class); private Logger logger = LoggerFactory.getLogger(AccountController.class);
...@@ -41,6 +45,7 @@ public class AccountController { ...@@ -41,6 +45,7 @@ public class AccountController {
* @return * @return
*/ */
@GetMapping(value = "/findBySelect") @GetMapping(value = "/findBySelect")
@ApiOperation(value = "查找结算账户信息-下拉框")
public String findBySelect(HttpServletRequest request) throws Exception { public String findBySelect(HttpServletRequest request) throws Exception {
String res = null; String res = null;
try { try {
...@@ -70,6 +75,7 @@ public class AccountController { ...@@ -70,6 +75,7 @@ public class AccountController {
* @return * @return
*/ */
@GetMapping(value = "/getAccount") @GetMapping(value = "/getAccount")
@ApiOperation(value = "获取所有结算账户")
public BaseResponseInfo getAccount(HttpServletRequest request) throws Exception { public BaseResponseInfo getAccount(HttpServletRequest request) throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
...@@ -96,6 +102,7 @@ public class AccountController { ...@@ -96,6 +102,7 @@ public class AccountController {
* @return * @return
*/ */
@GetMapping(value = "/findAccountInOutList") @GetMapping(value = "/findAccountInOutList")
@ApiOperation(value = "账户流水信息")
public BaseResponseInfo findAccountInOutList(@RequestParam("currentPage") Integer currentPage, public BaseResponseInfo findAccountInOutList(@RequestParam("currentPage") Integer currentPage,
@RequestParam("pageSize") Integer pageSize, @RequestParam("pageSize") Integer pageSize,
@RequestParam("accountId") Long accountId, @RequestParam("accountId") Long accountId,
...@@ -130,7 +137,15 @@ public class AccountController { ...@@ -130,7 +137,15 @@ public class AccountController {
return res; return res;
} }
/**
* 更新默认账户
* @param object
* @param request
* @return
* @throws Exception
*/
@PostMapping(value = "/updateIsDefault") @PostMapping(value = "/updateIsDefault")
@ApiOperation(value = "更新默认账户")
public String updateIsDefault(@RequestBody JSONObject object, public String updateIsDefault(@RequestBody JSONObject object,
HttpServletRequest request) throws Exception{ HttpServletRequest request) throws Exception{
Long accountId = object.getLong("id"); Long accountId = object.getLong("id");
...@@ -149,6 +164,7 @@ public class AccountController { ...@@ -149,6 +164,7 @@ public class AccountController {
* @return * @return
*/ */
@GetMapping(value = "/getStatistics") @GetMapping(value = "/getStatistics")
@ApiOperation(value = "结算账户的统计")
public BaseResponseInfo getStatistics(@RequestParam("name") String name, public BaseResponseInfo getStatistics(@RequestParam("name") String name,
@RequestParam("serialNo") String serialNo, @RequestParam("serialNo") String serialNo,
HttpServletRequest request) throws Exception { HttpServletRequest request) throws Exception {
......
...@@ -8,6 +8,8 @@ import com.jsh.erp.datasource.entities.AccountHeadVo4ListEx; ...@@ -8,6 +8,8 @@ import com.jsh.erp.datasource.entities.AccountHeadVo4ListEx;
import com.jsh.erp.service.accountHead.AccountHeadService; import com.jsh.erp.service.accountHead.AccountHeadService;
import com.jsh.erp.utils.BaseResponseInfo; import com.jsh.erp.utils.BaseResponseInfo;
import com.jsh.erp.utils.ErpInfo; import com.jsh.erp.utils.ErpInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -25,6 +27,7 @@ import static com.jsh.erp.utils.ResponseJsonUtil.returnJson; ...@@ -25,6 +27,7 @@ import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
*/ */
@RestController @RestController
@RequestMapping(value = "/accountHead") @RequestMapping(value = "/accountHead")
@Api(tags = {"财务管理"})
public class AccountHeadController { public class AccountHeadController {
private Logger logger = LoggerFactory.getLogger(AccountHeadController.class); private Logger logger = LoggerFactory.getLogger(AccountHeadController.class);
...@@ -38,6 +41,7 @@ public class AccountHeadController { ...@@ -38,6 +41,7 @@ public class AccountHeadController {
* @return * @return
*/ */
@PostMapping(value = "/batchSetStatus") @PostMapping(value = "/batchSetStatus")
@ApiOperation(value = "批量设置状态-审核或者反审核")
public String batchSetStatus(@RequestBody JSONObject jsonObject, public String batchSetStatus(@RequestBody JSONObject jsonObject,
HttpServletRequest request) throws Exception{ HttpServletRequest request) throws Exception{
Map<String, Object> objectMap = new HashMap<>(); Map<String, Object> objectMap = new HashMap<>();
...@@ -59,6 +63,7 @@ public class AccountHeadController { ...@@ -59,6 +63,7 @@ public class AccountHeadController {
* @throws Exception * @throws Exception
*/ */
@PostMapping(value = "/addAccountHeadAndDetail") @PostMapping(value = "/addAccountHeadAndDetail")
@ApiOperation(value = "新增财务主表及财务子表信息")
public Object addAccountHeadAndDetail(@RequestBody AccountHeadVo4Body body, HttpServletRequest request) throws Exception{ public Object addAccountHeadAndDetail(@RequestBody AccountHeadVo4Body body, HttpServletRequest request) throws Exception{
JSONObject result = ExceptionConstants.standardSuccess(); JSONObject result = ExceptionConstants.standardSuccess();
String beanJson = body.getInfo(); String beanJson = body.getInfo();
...@@ -75,6 +80,7 @@ public class AccountHeadController { ...@@ -75,6 +80,7 @@ public class AccountHeadController {
* @throws Exception * @throws Exception
*/ */
@PutMapping(value = "/updateAccountHeadAndDetail") @PutMapping(value = "/updateAccountHeadAndDetail")
@ApiOperation(value = "更新财务主表及财务子表信息")
public Object updateAccountHeadAndDetail(@RequestBody AccountHeadVo4Body body, HttpServletRequest request) throws Exception{ public Object updateAccountHeadAndDetail(@RequestBody AccountHeadVo4Body body, HttpServletRequest request) throws Exception{
JSONObject result = ExceptionConstants.standardSuccess(); JSONObject result = ExceptionConstants.standardSuccess();
String beanJson = body.getInfo(); String beanJson = body.getInfo();
...@@ -90,6 +96,7 @@ public class AccountHeadController { ...@@ -90,6 +96,7 @@ public class AccountHeadController {
* @return * @return
*/ */
@GetMapping(value = "/getDetailByNumber") @GetMapping(value = "/getDetailByNumber")
@ApiOperation(value = "根据编号查询单据信息")
public BaseResponseInfo getDetailByNumber(@RequestParam("billNo") String billNo, public BaseResponseInfo getDetailByNumber(@RequestParam("billNo") String billNo,
HttpServletRequest request)throws Exception { HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
......
...@@ -5,6 +5,8 @@ import com.alibaba.fastjson.JSONObject; ...@@ -5,6 +5,8 @@ import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.datasource.vo.AccountItemVo4List; import com.jsh.erp.datasource.vo.AccountItemVo4List;
import com.jsh.erp.service.accountItem.AccountItemService; import com.jsh.erp.service.accountItem.AccountItemService;
import com.jsh.erp.utils.BaseResponseInfo; import com.jsh.erp.utils.BaseResponseInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -25,6 +27,7 @@ import java.util.Map; ...@@ -25,6 +27,7 @@ import java.util.Map;
*/ */
@RestController @RestController
@RequestMapping(value = "/accountItem") @RequestMapping(value = "/accountItem")
@Api(tags = {"财务明细"})
public class AccountItemController { public class AccountItemController {
private Logger logger = LoggerFactory.getLogger(AccountItemController.class); private Logger logger = LoggerFactory.getLogger(AccountItemController.class);
...@@ -32,6 +35,7 @@ public class AccountItemController { ...@@ -32,6 +35,7 @@ public class AccountItemController {
private AccountItemService accountItemService; private AccountItemService accountItemService;
@GetMapping(value = "/getDetailList") @GetMapping(value = "/getDetailList")
@ApiOperation(value = "明细列表")
public BaseResponseInfo getDetailList(@RequestParam("headerId") Long headerId, public BaseResponseInfo getDetailList(@RequestParam("headerId") Long headerId,
HttpServletRequest request)throws Exception { HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
......
...@@ -15,6 +15,8 @@ import com.jsh.erp.service.systemConfig.SystemConfigService; ...@@ -15,6 +15,8 @@ import com.jsh.erp.service.systemConfig.SystemConfigService;
import com.jsh.erp.service.user.UserService; import com.jsh.erp.service.user.UserService;
import com.jsh.erp.service.userBusiness.UserBusinessService; import com.jsh.erp.service.userBusiness.UserBusinessService;
import com.jsh.erp.utils.*; import com.jsh.erp.utils.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.dao.DataAccessException; import org.springframework.dao.DataAccessException;
...@@ -33,6 +35,7 @@ import static com.jsh.erp.utils.ResponseJsonUtil.returnJson; ...@@ -33,6 +35,7 @@ import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
*/ */
@RestController @RestController
@RequestMapping(value = "/depot") @RequestMapping(value = "/depot")
@Api(tags = {"仓库管理"})
public class DepotController { public class DepotController {
private Logger logger = LoggerFactory.getLogger(DepotController.class); private Logger logger = LoggerFactory.getLogger(DepotController.class);
...@@ -45,7 +48,14 @@ public class DepotController { ...@@ -45,7 +48,14 @@ public class DepotController {
@Resource @Resource
private MaterialService materialService; private MaterialService materialService;
/**
* 仓库列表
* @param request
* @return
* @throws Exception
*/
@GetMapping(value = "/getAllList") @GetMapping(value = "/getAllList")
@ApiOperation(value = "仓库列表")
public BaseResponseInfo getAllList(HttpServletRequest request) throws Exception{ public BaseResponseInfo getAllList(HttpServletRequest request) throws Exception{
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
try { try {
...@@ -68,6 +78,7 @@ public class DepotController { ...@@ -68,6 +78,7 @@ public class DepotController {
* @return * @return
*/ */
@GetMapping(value = "/findUserDepot") @GetMapping(value = "/findUserDepot")
@ApiOperation(value = "用户对应仓库显示")
public JSONArray findUserDepot(@RequestParam("UBType") String type, @RequestParam("UBKeyId") String keyId, public JSONArray findUserDepot(@RequestParam("UBType") String type, @RequestParam("UBKeyId") String keyId,
HttpServletRequest request) throws Exception{ HttpServletRequest request) throws Exception{
JSONArray arr = new JSONArray(); JSONArray arr = new JSONArray();
...@@ -114,6 +125,7 @@ public class DepotController { ...@@ -114,6 +125,7 @@ public class DepotController {
* @throws Exception * @throws Exception
*/ */
@GetMapping(value = "/findDepotByCurrentUser") @GetMapping(value = "/findDepotByCurrentUser")
@ApiOperation(value = "获取当前用户拥有权限的仓库列表")
public BaseResponseInfo findDepotByCurrentUser(HttpServletRequest request) throws Exception{ public BaseResponseInfo findDepotByCurrentUser(HttpServletRequest request) throws Exception{
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
try { try {
...@@ -128,7 +140,15 @@ public class DepotController { ...@@ -128,7 +140,15 @@ public class DepotController {
return res; return res;
} }
/**
* 更新默认仓库
* @param object
* @param request
* @return
* @throws Exception
*/
@PostMapping(value = "/updateIsDefault") @PostMapping(value = "/updateIsDefault")
@ApiOperation(value = "更新默认仓库")
public String updateIsDefault(@RequestBody JSONObject object, public String updateIsDefault(@RequestBody JSONObject object,
HttpServletRequest request) throws Exception{ HttpServletRequest request) throws Exception{
Long depotId = object.getLong("id"); Long depotId = object.getLong("id");
...@@ -141,7 +161,14 @@ public class DepotController { ...@@ -141,7 +161,14 @@ public class DepotController {
} }
} }
/**
* 仓库列表-带库存
* @param mId
* @param request
* @return
*/
@GetMapping(value = "/getAllListWithStock") @GetMapping(value = "/getAllListWithStock")
@ApiOperation(value = "仓库列表-带库存")
public BaseResponseInfo getAllList(@RequestParam("mId") Long mId, public BaseResponseInfo getAllList(@RequestParam("mId") Long mId,
HttpServletRequest request) { HttpServletRequest request) {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
......
...@@ -18,6 +18,8 @@ import com.jsh.erp.service.log.LogService; ...@@ -18,6 +18,8 @@ import com.jsh.erp.service.log.LogService;
import com.jsh.erp.service.redis.RedisService; import com.jsh.erp.service.redis.RedisService;
import com.jsh.erp.service.supplier.SupplierService; import com.jsh.erp.service.supplier.SupplierService;
import com.jsh.erp.utils.*; import com.jsh.erp.utils.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -41,6 +43,7 @@ import static com.jsh.erp.utils.Tools.getNow3; ...@@ -41,6 +43,7 @@ import static com.jsh.erp.utils.Tools.getNow3;
*/ */
@RestController @RestController
@RequestMapping(value = "/depotHead") @RequestMapping(value = "/depotHead")
@Api(tags = {"单据管理"})
public class DepotHeadController { public class DepotHeadController {
private Logger logger = LoggerFactory.getLogger(DepotHeadController.class); private Logger logger = LoggerFactory.getLogger(DepotHeadController.class);
...@@ -63,6 +66,7 @@ public class DepotHeadController { ...@@ -63,6 +66,7 @@ public class DepotHeadController {
* @return * @return
*/ */
@PostMapping(value = "/batchSetStatus") @PostMapping(value = "/batchSetStatus")
@ApiOperation(value = "批量设置状态-审核或者反审核")
public String batchSetStatus(@RequestBody JSONObject jsonObject, public String batchSetStatus(@RequestBody JSONObject jsonObject,
HttpServletRequest request) throws Exception{ HttpServletRequest request) throws Exception{
Map<String, Object> objectMap = new HashMap<>(); Map<String, Object> objectMap = new HashMap<>();
...@@ -90,6 +94,7 @@ public class DepotHeadController { ...@@ -90,6 +94,7 @@ public class DepotHeadController {
* @return * @return
*/ */
@GetMapping(value = "/findInDetail") @GetMapping(value = "/findInDetail")
@ApiOperation(value = "入库出库明细接口")
public BaseResponseInfo findInDetail(@RequestParam("currentPage") Integer currentPage, public BaseResponseInfo findInDetail(@RequestParam("currentPage") Integer currentPage,
@RequestParam("pageSize") Integer pageSize, @RequestParam("pageSize") Integer pageSize,
@RequestParam("organId") Integer oId, @RequestParam("organId") Integer oId,
...@@ -139,6 +144,7 @@ public class DepotHeadController { ...@@ -139,6 +144,7 @@ public class DepotHeadController {
* @return * @return
*/ */
@GetMapping(value = "/findInOutMaterialCount") @GetMapping(value = "/findInOutMaterialCount")
@ApiOperation(value = "入库出库统计接口")
public BaseResponseInfo findInOutMaterialCount(@RequestParam("currentPage") Integer currentPage, public BaseResponseInfo findInOutMaterialCount(@RequestParam("currentPage") Integer currentPage,
@RequestParam("pageSize") Integer pageSize, @RequestParam("pageSize") Integer pageSize,
@RequestParam("organId") Integer oId, @RequestParam("organId") Integer oId,
...@@ -175,6 +181,7 @@ public class DepotHeadController { ...@@ -175,6 +181,7 @@ public class DepotHeadController {
} }
/** /**
* 调拨明细统计
* @param currentPage * @param currentPage
* @param pageSize * @param pageSize
* @param oId * @param oId
...@@ -188,6 +195,7 @@ public class DepotHeadController { ...@@ -188,6 +195,7 @@ public class DepotHeadController {
* @return * @return
*/ */
@GetMapping(value = "/findAllocationDetail") @GetMapping(value = "/findAllocationDetail")
@ApiOperation(value = "调拨明细统计")
public BaseResponseInfo findallocationDetail(@RequestParam("currentPage") Integer currentPage, public BaseResponseInfo findallocationDetail(@RequestParam("currentPage") Integer currentPage,
@RequestParam("pageSize") Integer pageSize, @RequestParam("pageSize") Integer pageSize,
@RequestParam("organId") Integer oId, @RequestParam("organId") Integer oId,
...@@ -229,6 +237,7 @@ public class DepotHeadController { ...@@ -229,6 +237,7 @@ public class DepotHeadController {
* @return * @return
*/ */
@GetMapping(value = "/findStatementAccount") @GetMapping(value = "/findStatementAccount")
@ApiOperation(value = "对账单接口")
public BaseResponseInfo findStatementAccount(@RequestParam("currentPage") Integer currentPage, public BaseResponseInfo findStatementAccount(@RequestParam("currentPage") Integer currentPage,
@RequestParam("pageSize") Integer pageSize, @RequestParam("pageSize") Integer pageSize,
@RequestParam("beginTime") String beginTime, @RequestParam("beginTime") String beginTime,
...@@ -281,6 +290,7 @@ public class DepotHeadController { ...@@ -281,6 +290,7 @@ public class DepotHeadController {
* @return * @return
*/ */
@GetMapping(value = "/getDetailByNumber") @GetMapping(value = "/getDetailByNumber")
@ApiOperation(value = "根据编号查询单据信息")
public BaseResponseInfo getDetailByNumber(@RequestParam("number") String number, public BaseResponseInfo getDetailByNumber(@RequestParam("number") String number,
HttpServletRequest request)throws Exception { HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
...@@ -308,6 +318,7 @@ public class DepotHeadController { ...@@ -308,6 +318,7 @@ public class DepotHeadController {
* @throws Exception * @throws Exception
*/ */
@PostMapping(value = "/addDepotHeadAndDetail") @PostMapping(value = "/addDepotHeadAndDetail")
@ApiOperation(value = "新增单据主表及单据子表信息")
public Object addDepotHeadAndDetail(@RequestBody DepotHeadVo4Body body, HttpServletRequest request) throws Exception{ public Object addDepotHeadAndDetail(@RequestBody DepotHeadVo4Body body, HttpServletRequest request) throws Exception{
JSONObject result = ExceptionConstants.standardSuccess(); JSONObject result = ExceptionConstants.standardSuccess();
String beanJson = body.getInfo(); String beanJson = body.getInfo();
...@@ -324,6 +335,7 @@ public class DepotHeadController { ...@@ -324,6 +335,7 @@ public class DepotHeadController {
* @throws Exception * @throws Exception
*/ */
@PutMapping(value = "/updateDepotHeadAndDetail") @PutMapping(value = "/updateDepotHeadAndDetail")
@ApiOperation(value = "更新单据主表及单据子表信息")
public Object updateDepotHeadAndDetail(@RequestBody DepotHeadVo4Body body, HttpServletRequest request) throws Exception{ public Object updateDepotHeadAndDetail(@RequestBody DepotHeadVo4Body body, HttpServletRequest request) throws Exception{
JSONObject result = ExceptionConstants.standardSuccess(); JSONObject result = ExceptionConstants.standardSuccess();
String beanJson = body.getInfo(); String beanJson = body.getInfo();
...@@ -338,6 +350,7 @@ public class DepotHeadController { ...@@ -338,6 +350,7 @@ public class DepotHeadController {
* @return * @return
*/ */
@GetMapping(value = "/getBuyAndSaleStatistics") @GetMapping(value = "/getBuyAndSaleStatistics")
@ApiOperation(value = "统计今日销售额、今日进货额、本月销售额、本月进货额")
public BaseResponseInfo getBuyAndSaleStatistics(HttpServletRequest request) { public BaseResponseInfo getBuyAndSaleStatistics(HttpServletRequest request) {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
...@@ -377,6 +390,7 @@ public class DepotHeadController { ...@@ -377,6 +390,7 @@ public class DepotHeadController {
* @return * @return
*/ */
@GetMapping(value = "/getCreatorByCurrentUser") @GetMapping(value = "/getCreatorByCurrentUser")
@ApiOperation(value = "根据当前用户获取操作员数组")
public BaseResponseInfo getCreatorByRoleType(HttpServletRequest request) { public BaseResponseInfo getCreatorByRoleType(HttpServletRequest request) {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
...@@ -404,6 +418,7 @@ public class DepotHeadController { ...@@ -404,6 +418,7 @@ public class DepotHeadController {
* @throws Exception * @throws Exception
*/ */
@GetMapping(value = "/debtList") @GetMapping(value = "/debtList")
@ApiOperation(value = "查询存在欠款的单据")
public String debtList(@RequestParam(value = Constants.SEARCH, required = false) String search, public String debtList(@RequestParam(value = Constants.SEARCH, required = false) String search,
HttpServletRequest request)throws Exception { HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<>(); Map<String, Object> objectMap = new HashMap<>();
......
...@@ -14,6 +14,8 @@ import com.jsh.erp.service.material.MaterialService; ...@@ -14,6 +14,8 @@ import com.jsh.erp.service.material.MaterialService;
import com.jsh.erp.service.redis.RedisService; import com.jsh.erp.service.redis.RedisService;
import com.jsh.erp.service.unit.UnitService; import com.jsh.erp.service.unit.UnitService;
import com.jsh.erp.utils.*; import com.jsh.erp.utils.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -35,6 +37,7 @@ import static com.jsh.erp.utils.Tools.getCenternTime; ...@@ -35,6 +37,7 @@ import static com.jsh.erp.utils.Tools.getCenternTime;
*/ */
@RestController @RestController
@RequestMapping(value = "/depotItem") @RequestMapping(value = "/depotItem")
@Api(tags = {"单据明细"})
public class DepotItemController { public class DepotItemController {
private Logger logger = LoggerFactory.getLogger(DepotItemController.class); private Logger logger = LoggerFactory.getLogger(DepotItemController.class);
...@@ -60,6 +63,7 @@ public class DepotItemController { ...@@ -60,6 +63,7 @@ public class DepotItemController {
* @return * @return
*/ */
@GetMapping(value = "/findDetailByTypeAndMaterialId") @GetMapping(value = "/findDetailByTypeAndMaterialId")
@ApiOperation(value = "只根据商品id查询单据列表")
public String findDetailByTypeAndMaterialId( public String findDetailByTypeAndMaterialId(
@RequestParam(value = Constants.PAGE_SIZE, required = false) Integer pageSize, @RequestParam(value = Constants.PAGE_SIZE, required = false) Integer pageSize,
@RequestParam(value = Constants.CURRENT_PAGE, required = false) Integer currentPage, @RequestParam(value = Constants.CURRENT_PAGE, required = false) Integer currentPage,
...@@ -114,6 +118,7 @@ public class DepotItemController { ...@@ -114,6 +118,7 @@ public class DepotItemController {
* @throws Exception * @throws Exception
*/ */
@GetMapping(value = "/findStockByDepotAndBarCode") @GetMapping(value = "/findStockByDepotAndBarCode")
@ApiOperation(value = "根据商品条码和仓库id查询库存数量")
public BaseResponseInfo findStockByDepotAndBarCode( public BaseResponseInfo findStockByDepotAndBarCode(
@RequestParam("depotId") Long depotId, @RequestParam("depotId") Long depotId,
@RequestParam("barCode") String barCode, @RequestParam("barCode") String barCode,
...@@ -154,7 +159,16 @@ public class DepotItemController { ...@@ -154,7 +159,16 @@ public class DepotItemController {
return res; return res;
} }
/**
* 单据明细列表
* @param headerId
* @param mpList
* @param request
* @return
* @throws Exception
*/
@GetMapping(value = "/getDetailList") @GetMapping(value = "/getDetailList")
@ApiOperation(value = "单据明细列表")
public BaseResponseInfo getDetailList(@RequestParam("headerId") Long headerId, public BaseResponseInfo getDetailList(@RequestParam("headerId") Long headerId,
@RequestParam("mpList") String mpList, @RequestParam("mpList") String mpList,
HttpServletRequest request)throws Exception { HttpServletRequest request)throws Exception {
...@@ -272,6 +286,7 @@ public class DepotItemController { ...@@ -272,6 +286,7 @@ public class DepotItemController {
* @throws Exception * @throws Exception
*/ */
@GetMapping(value = "/findByAll") @GetMapping(value = "/findByAll")
@ApiOperation(value = "查找所有的明细")
public BaseResponseInfo findByAll(@RequestParam("currentPage") Integer currentPage, public BaseResponseInfo findByAll(@RequestParam("currentPage") Integer currentPage,
@RequestParam("pageSize") Integer pageSize, @RequestParam("pageSize") Integer pageSize,
@RequestParam("depotId") Long depotId, @RequestParam("depotId") Long depotId,
...@@ -346,6 +361,7 @@ public class DepotItemController { ...@@ -346,6 +361,7 @@ public class DepotItemController {
* @return * @return
*/ */
@GetMapping(value = "/totalCountMoney") @GetMapping(value = "/totalCountMoney")
@ApiOperation(value = "统计总计金额")
public BaseResponseInfo totalCountMoney(@RequestParam("depotId") Long depotId, public BaseResponseInfo totalCountMoney(@RequestParam("depotId") Long depotId,
@RequestParam("monthTime") String monthTime, @RequestParam("monthTime") String monthTime,
@RequestParam("materialParam") String materialParam, @RequestParam("materialParam") String materialParam,
...@@ -390,6 +406,7 @@ public class DepotItemController { ...@@ -390,6 +406,7 @@ public class DepotItemController {
* @return * @return
*/ */
@GetMapping(value = "/buyIn") @GetMapping(value = "/buyIn")
@ApiOperation(value = "进货统计")
public BaseResponseInfo buyIn(@RequestParam("currentPage") Integer currentPage, public BaseResponseInfo buyIn(@RequestParam("currentPage") Integer currentPage,
@RequestParam("pageSize") Integer pageSize, @RequestParam("pageSize") Integer pageSize,
@RequestParam("monthTime") String monthTime, @RequestParam("monthTime") String monthTime,
...@@ -453,6 +470,7 @@ public class DepotItemController { ...@@ -453,6 +470,7 @@ public class DepotItemController {
* @return * @return
*/ */
@GetMapping(value = "/saleOut") @GetMapping(value = "/saleOut")
@ApiOperation(value = "销售统计")
public BaseResponseInfo saleOut(@RequestParam("currentPage") Integer currentPage, public BaseResponseInfo saleOut(@RequestParam("currentPage") Integer currentPage,
@RequestParam("pageSize") Integer pageSize, @RequestParam("pageSize") Integer pageSize,
@RequestParam("monthTime") String monthTime, @RequestParam("monthTime") String monthTime,
...@@ -534,6 +552,7 @@ public class DepotItemController { ...@@ -534,6 +552,7 @@ public class DepotItemController {
* @return * @return
*/ */
@GetMapping(value = "/findStockWarningCount") @GetMapping(value = "/findStockWarningCount")
@ApiOperation(value = "库存预警报表")
public BaseResponseInfo findStockWarningCount(@RequestParam("currentPage") Integer currentPage, public BaseResponseInfo findStockWarningCount(@RequestParam("currentPage") Integer currentPage,
@RequestParam("pageSize") Integer pageSize, @RequestParam("pageSize") Integer pageSize,
@RequestParam("materialParam") String materialParam, @RequestParam("materialParam") String materialParam,
...@@ -585,6 +604,7 @@ public class DepotItemController { ...@@ -585,6 +604,7 @@ public class DepotItemController {
* @throws Exception * @throws Exception
*/ */
@GetMapping(value = "/buyOrSalePrice") @GetMapping(value = "/buyOrSalePrice")
@ApiOperation(value = "统计采购或销售的总金额")
public BaseResponseInfo buyOrSalePrice(HttpServletRequest request, HttpServletResponse response)throws Exception { public BaseResponseInfo buyOrSalePrice(HttpServletRequest request, HttpServletResponse response)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
...@@ -627,6 +647,7 @@ public class DepotItemController { ...@@ -627,6 +647,7 @@ public class DepotItemController {
* @return * @return
*/ */
@GetMapping(value = "/getBatchNumberList") @GetMapping(value = "/getBatchNumberList")
@ApiOperation(value = "获取批次商品列表信息")
public BaseResponseInfo getBatchNumberList(@RequestParam("name") String name, public BaseResponseInfo getBatchNumberList(@RequestParam("name") String name,
@RequestParam("depotId") Long depotId, @RequestParam("depotId") Long depotId,
@RequestParam("barCode") String barCode, @RequestParam("barCode") String barCode,
......
...@@ -12,6 +12,8 @@ import com.jsh.erp.service.userBusiness.UserBusinessService; ...@@ -12,6 +12,8 @@ import com.jsh.erp.service.userBusiness.UserBusinessService;
import com.jsh.erp.utils.BaseResponseInfo; import com.jsh.erp.utils.BaseResponseInfo;
import com.jsh.erp.utils.StringUtil; import com.jsh.erp.utils.StringUtil;
import com.jsh.erp.utils.Tools; import com.jsh.erp.utils.Tools;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.dao.DataAccessException; import org.springframework.dao.DataAccessException;
...@@ -29,6 +31,7 @@ import java.util.Map; ...@@ -29,6 +31,7 @@ import java.util.Map;
*/ */
@RestController @RestController
@RequestMapping(value = "/function") @RequestMapping(value = "/function")
@Api(tags = {"功能管理"})
public class FunctionController { public class FunctionController {
private Logger logger = LoggerFactory.getLogger(FunctionController.class); private Logger logger = LoggerFactory.getLogger(FunctionController.class);
...@@ -38,7 +41,15 @@ public class FunctionController { ...@@ -38,7 +41,15 @@ public class FunctionController {
@Resource @Resource
private UserBusinessService userBusinessService; private UserBusinessService userBusinessService;
/**
* 根据父编号查询菜单
* @param jsonObject
* @param request
* @return
* @throws Exception
*/
@PostMapping(value = "/findMenuByPNumber") @PostMapping(value = "/findMenuByPNumber")
@ApiOperation(value = "根据父编号查询菜单")
public JSONArray findMenuByPNumber(@RequestBody JSONObject jsonObject, public JSONArray findMenuByPNumber(@RequestBody JSONObject jsonObject,
HttpServletRequest request)throws Exception { HttpServletRequest request)throws Exception {
String pNumber = jsonObject.getString("pNumber"); String pNumber = jsonObject.getString("pNumber");
...@@ -110,6 +121,7 @@ public class FunctionController { ...@@ -110,6 +121,7 @@ public class FunctionController {
* @return * @return
*/ */
@GetMapping(value = "/findRoleFunction") @GetMapping(value = "/findRoleFunction")
@ApiOperation(value = "角色对应功能显示")
public JSONArray findRoleFunction(@RequestParam("UBType") String type, @RequestParam("UBKeyId") String keyId, public JSONArray findRoleFunction(@RequestParam("UBType") String type, @RequestParam("UBKeyId") String keyId,
HttpServletRequest request)throws Exception { HttpServletRequest request)throws Exception {
JSONArray arr = new JSONArray(); JSONArray arr = new JSONArray();
...@@ -183,6 +195,7 @@ public class FunctionController { ...@@ -183,6 +195,7 @@ public class FunctionController {
* @return * @return
*/ */
@GetMapping(value = "/findRoleFunctionsById") @GetMapping(value = "/findRoleFunctionsById")
@ApiOperation(value = "根据id列表查找功能信息")
public BaseResponseInfo findByIds(@RequestParam("roleId") Long roleId, public BaseResponseInfo findByIds(@RequestParam("roleId") Long roleId,
HttpServletRequest request)throws Exception { HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
......
...@@ -8,6 +8,8 @@ import com.jsh.erp.datasource.entities.InOutItem; ...@@ -8,6 +8,8 @@ import com.jsh.erp.datasource.entities.InOutItem;
import com.jsh.erp.exception.BusinessRunTimeException; import com.jsh.erp.exception.BusinessRunTimeException;
import com.jsh.erp.service.inOutItem.InOutItemService; import com.jsh.erp.service.inOutItem.InOutItemService;
import com.jsh.erp.utils.BaseResponseInfo; import com.jsh.erp.utils.BaseResponseInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -23,6 +25,7 @@ import java.util.Map; ...@@ -23,6 +25,7 @@ import java.util.Map;
*/ */
@RestController @RestController
@RequestMapping(value = "/inOutItem") @RequestMapping(value = "/inOutItem")
@Api(tags = {"收支项目"})
public class InOutItemController { public class InOutItemController {
private Logger logger = LoggerFactory.getLogger(InOutItemController.class); private Logger logger = LoggerFactory.getLogger(InOutItemController.class);
...@@ -35,6 +38,7 @@ public class InOutItemController { ...@@ -35,6 +38,7 @@ public class InOutItemController {
* @return * @return
*/ */
@GetMapping(value = "/findBySelect") @GetMapping(value = "/findBySelect")
@ApiOperation(value = "查找收支项目信息")
public String findBySelect(@RequestParam("type") String type, HttpServletRequest request) throws Exception{ public String findBySelect(@RequestParam("type") String type, HttpServletRequest request) throws Exception{
String res = null; String res = null;
try { try {
......
...@@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSONObject; ...@@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.datasource.entities.MaterialAttribute; import com.jsh.erp.datasource.entities.MaterialAttribute;
import com.jsh.erp.service.materialAttribute.MaterialAttributeService; import com.jsh.erp.service.materialAttribute.MaterialAttributeService;
import com.jsh.erp.utils.BaseResponseInfo; import com.jsh.erp.utils.BaseResponseInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -20,13 +22,21 @@ import java.util.List; ...@@ -20,13 +22,21 @@ import java.util.List;
*/ */
@RestController @RestController
@RequestMapping(value = "/materialAttribute") @RequestMapping(value = "/materialAttribute")
@Api(tags = {"商品属性"})
public class MaterialAttributeController { public class MaterialAttributeController {
private Logger logger = LoggerFactory.getLogger(MaterialAttributeController.class); private Logger logger = LoggerFactory.getLogger(MaterialAttributeController.class);
@Resource @Resource
private MaterialAttributeService materialAttributeService; private MaterialAttributeService materialAttributeService;
/**
* 获取全部商品属性
* @param request
* @return
* @throws Exception
*/
@GetMapping("/getAll") @GetMapping("/getAll")
@ApiOperation(value = "获取全部商品属性")
public BaseResponseInfo getAll(HttpServletRequest request)throws Exception { public BaseResponseInfo getAll(HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
try { try {
......
...@@ -11,6 +11,8 @@ import com.jsh.erp.datasource.vo.TreeNode; ...@@ -11,6 +11,8 @@ import com.jsh.erp.datasource.vo.TreeNode;
import com.jsh.erp.exception.BusinessRunTimeException; import com.jsh.erp.exception.BusinessRunTimeException;
import com.jsh.erp.service.materialCategory.MaterialCategoryService; import com.jsh.erp.service.materialCategory.MaterialCategoryService;
import com.jsh.erp.utils.BaseResponseInfo; import com.jsh.erp.utils.BaseResponseInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -24,13 +26,22 @@ import java.util.List; ...@@ -24,13 +26,22 @@ import java.util.List;
*/ */
@RestController @RestController
@RequestMapping(value = "/materialCategory") @RequestMapping(value = "/materialCategory")
@Api(tags = {"商品类别"})
public class MaterialCategoryController { public class MaterialCategoryController {
private Logger logger = LoggerFactory.getLogger(MaterialCategoryController.class); private Logger logger = LoggerFactory.getLogger(MaterialCategoryController.class);
@Resource @Resource
private MaterialCategoryService materialCategoryService; private MaterialCategoryService materialCategoryService;
/**
* 获取全部商品类别
* @param parentId
* @param request
* @return
* @throws Exception
*/
@GetMapping(value = "/getAllList") @GetMapping(value = "/getAllList")
@ApiOperation(value = "获取全部商品类别")
public BaseResponseInfo getAllList(@RequestParam("parentId") Long parentId, HttpServletRequest request) throws Exception{ public BaseResponseInfo getAllList(@RequestParam("parentId") Long parentId, HttpServletRequest request) throws Exception{
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
try { try {
...@@ -52,6 +63,7 @@ public class MaterialCategoryController { ...@@ -52,6 +63,7 @@ public class MaterialCategoryController {
* @return * @return
*/ */
@GetMapping(value = "/findById") @GetMapping(value = "/findById")
@ApiOperation(value = "根据id来查询商品名称")
public BaseResponseInfo findById(@RequestParam("id") Long id, HttpServletRequest request)throws Exception { public BaseResponseInfo findById(@RequestParam("id") Long id, HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
try { try {
...@@ -89,6 +101,7 @@ public class MaterialCategoryController { ...@@ -89,6 +101,7 @@ public class MaterialCategoryController {
* @return com.alibaba.fastjson.JSONArray * @return com.alibaba.fastjson.JSONArray
*/ */
@RequestMapping(value = "/getMaterialCategoryTree") @RequestMapping(value = "/getMaterialCategoryTree")
@ApiOperation(value = "获取商品类别树数据")
public JSONArray getMaterialCategoryTree(@RequestParam("id") Long id) throws Exception{ public JSONArray getMaterialCategoryTree(@RequestParam("id") Long id) throws Exception{
JSONArray arr=new JSONArray(); JSONArray arr=new JSONArray();
List<TreeNode> materialCategoryTree = materialCategoryService.getMaterialCategoryTree(id); List<TreeNode> materialCategoryTree = materialCategoryService.getMaterialCategoryTree(id);
...@@ -110,6 +123,7 @@ public class MaterialCategoryController { ...@@ -110,6 +123,7 @@ public class MaterialCategoryController {
* @return java.lang.Object * @return java.lang.Object
*/ */
@RequestMapping(value = "/addMaterialCategory") @RequestMapping(value = "/addMaterialCategory")
@ApiOperation(value = "新增商品类别数据")
public Object addMaterialCategory(@RequestParam("info") String beanJson) throws Exception { public Object addMaterialCategory(@RequestParam("info") String beanJson) throws Exception {
JSONObject result = ExceptionConstants.standardSuccess(); JSONObject result = ExceptionConstants.standardSuccess();
MaterialCategory mc= JSON.parseObject(beanJson, MaterialCategory.class); MaterialCategory mc= JSON.parseObject(beanJson, MaterialCategory.class);
...@@ -129,6 +143,7 @@ public class MaterialCategoryController { ...@@ -129,6 +143,7 @@ public class MaterialCategoryController {
* @return java.lang.Object * @return java.lang.Object
*/ */
@RequestMapping(value = "/editMaterialCategory") @RequestMapping(value = "/editMaterialCategory")
@ApiOperation(value = "修改商品类别数据")
public Object editMaterialCategory(@RequestParam("info") String beanJson) throws Exception { public Object editMaterialCategory(@RequestParam("info") String beanJson) throws Exception {
JSONObject result = ExceptionConstants.standardSuccess(); JSONObject result = ExceptionConstants.standardSuccess();
MaterialCategory mc= JSON.parseObject(beanJson, MaterialCategory.class); MaterialCategory mc= JSON.parseObject(beanJson, MaterialCategory.class);
......
...@@ -13,6 +13,8 @@ import com.jsh.erp.service.material.MaterialService; ...@@ -13,6 +13,8 @@ import com.jsh.erp.service.material.MaterialService;
import com.jsh.erp.service.redis.RedisService; import com.jsh.erp.service.redis.RedisService;
import com.jsh.erp.service.unit.UnitService; import com.jsh.erp.service.unit.UnitService;
import com.jsh.erp.utils.*; import com.jsh.erp.utils.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import jxl.Sheet; import jxl.Sheet;
import jxl.Workbook; import jxl.Workbook;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -34,6 +36,7 @@ import static com.jsh.erp.utils.ResponseJsonUtil.returnJson; ...@@ -34,6 +36,7 @@ import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
*/ */
@RestController @RestController
@RequestMapping(value = "/material") @RequestMapping(value = "/material")
@Api(tags = {"商品管理"})
public class MaterialController { public class MaterialController {
private Logger logger = LoggerFactory.getLogger(MaterialController.class); private Logger logger = LoggerFactory.getLogger(MaterialController.class);
...@@ -52,7 +55,25 @@ public class MaterialController { ...@@ -52,7 +55,25 @@ public class MaterialController {
@Resource @Resource
private RedisService redisService; 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") @GetMapping(value = "/checkIsExist")
@ApiOperation(value = "检查商品是否存在")
public String checkIsExist(@RequestParam("id") Long id, @RequestParam("name") String name, public String checkIsExist(@RequestParam("id") Long id, @RequestParam("name") String name,
@RequestParam("model") String model, @RequestParam("color") String color, @RequestParam("model") String model, @RequestParam("color") String color,
@RequestParam("standard") String standard, @RequestParam("mfrs") String mfrs, @RequestParam("standard") String standard, @RequestParam("mfrs") String mfrs,
...@@ -79,6 +100,7 @@ public class MaterialController { ...@@ -79,6 +100,7 @@ public class MaterialController {
* @throws Exception * @throws Exception
*/ */
@PostMapping(value = "/batchSetStatus") @PostMapping(value = "/batchSetStatus")
@ApiOperation(value = "批量设置状态-启用或者禁用")
public String batchSetStatus(@RequestBody JSONObject jsonObject, public String batchSetStatus(@RequestBody JSONObject jsonObject,
HttpServletRequest request)throws Exception { HttpServletRequest request)throws Exception {
Boolean status = jsonObject.getBoolean("status"); Boolean status = jsonObject.getBoolean("status");
...@@ -99,6 +121,7 @@ public class MaterialController { ...@@ -99,6 +121,7 @@ public class MaterialController {
* @return * @return
*/ */
@GetMapping(value = "/findById") @GetMapping(value = "/findById")
@ApiOperation(value = "根据id来查询商品名称")
public BaseResponseInfo findById(@RequestParam("id") Long id, HttpServletRequest request) throws Exception{ public BaseResponseInfo findById(@RequestParam("id") Long id, HttpServletRequest request) throws Exception{
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
try { try {
...@@ -120,6 +143,7 @@ public class MaterialController { ...@@ -120,6 +143,7 @@ public class MaterialController {
* @return * @return
*/ */
@GetMapping(value = "/findByIdWithBarCode") @GetMapping(value = "/findByIdWithBarCode")
@ApiOperation(value = "根据meId来查询商品名称")
public BaseResponseInfo findByIdWithBarCode(@RequestParam("meId") Long meId, public BaseResponseInfo findByIdWithBarCode(@RequestParam("meId") Long meId,
@RequestParam("mpList") String mpList, @RequestParam("mpList") String mpList,
HttpServletRequest request) throws Exception{ HttpServletRequest request) throws Exception{
...@@ -164,6 +188,7 @@ public class MaterialController { ...@@ -164,6 +188,7 @@ public class MaterialController {
* @return * @return
*/ */
@GetMapping(value = "/findBySelect") @GetMapping(value = "/findBySelect")
@ApiOperation(value = "查找商品信息")
public JSONObject findBySelect(@RequestParam(value = "categoryId", required = false) Long categoryId, public JSONObject findBySelect(@RequestParam(value = "categoryId", required = false) Long categoryId,
@RequestParam(value = "q", required = false) String q, @RequestParam(value = "q", required = false) String q,
@RequestParam("mpList") String mpList, @RequestParam("mpList") String mpList,
...@@ -251,6 +276,7 @@ public class MaterialController { ...@@ -251,6 +276,7 @@ public class MaterialController {
* @throws Exception * @throws Exception
*/ */
@GetMapping(value = "/getMaterialByMeId") @GetMapping(value = "/getMaterialByMeId")
@ApiOperation(value = "根据商品id查找商品信息")
public JSONObject getMaterialByMeId(@RequestParam(value = "meId", required = false) Long meId, public JSONObject getMaterialByMeId(@RequestParam(value = "meId", required = false) Long meId,
@RequestParam("mpList") String mpList, @RequestParam("mpList") String mpList,
HttpServletRequest request) throws Exception{ HttpServletRequest request) throws Exception{
...@@ -317,6 +343,7 @@ public class MaterialController { ...@@ -317,6 +343,7 @@ public class MaterialController {
* @param response * @param response
*/ */
@GetMapping(value = "/exportExcel") @GetMapping(value = "/exportExcel")
@ApiOperation(value = "生成excel表格")
public void exportExcel(@RequestParam("categoryId") String categoryId, public void exportExcel(@RequestParam("categoryId") String categoryId,
@RequestParam("barCode") String barCode, @RequestParam("barCode") String barCode,
@RequestParam("name") String name, @RequestParam("name") String name,
...@@ -361,6 +388,7 @@ public class MaterialController { ...@@ -361,6 +388,7 @@ public class MaterialController {
* @return * @return
*/ */
@PostMapping(value = "/importExcel") @PostMapping(value = "/importExcel")
@ApiOperation(value = "excel表格导入产品")
public BaseResponseInfo importExcel(MultipartFile file, public BaseResponseInfo importExcel(MultipartFile file,
HttpServletRequest request, HttpServletResponse response) throws Exception{ HttpServletRequest request, HttpServletResponse response) throws Exception{
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
...@@ -387,7 +415,19 @@ public class MaterialController { ...@@ -387,7 +415,19 @@ public class MaterialController {
return null; return null;
} }
} }
/**
* 获取商品序列号
* @param q
* @param currentPage
* @param pageSize
* @param request
* @param response
* @return
* @throws Exception
*/
@GetMapping(value = "/getMaterialEnableSerialNumberList") @GetMapping(value = "/getMaterialEnableSerialNumberList")
@ApiOperation(value = "获取商品序列号")
public JSONObject getMaterialEnableSerialNumberList( public JSONObject getMaterialEnableSerialNumberList(
@RequestParam(value = "q", required = false) String q, @RequestParam(value = "q", required = false) String q,
@RequestParam("page") Integer currentPage, @RequestParam("page") Integer currentPage,
...@@ -406,7 +446,13 @@ public class MaterialController { ...@@ -406,7 +446,13 @@ public class MaterialController {
return object; return object;
} }
/**
* 获取最大条码
* @return
* @throws Exception
*/
@GetMapping(value = "/getMaxBarCode") @GetMapping(value = "/getMaxBarCode")
@ApiOperation(value = "获取最大条码")
public BaseResponseInfo getMaxBarCode() throws Exception { public BaseResponseInfo getMaxBarCode() throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
...@@ -423,6 +469,7 @@ public class MaterialController { ...@@ -423,6 +469,7 @@ public class MaterialController {
* @throws Exception * @throws Exception
*/ */
@GetMapping(value = "/getMaterialNameList") @GetMapping(value = "/getMaterialNameList")
@ApiOperation(value = "商品名称模糊匹配")
public JSONArray getMaterialNameList() throws Exception { public JSONArray getMaterialNameList() throws Exception {
JSONArray arr = new JSONArray(); JSONArray arr = new JSONArray();
try { try {
...@@ -445,6 +492,7 @@ public class MaterialController { ...@@ -445,6 +492,7 @@ public class MaterialController {
* @throws Exception * @throws Exception
*/ */
@GetMapping(value = "/getMaterialByBarCode") @GetMapping(value = "/getMaterialByBarCode")
@ApiOperation(value = "根据条码查询商品信息")
public BaseResponseInfo getMaterialByBarCode(@RequestParam("barCode") String barCode, public BaseResponseInfo getMaterialByBarCode(@RequestParam("barCode") String barCode,
@RequestParam("mpList") String mpList, @RequestParam("mpList") String mpList,
@RequestParam(required = false, value = "prefixNo") String prefixNo, @RequestParam(required = false, value = "prefixNo") String prefixNo,
...@@ -541,6 +589,7 @@ public class MaterialController { ...@@ -541,6 +589,7 @@ public class MaterialController {
* @throws Exception * @throws Exception
*/ */
@GetMapping(value = "/getListWithStock") @GetMapping(value = "/getListWithStock")
@ApiOperation(value = "商品库存查询")
public BaseResponseInfo getListWithStock(@RequestParam("currentPage") Integer currentPage, public BaseResponseInfo getListWithStock(@RequestParam("currentPage") Integer currentPage,
@RequestParam("pageSize") Integer pageSize, @RequestParam("pageSize") Integer pageSize,
@RequestParam("depotId") Long depotId, @RequestParam("depotId") Long depotId,
...@@ -585,6 +634,7 @@ public class MaterialController { ...@@ -585,6 +634,7 @@ public class MaterialController {
* @throws Exception * @throws Exception
*/ */
@PostMapping(value = "/batchSetMaterialCurrentStock") @PostMapping(value = "/batchSetMaterialCurrentStock")
@ApiOperation(value = "批量设置商品当前的实时库存(按每个仓库)")
public String batchSetMaterialCurrentStock(@RequestBody JSONObject jsonObject, public String batchSetMaterialCurrentStock(@RequestBody JSONObject jsonObject,
HttpServletRequest request)throws Exception { HttpServletRequest request)throws Exception {
String ids = jsonObject.getString("ids"); String ids = jsonObject.getString("ids");
......
...@@ -7,6 +7,8 @@ import com.jsh.erp.datasource.vo.MaterialExtendVo4List; ...@@ -7,6 +7,8 @@ import com.jsh.erp.datasource.vo.MaterialExtendVo4List;
import com.jsh.erp.service.materialExtend.MaterialExtendService; import com.jsh.erp.service.materialExtend.MaterialExtendService;
import com.jsh.erp.utils.BaseResponseInfo; import com.jsh.erp.utils.BaseResponseInfo;
import com.jsh.erp.utils.StringUtil; import com.jsh.erp.utils.StringUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -23,12 +25,14 @@ import java.util.Map; ...@@ -23,12 +25,14 @@ import java.util.Map;
*/ */
@RestController @RestController
@RequestMapping(value = "/materialsExtend") @RequestMapping(value = "/materialsExtend")
@Api(tags = {"商品价格扩展"})
public class MaterialExtendController { public class MaterialExtendController {
private Logger logger = LoggerFactory.getLogger(MaterialExtendController.class); private Logger logger = LoggerFactory.getLogger(MaterialExtendController.class);
@Resource @Resource
private MaterialExtendService materialExtendService; private MaterialExtendService materialExtendService;
@GetMapping(value = "/getDetailList") @GetMapping(value = "/getDetailList")
@ApiOperation(value = "价格信息列表")
public BaseResponseInfo getDetailList(@RequestParam("materialId") Long materialId, public BaseResponseInfo getDetailList(@RequestParam("materialId") Long materialId,
HttpServletRequest request)throws Exception { HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
...@@ -69,7 +73,15 @@ public class MaterialExtendController { ...@@ -69,7 +73,15 @@ public class MaterialExtendController {
return res; return res;
} }
/**
* 根据条码查询商品信息
* @param barCode
* @param request
* @return
* @throws Exception
*/
@GetMapping(value = "/getInfoByBarCode") @GetMapping(value = "/getInfoByBarCode")
@ApiOperation(value = "根据条码查询商品信息")
public BaseResponseInfo getInfoByBarCode(@RequestParam("barCode") String barCode, public BaseResponseInfo getInfoByBarCode(@RequestParam("barCode") String barCode,
HttpServletRequest request)throws Exception { HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
...@@ -86,7 +98,16 @@ public class MaterialExtendController { ...@@ -86,7 +98,16 @@ public class MaterialExtendController {
return res; return res;
} }
/**
* 校验条码是否存在
* @param id
* @param barCode
* @param request
* @return
* @throws Exception
*/
@GetMapping(value = "/checkIsBarCodeExist") @GetMapping(value = "/checkIsBarCodeExist")
@ApiOperation(value = "校验条码是否存在")
public BaseResponseInfo checkIsBarCodeExist(@RequestParam("id") Long id, public BaseResponseInfo checkIsBarCodeExist(@RequestParam("id") Long id,
@RequestParam("barCode") String barCode, @RequestParam("barCode") String barCode,
HttpServletRequest request)throws Exception { HttpServletRequest request)throws Exception {
......
...@@ -5,6 +5,7 @@ import com.jsh.erp.constants.ExceptionConstants; ...@@ -5,6 +5,7 @@ import com.jsh.erp.constants.ExceptionConstants;
import com.jsh.erp.exception.BusinessRunTimeException; import com.jsh.erp.exception.BusinessRunTimeException;
import com.jsh.erp.service.material.MaterialService; import com.jsh.erp.service.material.MaterialService;
import com.jsh.erp.service.materialProperty.MaterialPropertyService; import com.jsh.erp.service.materialProperty.MaterialPropertyService;
import io.swagger.annotations.Api;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
...@@ -22,6 +23,7 @@ import javax.annotation.Resource; ...@@ -22,6 +23,7 @@ import javax.annotation.Resource;
*/ */
@RestController @RestController
@RequestMapping(value = "/materialProperty") @RequestMapping(value = "/materialProperty")
@Api(tags = {"商品扩展字段"})
public class MaterialPropertyController { public class MaterialPropertyController {
......
...@@ -3,6 +3,8 @@ package com.jsh.erp.controller; ...@@ -3,6 +3,8 @@ package com.jsh.erp.controller;
import com.jsh.erp.datasource.entities.Msg; import com.jsh.erp.datasource.entities.Msg;
import com.jsh.erp.service.msg.MsgService; import com.jsh.erp.service.msg.MsgService;
import com.jsh.erp.utils.BaseResponseInfo; import com.jsh.erp.utils.BaseResponseInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -18,13 +20,22 @@ import java.util.Map; ...@@ -18,13 +20,22 @@ import java.util.Map;
*/ */
@RestController @RestController
@RequestMapping(value = "/msg") @RequestMapping(value = "/msg")
@Api(tags = {"消息管理"})
public class MsgController { public class MsgController {
private Logger logger = LoggerFactory.getLogger(MsgController.class); private Logger logger = LoggerFactory.getLogger(MsgController.class);
@Resource @Resource
private MsgService msgService; private MsgService msgService;
/**
* 根据状态查询消息
* @param status
* @param request
* @return
* @throws Exception
*/
@GetMapping("/getMsgByStatus") @GetMapping("/getMsgByStatus")
@ApiOperation(value = "根据状态查询消息")
public BaseResponseInfo getMsgByStatus(@RequestParam("status") String status, public BaseResponseInfo getMsgByStatus(@RequestParam("status") String status,
HttpServletRequest request)throws Exception { HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
...@@ -40,7 +51,16 @@ public class MsgController { ...@@ -40,7 +51,16 @@ public class MsgController {
return res; return res;
} }
/**
* 批量更新状态
* @param ids
* @param status
* @param request
* @return
* @throws Exception
*/
@PostMapping("/batchUpdateStatus") @PostMapping("/batchUpdateStatus")
@ApiOperation(value = "批量更新状态")
public BaseResponseInfo batchUpdateStatus(@RequestParam("ids") String ids, public BaseResponseInfo batchUpdateStatus(@RequestParam("ids") String ids,
@RequestParam("status") String status, @RequestParam("status") String status,
HttpServletRequest request)throws Exception { HttpServletRequest request)throws Exception {
...@@ -57,7 +77,15 @@ public class MsgController { ...@@ -57,7 +77,15 @@ public class MsgController {
return res; return res;
} }
/**
* 根据状态查询数量
* @param status
* @param request
* @return
* @throws Exception
*/
@GetMapping("/getMsgCountByStatus") @GetMapping("/getMsgCountByStatus")
@ApiOperation(value = "根据状态查询数量")
public BaseResponseInfo getMsgCountByStatus(@RequestParam("status") String status, public BaseResponseInfo getMsgCountByStatus(@RequestParam("status") String status,
HttpServletRequest request)throws Exception { HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
......
...@@ -11,6 +11,8 @@ import com.jsh.erp.exception.BusinessRunTimeException; ...@@ -11,6 +11,8 @@ import com.jsh.erp.exception.BusinessRunTimeException;
import com.jsh.erp.service.materialCategory.MaterialCategoryService; import com.jsh.erp.service.materialCategory.MaterialCategoryService;
import com.jsh.erp.service.organization.OrganizationService; import com.jsh.erp.service.organization.OrganizationService;
import com.jsh.erp.utils.BaseResponseInfo; import com.jsh.erp.utils.BaseResponseInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -28,6 +30,7 @@ import java.util.List; ...@@ -28,6 +30,7 @@ import java.util.List;
*/ */
@RestController @RestController
@RequestMapping(value = "/organization") @RequestMapping(value = "/organization")
@Api(tags = {"机构管理"})
public class OrganizationController { public class OrganizationController {
private Logger logger = LoggerFactory.getLogger(OrganizationController.class); private Logger logger = LoggerFactory.getLogger(OrganizationController.class);
...@@ -40,6 +43,7 @@ public class OrganizationController { ...@@ -40,6 +43,7 @@ public class OrganizationController {
* @return * @return
*/ */
@GetMapping(value = "/findById") @GetMapping(value = "/findById")
@ApiOperation(value = "根据id来查询机构信息")
public BaseResponseInfo findById(@RequestParam("id") Long id, HttpServletRequest request) throws Exception { public BaseResponseInfo findById(@RequestParam("id") Long id, HttpServletRequest request) throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
...@@ -80,6 +84,7 @@ public class OrganizationController { ...@@ -80,6 +84,7 @@ public class OrganizationController {
* @return com.alibaba.fastjson.JSONArray * @return com.alibaba.fastjson.JSONArray
*/ */
@RequestMapping(value = "/getOrganizationTree") @RequestMapping(value = "/getOrganizationTree")
@ApiOperation(value = "获取机构树数据")
public JSONArray getOrganizationTree(@RequestParam("id") Long id) throws Exception{ public JSONArray getOrganizationTree(@RequestParam("id") Long id) throws Exception{
JSONArray arr=new JSONArray(); JSONArray arr=new JSONArray();
List<TreeNode> organizationTree= organizationService.getOrganizationTree(id); List<TreeNode> organizationTree= organizationService.getOrganizationTree(id);
...@@ -101,6 +106,7 @@ public class OrganizationController { ...@@ -101,6 +106,7 @@ public class OrganizationController {
* @return java.lang.Object * @return java.lang.Object
*/ */
@PostMapping(value = "/addOrganization") @PostMapping(value = "/addOrganization")
@ApiOperation(value = "新增机构信息")
public Object addOrganization(@RequestParam("info") String beanJson) throws Exception { public Object addOrganization(@RequestParam("info") String beanJson) throws Exception {
JSONObject result = ExceptionConstants.standardSuccess(); JSONObject result = ExceptionConstants.standardSuccess();
Organization org= JSON.parseObject(beanJson, Organization.class); Organization org= JSON.parseObject(beanJson, Organization.class);
...@@ -120,6 +126,7 @@ public class OrganizationController { ...@@ -120,6 +126,7 @@ public class OrganizationController {
* @return java.lang.Object * @return java.lang.Object
*/ */
@PostMapping(value = "/editOrganization") @PostMapping(value = "/editOrganization")
@ApiOperation(value = "修改机构信息")
public Object editOrganization(@RequestParam("info") String beanJson) throws Exception { public Object editOrganization(@RequestParam("info") String beanJson) throws Exception {
JSONObject result = ExceptionConstants.standardSuccess(); JSONObject result = ExceptionConstants.standardSuccess();
Organization org= JSON.parseObject(beanJson, Organization.class); Organization org= JSON.parseObject(beanJson, Organization.class);
......
...@@ -8,6 +8,8 @@ import com.jsh.erp.datasource.entities.Person; ...@@ -8,6 +8,8 @@ import com.jsh.erp.datasource.entities.Person;
import com.jsh.erp.exception.BusinessRunTimeException; import com.jsh.erp.exception.BusinessRunTimeException;
import com.jsh.erp.service.person.PersonService; import com.jsh.erp.service.person.PersonService;
import com.jsh.erp.utils.BaseResponseInfo; import com.jsh.erp.utils.BaseResponseInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -23,13 +25,21 @@ import java.util.Map; ...@@ -23,13 +25,21 @@ import java.util.Map;
*/ */
@RestController @RestController
@RequestMapping(value = "/person") @RequestMapping(value = "/person")
@Api(tags = {"经手人管理"})
public class PersonController { public class PersonController {
private Logger logger = LoggerFactory.getLogger(PersonController.class); private Logger logger = LoggerFactory.getLogger(PersonController.class);
@Resource @Resource
private PersonService personService; private PersonService personService;
/**
* 全部数据列表
* @param request
* @return
* @throws Exception
*/
@GetMapping(value = "/getAllList") @GetMapping(value = "/getAllList")
@ApiOperation(value = "全部数据列表")
public BaseResponseInfo getAllList(HttpServletRequest request)throws Exception { public BaseResponseInfo getAllList(HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
...@@ -53,6 +63,7 @@ public class PersonController { ...@@ -53,6 +63,7 @@ public class PersonController {
* @return * @return
*/ */
@GetMapping(value = "/getPersonByIds") @GetMapping(value = "/getPersonByIds")
@ApiOperation(value = "根据Id获取经手人信息")
public BaseResponseInfo getPersonByIds(@RequestParam("personIds") String personIds, public BaseResponseInfo getPersonByIds(@RequestParam("personIds") String personIds,
HttpServletRequest request)throws Exception { HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
...@@ -78,6 +89,7 @@ public class PersonController { ...@@ -78,6 +89,7 @@ public class PersonController {
* @return * @return
*/ */
@GetMapping(value = "/getPersonByType") @GetMapping(value = "/getPersonByType")
@ApiOperation(value = "根据类型获取经手人信息")
public BaseResponseInfo getPersonByType(@RequestParam("type") String type, public BaseResponseInfo getPersonByType(@RequestParam("type") String type,
HttpServletRequest request)throws Exception { HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
...@@ -102,6 +114,7 @@ public class PersonController { ...@@ -102,6 +114,7 @@ public class PersonController {
* @return * @return
*/ */
@GetMapping(value = "/getPersonByNumType") @GetMapping(value = "/getPersonByNumType")
@ApiOperation(value = "根据类型获取经手人信息1-业务员,2-仓管员,3-财务员")
public JSONArray getPersonByNumType(@RequestParam("type") String typeNum, public JSONArray getPersonByNumType(@RequestParam("type") String typeNum,
HttpServletRequest request)throws Exception { HttpServletRequest request)throws Exception {
JSONArray dataArray = new JSONArray(); JSONArray dataArray = new JSONArray();
......
...@@ -7,6 +7,8 @@ import com.jsh.erp.service.platformConfig.PlatformConfigService; ...@@ -7,6 +7,8 @@ import com.jsh.erp.service.platformConfig.PlatformConfigService;
import com.jsh.erp.service.user.UserService; import com.jsh.erp.service.user.UserService;
import com.jsh.erp.utils.BaseResponseInfo; import com.jsh.erp.utils.BaseResponseInfo;
import com.jsh.erp.utils.ErpInfo; import com.jsh.erp.utils.ErpInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -24,6 +26,7 @@ import static com.jsh.erp.utils.ResponseJsonUtil.returnJson; ...@@ -24,6 +26,7 @@ import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
*/ */
@RestController @RestController
@RequestMapping(value = "/platformConfig") @RequestMapping(value = "/platformConfig")
@Api(tags = {"平台参数"})
public class PlatformConfigController { public class PlatformConfigController {
private Logger logger = LoggerFactory.getLogger(PlatformConfigController.class); private Logger logger = LoggerFactory.getLogger(PlatformConfigController.class);
...@@ -44,6 +47,7 @@ public class PlatformConfigController { ...@@ -44,6 +47,7 @@ public class PlatformConfigController {
* @return * @return
*/ */
@GetMapping(value = "/getPlatform/name") @GetMapping(value = "/getPlatform/name")
@ApiOperation(value = "获取平台名称")
public String getPlatformName(HttpServletRequest request)throws Exception { public String getPlatformName(HttpServletRequest request)throws Exception {
String res; String res;
try { try {
...@@ -63,6 +67,7 @@ public class PlatformConfigController { ...@@ -63,6 +67,7 @@ public class PlatformConfigController {
* @return * @return
*/ */
@GetMapping(value = "/getPlatform/url") @GetMapping(value = "/getPlatform/url")
@ApiOperation(value = "获取官方网站地址")
public String getPlatformUrl(HttpServletRequest request)throws Exception { public String getPlatformUrl(HttpServletRequest request)throws Exception {
String res; String res;
try { try {
...@@ -83,6 +88,7 @@ public class PlatformConfigController { ...@@ -83,6 +88,7 @@ public class PlatformConfigController {
* @return * @return
*/ */
@PostMapping(value = "/updatePlatformConfigByKey") @PostMapping(value = "/updatePlatformConfigByKey")
@ApiOperation(value = "根据platformKey更新platformValue")
public String updatePlatformConfigByKey(@RequestBody JSONObject object, public String updatePlatformConfigByKey(@RequestBody JSONObject object,
HttpServletRequest request)throws Exception { HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<>(); Map<String, Object> objectMap = new HashMap<>();
...@@ -103,6 +109,7 @@ public class PlatformConfigController { ...@@ -103,6 +109,7 @@ public class PlatformConfigController {
* @return * @return
*/ */
@GetMapping(value = "/getPlatformConfigByKey") @GetMapping(value = "/getPlatformConfigByKey")
@ApiOperation(value = "根据platformKey查询信息")
public BaseResponseInfo getPlatformConfigByKey(@RequestParam("platformKey") String platformKey, public BaseResponseInfo getPlatformConfigByKey(@RequestParam("platformKey") String platformKey,
HttpServletRequest request)throws Exception { HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
......
...@@ -6,6 +6,8 @@ import com.gitee.starblues.integration.operator.module.PluginInfo; ...@@ -6,6 +6,8 @@ import com.gitee.starblues.integration.operator.module.PluginInfo;
import com.jsh.erp.utils.BaseResponseInfo; import com.jsh.erp.utils.BaseResponseInfo;
import com.jsh.erp.utils.ComputerInfo; import com.jsh.erp.utils.ComputerInfo;
import com.jsh.erp.utils.StringUtil; 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.beans.factory.annotation.Autowired;
import org.springframework.util.DigestUtils; import org.springframework.util.DigestUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -23,6 +25,7 @@ import java.util.*; ...@@ -23,6 +25,7 @@ import java.util.*;
*/ */
@RestController @RestController
@RequestMapping("/plugin") @RequestMapping("/plugin")
@Api(tags = {"插件管理"})
public class PluginController { public class PluginController {
...@@ -37,6 +40,7 @@ public class PluginController { ...@@ -37,6 +40,7 @@ public class PluginController {
* @return 返回插件信息 * @return 返回插件信息
*/ */
@GetMapping(value = "/list") @GetMapping(value = "/list")
@ApiOperation(value = "获取插件信息")
public BaseResponseInfo getPluginInfo(@RequestParam(value = "name",required = false) String name, public BaseResponseInfo getPluginInfo(@RequestParam(value = "name",required = false) String name,
@RequestParam("currentPage") Integer currentPage, @RequestParam("currentPage") Integer currentPage,
@RequestParam("pageSize") Integer pageSize, @RequestParam("pageSize") Integer pageSize,
...@@ -73,6 +77,7 @@ public class PluginController { ...@@ -73,6 +77,7 @@ public class PluginController {
* @return 获取插件文件名。只在生产环境显示 * @return 获取插件文件名。只在生产环境显示
*/ */
@GetMapping("/files") @GetMapping("/files")
@ApiOperation(value = "获取插件jar文件名")
public Set<String> getPluginFilePaths(){ public Set<String> getPluginFilePaths(){
try { try {
return pluginOperator.getPluginFilePaths(); return pluginOperator.getPluginFilePaths();
...@@ -89,6 +94,7 @@ public class PluginController { ...@@ -89,6 +94,7 @@ public class PluginController {
* @return 返回操作结果 * @return 返回操作结果
*/ */
@PostMapping("/stop/{id}") @PostMapping("/stop/{id}")
@ApiOperation(value = "根据插件id停止插件")
public BaseResponseInfo stop(@PathVariable("id") String id){ public BaseResponseInfo stop(@PathVariable("id") String id){
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
...@@ -117,6 +123,7 @@ public class PluginController { ...@@ -117,6 +123,7 @@ public class PluginController {
* @return 返回操作结果 * @return 返回操作结果
*/ */
@PostMapping("/start/{id}") @PostMapping("/start/{id}")
@ApiOperation(value = "根据插件id启动插件")
public BaseResponseInfo start(@PathVariable("id") String id){ public BaseResponseInfo start(@PathVariable("id") String id){
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
...@@ -146,6 +153,7 @@ public class PluginController { ...@@ -146,6 +153,7 @@ public class PluginController {
* @return 返回操作结果 * @return 返回操作结果
*/ */
@PostMapping("/uninstall/{id}") @PostMapping("/uninstall/{id}")
@ApiOperation(value = "根据插件id卸载插件")
public BaseResponseInfo uninstall(@PathVariable("id") String id){ public BaseResponseInfo uninstall(@PathVariable("id") String id){
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
...@@ -175,6 +183,7 @@ public class PluginController { ...@@ -175,6 +183,7 @@ public class PluginController {
* @return 操作结果 * @return 操作结果
*/ */
@PostMapping("/installByPath") @PostMapping("/installByPath")
@ApiOperation(value = "根据插件路径安装插件")
public String install(@RequestParam("path") String path){ public String install(@RequestParam("path") String path){
try { try {
if(pluginOperator.install(Paths.get(path))){ if(pluginOperator.install(Paths.get(path))){
...@@ -195,6 +204,7 @@ public class PluginController { ...@@ -195,6 +204,7 @@ public class PluginController {
* @return 操作结果 * @return 操作结果
*/ */
@PostMapping("/uploadInstallPluginJar") @PostMapping("/uploadInstallPluginJar")
@ApiOperation(value = "上传并安装插件")
public BaseResponseInfo install(MultipartFile file, HttpServletRequest request, HttpServletResponse response){ public BaseResponseInfo install(MultipartFile file, HttpServletRequest request, HttpServletResponse response){
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
try { try {
...@@ -215,6 +225,7 @@ public class PluginController { ...@@ -215,6 +225,7 @@ public class PluginController {
* @return 操作结果 * @return 操作结果
*/ */
@PostMapping("/uploadPluginConfigFile") @PostMapping("/uploadPluginConfigFile")
@ApiOperation(value = "上传插件的配置文件")
public String uploadConfig(@RequestParam("configFile") MultipartFile multipartFile){ public String uploadConfig(@RequestParam("configFile") MultipartFile multipartFile){
try { try {
if(pluginOperator.uploadConfigFile(multipartFile)){ if(pluginOperator.uploadConfigFile(multipartFile)){
...@@ -235,6 +246,7 @@ public class PluginController { ...@@ -235,6 +246,7 @@ public class PluginController {
* @return 操作结果 * @return 操作结果
*/ */
@PostMapping("/back/{pluginId}") @PostMapping("/back/{pluginId}")
@ApiOperation(value = "备份插件")
public String backupPlugin(@PathVariable("pluginId") String pluginId){ public String backupPlugin(@PathVariable("pluginId") String pluginId){
try { try {
if(pluginOperator.backupPlugin(pluginId, "testBack")){ if(pluginOperator.backupPlugin(pluginId, "testBack")){
...@@ -253,6 +265,7 @@ public class PluginController { ...@@ -253,6 +265,7 @@ public class PluginController {
* @return * @return
*/ */
@GetMapping("/getMacWithSecret") @GetMapping("/getMacWithSecret")
@ApiOperation(value = "获取加密后的mac")
public BaseResponseInfo getMacWithSecret(){ public BaseResponseInfo getMacWithSecret(){
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
try { try {
......
...@@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSONObject; ...@@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.BusinessConstants; import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.service.CommonQueryManager; import com.jsh.erp.service.CommonQueryManager;
import com.jsh.erp.utils.*; import com.jsh.erp.utils.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -21,12 +23,14 @@ import static com.jsh.erp.utils.ResponseJsonUtil.returnJson; ...@@ -21,12 +23,14 @@ import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
* by jishenghua 2018-9-12 23:58:10 华夏erp * by jishenghua 2018-9-12 23:58:10 华夏erp
*/ */
@RestController @RestController
@Api(tags = {"资源接口"})
public class ResourceController { public class ResourceController {
@Resource @Resource
private CommonQueryManager configResourceManager; private CommonQueryManager configResourceManager;
@GetMapping(value = "/{apiName}/info") @GetMapping(value = "/{apiName}/info")
@ApiOperation(value = "根据id获取信息")
public String getList(@PathVariable("apiName") String apiName, public String getList(@PathVariable("apiName") String apiName,
@RequestParam("id") Long id, @RequestParam("id") Long id,
HttpServletRequest request) throws Exception { HttpServletRequest request) throws Exception {
...@@ -41,6 +45,7 @@ public class ResourceController { ...@@ -41,6 +45,7 @@ public class ResourceController {
} }
@GetMapping(value = "/{apiName}/list") @GetMapping(value = "/{apiName}/list")
@ApiOperation(value = "获取信息列表")
public String getList(@PathVariable("apiName") String apiName, public String getList(@PathVariable("apiName") String apiName,
@RequestParam(value = Constants.PAGE_SIZE, required = false) Integer pageSize, @RequestParam(value = Constants.PAGE_SIZE, required = false) Integer pageSize,
@RequestParam(value = Constants.CURRENT_PAGE, required = false) Integer currentPage, @RequestParam(value = Constants.CURRENT_PAGE, required = false) Integer currentPage,
...@@ -69,6 +74,7 @@ public class ResourceController { ...@@ -69,6 +74,7 @@ public class ResourceController {
} }
@PostMapping(value = "/{apiName}/add", produces = {"application/javascript", "application/json"}) @PostMapping(value = "/{apiName}/add", produces = {"application/javascript", "application/json"})
@ApiOperation(value = "新增")
public String addResource(@PathVariable("apiName") String apiName, public String addResource(@PathVariable("apiName") String apiName,
@RequestBody JSONObject obj, HttpServletRequest request)throws Exception { @RequestBody JSONObject obj, HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<String, Object>(); Map<String, Object> objectMap = new HashMap<String, Object>();
...@@ -83,6 +89,7 @@ public class ResourceController { ...@@ -83,6 +89,7 @@ public class ResourceController {
} }
@PutMapping(value = "/{apiName}/update", produces = {"application/javascript", "application/json"}) @PutMapping(value = "/{apiName}/update", produces = {"application/javascript", "application/json"})
@ApiOperation(value = "修改")
public String updateResource(@PathVariable("apiName") String apiName, public String updateResource(@PathVariable("apiName") String apiName,
@RequestBody JSONObject obj, HttpServletRequest request)throws Exception { @RequestBody JSONObject obj, HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<String, Object>(); Map<String, Object> objectMap = new HashMap<String, Object>();
...@@ -97,6 +104,7 @@ public class ResourceController { ...@@ -97,6 +104,7 @@ public class ResourceController {
} }
@DeleteMapping(value = "/{apiName}/delete", produces = {"application/javascript", "application/json"}) @DeleteMapping(value = "/{apiName}/delete", produces = {"application/javascript", "application/json"})
@ApiOperation(value = "删除")
public String deleteResource(@PathVariable("apiName") String apiName, public String deleteResource(@PathVariable("apiName") String apiName,
@RequestParam("id") Long id, HttpServletRequest request)throws Exception { @RequestParam("id") Long id, HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<String, Object>(); Map<String, Object> objectMap = new HashMap<String, Object>();
...@@ -111,6 +119,7 @@ public class ResourceController { ...@@ -111,6 +119,7 @@ public class ResourceController {
} }
@DeleteMapping(value = "/{apiName}/deleteBatch", produces = {"application/javascript", "application/json"}) @DeleteMapping(value = "/{apiName}/deleteBatch", produces = {"application/javascript", "application/json"})
@ApiOperation(value = "批量删除")
public String batchDeleteResource(@PathVariable("apiName") String apiName, public String batchDeleteResource(@PathVariable("apiName") String apiName,
@RequestParam("ids") String ids, HttpServletRequest request)throws Exception { @RequestParam("ids") String ids, HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<String, Object>(); Map<String, Object> objectMap = new HashMap<String, Object>();
...@@ -125,6 +134,7 @@ public class ResourceController { ...@@ -125,6 +134,7 @@ public class ResourceController {
} }
@GetMapping(value = "/{apiName}/checkIsNameExist") @GetMapping(value = "/{apiName}/checkIsNameExist")
@ApiOperation(value = "检查名称是否存在")
public String checkIsNameExist(@PathVariable("apiName") String apiName, public String checkIsNameExist(@PathVariable("apiName") String apiName,
@RequestParam Long id, @RequestParam(value ="name", required = false) String name, @RequestParam Long id, @RequestParam(value ="name", required = false) String name,
HttpServletRequest request)throws Exception { HttpServletRequest request)throws Exception {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment