Commit 9e48a42c by huluobin

更新费用单的时候更新rmb金额

parent 62794454
......@@ -6,3 +6,4 @@ RUN echo "Asia/Shanghai" > /etc/timezone
ENTRYPOINT ["java","-Xms300m","-Xmx600m","-jar","-Dspring.profiles.active=test","/app.jar"]
EXPOSE 8082
cost/list/reset/resetInvoice
......@@ -64,6 +64,22 @@ public class CostController {
CostLogService costLogService;
@Resource
CostDao costDao;
@Autowired
UnSubmitState unSubmitState;
@Autowired
DepartmentCheckState departmentCheckState;
@Autowired
FinalCheckState finalCheckState;
@Autowired
FinancialCheckState financialCheckState;
@Autowired
PayedState payedState;
@Autowired
RefuseState refuseState;
@Autowired
UnPayState unPayState;
@Autowired
HrCheckState hrCheckState;
@ApiOperation("获取前端要打印的费用单列表")
@PostMapping("/list/print/list")
......@@ -160,22 +176,6 @@ public class CostController {
return resp;
}
@Autowired
UnSubmitState unSubmitState;
@Autowired
DepartmentCheckState departmentCheckState;
@Autowired
FinalCheckState finalCheckState;
@Autowired
FinancialCheckState financialCheckState;
@Autowired
PayedState payedState;
@Autowired
RefuseState refuseState;
@Autowired
UnPayState unPayState;
@Autowired
HrCheckState hrCheckState;
@ApiOperation("提交费用单")
@PostMapping("submitAudit")
......
......@@ -110,6 +110,9 @@ public abstract class AbstractCostService implements CostService {
@Override
public void setPrimaryDepartment(List<CostDomain> costDomains) {
if (ListUtil.isEmpty(costDomains)) {
return;
}
List<OaUser> oaUserList = oaUserMapper.selectList(
new LambdaQueryWrapper<OaUser>()
.in(OaUser::getOaUserId, costDomains.stream().map(CostDomain::getCreateUserid).collect(Collectors.toList()))
......@@ -178,6 +181,11 @@ public abstract class AbstractCostService implements CostService {
setCostDomain(costDomain);
costDomain.setLastModifyDate(LocalDateTime.now());
BigDecimal toRmbRate = CurUtils.getCur(costDomain.getDic(), "CNY");
costDomain.setToRmbRate(toRmbRate);
costDomain.setAmountRmb(costDomain.getAmount().multiply(toRmbRate).setScale(2, BigDecimal.ROUND_HALF_UP));
Integer update = costDao.update(costDomain, new LambdaQueryWrapper<CostDomain>()
.eq(CostDomain::getCostNo, costDomain.getCostNo()));
......
......@@ -6,7 +6,6 @@ import com.bailuntec.api.bailuntec.cw.request.PostApplyReq;
import com.bailuntec.api.bailuntec.cw.response.CwResult;
import com.bailuntec.common.BeanUtils;
import com.bailuntec.common.JsonUtilByJackson;
import com.blt.other.common.exception.BizRuntimeException;
import com.blt.other.common.exception.RpcException;
import com.blt.other.common.util.CurUtils;
import com.blt.other.module.cost.model.CostDomain;
......@@ -159,6 +158,7 @@ public class Lend2PayCostServiceImpl extends AbstractCostService implements Cost
//todo 邮件通知
log.error("金额异常 联系管理员,costNo:{}", supCostDomain.getCostNo());
}
supCostDomain.setLastModifyDate(LocalDateTime.now());
costDao.updateById(supCostDomain);
}
......
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