Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dc-cost-system
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
bltdc
dc-cost-system
Commits
621b1901
Commit
621b1901
authored
Jan 04, 2021
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
84bc1e6f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
118 additions
and
24 deletions
+118
-24
pom.xml
bailuntec-cost-core/pom.xml
+0
-1
SessionHandlerInterceptor.java
...t/other/common/interceptor/SessionHandlerInterceptor.java
+1
-1
CostDao.java
.../src/main/java/com/blt/other/module/cost/dao/CostDao.java
+2
-0
Cost.xml
bailuntec-cost-core/src/main/resources/mapper/Cost.xml
+26
-20
OtherApplicationTests.java
...re/src/test/java/com/blt/other/OtherApplicationTests.java
+89
-2
No files found.
bailuntec-cost-core/pom.xml
View file @
621b1901
...
...
@@ -35,7 +35,6 @@
<commons.io>
2.4
</commons.io>
<commons-lang3.verson>
3.10
</commons-lang3.verson>
<qiniu-java-sdk.version>
[7.2.0, 7.2.99]
</qiniu-java-sdk.version>
<log4j2.disruptor.version>
3.4.2
</log4j2.disruptor.version>
</properties>
...
...
bailuntec-cost-core/src/main/java/com/blt/other/common/interceptor/SessionHandlerInterceptor.java
View file @
621b1901
...
...
@@ -27,7 +27,7 @@ public class SessionHandlerInterceptor implements HandlerInterceptor {
.
stream
()
.
filter
(
item
->
item
.
contains
(
"BailunToken"
))
.
findAny
()
.
map
(
item
->
item
.
replaceAll
(
"BailunToken="
,
""
).
trim
())
.
map
(
item
->
item
.
replaceAll
(
"
BailunToken="
,
""
).
trim
())
.
orElseThrow
(()
->
new
BizRuntimeException
(
"400"
,
"请先登陆"
));
SysUser
sysUser
=
JwtUtil
.
validateToken
(
token
);
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/dao/CostDao.java
View file @
621b1901
...
...
@@ -94,4 +94,6 @@ public interface CostDao extends BaseMapper<CostDomain> {
//小程序列表查询
Page
<
CostDomain
>
appCostList
(
@Param
(
"page"
)
IPage
<
CostDomain
>
costDomainIPage
,
@Param
(
"req"
)
AppCostListReq
req
);
List
<
CostDomain
>
selectByStatus
(
Integer
costStatus
);
}
bailuntec-cost-core/src/main/resources/mapper/Cost.xml
View file @
621b1901
...
...
@@ -467,9 +467,9 @@
<select
id=
"departmentCheckCostList"
resultType=
"com.blt.other.module.cost.model.CostDomain"
>
select t1.*
from cost t1
left join cost_current_reviewer t3 on t1.cost_no = t3.cost_no and t3.oa_user_id = #{req.userid}
left join cost_current_reviewer t3 on t1.cost_no = t3.cost_no and t3.oa_user_id = #{req.userid}
where t1.cost_status = 6
and t3.id is not null
and t3.id is not null
<if
test=
"req.costNo !=null and req.costNo !=''"
>
and (t1.bank_card_user like concat('%',#{req.costNo},'%') or t1.cost_no = #{req.costNo})
</if>
...
...
@@ -479,15 +479,15 @@
<select
id=
"departmentCheckAllCostList"
resultType=
"com.blt.other.module.cost.model.CostDomain"
>
select t1.*
from cost t1
left join cost_log t2 on t1.cost_no = t2.cost_no and t2.type in (2, 3) and t2.update_userid = #{req.userid}
left join cost_log t2 on t1.cost_no = t2.cost_no and t2.type in (2, 3) and t2.update_userid = #{req.userid}
where t1.cost_status not in (0, 3, 5)
and t2.id is not null
and t2.id is not null
union
select t1.*
from cost t1
left join cost_current_reviewer t3 on t1.cost_no = t3.cost_no and t3.oa_user_id = #{req.userid}
left join cost_current_reviewer t3 on t1.cost_no = t3.cost_no and t3.oa_user_id = #{req.userid}
where t1.cost_status = 6
and t3.id is not null
and t3.id is not null
<if
test=
"req.costNo !=null and req.costNo !=''"
>
and (t1.bank_card_user like concat('%',#{req.costNo},'%') or t1.cost_no = #{req.costNo})
</if>
...
...
@@ -497,10 +497,10 @@
<select
id=
"departmentManualCheckLllCostList"
resultType=
"com.blt.other.module.cost.model.CostDomain"
>
select t1.*
from cost t1
left join cost_log t2 on t1.cost_no = t2.cost_no and t2.type = 3 and t2.update_userid = #{req.userid}
left join cost_current_reviewer t3 on t1.cost_no = t3.cost_no and t3.oa_user_id = #{req.userid}
left join cost_log t2 on t1.cost_no = t2.cost_no and t2.type = 3 and t2.update_userid = #{req.userid}
left join cost_current_reviewer t3 on t1.cost_no = t3.cost_no and t3.oa_user_id = #{req.userid}
where t1.cost_status not in (0, 3, 5)
and t2.id is not null
and t2.id is not null
<if
test=
"req.costNo !=null and req.costNo !=''"
>
and (t1.bank_card_user like concat('%',#{req.costNo},'%') or t1.cost_no = #{req.costNo})
</if>
...
...
@@ -510,10 +510,10 @@
<select
id=
"departmentAutoCheckLllCostList"
resultType=
"com.blt.other.module.cost.model.CostDomain"
>
select t1.*
from cost t1
left join cost_log t2 on t1.cost_no = t2.cost_no and t2.type = 2 and t2.update_userid = #{req.userid}
left join cost_current_reviewer t3 on t1.cost_no = t3.cost_no and t3.oa_user_id = #{req.userid}
left join cost_log t2 on t1.cost_no = t2.cost_no and t2.type = 2 and t2.update_userid = #{req.userid}
left join cost_current_reviewer t3 on t1.cost_no = t3.cost_no and t3.oa_user_id = #{req.userid}
where t1.cost_status not in (0, 3, 5)
and t2.id is not null
and t2.id is not null
<if
test=
"req.costNo !=null and req.costNo !=''"
>
and (t1.bank_card_user like concat('%',#{req.costNo},'%') or t1.cost_no = #{req.costNo})
</if>
...
...
@@ -523,24 +523,30 @@
<select
id=
"financialOrFinalCheckCostList"
resultType=
"com.blt.other.module.cost.model.CostDomain"
>
select t1.*
from cost t1
left join cost_current_reviewer t3 on t1.cost_no = t3.cost_no and t3.oa_user_id = #{req.userid}
left join cost_current_reviewer t3 on t1.cost_no = t3.cost_no and t3.oa_user_id = #{req.userid}
where t1.cost_status = 6
and t3.id is not null
<if
test=
"req.costNo !=null and req.costNo !=''"
>
and (t1.bank_card_user like concat('%',#{req.costNo},'%') or t1.cost_no = #{req.costNo})
</if>
and t3.id is not null
<if
test=
"req.costNo !=null and req.costNo !=''"
>
and (t1.bank_card_user like concat('%',#{req.costNo},'%') or t1.cost_no = #{req.costNo})
</if>
</select>
<!--需要我人事审核的-->
<select
id=
"hrCheckCostList"
resultType=
"com.blt.other.module.cost.model.CostDomain"
>
select t1.*
from cost t1
left join cost_current_reviewer t3 on t1.cost_no = t3.cost_no and t3.oa_user_id = #{req.userid}
left join cost_current_reviewer t3 on t1.cost_no = t3.cost_no and t3.oa_user_id = #{req.userid}
where t1.cost_status = 9
and t3.id is not null
and t3.id is not null
<if
test=
"req.costNo !=null and req.costNo !=''"
>
and (t1.bank_card_user like concat('%',#{req.costNo},'%') or t1.cost_no = #{req.costNo})
</if>
</select>
</select>
<select
id=
"selectByStatus"
resultType=
"com.blt.other.module.cost.model.CostDomain"
>
select *
from cost
where cost_status = #{costStatus}
</select>
</mapper>
bailuntec-cost-core/src/test/java/com/blt/other/OtherApplicationTests.java
View file @
621b1901
...
...
@@ -11,15 +11,18 @@ import com.bailuntec.api.bailuntec.oa.response.OaUserResp;
import
com.bailuntec.common.SpringContextUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.IdWorker
;
import
com.blt.other.database.model.CostCompanyDomain
;
import
com.blt.other.database.model.CostTypeDomain
;
import
com.blt.other.module.auth.dao.OaDepartmentMapper
;
import
com.blt.other.module.auth.dao.OaUserMapper
;
import
com.blt.other.module.auth.model.OaDepartment
;
import
com.blt.other.module.auth.model.OaUser
;
import
com.blt.other.module.auth.service.IOaDepartmentService
;
import
com.blt.other.module.auth.service.IOaUserService
;
import
com.blt.other.module.cost.dao.AccountingSubjectMapper
;
import
com.blt.other.module.cost.dao.CostTypeDao
;
import
com.blt.other.module.cost.dao.*
;
import
com.blt.other.module.cost.model.AccountingSubject
;
import
com.blt.other.module.cost.model.CostCurrentReviewer
;
import
com.blt.other.module.cost.model.CostDomain
;
import
com.blt.other.module.sys.dao.CostReviewerMapper
;
import
com.blt.other.module.sys.dao.DepartmentReviewerMapper
;
import
com.blt.other.module.sys.model.CostReviewer
;
...
...
@@ -253,6 +256,90 @@ public class OtherApplicationTests {
}
}
@Resource
CostDao
costDao
;
@Resource
CostCurrentReviewerMapper
costCurrentReviewerMapper
;
@Resource
CostCompanyDao
costCompanyDao
;
@Resource
OaUserMapper
oaUserMapper
;
@Test
@Rollback
(
value
=
false
)
public
void
syncOldCost
()
{
List
<
CostDomain
>
costDomains1
=
costDao
.
selectByStatus
(
CostDomain
.
STATUS_DEPARTMENT_CHECK
);
costDomains1
.
forEach
(
costDomain
->
{
OaUser
oaUser
=
oaUserMapper
.
selectByOaUserId
(
costDomain
.
getCreateUserid
());
List
<
CostReviewer
>
costReviewerList
=
costReviewerMapper
.
selectList
(
new
LambdaQueryWrapper
<
CostReviewer
>()
.
eq
(
CostReviewer:
:
getType
,
1
)
.
eq
(
CostReviewer:
:
getReferId
,
oaUser
.
getPrimaryDepartmentId
()));
costReviewerList
.
forEach
(
costReviewer
->
{
CostCurrentReviewer
costCurrentReviewer
=
new
CostCurrentReviewer
();
costCurrentReviewer
.
setUsername
(
costReviewer
.
getReviewerUserName
());
costCurrentReviewer
.
setOaUserId
(
costReviewer
.
getReviewerUserId
());
costCurrentReviewer
.
setCostNo
(
costDomain
.
getCostNo
());
costCurrentReviewerMapper
.
insert
(
costCurrentReviewer
);
});
});
List
<
CostDomain
>
costDomains2
=
costDao
.
selectByStatus
(
CostDomain
.
STATUS_FINANCIAL_CHECK
);
costDomains2
.
forEach
(
costDomain
->
{
CostCompanyDomain
costCompanyDomain
=
costCompanyDao
.
selectByNo
(
costDomain
.
getCompanyNo
());
List
<
CostReviewer
>
costReviewerList
=
costReviewerMapper
.
selectList
(
new
LambdaQueryWrapper
<
CostReviewer
>()
.
eq
(
CostReviewer:
:
getType
,
CostReviewer
.
financialReviewer
)
.
eq
(
CostReviewer:
:
getReferId
,
costCompanyDomain
.
getId
()));
costReviewerList
.
forEach
(
costReviewer
->
{
CostCurrentReviewer
costCurrentReviewer
=
new
CostCurrentReviewer
();
costCurrentReviewer
.
setUsername
(
costReviewer
.
getReviewerUserName
());
costCurrentReviewer
.
setOaUserId
(
costReviewer
.
getReviewerUserId
());
costCurrentReviewer
.
setCostNo
(
costDomain
.
getCostNo
());
costCurrentReviewerMapper
.
insert
(
costCurrentReviewer
);
});
});
List
<
CostDomain
>
costDomains3
=
costDao
.
selectByStatus
(
CostDomain
.
STATUS_HR_CHECK
);
costDomains3
.
forEach
(
costDomain
->
{
CostCompanyDomain
costCompanyDomain
=
costCompanyDao
.
selectByNo
(
costDomain
.
getCompanyNo
());
List
<
CostReviewer
>
costReviewerList
=
costReviewerMapper
.
selectList
(
new
LambdaQueryWrapper
<
CostReviewer
>()
.
eq
(
CostReviewer:
:
getType
,
CostReviewer
.
hrReviewer
)
.
eq
(
CostReviewer:
:
getReferId
,
costCompanyDomain
.
getId
()));
costReviewerList
.
forEach
(
costReviewer
->
{
CostCurrentReviewer
costCurrentReviewer
=
new
CostCurrentReviewer
();
costCurrentReviewer
.
setUsername
(
costReviewer
.
getReviewerUserName
());
costCurrentReviewer
.
setOaUserId
(
costReviewer
.
getReviewerUserId
());
costCurrentReviewer
.
setCostNo
(
costDomain
.
getCostNo
());
costCurrentReviewerMapper
.
insert
(
costCurrentReviewer
);
});
});
List
<
CostDomain
>
costDomains4
=
costDao
.
selectByStatus
(
CostDomain
.
STATUS_FINAL_CHECK
);
costDomains4
.
forEach
(
costDomain
->
{
CostCompanyDomain
costCompanyDomain
=
costCompanyDao
.
selectByNo
(
costDomain
.
getCompanyNo
());
List
<
CostReviewer
>
costReviewerList
=
costReviewerMapper
.
selectList
(
new
LambdaQueryWrapper
<
CostReviewer
>()
.
eq
(
CostReviewer:
:
getType
,
CostReviewer
.
finalReviewer
)
.
eq
(
CostReviewer:
:
getReferId
,
costCompanyDomain
.
getId
()));
costReviewerList
.
forEach
(
costReviewer
->
{
CostCurrentReviewer
costCurrentReviewer
=
new
CostCurrentReviewer
();
costCurrentReviewer
.
setUsername
(
costReviewer
.
getReviewerUserName
());
costCurrentReviewer
.
setOaUserId
(
costReviewer
.
getReviewerUserId
());
costCurrentReviewer
.
setCostNo
(
costDomain
.
getCostNo
());
costCurrentReviewerMapper
.
insert
(
costCurrentReviewer
);
});
});
}
}
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