Commit 50ae0b6a by huluobin

update bug fix

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