Commit 728a9486 by huluobin

# 更新

parent 738072ec
...@@ -8,15 +8,5 @@ https://mirror.tuna.tsinghua.edu.cn/alpine/v3.4/community" > /etc/apk/repositori ...@@ -8,15 +8,5 @@ https://mirror.tuna.tsinghua.edu.cn/alpine/v3.4/community" > /etc/apk/repositori
RUN apk --update add curl bash ttf-dejavu && \ RUN apk --update add curl bash ttf-dejavu && \
rm -rf /var/cache/apk/* rm -rf /var/cache/apk/*
RUN echo "http://mirrors.aliyun.com/alpine/v3.6/main" > /etc/apk/repositories \
&& echo "http://mirrors.aliyun.com/alpine/v3.6/community" >> /etc/apk/repositories \
&& apk update upgrade \
&& apk add --no-cache procps unzip curl bash tzdata \
&& apk add ttf-dejavu \
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo "Asia/Shanghai" > /etc/timezone
RUN apk add --update ttf-dejavu fontconfig && rm -rf /var/cache/apk/*
ENTRYPOINT ["java","-Xms1G","-Xmx1G","-jar","-Dspring.profiles.active=test","/cost-service-1.0-SNAPSHOT.jar"] ENTRYPOINT ["java","-Xms1G","-Xmx1G","-jar","-Dspring.profiles.active=test","/cost-service-1.0-SNAPSHOT.jar"]
EXPOSE 8082 EXPOSE 8082
...@@ -16,7 +16,7 @@ import java.io.IOException; ...@@ -16,7 +16,7 @@ import java.io.IOException;
*/ */
@Component @Component
@ServletComponentScan @ServletComponentScan
@WebFilter(urlPatterns = {"/purchase/other/*"}, filterName = "requestBakFilter") @WebFilter(urlPatterns = {"/*"}, filterName = "requestBakFilter")
public class RequestBakFilter implements Filter { public class RequestBakFilter implements Filter {
@Override @Override
......
...@@ -200,40 +200,33 @@ public abstract class AbstractCostService implements CostService { ...@@ -200,40 +200,33 @@ public abstract class AbstractCostService implements CostService {
@Override @Override
public void resetCost(String costNo) { public void resetCost(String costNo) {
List<CostDetailDomain> costDetailDomains = costDetailDao.selectListByCostNo(costNo); List<CostDetailDomain> costDetailDomains = costDetailDao.selectListByCostNo(costNo);
CostDetailDomain costDetailDomain = costDetailDomains.get(0);
BigDecimal amount = new BigDecimal(0); if (costDetailDomains.stream().collect(Collectors.groupingBy(CostDetailDomain::getDic)).keySet().size() > 1) {
if (ListUtil.isNotEmpty(costDetailDomains)) { throw new RuntimeException("请统一货币单位");
}
//费用单总金额重新计算 if (costDetailDomains.stream().collect(Collectors.groupingBy(CostDetailDomain::getTypeId)).keySet().size() > 1) {
if (costDetailDomains.stream().collect(Collectors.groupingBy(CostDetailDomain::getDic)).keySet().size() > 1) { throw new RuntimeException("请统一费用类型");
throw new RuntimeException("请统一货币单位"); }
}
for (CostDetailDomain domain : costDetailDomains) {
amount = amount.add(domain.getAmount());
}
CostDomain costDomain = this.getCostByCostNo(costNo);
costDomain.setAmount(amount);
BigDecimal toRmbRate = CurUtils.getCur(costDomain.getDic(), "CNY");
costDomain.setToRmbRate(toRmbRate);
costDomain.setAmountRmb(costDomain.getAmount().multiply(toRmbRate).setScale(2, BigDecimal.ROUND_HALF_UP));
CostDetailDomain costDetailDomain = costDetailDomains.get(0); CostDomain costDomain = this.getCostByCostNo(costNo);
costDomain.setAmount(costDetailDomains.stream().map(CostDetailDomain::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
CostTypeDomain costTypeDomain = costTypeDao.selectById(costDetailDomain.getTypeId()); BigDecimal toRmbRate = CurUtils.getCur(costDomain.getDic(), "CNY");
AccountingSubject accountingSubject = accountingSubjectMapper.selectById(costTypeDomain.getAccountingSubjectId()); costDomain.setToRmbRate(toRmbRate);
costDomain.setAmountRmb(costDomain.getAmount().multiply(toRmbRate).setScale(2, BigDecimal.ROUND_HALF_UP));
costDomain.setTypeId(costTypeDomain.getId()); CostTypeDomain costTypeDomain = costTypeDao.selectById(costDetailDomain.getTypeId());
costDomain.setTypeNo(costTypeDomain.getTypeNo()); AccountingSubject accountingSubject = accountingSubjectMapper.selectById(costTypeDomain.getAccountingSubjectId());
costDomain.setTypeName(costTypeDomain.getTypeName());
costDomain.setAccountingSubjectNo(accountingSubject.getSubjectNo());
costDomain.setAccountingSubjectName(accountingSubject.getName());
costDomain.setLastModifyDate(LocalDateTime.now()); costDomain.setTypeId(costTypeDomain.getId());
costDomain.setTypeNo(costTypeDomain.getTypeNo());
costDomain.setTypeName(costTypeDomain.getTypeName());
costDomain.setAccountingSubjectNo(accountingSubject.getSubjectNo());
costDomain.setAccountingSubjectName(accountingSubject.getName());
costDomain.setLastModifyDate(LocalDateTime.now());
costDao.updateById(costDomain); costDao.updateById(costDomain);
}
} }
@Override @Override
......
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