|
@ -137,26 +137,34 @@ public class RehabilitationPlanController extends EnvelopRestEndpoint {
|
|
|
@RequestParam(value = "rehabilitationPlan", required = true)String rehabilitationPlan){
|
|
|
try {
|
|
|
JSONObject json = new JSONObject(rehabilitationPlan);
|
|
|
json.put("totalExpense", DataUtils.doubleToInt(json.getDouble("totalExpense")));
|
|
|
if(json.has("totalExpense")) {
|
|
|
json.put("totalExpense", DataUtils.doubleToInt(json.getDouble("totalExpense")));
|
|
|
}
|
|
|
JSONArray array = new JSONArray();
|
|
|
for(Object planDetail : json.getJSONArray("detail")) {
|
|
|
JSONObject j = (JSONObject)planDetail;
|
|
|
String executeTime = j.get("executeTime").toString();
|
|
|
String[] result = null;
|
|
|
if(executeTime.contains(",")){
|
|
|
result = executeTime.split(",");
|
|
|
if(j.has("executeTime")) {
|
|
|
String executeTime = j.get("executeTime").toString();
|
|
|
String[] result = null;
|
|
|
if (executeTime.contains(",")) {
|
|
|
result = executeTime.split(",");
|
|
|
} else {
|
|
|
result = new String[1];
|
|
|
result[0] = executeTime;
|
|
|
}
|
|
|
int len = result.length;
|
|
|
while (len > 0) {
|
|
|
len--;
|
|
|
JSONObject temp = new JSONObject(j.toString());
|
|
|
temp.put("executeTime", result[len]);
|
|
|
temp.put("createUser", json.get("createUser"));
|
|
|
temp.put("createUserName", json.get("createUserName"));
|
|
|
array.put(temp);
|
|
|
}
|
|
|
}else {
|
|
|
result = new String[1];
|
|
|
result[0] = executeTime;
|
|
|
}
|
|
|
int len = result.length;
|
|
|
while(len > 0){
|
|
|
len --;
|
|
|
JSONObject temp = new JSONObject(j.toString());
|
|
|
temp.put("executeTime", result[len]);
|
|
|
temp.put("createUser", json.get("createUser"));
|
|
|
temp.put("createUserName", json.get("createUserName"));
|
|
|
array.put(temp);
|
|
|
j.put("createUser", json.get("createUser"));
|
|
|
j.put("createUserName", json.get("createUserName"));
|
|
|
array.put(j);
|
|
|
}
|
|
|
}
|
|
|
String planDetails = array.toString();
|