|
|
@@ -28,9 +28,9 @@ public class MoneyReportServiceImpl implements MoneyReportService {
|
|
|
@Autowired
|
|
|
private VendorAcountViewMapper vendorAcountViewMapper;
|
|
|
@Autowired
|
|
|
- private PaydetailViewMapper paydetailViewMapper;
|
|
|
+ private PayablesdetailMapper payablesdetailMapper;
|
|
|
@Autowired
|
|
|
- private RecdetailViewMapper recdetailViewMapper;
|
|
|
+ private ReceivablesdetailMapper receivablesdetailMapper;
|
|
|
@Autowired
|
|
|
private AcountbalanceViewMapper acountbalanceViewMapper;
|
|
|
@Autowired
|
|
|
@@ -93,6 +93,8 @@ public class MoneyReportServiceImpl implements MoneyReportService {
|
|
|
}
|
|
|
|
|
|
private Map<String, Object> getListDATA(@PageDefault(size = 10) PageRequest page, ListReqDTO req, String type) {
|
|
|
+
|
|
|
+ //调用存储过程
|
|
|
if ("custormonthdetails".equals(type)){
|
|
|
Map map1 = this.getYm(req.getCondition());
|
|
|
Map<String, Integer> map = new HashMap();
|
|
|
@@ -107,6 +109,35 @@ public class MoneyReportServiceImpl implements MoneyReportService {
|
|
|
map.put("v_YearMonthTo", Integer.valueOf((String) map1.get("yearmonthTo")));
|
|
|
map.put("v_companyid", Math.toIntExact(BaseContextHolder.getCompanyId()));
|
|
|
vendmonthMapper.callVend(map);
|
|
|
+ }else if ("payDetail".equals(type)){
|
|
|
+ Map<String, String> maps = new HashMap<>();
|
|
|
+ Map<String, String> map = this.getIdAndDate(req.getCondition());
|
|
|
+ Long custid = new Long(0);
|
|
|
+ if (map.get("name") == null) {
|
|
|
+ custid = new Long(0);
|
|
|
+ }else {
|
|
|
+ custid = payablesdetailMapper.selectIdByName(map.get("name"), BaseContextHolder.getCompanyId());
|
|
|
+ }
|
|
|
+ maps.put("V_vendid", String.valueOf(custid));
|
|
|
+ maps.put("V_start", map.get("yearmonth"));
|
|
|
+ maps.put("V_end", map.get("yearmonthTo"));
|
|
|
+ maps.put("v_companyid", String.valueOf(BaseContextHolder.getCompanyId()));
|
|
|
+ payablesdetailMapper.callvend(maps);
|
|
|
+
|
|
|
+ }else if("recDetail".equals(type)){
|
|
|
+ Map<String, String> maps = new HashMap<>();
|
|
|
+ Map<String, String> map = this.getIdAndDate(req.getCondition());
|
|
|
+ Long custid = new Long(0);
|
|
|
+ if (map.get("name") == null) {
|
|
|
+ custid = new Long(0);
|
|
|
+ }else {
|
|
|
+ custid = receivablesdetailMapper.selectIdByName(map.get("name"), BaseContextHolder.getCompanyId());
|
|
|
+ }
|
|
|
+ maps.put("V_custid", String.valueOf(custid));
|
|
|
+ maps.put("V_start", map.get("yearmonth"));
|
|
|
+ maps.put("V_end", map.get("yearmonthTo"));
|
|
|
+ maps.put("v_companyid", String.valueOf(BaseContextHolder.getCompanyId()));
|
|
|
+ receivablesdetailMapper.callcust(maps);
|
|
|
}
|
|
|
|
|
|
/* //设置默认分页
|
|
|
@@ -169,14 +200,14 @@ public class MoneyReportServiceImpl implements MoneyReportService {
|
|
|
}
|
|
|
}
|
|
|
} else if("payDetail".equals(type)){
|
|
|
- list = paydetailViewMapper.selectByCondition(con, companyId);
|
|
|
+ list = payablesdetailMapper.selectByCondition(con, companyId);
|
|
|
if (!StringUtils.isEmpty(calculateFieldsSql)) {
|
|
|
- res = paydetailViewMapper.selectCalculateFields(calculateFieldsSql, con, companyId);
|
|
|
+ res = payablesdetailMapper.selectCalculateFields(calculateFieldsSql, con, companyId);
|
|
|
}
|
|
|
}else if("recDetail".equals(type)){
|
|
|
- list = recdetailViewMapper.selectByCondition(con, companyId);
|
|
|
+ list = receivablesdetailMapper.selectByCondition(con, companyId);
|
|
|
if (!StringUtils.isEmpty(calculateFieldsSql)) {
|
|
|
- res = recdetailViewMapper.selectCalculateFields(calculateFieldsSql, con, companyId);
|
|
|
+ res = receivablesdetailMapper.selectCalculateFields(calculateFieldsSql, con, companyId);
|
|
|
}
|
|
|
}else if ("acountBalance".equals(type)){
|
|
|
list = acountbalanceViewMapper.selectByCondition(con, companyId);
|
|
|
@@ -271,23 +302,38 @@ public class MoneyReportServiceImpl implements MoneyReportService {
|
|
|
StringBuffer finalCondition = new StringBuffer();
|
|
|
for (int i = 0; i < jsonArray.size(); i++) {
|
|
|
JSONObject jsonObject = (JSONObject) jsonArray.get(i);
|
|
|
-//
|
|
|
-// String yearmonth = "yearmonth";
|
|
|
-// String yearmonthTo = "yearmonthTo";
|
|
|
-// if (st.equals("vend")){
|
|
|
-// yearmonth = "vm_" + yearmonth;
|
|
|
-// yearmonthTo = "vm_" + yearmonthTo;
|
|
|
-// }else if (st.equals("cust")){
|
|
|
-// yearmonth = "cm_" + yearmonth;
|
|
|
-// yearmonthTo = "cm_" + yearmonthTo;
|
|
|
-// }
|
|
|
+ String type = (String) jsonObject.get("type");
|
|
|
+ if ("date".equals(type)) {
|
|
|
String value = (String) jsonObject.get("value");
|
|
|
String[] arr = value.split(",");
|
|
|
map.put("yearmonth", arr[0]);
|
|
|
map.put("yearmonthTo", arr[1]);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
System.out.println("map:" + map);
|
|
|
return map;
|
|
|
}
|
|
|
+
|
|
|
+ public Map<String, String> getIdAndDate(String cons){
|
|
|
+ JSONArray jsonArray = JSONArray.parseArray(cons);
|
|
|
+ Map<String, String> map = new HashMap<>();
|
|
|
+ if (null != jsonArray && jsonArray.size() > 0) {
|
|
|
+ StringBuffer finalCondition = new StringBuffer();
|
|
|
+ for (int i = 0; i < jsonArray.size(); i++) {
|
|
|
+ JSONObject jsonObject = (JSONObject) jsonArray.get(i);
|
|
|
+ String type = (String) jsonObject.get("type");
|
|
|
+ if ("string".equals(type)){
|
|
|
+ String value = (String) jsonObject.get("value");
|
|
|
+ map.put("name", value);
|
|
|
+ }else if ("date".equals(type)){
|
|
|
+ String value = (String) jsonObject.get("value");
|
|
|
+ String[] arr = value.split(",");
|
|
|
+ map.put("yearmonth", arr[0]);
|
|
|
+ map.put("yearmonthTo", arr[1]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return map;
|
|
|
+ }
|
|
|
}
|