|
@@ -1132,16 +1132,142 @@ public class SikuServiceImpl implements SikuService {
|
|
|
|
|
|
|
|
|
|
|
|
|
Map result = MkBxUtil.receiveReimburse(body);
|
|
Map result = MkBxUtil.receiveReimburse(body);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return McR.success();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public McR checkBudgetAmt(Map map) {
|
|
|
|
|
+ String projectCode = UtilMap.getString(map, "projectCode");
|
|
|
|
|
+ long ldqssj = UtilMap.getLong(map, "ldqssj");//落地起始时间
|
|
|
|
|
+
|
|
|
|
|
+ //落地起始时间在几月份
|
|
|
|
|
+ Calendar calendar = Calendar.getInstance();
|
|
|
|
|
+ calendar.setTimeInMillis(ldqssj);
|
|
|
|
|
+ int month = calendar.get(Calendar.MONTH) + 1;
|
|
|
|
|
+
|
|
|
|
|
+ List<Map> list = UtilMap.getList(map, "list");
|
|
|
|
|
+
|
|
|
|
|
+ List<String> subjectCodeList = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
+ Map<String,Double> cgmxMap = new HashMap();
|
|
|
|
|
+ for (Map map1 : list) {
|
|
|
|
|
+ Double jscb = UtilMap.getDouble(map1, "numberField_mkkmij5e");//结算成本
|
|
|
|
|
+ String subjectCode = UtilMap.getString(map1, "textField_mn8nhpnz");//预算科目编号
|
|
|
|
|
+ subjectCodeList.add(subjectCode);
|
|
|
|
|
+
|
|
|
|
|
+ if (cgmxMap.containsKey(subjectCode)){
|
|
|
|
|
+ cgmxMap.put(subjectCode,UtilMap.getDouble(cgmxMap,subjectCode) + jscb);
|
|
|
|
|
+ }else {
|
|
|
|
|
+ cgmxMap.put(subjectCode,jscb);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ Map body = new HashMap();
|
|
|
|
|
+ body.put("budgetPlanBizCode","全面预算");//预算方案编码
|
|
|
|
|
+ body.put("budgetOrgBizCodes",Arrays.asList(projectCode));//预算组织编码
|
|
|
|
|
+ body.put("budgetSubjectBizCodes",subjectCodeList);//预算科目编码
|
|
|
|
|
+ body.put("pageNum",1);
|
|
|
|
|
+ body.put("pageSize",50);
|
|
|
|
|
+
|
|
|
|
|
+ List<Map> budgetList = MkBxUtil.budgetInfo(body);
|
|
|
|
|
+ boolean flag = true;
|
|
|
|
|
+ StringBuilder errorMsg = new StringBuilder();
|
|
|
|
|
+
|
|
|
|
|
+ for (Map budget : budgetList) {
|
|
|
|
|
+ String subjectCode = UtilMap.getString(budget, "subjectBizCode");
|
|
|
|
|
+ String subjectName = UtilMap.getString(budget, "subjectName");
|
|
|
|
|
+ List<Map> budgetUnits = UtilMap.getList(budget, "budgetUnits");
|
|
|
|
|
+
|
|
|
|
|
+ for (Map budgetUnit : budgetUnits) {
|
|
|
|
|
+ int periodNum = UtilMap.getInt(budgetUnit, "periodNum");
|
|
|
|
|
+
|
|
|
|
|
+ if (periodNum == month) {
|
|
|
|
|
+ Double usableAmount = UtilMap.getDouble(budgetUnit, "usableAmount");
|
|
|
|
|
+
|
|
|
|
|
+ Double jscb = cgmxMap.get(subjectCode);
|
|
|
|
|
+ if (jscb > usableAmount) {
|
|
|
|
|
+ flag = false;
|
|
|
|
|
+ errorMsg.append("[").append(subjectName).append("]预算金额不足,剩余可用预算金额[").append(usableAmount).append("];");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ Map result = new HashMap();
|
|
|
|
|
+ result.put("flag",flag);
|
|
|
|
|
+ result.put("errorMsg", errorMsg.toString());
|
|
|
|
|
|
|
|
|
|
+ return McR.success(result);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void updateBudget(Map map) {
|
|
|
|
|
+ String formInstId = UtilMap.getString(map, "formInstId");
|
|
|
|
|
+ String type = UtilMap.getString(map, "type");
|
|
|
|
|
|
|
|
|
|
+ Map formData = ydClient.queryData(YDParam.builder()
|
|
|
|
|
+ .formInstanceId(formInstId).build(), YDConf.FORM_QUERY.retrieve_id).getFormData();
|
|
|
|
|
+
|
|
|
|
|
+ String projectCode = UtilMap.getString(formData, "textField_mmoh6nvx");
|
|
|
|
|
+
|
|
|
|
|
+ long ldqssj = UtilMap.getLong(formData, "dateField_mkdf8q8p");
|
|
|
|
|
+
|
|
|
|
|
+ //落地起始时间在几月份
|
|
|
|
|
+ Calendar calendar = Calendar.getInstance();
|
|
|
|
|
+ calendar.setTimeInMillis(ldqssj);
|
|
|
|
|
+ int month = calendar.get(Calendar.MONTH) + 1;
|
|
|
|
|
+
|
|
|
|
|
+ Map body = new HashMap();
|
|
|
|
|
+ body.put("budgetPlanBizCode","全面预算");
|
|
|
|
|
+ body.put("increment",false);
|
|
|
|
|
+ body.put("onlyError",false);
|
|
|
|
|
+
|
|
|
|
|
+ List<Map> budgets = new ArrayList<>();
|
|
|
|
|
+
|
|
|
|
|
+ if ("冻结".equals(type)){
|
|
|
|
|
+ //客户报价(汇总)
|
|
|
|
|
+ List<Map> list = UtilMap.getList(formData, "tableField_mmveqhwl");
|
|
|
|
|
+
|
|
|
|
|
+ for (Map map1 : list) {
|
|
|
|
|
+ Map budget = new HashMap();
|
|
|
|
|
+ budget.put("budgetOrgBizCode",projectCode);
|
|
|
|
|
+ budget.put("budgetSubjectBizCode",UtilMap.getString(map1, "textField_mmvgh1zv"));
|
|
|
|
|
+
|
|
|
|
|
+ Map budgetUnit = new HashMap();
|
|
|
|
|
+ budgetUnit.put("periodNum",month);
|
|
|
|
|
+ budgetUnit.put("budgetAmount",0);//置零 相当于冻结
|
|
|
|
|
+ budget.put("budgetUnits",Arrays.asList(budgetUnit));
|
|
|
|
|
+
|
|
|
|
|
+ budgets.add(budget);
|
|
|
|
|
+ }
|
|
|
|
|
+ }else {
|
|
|
|
|
+ //释放
|
|
|
|
|
+ //客户报价(汇总对照)
|
|
|
|
|
+ List<Map> list = UtilMap.getList(formData, "tableField_mncsu1ef");
|
|
|
|
|
+
|
|
|
|
|
+ for (Map map1 : list) {
|
|
|
|
|
+ Map budget = new HashMap();
|
|
|
|
|
+ budget.put("budgetOrgBizCode",projectCode);
|
|
|
|
|
+ budget.put("budgetSubjectBizCode",UtilMap.getString(map1, "textField_mncsu1ee"));
|
|
|
|
|
+ Double amt = UtilMap.getDouble(map1, "numberField_mncsu1ea");
|
|
|
|
|
+
|
|
|
|
|
+ Map budgetUnit = new HashMap();
|
|
|
|
|
+ budgetUnit.put("periodNum",month);
|
|
|
|
|
+ budgetUnit.put("budgetAmount",amt);
|
|
|
|
|
+ budget.put("budgetUnits",Arrays.asList(budgetUnit));
|
|
|
|
|
+
|
|
|
|
|
+ budgets.add(budget);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ body.put("budgets",budgets);
|
|
|
|
|
+ MkBxUtil.batchBudget(body);
|
|
|
|
|
|
|
|
- return McR.success();
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//文件下载到本地
|
|
//文件下载到本地
|