Commit 621b1901 by huluobin

update

parent 84bc1e6f
......@@ -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>
......
......@@ -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);
......
......@@ -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);
}
......@@ -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>
......@@ -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);
});
});
}
}
Markdown is supported
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