Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
JSH ERP
Commits
a923700c
Commit
a923700c
authored
Nov 08, 2021
by
季圣华
Browse files
给接口增加swagger描述
parent
744691d9
Changes
30
Hide whitespace changes
Inline
Side-by-side
jshERP-boot/src/main/java/com/jsh/erp/controller/RoleController.java
View file @
a923700c
...
@@ -8,6 +8,8 @@ import com.jsh.erp.exception.BusinessRunTimeException;
...
@@ -8,6 +8,8 @@ import com.jsh.erp.exception.BusinessRunTimeException;
import
com.jsh.erp.service.role.RoleService
;
import
com.jsh.erp.service.role.RoleService
;
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
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,6 +23,7 @@ import java.util.List;
...
@@ -21,6 +23,7 @@ import java.util.List;
*/
*/
@RestController
@RestController
@RequestMapping
(
value
=
"/role"
)
@RequestMapping
(
value
=
"/role"
)
@Api
(
tags
=
{
"角色管理"
})
public
class
RoleController
{
public
class
RoleController
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
RoleController
.
class
);
private
Logger
logger
=
LoggerFactory
.
getLogger
(
RoleController
.
class
);
...
@@ -36,6 +39,7 @@ public class RoleController {
...
@@ -36,6 +39,7 @@ public class RoleController {
* @return
* @return
*/
*/
@GetMapping
(
value
=
"/findUserRole"
)
@GetMapping
(
value
=
"/findUserRole"
)
@ApiOperation
(
value
=
"查询用户的角色"
)
public
JSONArray
findUserRole
(
@RequestParam
(
"UBType"
)
String
type
,
@RequestParam
(
"UBKeyId"
)
String
keyId
,
public
JSONArray
findUserRole
(
@RequestParam
(
"UBType"
)
String
type
,
@RequestParam
(
"UBKeyId"
)
String
keyId
,
HttpServletRequest
request
)
throws
Exception
{
HttpServletRequest
request
)
throws
Exception
{
JSONArray
arr
=
new
JSONArray
();
JSONArray
arr
=
new
JSONArray
();
...
@@ -62,6 +66,7 @@ public class RoleController {
...
@@ -62,6 +66,7 @@ public class RoleController {
}
}
@GetMapping
(
value
=
"/allList"
)
@GetMapping
(
value
=
"/allList"
)
@ApiOperation
(
value
=
"查询全部角色列表"
)
public
List
<
Role
>
allList
(
HttpServletRequest
request
)
throws
Exception
{
public
List
<
Role
>
allList
(
HttpServletRequest
request
)
throws
Exception
{
return
roleService
.
allList
();
return
roleService
.
allList
();
}
}
...
...
jshERP-boot/src/main/java/com/jsh/erp/controller/SequenceController.java
View file @
a923700c
...
@@ -3,6 +3,8 @@ package com.jsh.erp.controller;
...
@@ -3,6 +3,8 @@ package com.jsh.erp.controller;
import
com.jsh.erp.service.depotHead.DepotHeadService
;
import
com.jsh.erp.service.depotHead.DepotHeadService
;
import
com.jsh.erp.service.sequence.SequenceService
;
import
com.jsh.erp.service.sequence.SequenceService
;
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
;
...
@@ -19,6 +21,7 @@ import java.util.Map;
...
@@ -19,6 +21,7 @@ import java.util.Map;
*/
*/
@RestController
@RestController
@RequestMapping
(
value
=
"/sequence"
)
@RequestMapping
(
value
=
"/sequence"
)
@Api
(
tags
=
{
"单据编号"
})
public
class
SequenceController
{
public
class
SequenceController
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
SequenceController
.
class
);
private
Logger
logger
=
LoggerFactory
.
getLogger
(
SequenceController
.
class
);
...
@@ -31,6 +34,7 @@ public class SequenceController {
...
@@ -31,6 +34,7 @@ public class SequenceController {
* @return
* @return
*/
*/
@GetMapping
(
value
=
"/buildNumber"
)
@GetMapping
(
value
=
"/buildNumber"
)
@ApiOperation
(
value
=
"单据编号生成接口"
)
public
BaseResponseInfo
buildNumber
(
HttpServletRequest
request
)
throws
Exception
{
public
BaseResponseInfo
buildNumber
(
HttpServletRequest
request
)
throws
Exception
{
BaseResponseInfo
res
=
new
BaseResponseInfo
();
BaseResponseInfo
res
=
new
BaseResponseInfo
();
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
...
...
jshERP-boot/src/main/java/com/jsh/erp/controller/SerialNumberController.java
View file @
a923700c
...
@@ -12,6 +12,8 @@ import com.jsh.erp.utils.BaseResponseInfo;
...
@@ -12,6 +12,8 @@ import com.jsh.erp.utils.BaseResponseInfo;
import
com.jsh.erp.utils.Constants
;
import
com.jsh.erp.utils.Constants
;
import
com.jsh.erp.utils.ErpInfo
;
import
com.jsh.erp.utils.ErpInfo
;
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.*
;
...
@@ -31,6 +33,8 @@ import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
...
@@ -31,6 +33,8 @@ import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
* @Date: 2019/1/22 10:29
* @Date: 2019/1/22 10:29
*/
*/
@RestController
@RestController
@RequestMapping
(
value
=
"/serialNumber"
)
@Api
(
tags
=
{
"序列号管理"
})
public
class
SerialNumberController
{
public
class
SerialNumberController
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
SerialNumberController
.
class
);
private
Logger
logger
=
LoggerFactory
.
getLogger
(
SerialNumberController
.
class
);
...
@@ -43,13 +47,13 @@ public class SerialNumberController {
...
@@ -43,13 +47,13 @@ public class SerialNumberController {
*批量添加序列号
*批量添加序列号
* create time: 2019/1/29 15:11
* create time: 2019/1/29 15:11
* @Param: materialName
* @Param: materialName
* @Param: serialNumberPrefix
* @Param: serialNumberPrefix
* @Param: batAddTotal
* @Param: batAddTotal
* @Param: remark
* @Param: remark
* @return java.lang.Object
* @return java.lang.Object
*/
*/
@PostMapping
(
"/
serialNumber/
batAddSerialNumber"
)
@PostMapping
(
"/batAddSerialNumber"
)
@
ResponseBody
@
ApiOperation
(
value
=
"批量添加序列号"
)
public
String
batAddSerialNumber
(
@RequestBody
JSONObject
jsonObject
,
HttpServletRequest
request
)
throws
Exception
{
public
String
batAddSerialNumber
(
@RequestBody
JSONObject
jsonObject
,
HttpServletRequest
request
)
throws
Exception
{
Map
<
String
,
Object
>
objectMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
objectMap
=
new
HashMap
<>();
String
materialCode
=
jsonObject
.
getString
(
"materialCode"
);
String
materialCode
=
jsonObject
.
getString
(
"materialCode"
);
...
@@ -77,7 +81,8 @@ public class SerialNumberController {
...
@@ -77,7 +81,8 @@ public class SerialNumberController {
* @return
* @return
* @throws Exception
* @throws Exception
*/
*/
@GetMapping
(
value
=
"/serialNumber/getEnableSerialNumberList"
)
@GetMapping
(
value
=
"/getEnableSerialNumberList"
)
@ApiOperation
(
value
=
"获取序列号商品"
)
public
BaseResponseInfo
getEnableSerialNumberList
(
@RequestParam
(
"name"
)
String
name
,
public
BaseResponseInfo
getEnableSerialNumberList
(
@RequestParam
(
"name"
)
String
name
,
@RequestParam
(
"depotId"
)
Long
depotId
,
@RequestParam
(
"depotId"
)
Long
depotId
,
@RequestParam
(
"barCode"
)
String
barCode
,
@RequestParam
(
"barCode"
)
String
barCode
,
...
...
jshERP-boot/src/main/java/com/jsh/erp/controller/SupplierController.java
View file @
a923700c
...
@@ -11,6 +11,8 @@ import com.jsh.erp.service.systemConfig.SystemConfigService;
...
@@ -11,6 +11,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
jxl.Sheet
;
import
jxl.Sheet
;
import
jxl.Workbook
;
import
jxl.Workbook
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
...
@@ -37,6 +39,7 @@ import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
...
@@ -37,6 +39,7 @@ import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
*/
*/
@RestController
@RestController
@RequestMapping
(
value
=
"/supplier"
)
@RequestMapping
(
value
=
"/supplier"
)
@Api
(
tags
=
{
"商家管理"
})
public
class
SupplierController
{
public
class
SupplierController
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
SupplierController
.
class
);
private
Logger
logger
=
LoggerFactory
.
getLogger
(
SupplierController
.
class
);
...
@@ -58,6 +61,7 @@ public class SupplierController {
...
@@ -58,6 +61,7 @@ public class SupplierController {
* @return
* @return
*/
*/
@PostMapping
(
value
=
"/findBySelect_cus"
)
@PostMapping
(
value
=
"/findBySelect_cus"
)
@ApiOperation
(
value
=
"查找客户信息"
)
public
JSONArray
findBySelectCus
(
HttpServletRequest
request
)
{
public
JSONArray
findBySelectCus
(
HttpServletRequest
request
)
{
JSONArray
arr
=
new
JSONArray
();
JSONArray
arr
=
new
JSONArray
();
try
{
try
{
...
@@ -92,6 +96,7 @@ public class SupplierController {
...
@@ -92,6 +96,7 @@ public class SupplierController {
* @return
* @return
*/
*/
@PostMapping
(
value
=
"/findBySelect_sup"
)
@PostMapping
(
value
=
"/findBySelect_sup"
)
@ApiOperation
(
value
=
"查找供应商信息"
)
public
JSONArray
findBySelectSup
(
HttpServletRequest
request
)
throws
Exception
{
public
JSONArray
findBySelectSup
(
HttpServletRequest
request
)
throws
Exception
{
JSONArray
arr
=
new
JSONArray
();
JSONArray
arr
=
new
JSONArray
();
try
{
try
{
...
@@ -119,6 +124,7 @@ public class SupplierController {
...
@@ -119,6 +124,7 @@ public class SupplierController {
* @return
* @return
*/
*/
@PostMapping
(
value
=
"/findBySelect_organ"
)
@PostMapping
(
value
=
"/findBySelect_organ"
)
@ApiOperation
(
value
=
"查找往来单位,含供应商和客户信息"
)
public
JSONArray
findBySelectOrgan
(
HttpServletRequest
request
)
throws
Exception
{
public
JSONArray
findBySelectOrgan
(
HttpServletRequest
request
)
throws
Exception
{
JSONArray
arr
=
new
JSONArray
();
JSONArray
arr
=
new
JSONArray
();
try
{
try
{
...
@@ -163,6 +169,7 @@ public class SupplierController {
...
@@ -163,6 +169,7 @@ public class SupplierController {
* @return
* @return
*/
*/
@PostMapping
(
value
=
"/findBySelect_retail"
)
@PostMapping
(
value
=
"/findBySelect_retail"
)
@ApiOperation
(
value
=
"查找会员信息"
)
public
JSONArray
findBySelectRetail
(
HttpServletRequest
request
)
throws
Exception
{
public
JSONArray
findBySelectRetail
(
HttpServletRequest
request
)
throws
Exception
{
JSONArray
arr
=
new
JSONArray
();
JSONArray
arr
=
new
JSONArray
();
try
{
try
{
...
@@ -192,6 +199,7 @@ public class SupplierController {
...
@@ -192,6 +199,7 @@ public class SupplierController {
* @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
{
Boolean
status
=
jsonObject
.
getBoolean
(
"status"
);
Boolean
status
=
jsonObject
.
getBoolean
(
"status"
);
...
@@ -213,6 +221,7 @@ public class SupplierController {
...
@@ -213,6 +221,7 @@ public class SupplierController {
* @return
* @return
*/
*/
@GetMapping
(
value
=
"/findUserCustomer"
)
@GetMapping
(
value
=
"/findUserCustomer"
)
@ApiOperation
(
value
=
"用户对应客户显示"
)
public
JSONArray
findUserCustomer
(
@RequestParam
(
"UBType"
)
String
type
,
@RequestParam
(
"UBKeyId"
)
String
keyId
,
public
JSONArray
findUserCustomer
(
@RequestParam
(
"UBType"
)
String
type
,
@RequestParam
(
"UBKeyId"
)
String
keyId
,
HttpServletRequest
request
)
throws
Exception
{
HttpServletRequest
request
)
throws
Exception
{
JSONArray
arr
=
new
JSONArray
();
JSONArray
arr
=
new
JSONArray
();
...
@@ -260,6 +269,7 @@ public class SupplierController {
...
@@ -260,6 +269,7 @@ public class SupplierController {
* @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
();
...
...
jshERP-boot/src/main/java/com/jsh/erp/controller/SystemConfigController.java
View file @
a923700c
...
@@ -14,6 +14,8 @@ import com.jsh.erp.utils.BaseResponseInfo;
...
@@ -14,6 +14,8 @@ import com.jsh.erp.utils.BaseResponseInfo;
import
com.jsh.erp.utils.FileUtils
;
import
com.jsh.erp.utils.FileUtils
;
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.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
...
@@ -38,6 +40,7 @@ import java.util.List;
...
@@ -38,6 +40,7 @@ import java.util.List;
*/
*/
@RestController
@RestController
@RequestMapping
(
value
=
"/systemConfig"
)
@RequestMapping
(
value
=
"/systemConfig"
)
@Api
(
tags
=
{
"系统参数"
})
public
class
SystemConfigController
{
public
class
SystemConfigController
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
SystemConfigController
.
class
);
private
Logger
logger
=
LoggerFactory
.
getLogger
(
SystemConfigController
.
class
);
...
@@ -68,6 +71,7 @@ public class SystemConfigController {
...
@@ -68,6 +71,7 @@ public class SystemConfigController {
* @return
* @return
*/
*/
@GetMapping
(
value
=
"/getCurrentInfo"
)
@GetMapping
(
value
=
"/getCurrentInfo"
)
@ApiOperation
(
value
=
"获取当前租户的配置信息"
)
public
BaseResponseInfo
getCurrentInfo
(
HttpServletRequest
request
)
throws
Exception
{
public
BaseResponseInfo
getCurrentInfo
(
HttpServletRequest
request
)
throws
Exception
{
BaseResponseInfo
res
=
new
BaseResponseInfo
();
BaseResponseInfo
res
=
new
BaseResponseInfo
();
try
{
try
{
...
@@ -91,6 +95,7 @@ public class SystemConfigController {
...
@@ -91,6 +95,7 @@ public class SystemConfigController {
* @throws Exception
* @throws Exception
*/
*/
@GetMapping
(
value
=
"/fileSizeLimit"
)
@GetMapping
(
value
=
"/fileSizeLimit"
)
@ApiOperation
(
value
=
"获取文件大小限制"
)
public
BaseResponseInfo
fileSizeLimit
(
HttpServletRequest
request
)
throws
Exception
{
public
BaseResponseInfo
fileSizeLimit
(
HttpServletRequest
request
)
throws
Exception
{
BaseResponseInfo
res
=
new
BaseResponseInfo
();
BaseResponseInfo
res
=
new
BaseResponseInfo
();
try
{
try
{
...
@@ -117,6 +122,7 @@ public class SystemConfigController {
...
@@ -117,6 +122,7 @@ public class SystemConfigController {
* @return
* @return
*/
*/
@PostMapping
(
value
=
"/upload"
)
@PostMapping
(
value
=
"/upload"
)
@ApiOperation
(
value
=
"文件上传统一方法"
)
public
BaseResponseInfo
upload
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
public
BaseResponseInfo
upload
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
BaseResponseInfo
res
=
new
BaseResponseInfo
();
BaseResponseInfo
res
=
new
BaseResponseInfo
();
try
{
try
{
...
@@ -194,6 +200,7 @@ public class SystemConfigController {
...
@@ -194,6 +200,7 @@ public class SystemConfigController {
* @param response
* @param response
*/
*/
@GetMapping
(
value
=
"/static/**"
)
@GetMapping
(
value
=
"/static/**"
)
@ApiOperation
(
value
=
"预览图片&下载文件"
)
public
void
view
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
public
void
view
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
// ISO-8859-1 ==> UTF-8 进行编码转换
// ISO-8859-1 ==> UTF-8 进行编码转换
String
imgPath
=
extractPathFromPattern
(
request
);
String
imgPath
=
extractPathFromPattern
(
request
);
...
...
jshERP-boot/src/main/java/com/jsh/erp/controller/TenantController.java
View file @
a923700c
...
@@ -15,6 +15,8 @@ import com.jsh.erp.service.redis.RedisService;
...
@@ -15,6 +15,8 @@ import com.jsh.erp.service.redis.RedisService;
import
com.jsh.erp.service.tenant.TenantService
;
import
com.jsh.erp.service.tenant.TenantService
;
import
com.jsh.erp.service.user.UserService
;
import
com.jsh.erp.service.user.UserService
;
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
;
...
@@ -37,6 +39,7 @@ import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
...
@@ -37,6 +39,7 @@ import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
*/
*/
@RestController
@RestController
@RequestMapping
(
value
=
"/tenant"
)
@RequestMapping
(
value
=
"/tenant"
)
@Api
(
tags
=
{
"租户管理"
})
public
class
TenantController
{
public
class
TenantController
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
TenantController
.
class
);
private
Logger
logger
=
LoggerFactory
.
getLogger
(
TenantController
.
class
);
...
@@ -50,6 +53,7 @@ public class TenantController {
...
@@ -50,6 +53,7 @@ public class TenantController {
* @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
{
Boolean
status
=
jsonObject
.
getBoolean
(
"status"
);
Boolean
status
=
jsonObject
.
getBoolean
(
"status"
);
...
...
jshERP-boot/src/main/java/com/jsh/erp/controller/UnitController.java
View file @
a923700c
...
@@ -5,6 +5,7 @@ import com.jsh.erp.constants.BusinessConstants;
...
@@ -5,6 +5,7 @@ import com.jsh.erp.constants.BusinessConstants;
import
com.jsh.erp.constants.ExceptionConstants
;
import
com.jsh.erp.constants.ExceptionConstants
;
import
com.jsh.erp.exception.BusinessRunTimeException
;
import
com.jsh.erp.exception.BusinessRunTimeException
;
import
com.jsh.erp.service.unit.UnitService
;
import
com.jsh.erp.service.unit.UnitService
;
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
=
"/unit"
)
@RequestMapping
(
value
=
"/unit"
)
@Api
(
tags
=
{
"单位管理"
})
public
class
UnitController
{
public
class
UnitController
{
}
}
jshERP-boot/src/main/java/com/jsh/erp/controller/UserBusinessController.java
View file @
a923700c
...
@@ -9,6 +9,8 @@ import com.jsh.erp.service.userBusiness.UserBusinessService;
...
@@ -9,6 +9,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.ErpInfo
;
import
com.jsh.erp.utils.ErpInfo
;
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.*
;
...
@@ -26,6 +28,7 @@ import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
...
@@ -26,6 +28,7 @@ import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
*/
*/
@RestController
@RestController
@RequestMapping
(
value
=
"/userBusiness"
)
@RequestMapping
(
value
=
"/userBusiness"
)
@Api
(
tags
=
{
"用户角色模块的关系"
})
public
class
UserBusinessController
{
public
class
UserBusinessController
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
UserBusinessController
.
class
);
private
Logger
logger
=
LoggerFactory
.
getLogger
(
UserBusinessController
.
class
);
...
@@ -34,7 +37,16 @@ public class UserBusinessController {
...
@@ -34,7 +37,16 @@ public class UserBusinessController {
@Resource
@Resource
private
UserService
userService
;
private
UserService
userService
;
/**
* 获取信息
* @param keyId
* @param type
* @param request
* @return
* @throws Exception
*/
@GetMapping
(
value
=
"/getBasicData"
)
@GetMapping
(
value
=
"/getBasicData"
)
@ApiOperation
(
value
=
"获取信息"
)
public
BaseResponseInfo
getBasicData
(
@RequestParam
(
value
=
"KeyId"
)
String
keyId
,
public
BaseResponseInfo
getBasicData
(
@RequestParam
(
value
=
"KeyId"
)
String
keyId
,
@RequestParam
(
value
=
"Type"
)
String
type
,
@RequestParam
(
value
=
"Type"
)
String
type
,
HttpServletRequest
request
)
throws
Exception
{
HttpServletRequest
request
)
throws
Exception
{
...
@@ -53,7 +65,16 @@ public class UserBusinessController {
...
@@ -53,7 +65,16 @@ public class UserBusinessController {
return
res
;
return
res
;
}
}
/**
* 校验存在
* @param type
* @param keyId
* @param request
* @return
* @throws Exception
*/
@GetMapping
(
value
=
"/checkIsValueExist"
)
@GetMapping
(
value
=
"/checkIsValueExist"
)
@ApiOperation
(
value
=
"校验存在"
)
public
String
checkIsValueExist
(
@RequestParam
(
value
=
"type"
,
required
=
false
)
String
type
,
public
String
checkIsValueExist
(
@RequestParam
(
value
=
"type"
,
required
=
false
)
String
type
,
@RequestParam
(
value
=
"keyId"
,
required
=
false
)
String
keyId
,
@RequestParam
(
value
=
"keyId"
,
required
=
false
)
String
keyId
,
HttpServletRequest
request
)
throws
Exception
{
HttpServletRequest
request
)
throws
Exception
{
...
@@ -74,6 +95,7 @@ public class UserBusinessController {
...
@@ -74,6 +95,7 @@ public class UserBusinessController {
* @return
* @return
*/
*/
@PostMapping
(
value
=
"/updateBtnStr"
)
@PostMapping
(
value
=
"/updateBtnStr"
)
@ApiOperation
(
value
=
"更新角色的按钮权限"
)
public
BaseResponseInfo
updateBtnStr
(
@RequestBody
JSONObject
jsonObject
,
public
BaseResponseInfo
updateBtnStr
(
@RequestBody
JSONObject
jsonObject
,
HttpServletRequest
request
)
throws
Exception
{
HttpServletRequest
request
)
throws
Exception
{
BaseResponseInfo
res
=
new
BaseResponseInfo
();
BaseResponseInfo
res
=
new
BaseResponseInfo
();
...
...
jshERP-boot/src/main/java/com/jsh/erp/controller/UserController.java
View file @
a923700c
...
@@ -16,6 +16,8 @@ import com.jsh.erp.service.redis.RedisService;
...
@@ -16,6 +16,8 @@ import com.jsh.erp.service.redis.RedisService;
import
com.jsh.erp.service.tenant.TenantService
;
import
com.jsh.erp.service.tenant.TenantService
;
import
com.jsh.erp.service.user.UserService
;
import
com.jsh.erp.service.user.UserService
;
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
;
...
@@ -39,6 +41,7 @@ import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
...
@@ -39,6 +41,7 @@ import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
*/
*/
@RestController
@RestController
@RequestMapping
(
value
=
"/user"
)
@RequestMapping
(
value
=
"/user"
)
@Api
(
tags
=
{
"用户管理"
})
public
class
UserController
{
public
class
UserController
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
UserController
.
class
);
private
Logger
logger
=
LoggerFactory
.
getLogger
(
UserController
.
class
);
...
@@ -68,6 +71,7 @@ public class UserController {
...
@@ -68,6 +71,7 @@ public class UserController {
private
static
final
String
BASE_CHECK_CODES
=
"qwertyuiplkjhgfdsazxcvbnmQWERTYUPLKJHGFDSAZXCVBNM1234567890"
;
private
static
final
String
BASE_CHECK_CODES
=
"qwertyuiplkjhgfdsazxcvbnmQWERTYUPLKJHGFDSAZXCVBNM1234567890"
;
@PostMapping
(
value
=
"/login"
)
@PostMapping
(
value
=
"/login"
)
@ApiOperation
(
value
=
"登录"
)
public
BaseResponseInfo
login
(
@RequestBody
User
userParam
,
public
BaseResponseInfo
login
(
@RequestBody
User
userParam
,
HttpServletRequest
request
)
throws
Exception
{
HttpServletRequest
request
)
throws
Exception
{
logger
.
info
(
"============用户登录 login 方法调用开始=============="
);
logger
.
info
(
"============用户登录 login 方法调用开始=============="
);
...
@@ -166,6 +170,7 @@ public class UserController {
...
@@ -166,6 +170,7 @@ public class UserController {
}
}
@GetMapping
(
value
=
"/getUserSession"
)
@GetMapping
(
value
=
"/getUserSession"
)
@ApiOperation
(
value
=
"获取用户信息"
)
public
BaseResponseInfo
getSessionUser
(
HttpServletRequest
request
)
throws
Exception
{
public
BaseResponseInfo
getSessionUser
(
HttpServletRequest
request
)
throws
Exception
{
BaseResponseInfo
res
=
new
BaseResponseInfo
();
BaseResponseInfo
res
=
new
BaseResponseInfo
();
try
{
try
{
...
@@ -185,6 +190,7 @@ public class UserController {
...
@@ -185,6 +190,7 @@ public class UserController {
}
}
@GetMapping
(
value
=
"/logout"
)
@GetMapping
(
value
=
"/logout"
)
@ApiOperation
(
value
=
"退出"
)
public
BaseResponseInfo
logout
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
Exception
{
public
BaseResponseInfo
logout
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
Exception
{
BaseResponseInfo
res
=
new
BaseResponseInfo
();
BaseResponseInfo
res
=
new
BaseResponseInfo
();
try
{
try
{
...
@@ -199,6 +205,7 @@ public class UserController {
...
@@ -199,6 +205,7 @@ public class UserController {
}
}
@PostMapping
(
value
=
"/resetPwd"
)
@PostMapping
(
value
=
"/resetPwd"
)
@ApiOperation
(
value
=
"重置密码"
)
public
String
resetPwd
(
@RequestBody
JSONObject
jsonObject
,
public
String
resetPwd
(
@RequestBody
JSONObject
jsonObject
,
HttpServletRequest
request
)
throws
Exception
{
HttpServletRequest
request
)
throws
Exception
{
Map
<
String
,
Object
>
objectMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
objectMap
=
new
HashMap
<>();
...
@@ -214,6 +221,7 @@ public class UserController {
...
@@ -214,6 +221,7 @@ public class UserController {
}
}
@PutMapping
(
value
=
"/updatePwd"
)
@PutMapping
(
value
=
"/updatePwd"
)
@ApiOperation
(
value
=
"更新密码"
)
public
String
updatePwd
(
@RequestBody
JSONObject
jsonObject
,
HttpServletRequest
request
)
throws
Exception
{
public
String
updatePwd
(
@RequestBody
JSONObject
jsonObject
,
HttpServletRequest
request
)
throws
Exception
{
Integer
flag
=
0
;
Integer
flag
=
0
;
Map
<
String
,
Object
>
objectMap
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
objectMap
=
new
HashMap
<
String
,
Object
>();
...
@@ -255,6 +263,7 @@ public class UserController {
...
@@ -255,6 +263,7 @@ public class UserController {
* @return
* @return
*/
*/
@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
{
...
@@ -280,6 +289,7 @@ public class UserController {
...
@@ -280,6 +289,7 @@ public class UserController {
* @throws Exception
* @throws Exception
*/
*/
@GetMapping
(
value
=
"/getUserList"
)
@GetMapping
(
value
=
"/getUserList"
)
@ApiOperation
(
value
=
"用户列表"
)
public
JSONArray
getUserList
(
HttpServletRequest
request
)
throws
Exception
{
public
JSONArray
getUserList
(
HttpServletRequest
request
)
throws
Exception
{
JSONArray
dataArray
=
new
JSONArray
();
JSONArray
dataArray
=
new
JSONArray
();
try
{
try
{
...
@@ -307,6 +317,7 @@ public class UserController {
...
@@ -307,6 +317,7 @@ public class UserController {
* @return java.lang.Object
* @return java.lang.Object
*/
*/
@PostMapping
(
"/addUser"
)
@PostMapping
(
"/addUser"
)
@ApiOperation
(
value
=
"新增用户"
)
@ResponseBody
@ResponseBody
public
Object
addUser
(
@RequestBody
JSONObject
obj
,
HttpServletRequest
request
)
throws
Exception
{
public
Object
addUser
(
@RequestBody
JSONObject
obj
,
HttpServletRequest
request
)
throws
Exception
{
JSONObject
result
=
ExceptionConstants
.
standardSuccess
();
JSONObject
result
=
ExceptionConstants
.
standardSuccess
();
...
@@ -331,6 +342,7 @@ public class UserController {
...
@@ -331,6 +342,7 @@ public class UserController {
* @return java.lang.Object
* @return java.lang.Object
*/
*/
@PutMapping
(
"/updateUser"
)
@PutMapping
(
"/updateUser"
)
@ApiOperation
(
value
=
"修改用户"
)
@ResponseBody
@ResponseBody
public
Object
updateUser
(
@RequestBody
JSONObject
obj
,
HttpServletRequest
request
)
throws
Exception
{
public
Object
updateUser
(
@RequestBody
JSONObject
obj
,
HttpServletRequest
request
)
throws
Exception
{
JSONObject
result
=
ExceptionConstants
.
standardSuccess
();
JSONObject
result
=
ExceptionConstants
.
standardSuccess
();
...
@@ -346,6 +358,7 @@ public class UserController {
...
@@ -346,6 +358,7 @@ public class UserController {
* @throws Exception
* @throws Exception
*/
*/
@PostMapping
(
value
=
"/registerUser"
)
@PostMapping
(
value
=
"/registerUser"
)
@ApiOperation
(
value
=
"注册用户"
)
public
Object
registerUser
(
@RequestBody
UserEx
ue
,
public
Object
registerUser
(
@RequestBody
UserEx
ue
,
HttpServletRequest
request
)
throws
Exception
{
HttpServletRequest
request
)
throws
Exception
{
JSONObject
result
=
ExceptionConstants
.
standardSuccess
();
JSONObject
result
=
ExceptionConstants
.
standardSuccess
();
...
@@ -355,7 +368,13 @@ public class UserController {
...
@@ -355,7 +368,13 @@ public class UserController {
return
result
;
return
result
;
}
}
/**
* 获取机构用户树
* @return
* @throws Exception
*/
@RequestMapping
(
"/getOrganizationUserTree"
)
@RequestMapping
(
"/getOrganizationUserTree"
)
@ApiOperation
(
value
=
"获取机构用户树"
)
public
JSONArray
getOrganizationUserTree
()
throws
Exception
{
public
JSONArray
getOrganizationUserTree
()
throws
Exception
{
JSONArray
arr
=
new
JSONArray
();
JSONArray
arr
=
new
JSONArray
();
List
<
TreeNodeEx
>
organizationUserTree
=
userService
.
getOrganizationUserTree
();
List
<
TreeNodeEx
>
organizationUserTree
=
userService
.
getOrganizationUserTree
();
...
@@ -375,6 +394,7 @@ public class UserController {
...
@@ -375,6 +394,7 @@ public class UserController {
* @return
* @return
*/
*/
@GetMapping
(
"/getRoleTypeByCurrentUser"
)
@GetMapping
(
"/getRoleTypeByCurrentUser"
)
@ApiOperation
(
value
=
"获取当前用户的角色类型"
)
public
BaseResponseInfo
getRoleTypeByCurrentUser
(
HttpServletRequest
request
)
{
public
BaseResponseInfo
getRoleTypeByCurrentUser
(
HttpServletRequest
request
)
{
BaseResponseInfo
res
=
new
BaseResponseInfo
();
BaseResponseInfo
res
=
new
BaseResponseInfo
();
try
{
try
{
...
@@ -391,7 +411,14 @@ public class UserController {
...
@@ -391,7 +411,14 @@ public class UserController {
return
res
;
return
res
;
}
}
/**
* 获取随机校验码
* @param response
* @param key
* @return
*/
@GetMapping
(
value
=
"/randomImage/{key}"
)
@GetMapping
(
value
=
"/randomImage/{key}"
)
@ApiOperation
(
value
=
"获取随机校验码"
)
public
BaseResponseInfo
randomImage
(
HttpServletResponse
response
,
@PathVariable
String
key
){
public
BaseResponseInfo
randomImage
(
HttpServletResponse
response
,
@PathVariable
String
key
){
BaseResponseInfo
res
=
new
BaseResponseInfo
();
BaseResponseInfo
res
=
new
BaseResponseInfo
();
try
{
try
{
...
@@ -417,6 +444,7 @@ public class UserController {
...
@@ -417,6 +444,7 @@ public class UserController {
* @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
{
Byte
status
=
jsonObject
.
getByte
(
"status"
);
Byte
status
=
jsonObject
.
getByte
(
"status"
);
...
@@ -436,6 +464,7 @@ public class UserController {
...
@@ -436,6 +464,7 @@ public class UserController {
* @return
* @return
*/
*/
@GetMapping
(
value
=
"/infoWithTenant"
)
@GetMapping
(
value
=
"/infoWithTenant"
)
@ApiOperation
(
value
=
"获取当前用户的用户数量和租户信息"
)
public
BaseResponseInfo
randomImage
(
HttpServletRequest
request
){
public
BaseResponseInfo
randomImage
(
HttpServletRequest
request
){
BaseResponseInfo
res
=
new
BaseResponseInfo
();
BaseResponseInfo
res
=
new
BaseResponseInfo
();
try
{
try
{
...
...
jshERP-boot/src/main/java/com/jsh/erp/service/serialNumber/SerialNumberService.java
View file @
a923700c
...
@@ -278,9 +278,9 @@ public class SerialNumberService {
...
@@ -278,9 +278,9 @@ public class SerialNumberService {
* 卖出序列号
* 卖出序列号
* create time: 2019/1/25 9:17
* create time: 2019/1/25 9:17
* @Param: materialId
* @Param: materialId
* @Param: depotheadId
* @Param: depotheadId
* @Param: isSell 卖出'1'
* @Param: isSell 卖出'1'
* @Param: Count 卖出或者赎回的数量
* @Param: Count 卖出或者赎回的数量
* @return com.jsh.erp.datasource.entities.SerialNumberEx
* @return com.jsh.erp.datasource.entities.SerialNumberEx
*/
*/
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment