Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
haoban3.0
haoban-manage3.0
Commits
0b2ee033
Commit
0b2ee033
authored
Mar 19, 2020
by
huangZW
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
111
parent
06c0a8f7
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
149 additions
and
10 deletions
+149
-10
AuditApiService.java
...va/com/gic/haoban/manage/api/service/AuditApiService.java
+1
-1
TabHaobanAuditMapper.java
...aoban/manage/service/dao/mapper/TabHaobanAuditMapper.java
+2
-1
TabHaobanAudit.java
.../com/gic/haoban/manage/service/entity/TabHaobanAudit.java
+11
-0
AuditApiServiceImpl.java
.../manage/service/service/out/impl/AuditApiServiceImpl.java
+2
-2
TabHaobanAuditMapper.xml
...ervice/src/main/resources/mapper/TabHaobanAuditMapper.xml
+58
-6
AuditController.java
...com/gic/haoban/manage/web/controller/AuditController.java
+75
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/AuditApiService.java
View file @
0b2ee033
...
...
@@ -10,7 +10,7 @@ import com.gic.haoban.manage.api.dto.AuditDTO;
*/
public
interface
AuditApiService
{
Page
<
AuditDTO
>
page
(
Integer
auditType
,
String
search
,
String
enterpriseId
,
Integer
auditStatus
,
BasePageInfo
pageInfo
);
Page
<
AuditDTO
>
page
(
Integer
auditType
,
String
search
,
String
wxEnterpriseId
,
String
enterpriseId
,
Integer
auditStatus
,
BasePageInfo
pageInfo
);
void
audit
(
String
auditId
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/TabHaobanAuditMapper.java
View file @
0b2ee033
...
...
@@ -18,5 +18,5 @@ public interface TabHaobanAuditMapper {
int
updateByPrimaryKey
(
TabHaobanAudit
record
);
Page
<
TabHaobanAudit
>
page
(
Integer
auditType
,
List
<
String
>
storeIds
,
List
<
String
>
staffIds
,
String
enterpriseId
,
Integer
auditStatus
);
Page
<
TabHaobanAudit
>
page
(
Integer
auditType
,
List
<
String
>
storeIds
,
List
<
String
>
staffIds
,
String
wxEnterpriseId
,
String
enterpriseId
,
Integer
auditStatus
);
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/entity/TabHaobanAudit.java
View file @
0b2ee033
...
...
@@ -40,6 +40,8 @@ public class TabHaobanAudit implements Serializable {
private
Integer
statusFlag
;
private
String
wxEnterpriseId
;
private
static
final
long
serialVersionUID
=
1L
;
public
String
getAuditId
()
{
...
...
@@ -185,4 +187,12 @@ public class TabHaobanAudit implements Serializable {
public
void
setStatusFlag
(
Integer
statusFlag
)
{
this
.
statusFlag
=
statusFlag
;
}
public
String
getWxEnterpriseId
()
{
return
wxEnterpriseId
;
}
public
void
setWxEnterpriseId
(
String
wxEnterpriseId
)
{
this
.
wxEnterpriseId
=
wxEnterpriseId
==
null
?
null
:
wxEnterpriseId
.
trim
();
}
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/AuditApiServiceImpl.java
View file @
0b2ee033
...
...
@@ -37,7 +37,7 @@ public class AuditApiServiceImpl implements AuditApiService{
@Autowired
private
StaffMapper
staffMapper
;
@Override
public
Page
<
AuditDTO
>
page
(
Integer
auditType
,
String
search
,
public
Page
<
AuditDTO
>
page
(
Integer
auditType
,
String
search
,
String
wxEnterpriseId
,
String
enterpriseId
,
Integer
auditStatus
,
BasePageInfo
pageInfo
)
{
List
<
String
>
storeIds
=
new
ArrayList
<>();
List
<
String
>
staffIds
=
new
ArrayList
<>();
...
...
@@ -52,7 +52,7 @@ public class AuditApiServiceImpl implements AuditApiService{
}
}
PageHelper
.
startPage
(
pageInfo
.
getPageNum
(),
pageInfo
.
getPageSize
());
com
.
github
.
pagehelper
.
Page
<
TabHaobanAudit
>
page
=
auditMapper
.
page
(
auditType
,
storeIds
,
staffIds
,
enterpriseId
,
auditStatus
);
com
.
github
.
pagehelper
.
Page
<
TabHaobanAudit
>
page
=
auditMapper
.
page
(
auditType
,
storeIds
,
staffIds
,
wxEnterpriseId
,
enterpriseId
,
auditStatus
);
return
PageUtil
.
changePageHelperToCurrentPage
(
page
,
AuditDTO
.
class
);
}
@Override
...
...
haoban-manage3-service/src/main/resources/mapper/TabHaobanAuditMapper.xml
View file @
0b2ee033
...
...
@@ -20,11 +20,12 @@
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"status_flag"
property=
"statusFlag"
jdbcType=
"INTEGER"
/>
<result
column=
"wx_enterprise_id"
property=
"wxEnterpriseId"
jdbcType=
"VARCHAR"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
audit_id, audit_type, commit_name, commit_staff_id, commit_staff_name, commit_staff_img,
commit_store_id, change_field, old_value, new_value, commit_time, enterprise_id,
audit_name, audit_status, audit_reason, create_time, update_time, status_flag
audit_name, audit_status, audit_reason, create_time, update_time, status_flag
, wx_enterprise_id
</sql>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
...
...
@@ -42,15 +43,15 @@
commit_store_id, change_field, old_value,
new_value, commit_time, enterprise_id,
audit_name, audit_status, audit_reason,
create_time, update_time, status_flag
)
create_time, update_time, status_flag
,
wx_enterprise_id
)
values (#{auditId,jdbcType=VARCHAR}, #{auditType,jdbcType=INTEGER}, #{commitName,jdbcType=VARCHAR},
#{commitStaffId,jdbcType=VARCHAR}, #{commitStaffName,jdbcType=VARCHAR}, #{commitStaffImg,jdbcType=VARCHAR},
#{commitStoreId,jdbcType=VARCHAR}, #{changeField,jdbcType=VARCHAR}, #{oldValue,jdbcType=VARCHAR},
#{newValue,jdbcType=VARCHAR}, #{commitTime,jdbcType=TIMESTAMP}, #{enterpriseId,jdbcType=VARCHAR},
#{auditName,jdbcType=VARCHAR}, #{auditStatus,jdbcType=INTEGER}, #{auditReason,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{statusFlag,jdbcType=INTEGER}
)
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{statusFlag,jdbcType=INTEGER}
,
#{wxEnterpriseId,jdbcType=VARCHAR}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanAudit"
>
insert into tab_haoban_audit
...
...
@@ -109,6 +110,9 @@
<if
test=
"statusFlag != null"
>
status_flag,
</if>
<if
test=
"wxEnterpriseId != null"
>
wx_enterprise_id,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"auditId != null"
>
...
...
@@ -165,6 +169,9 @@
<if
test=
"statusFlag != null"
>
#{statusFlag,jdbcType=INTEGER},
</if>
<if
test=
"wxEnterpriseId != null"
>
#{wxEnterpriseId,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanAudit"
>
...
...
@@ -221,6 +228,9 @@
<if
test=
"statusFlag != null"
>
status_flag = #{statusFlag,jdbcType=INTEGER},
</if>
<if
test=
"wxEnterpriseId != null"
>
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
</if>
</set>
where audit_id = #{auditId,jdbcType=VARCHAR}
</update>
...
...
@@ -242,7 +252,48 @@
audit_reason = #{auditReason,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
status_flag = #{statusFlag,jdbcType=INTEGER}
status_flag = #{statusFlag,jdbcType=INTEGER},
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
where audit_id = #{auditId,jdbcType=VARCHAR}
</update>
<sql
id=
"storeSql"
>
<if
test=
"null != storeIds and storeIds.size gt 0"
>
and commit_store_id in
<foreach
collection=
"storeIds"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
</sql>
<sql
id=
"staffSql"
>
<if
test=
"null != staffIds and staffIds.size gt 0"
>
and commit_staff_id in
<foreach
collection=
"staffIds"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
</sql>
<select
id=
"page"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_audit
where 1=1
<if
test =
"wxEnterpriseId != null"
>
and wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
</if>
<if
test =
"enterpriseId != null"
>
and enterprise_id = #{enterpriseId,jdbcType=VARCHAR}
</if>
<if
test =
"audit_type != null"
>
and audit_type = #{auditType,jdbcType=INTEGER}
</if>
<if
test =
"audit_status != null and audit_status == 0"
>
and audit_status = 0
</if>
<if
test =
"audit_status != null and audit_status != 0"
>
and audit_status in (1,2)
</if>
<include
refid=
"storeSql"
/>
<include
refid=
"staffSql"
/>
</select>
</mapper>
\ No newline at end of file
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/AuditController.java
0 → 100644
View file @
0b2ee033
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
;
import
java.util.List
;
import
com.alibaba.fastjson.JSON
;
import
com.ctrip.framework.apollo.spring.annotation.ApolloConfig
;
import
com.gic.api.base.commons.Page
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.common.utils.GlobalVar
;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.service.ApplicationSettingApiService
;
import
com.gic.haoban.manage.api.service.AuditApiService
;
import
com.gic.haoban.manage.api.service.AuditSettingApiService
;
import
com.gic.haoban.manage.api.service.DepartmentApiService
;
import
com.gic.haoban.manage.api.service.WxApplicationApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseApiService
;
import
com.gic.haoban.manage.web.anno.IgnoreLogin
;
import
com.gic.haoban.manage.web.auth.AuthRequestUtil
;
import
com.gic.haoban.manage.web.config.Config
;
import
com.gic.haoban.manage.web.vo.LoginVO
;
import
com.gic.wechat.api.service.qywx.QywxSuiteApiService
;
import
com.gic.wechat.api.service.qywx.QywxUserApiService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.manage.api.service.ApplicationApiService
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
@RestController
@RequestMapping
(
"/audit"
)
public
class
AuditController
extends
WebBaseController
{
private
static
final
Logger
log
=
LogManager
.
getLogger
(
AuditController
.
class
);
@Autowired
private
AuditSettingApiService
auditSettingApiService
;
@Autowired
private
AuditApiService
auditApiService
;
@RequestMapping
(
"open-or-close"
)
public
HaobanResponse
openOrClose
(
String
wxEnterpriseId
,
Integer
auditFlag
)
{
if
(
StringUtils
.
isAnyBlank
(
wxEnterpriseId
)){
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
if
(
auditFlag
==
null
){
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
auditSettingApiService
.
saveSetting
(
wxEnterpriseId
,
auditFlag
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
@RequestMapping
(
"find-setting"
)
public
HaobanResponse
findSetting
(
String
wxEnterpriseId
)
{
if
(
StringUtils
.
isAnyBlank
(
wxEnterpriseId
)){
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
auditSettingApiService
.
findSettingByWxEnterpriseId
(
wxEnterpriseId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
@RequestMapping
(
"find-page"
)
public
HaobanResponse
findPage
(
String
wxEnterpriseId
,
String
enterpriseId
,
String
search
,
BasePageInfo
pageInfo
,
Integer
auditType
,
Integer
auditStatus
)
{
if
(
auditStatus
==
null
){
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
Page
<
AuditDTO
>
page
=
auditApiService
.
page
(
auditType
,
search
,
wxEnterpriseId
,
enterpriseId
,
auditStatus
,
pageInfo
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
page
);
}
}
Write
Preview
Markdown
is supported
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