|
|
@ -21,6 +21,7 @@ import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import java.lang.reflect.Field; |
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.math.RoundingMode; |
|
|
|
import java.util.*; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
@ -76,27 +77,6 @@ public class DailyReportService extends MybatisBaseService<DailyReportMapper, Da |
|
|
|
BaseModelConfig baseModelConfig = baseMapper.selectConfig(configSid); |
|
|
|
BeanUtil.copyProperties(baseModelConfig, dailyReportVo, "useOrgName"); |
|
|
|
BeanUtil.copyProperties(baseVehicleModel, dailyReportVo, "useOrgName"); |
|
|
|
/*List<DailyParameterVo> parameterVoList = baseMapper.selectByParameters(useOrgSid); |
|
|
|
parameterVoList.removeAll(Collections.singleton(null)); |
|
|
|
for (int j = 0; j < parameterVoList.size(); j++) { |
|
|
|
Map<String,Object> map = new HashMap<>(); |
|
|
|
DailyParameterVo dailyParameterVo = parameterVoList.get(j); |
|
|
|
String tableName = Arrays.asList(dailyParameterVo.getTableNameKey().split("\\.")).get(1); |
|
|
|
if("base_model_config".equals(tableName)){ |
|
|
|
try { |
|
|
|
Field field = baseModelConfig.getClass().getDeclaredField(dailyParameterVo.getColName()); |
|
|
|
field.setAccessible(true); |
|
|
|
map.put(dailyParameterVo.getColName(),field.get(baseModelConfig)); |
|
|
|
|
|
|
|
} catch (NoSuchFieldException | IllegalAccessException e) { |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}else if("base_vehicle_model".equals(tableName)){ |
|
|
|
|
|
|
|
} |
|
|
|
}*/ |
|
|
|
} |
|
|
|
} |
|
|
|
PagerVo<DailyReportVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
@ -223,7 +203,7 @@ public class DailyReportService extends MybatisBaseService<DailyReportMapper, Da |
|
|
|
recordList.removeAll(Collections.singleton(null)); |
|
|
|
if (!recordList.isEmpty()) { |
|
|
|
for (int i = 0; i < recordList.size(); i++) { |
|
|
|
DailyReportListVo dailyReportVo = recordList.get(i); |
|
|
|
/*DailyReportListVo dailyReportVo = recordList.get(i); |
|
|
|
//根据库存小计和排产小计计算库存总计
|
|
|
|
int stock_subtotal = dailyReportVo.getStock_subtotal(); |
|
|
|
int pcOrder_subtotal = dailyReportVo.getPcOrder_subtotal(); |
|
|
@ -235,7 +215,19 @@ public class DailyReportService extends MybatisBaseService<DailyReportMapper, Da |
|
|
|
} else { |
|
|
|
BigDecimal big = new BigDecimal(stock_total).divide(new BigDecimal(threeNum).divide(new BigDecimal(3), 2, BigDecimal.ROUND_CEILING), 2, BigDecimal.ROUND_CEILING); |
|
|
|
dailyReportVo.setSaleOfStockRatio(big.toString()); |
|
|
|
}*/ |
|
|
|
DailyReportListVo dailyReportListVo = recordList.get(i); |
|
|
|
String ratio = ""; |
|
|
|
if (StringUtils.isBlank(dailyReportListVo.getSaleAllToThree())) { |
|
|
|
ratio = dailyReportListVo.getStock_subtotal() + ":1"; |
|
|
|
} else { |
|
|
|
if ("0".equals(dailyReportListVo.getSaleAllToThree())) { |
|
|
|
ratio = dailyReportListVo.getStock_subtotal() + ":1"; |
|
|
|
} else { |
|
|
|
ratio = new BigDecimal(dailyReportListVo.getStock_total()).divide((new BigDecimal(dailyReportListVo.getSaleAllToThree()).divide(new BigDecimal(3), 4, RoundingMode.HALF_UP)), 0, RoundingMode.HALF_UP).toString() + ":1"; |
|
|
|
} |
|
|
|
} |
|
|
|
dailyReportListVo.setSaleOfStockRatio(ratio); |
|
|
|
} |
|
|
|
} |
|
|
|
PagerVo<DailyReportListVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
|