Commit dede7794 by huluobin

不知道改了什么

parent 997cec37
...@@ -61,7 +61,7 @@ public class CostApiServiceImpl implements CostApiService { ...@@ -61,7 +61,7 @@ public class CostApiServiceImpl implements CostApiService {
@Override @Override
@Transactional @Transactional
public String generateLogisticsCost(int costForm, LogisticsCostDto logisticsCostDto) throws Exception{ public String generateLogisticsCost(int costForm, LogisticsCostDto logisticsCostDto) throws Exception {
CostDomain costDomain = new CostDomain(); CostDomain costDomain = new CostDomain();
String costNo = CostUtils.getIdNum(costService); String costNo = CostUtils.getIdNum(costService);
costDomain.setCostNo(costNo); costDomain.setCostNo(costNo);
...@@ -81,10 +81,10 @@ public class CostApiServiceImpl implements CostApiService { ...@@ -81,10 +81,10 @@ public class CostApiServiceImpl implements CostApiService {
costDomain.setDic(logisticsCostDto.getCurrency()); costDomain.setDic(logisticsCostDto.getCurrency());
costDomain.setSourceFrom(logisticsCostDto.getSourceFrom()); costDomain.setSourceFrom(logisticsCostDto.getSourceFrom());
BigDecimal toRmbRate = null; BigDecimal toRmbRate = null;
if ("CNY".equals(logisticsCostDto.getCurrency())){ if ("CNY".equals(logisticsCostDto.getCurrency())) {
toRmbRate = BigDecimal.ONE; toRmbRate = BigDecimal.ONE;
costDomain.setAmountRmb(logisticsCostDto.getAmount()); costDomain.setAmountRmb(logisticsCostDto.getAmount());
}else{ } else {
toRmbRate = CurUtils.getCur(logisticsCostDto.getCurrency(), "CNY", getExchangeRateApi); toRmbRate = CurUtils.getCur(logisticsCostDto.getCurrency(), "CNY", getExchangeRateApi);
costDomain.setAmountRmb(logisticsCostDto.getAmount().multiply(toRmbRate).setScale(2, BigDecimal.ROUND_HALF_UP)); costDomain.setAmountRmb(logisticsCostDto.getAmount().multiply(toRmbRate).setScale(2, BigDecimal.ROUND_HALF_UP));
} }
...@@ -92,11 +92,11 @@ public class CostApiServiceImpl implements CostApiService { ...@@ -92,11 +92,11 @@ public class CostApiServiceImpl implements CostApiService {
List<LogisticsFinansysDto> logisticsList = userCostFinansysService.getAllLogisticsFinansys(); // 一级物流供应商 List<LogisticsFinansysDto> logisticsList = userCostFinansysService.getAllLogisticsFinansys(); // 一级物流供应商
List<SubLogisticsFinansysDto> subLogisticsList = userCostFinansysService.getAllSubLogisticsFinansys(); // 二级物流供应商 List<SubLogisticsFinansysDto> subLogisticsList = userCostFinansysService.getAllSubLogisticsFinansys(); // 二级物流供应商
if(logisticsList != null && subLogisticsList != null){ if (logisticsList != null && subLogisticsList != null) {
if (logisticsCostDto.getSubLogisticsSupplierId().intValue() == 0){ if (logisticsCostDto.getSubLogisticsSupplierId().intValue() == 0) {
// 没有二级,只有一级 // 没有二级,只有一级
for (LogisticsFinansysDto logistics : logisticsList){ for (LogisticsFinansysDto logistics : logisticsList) {
if(logistics.getId().intValue() == logisticsCostDto.getLogisticsSupplierId().intValue()){ if (logistics.getId().intValue() == logisticsCostDto.getLogisticsSupplierId().intValue()) {
costDomain.setLogisticsSupplierId(logistics.getId()); costDomain.setLogisticsSupplierId(logistics.getId());
costDomain.setBankCompany(logistics.getName()); costDomain.setBankCompany(logistics.getName());
costDomain.setBankCardUser(logistics.getBankuser()); costDomain.setBankCardUser(logistics.getBankuser());
...@@ -105,13 +105,13 @@ public class CostApiServiceImpl implements CostApiService { ...@@ -105,13 +105,13 @@ public class CostApiServiceImpl implements CostApiService {
break; break;
} }
} }
}else{ } else {
// 根据二级找一级 // 根据二级找一级
for (SubLogisticsFinansysDto subLogistics : subLogisticsList){ for (SubLogisticsFinansysDto subLogistics : subLogisticsList) {
if(subLogistics.getId().intValue() == logisticsCostDto.getSubLogisticsSupplierId().intValue()){ if (subLogistics.getId().intValue() == logisticsCostDto.getSubLogisticsSupplierId().intValue()) {
costDomain.setSubLogisticsSupplierId(subLogistics.getId()); costDomain.setSubLogisticsSupplierId(subLogistics.getId());
for (LogisticsFinansysDto logistics : logisticsList){ for (LogisticsFinansysDto logistics : logisticsList) {
if(logistics.getId().intValue() == subLogistics.getParentid().intValue()){ if (logistics.getId().intValue() == subLogistics.getParentid().intValue()) {
costDomain.setLogisticsSupplierId(logistics.getId()); costDomain.setLogisticsSupplierId(logistics.getId());
costDomain.setBankCompany(logistics.getName()); costDomain.setBankCompany(logistics.getName());
costDomain.setBankCardUser(logistics.getBankuser()); costDomain.setBankCardUser(logistics.getBankuser());
...@@ -130,14 +130,14 @@ public class CostApiServiceImpl implements CostApiService { ...@@ -130,14 +130,14 @@ public class CostApiServiceImpl implements CostApiService {
logisticsList.clear(); logisticsList.clear();
subLogisticsList.clear(); subLogisticsList.clear();
if (costDomain.getLogisticsSupplierId() == null){ if (costDomain.getLogisticsSupplierId() == null) {
throw new Exception("没有匹配到一级物流供应商信息!"); throw new Exception("没有匹配到一级物流供应商信息!");
} }
UserDomain user = userDao.selectByuserid(logisticsCostDto.getUserId()); UserDomain user = userDao.selectByuserid(logisticsCostDto.getUserId());
if (user == null){ if (user == null) {
throw new Exception("费用系统中没有该用户信息,请先登录一次费用系统再进行推送!"); throw new Exception("费用系统中没有该用户信息,请先登录一次费用系统再进行推送!");
}else{ } else {
costDomain.setCreateUserid(user.getUserid()); costDomain.setCreateUserid(user.getUserid());
costDomain.setCreateUsercode(user.getUsercode()); costDomain.setCreateUsercode(user.getUsercode());
costDomain.setCreateUsername(user.getUsername()); costDomain.setCreateUsername(user.getUsername());
...@@ -157,10 +157,10 @@ public class CostApiServiceImpl implements CostApiService { ...@@ -157,10 +157,10 @@ public class CostApiServiceImpl implements CostApiService {
public List<ManageCostDto> getMangeCostList(String startDateStr, String endDateStr, String feeSuperType, String feeSubType, Integer companyValue, String companyName, String departmentName, Integer createUserId, Integer payUserId) throws Exception { public List<ManageCostDto> getMangeCostList(String startDateStr, String endDateStr, String feeSuperType, String feeSubType, Integer companyValue, String companyName, String departmentName, Integer createUserId, Integer payUserId) throws Exception {
Date startDate = null; Date startDate = null;
Date endDate = null; Date endDate = null;
if(!StringUtils.isEmpty(startDateStr)){ if (!StringUtils.isEmpty(startDateStr)) {
startDate = DateTimeUtil.stringToDate(startDateStr, DateTimeUtil.DATE_FORMAT); startDate = DateTimeUtil.stringToDate(startDateStr, DateTimeUtil.DATE_FORMAT);
} }
if(!StringUtils.isEmpty(endDateStr)){ if (!StringUtils.isEmpty(endDateStr)) {
endDate = DateTimeUtil.stringToDate(endDateStr, DateTimeUtil.DATE_FORMAT); endDate = DateTimeUtil.stringToDate(endDateStr, DateTimeUtil.DATE_FORMAT);
} }
ArrayList<Integer> companyValueList = new ArrayList<>(6); ArrayList<Integer> companyValueList = new ArrayList<>(6);
...@@ -172,6 +172,10 @@ public class CostApiServiceImpl implements CostApiService { ...@@ -172,6 +172,10 @@ public class CostApiServiceImpl implements CostApiService {
companyValueList.add(60); companyValueList.add(60);
companyValueList.add(61); companyValueList.add(61);
companyValueList.add(66); companyValueList.add(66);
companyValueList.add(72);
companyValueList.add(67);
companyValueList.add(58);
companyValueList.add(54);
} }
} }
List<ManageCostDto> manageCostDtoList = costDao.selectManageCost(startDate, DateTimeUtil.addDays(endDate, 1), feeSuperType, feeSubType, companyValueList, companyName, departmentName, createUserId, payUserId); List<ManageCostDto> manageCostDtoList = costDao.selectManageCost(startDate, DateTimeUtil.addDays(endDate, 1), feeSuperType, feeSubType, companyValueList, companyName, departmentName, createUserId, payUserId);
...@@ -185,13 +189,13 @@ public class CostApiServiceImpl implements CostApiService { ...@@ -185,13 +189,13 @@ public class CostApiServiceImpl implements CostApiService {
} }
if ((companyValue == null || companyValue == 2) && ((feeSuperType == null && departmentName == null) || if ((companyValue == null || companyValue == 2) && ((feeSuperType == null && departmentName == null) ||
(("耗材".equals(feeSuperType) || "耗材".equals(feeSubType)) && "采购部".equals(departmentName)) || (("耗材".equals(feeSuperType) || "耗材".equals(feeSubType)) && "采购部".equals(departmentName)) ||
(("耗材".equals(feeSuperType) || "耗材".equals(feeSubType)) && departmentName == null))){ (("耗材".equals(feeSuperType) || "耗材".equals(feeSubType)) && departmentName == null))) {
try { try {
String param = "?companymainvalue_from=40&isquestion=-1&orderType=-1&cashier_type=1&sourcecode=buy&order=asc&offset=0&limit=1000" + String param = "?companymainvalue_from=40&isquestion=-1&orderType=-1&cashier_type=1&sourcecode=buy&order=asc&offset=0&limit=1000" +
"&cashier_time_start=" + startDateStr +"&cashier_time_end=" + endDateStr; "&cashier_time_start=" + startDateStr + "&cashier_time_end=" + endDateStr;
ConsumablesResultDto consumablesResultDto = JSONObject.parseObject(HttpUtil.httpGet(getConsumablesApiUrl + param), ConsumablesResultDto.class); ConsumablesResultDto consumablesResultDto = JSONObject.parseObject(HttpUtil.httpGet(getConsumablesApiUrl + param), ConsumablesResultDto.class);
if(consumablesResultDto.getTotal() > 0 && consumablesResultDto.getRows().size() > 0){ if (consumablesResultDto.getTotal() > 0 && consumablesResultDto.getRows().size() > 0) {
for (ManageCostDto manageCostDto : consumablesResultDto.getRows()){ for (ManageCostDto manageCostDto : consumablesResultDto.getRows()) {
manageCostDto.setReceiveUnit("余江县酷乐电子用品店"); manageCostDto.setReceiveUnit("余江县酷乐电子用品店");
manageCostDto.setReason("耗材"); manageCostDto.setReason("耗材");
manageCostDto.setManageCostType(-1); manageCostDto.setManageCostType(-1);
...@@ -207,7 +211,7 @@ public class CostApiServiceImpl implements CostApiService { ...@@ -207,7 +211,7 @@ public class CostApiServiceImpl implements CostApiService {
manageCostDtoList.add(manageCostDto); manageCostDtoList.add(manageCostDto);
} }
} }
}catch (Exception e){ } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
logger.error(">>>>>获取耗材信息失败"); logger.error(">>>>>获取耗材信息失败");
} }
...@@ -219,10 +223,10 @@ public class CostApiServiceImpl implements CostApiService { ...@@ -219,10 +223,10 @@ public class CostApiServiceImpl implements CostApiService {
public List<ManageCostDto> getLogisticsCostList(String startDateStr, String endDateStr, String feeSuperType, String feeSubType, Integer companyValue, String companyName, String departmentName, Integer createUserId, Integer payUserId) throws Exception { public List<ManageCostDto> getLogisticsCostList(String startDateStr, String endDateStr, String feeSuperType, String feeSubType, Integer companyValue, String companyName, String departmentName, Integer createUserId, Integer payUserId) throws Exception {
Date startDate = null; Date startDate = null;
Date endDate = null; Date endDate = null;
if(!StringUtils.isEmpty(startDateStr)){ if (!StringUtils.isEmpty(startDateStr)) {
startDate = DateTimeUtil.stringToDate(startDateStr, DateTimeUtil.DATE_FORMAT); startDate = DateTimeUtil.stringToDate(startDateStr, DateTimeUtil.DATE_FORMAT);
} }
if(!StringUtils.isEmpty(endDateStr)){ if (!StringUtils.isEmpty(endDateStr)) {
endDate = DateTimeUtil.stringToDate(endDateStr, DateTimeUtil.DATE_FORMAT); endDate = DateTimeUtil.stringToDate(endDateStr, DateTimeUtil.DATE_FORMAT);
} }
ArrayList<Integer> companyValueList = new ArrayList<>(6); ArrayList<Integer> companyValueList = new ArrayList<>(6);
...@@ -242,12 +246,12 @@ public class CostApiServiceImpl implements CostApiService { ...@@ -242,12 +246,12 @@ public class CostApiServiceImpl implements CostApiService {
} }
@Override @Override
public List<CostDomain> getBalanceSheetCost(Date startDate, Date endDate){ public List<CostDomain> getBalanceSheetCost(Date startDate, Date endDate) {
return costDao.selectBalanceSheetCost(startDate, endDate); return costDao.selectBalanceSheetCost(startDate, endDate);
} }
@Override @Override
public List<CostDomain> getNoPayCost(List<String> costNoList){ public List<CostDomain> getNoPayCost(List<String> costNoList) {
return costDao.selectNoPayCost(costNoList); return costDao.selectNoPayCost(costNoList);
} }
......
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