Commit 728a9486 by huluobin

# 更新

parent 738072ec
......@@ -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 && \
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"]
EXPOSE 8082
......@@ -16,7 +16,7 @@ import java.io.IOException;
*/
@Component
@ServletComponentScan
@WebFilter(urlPatterns = {"/purchase/other/*"}, filterName = "requestBakFilter")
@WebFilter(urlPatterns = {"/*"}, filterName = "requestBakFilter")
public class RequestBakFilter implements Filter {
@Override
......
......@@ -200,27 +200,22 @@ public abstract class AbstractCostService implements CostService {
@Override
public void resetCost(String costNo) {
List<CostDetailDomain> costDetailDomains = costDetailDao.selectListByCostNo(costNo);
CostDetailDomain costDetailDomain = costDetailDomains.get(0);
BigDecimal amount = new BigDecimal(0);
if (ListUtil.isNotEmpty(costDetailDomains)) {
//费用单总金额重新计算
if (costDetailDomains.stream().collect(Collectors.groupingBy(CostDetailDomain::getDic)).keySet().size() > 1) {
throw new RuntimeException("请统一货币单位");
}
for (CostDetailDomain domain : costDetailDomains) {
amount = amount.add(domain.getAmount());
if (costDetailDomains.stream().collect(Collectors.groupingBy(CostDetailDomain::getTypeId)).keySet().size() > 1) {
throw new RuntimeException("请统一费用类型");
}
CostDomain costDomain = this.getCostByCostNo(costNo);
costDomain.setAmount(amount);
costDomain.setAmount(costDetailDomains.stream().map(CostDetailDomain::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
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);
CostTypeDomain costTypeDomain = costTypeDao.selectById(costDetailDomain.getTypeId());
AccountingSubject accountingSubject = accountingSubjectMapper.selectById(costTypeDomain.getAccountingSubjectId());
......@@ -229,12 +224,10 @@ public abstract class AbstractCostService implements CostService {
costDomain.setTypeName(costTypeDomain.getTypeName());
costDomain.setAccountingSubjectNo(accountingSubject.getSubjectNo());
costDomain.setAccountingSubjectName(accountingSubject.getName());
costDomain.setLastModifyDate(LocalDateTime.now());
costDao.updateById(costDomain);
}
}
@Override
public Integer setStatus(String costNo, int i) {
......
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