|
|
@@ -700,6 +700,37 @@ public class PublicInquiryServiceImpl implements PublicInquiryService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取当前月和上个月询价单数量
|
|
|
+ *
|
|
|
+ * @return 数量map
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public ModelMap getCountOfLastAndThisMonth() {
|
|
|
+ Calendar now = Calendar.getInstance();
|
|
|
+ Integer year = now.get(Calendar.YEAR);
|
|
|
+ Integer month = now.get(Calendar.MONTH) + 1;
|
|
|
+ ModelMap result = new ModelMap();
|
|
|
+ try {
|
|
|
+ Long current = inquiryItemInfoDao.countByMonth(year, month);
|
|
|
+ result.put("current", current);
|
|
|
+ if (month == 1) {
|
|
|
+ year = year - 1;
|
|
|
+ month = 12;
|
|
|
+ } else {
|
|
|
+ month = month - 1;
|
|
|
+ }
|
|
|
+ Long last = inquiryItemInfoDao.countByMonth(year, month);
|
|
|
+ result.put("last", last);
|
|
|
+ result.put("success", "true");
|
|
|
+ } catch (Exception e) {
|
|
|
+ result.put("message", e.getMessage());
|
|
|
+ result.put("success", false);
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 将公共询价服务中心的公共询价转成ERP的对应的字段
|
|
|
*
|
|
|
@@ -1610,6 +1641,36 @@ public class PublicInquiryServiceImpl implements PublicInquiryService {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 根据年份和月份字符串获取条数
|
|
|
+ *
|
|
|
+ * @param year 年份
|
|
|
+ * @param months 月份字符串 6,7,8
|
|
|
+ * @return map
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public List<ModelMap> countByMonths(Integer year, String months) {
|
|
|
+ List<ModelMap> results = new ArrayList<>();
|
|
|
+ try {
|
|
|
+ String[] monthArray = months.split(",");
|
|
|
+ for (String month : monthArray) {
|
|
|
+ ModelMap result = new ModelMap();
|
|
|
+ Long count = inquiryItemInfoDao.countByMonth(year, Integer.valueOf(month));
|
|
|
+ result.put("count", count);
|
|
|
+ result.put("success", "true");
|
|
|
+ result.put("month", Integer.valueOf(month));
|
|
|
+ results.add(result);
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ ModelMap result = new ModelMap();
|
|
|
+ result.put("message", e.getMessage());
|
|
|
+ result.put("success", false);
|
|
|
+ results.add(result);
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return results;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 根据enUU获取
|
|
|
*
|