Commit 50ae0b6a by huluobin

update bug fix

parent af59f1ed
......@@ -252,9 +252,11 @@ public abstract class AbstractCostService implements CostService {
//释放已申请的金额
CostDomain supCost = costDao.selectByCostNo(costDomain.getSupCostNo());
supCost.setRepaymentAppliedAmount(supCost.getRepaymentAppliedAmount().subtract(costDomain.getAmount()));
supCost.setLastModifyDate(LocalDateTime.now());
costDao.updateById(supCost);
if (supCost != null) {
supCost.setRepaymentAppliedAmount(supCost.getRepaymentAppliedAmount().subtract(costDomain.getAmount()));
supCost.setLastModifyDate(LocalDateTime.now());
costDao.updateById(supCost);
}
}
return costDao.update(costDomain, new LambdaQueryWrapper<CostDomain>()
.eq(CostDomain::getCostNo, costDomain.getCostNo()));
......
......@@ -53,7 +53,6 @@ public class DepartmentCheckState extends CostState {
costDomain.setLastModifyDate(LocalDateTime.now());
costDao.updateById(costDomain);
//流转状态
nextState(hrCheckState);
costSubscribe.subscribe(costContext);
......
......@@ -2,8 +2,8 @@ spring:
# 数据源配置
datasource:
driver-class-name: com.mysql.jdbc.Driver
# url: jdbc:mysql://gz-cdb-lnrmt5zh.sql.tencentcdb.com:61369/bailun_other?useUnicode=true&characterEncoding=UTF-8&useSSL=false
url: jdbc:mysql://10.0.8.2:3306/bailun_other?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull
url: jdbc:mysql://gz-cdb-lnrmt5zh.sql.tencentcdb.com:61369/bailun_other?useUnicode=true&characterEncoding=UTF-8&useSSL=false
# url: jdbc:mysql://10.0.8.2:3306/bailun_other?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull
username: root
password: "#7kfnymAM$Y9-Ntf"
hikari:
......
package com.blt.other;
import com.alibaba.excel.EasyExcel;
import com.bailuntec.api.bailuntec.oa.OaApi;
import com.bailuntec.api.bailuntec.oa.response.OaDepartmentResp;
import com.bailuntec.api.bailuntec.oa.response.OaUserResp;
......@@ -77,14 +76,15 @@ public class OtherApplicationTests {
Map<Integer, OaDepartment> oaDepartmentMap = oaDepartmentList.stream().collect(Collectors.toMap(
OaDepartment::getDepartmentId, oaDepartment -> oaDepartment, (k1, k2) -> k1
));
oaUserList.forEach(oaUser ->
oaUser.setPrimaryDepartmentId(this.getPrimaryDepartment(oaDepartmentMap, oaDepartmentMap.get(oaUser.getDepartmentId())).getDepartmentId()));
oaUserService.remove(new LambdaQueryWrapper<>());
oaUserService.saveBatch(oaUserList);
oaUserList.forEach(oaUser -> {
oaUser.setPrimaryDepartmentId(this.getPrimaryDepartment(oaDepartmentMap, oaDepartmentMap.get(oaUser.getDepartmentId())).getDepartmentId());
if (oaUserService.getOne(new LambdaQueryWrapper<OaUser>().eq(OaUser::getOaUserId, oaUser.getOaUserId())) == null) {
oaUserService.save(oaUser);
}
});
oaDepartmentList.forEach(oaDepartment -> {
if (oaDepartmentMapper.selectByDepartmentId(oaDepartment.getDepartmentId())==null){
if (oaDepartmentMapper.selectByDepartmentId(oaDepartment.getDepartmentId()) == null) {
oaDepartment.setUpdateUserId(0);
oaDepartmentService.save(oaDepartment);
}
......@@ -107,6 +107,7 @@ public class OtherApplicationTests {
@Resource
DepartmentCheckState departmentCheckState;
@Test
public void importMallProduct() {
CostContext costContext = new CostContext("F029432", null);
......
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