代码更新

This commit is contained in:
2022-09-30 15:19:09 +08:00
parent c96a961af3
commit 38b68fd258
7 changed files with 194 additions and 18 deletions

View File

@@ -93,7 +93,7 @@ public class DeviceBigScreenServiceImpl implements DeviceBigScreenService {
json.put("dept_name_jm", "0");
}
// 当前日期
json.put("device_date", run_date);
json.put("device_date", run_date.substring(5, 10));
resultArr.add(json);
}
@@ -298,8 +298,13 @@ public class DeviceBigScreenServiceImpl implements DeviceBigScreenService {
jsonObject.put("not_num", jsonObject.getString("need_num"));
// 完成率:已保养台数/需保养台数
String div = NumberUtil.div(jsonObject.getShort("end_num"), jsonObject.getShort("need_num")).toString();
jsonObject.put("confirm_rate", NumberUtil.round(NumberUtil.mul(div, "100"), 2));
try {
String div = NumberUtil.div(jsonObject.getShort("end_num"), jsonObject.getShort("need_num")).toString();
jsonObject.put("confirm_rate", NumberUtil.round(NumberUtil.mul(div, "100"), 2));
} catch (Exception e) {
jsonObject.put("confirm_rate", "0.0");
}
resultArr.add(jsonObject);
}
@@ -418,12 +423,17 @@ public class DeviceBigScreenServiceImpl implements DeviceBigScreenService {
String one_all_time = "0"; // 一台设备30天的维修时间
JSONArray jsonReArr = WQL.getWO("EM_DEVICEBIGSCREEN_03").addParamMap(map).process().getResultJSONArray(0);
for (int k = 0; k < jsonReArr.size(); k++) {
JSONObject jsonObject = jsonReArr.getJSONObject(k);
Object o = jsonReArr.get(k);
JSONObject jsonObject = JSONObject.parseObject(o.toString());
Date date_finish_time = DateUtil.parse(jsonObject.getString("finish_time")); // 报修完成时间
Date date_create_time = DateUtil.parse(jsonObject.getString("create_time")); // 报修时间
// 一台设备一天的维修时间
long one_day_time = DateUtil.between(date_create_time, date_finish_time, DateUnit.HOUR, false);
long one_day_time = 0;
try {
one_day_time = DateUtil.between(date_create_time, date_finish_time, DateUnit.HOUR, false);
} catch (Exception e) {
}
one_all_time = NumberUtil.add(one_all_time,String.valueOf(one_day_time)).toString();
}

View File

@@ -12,6 +12,7 @@ import com.alibaba.fastjson.JSON;
import lombok.RequiredArgsConstructor;
import org.nl.exception.BadRequestException;
import org.nl.modules.security.service.dto.JwtUserDto;
import org.nl.modules.system.service.DeptService;
import org.nl.modules.system.service.impl.ParamServiceImpl;
import org.nl.modules.system.util.CodeUtil;
import org.nl.utils.SpringContextHolder;
@@ -552,6 +553,7 @@ public class DevicerepairmstServiceImpl implements DevicerepairmstService {
JSONObject jsonMst = reMstTab.query("repair_id = '" + whereJson.getString("repair_id") + "'").uniqueResult(0);
jsonMst.put("invstatus", "05");
jsonMst.put("outsourceback_remark", whereJson.getString("outsourceback_remark"));
jsonMst.put("outsourceback_optid", currentUserId);
jsonMst.put("outsourceback_optname", nickName);
jsonMst.put("outsourceback_time", DateUtil.now());
@@ -996,6 +998,8 @@ public class DevicerepairmstServiceImpl implements DevicerepairmstService {
@Override
public Map<String, Object> query5(Map whereJson, Pageable page) {
DeptService deptService = SpringContextHolder.getBean(DeptService.class);
String device_code = MapUtil.getStr(whereJson, "device_code");
String repair_code = MapUtil.getStr(whereJson, "repair_code");
String maintenancecycle = MapUtil.getStr(whereJson, "maintenancecycle");
@@ -1022,6 +1026,12 @@ public class DevicerepairmstServiceImpl implements DevicerepairmstService {
String classIds = classstandardService.getAllChildIdStr(class_idStr);
map.put("classIds", classIds);
}
// 归属部门
String dept_id = MapUtil.getStr(whereJson, "dept_id");
if (!StrUtil.isEmpty(dept_id)) {
String deptIds = deptService.getChildIdStr(Long.parseLong(dept_id));
map.put("deptIds", deptIds);
}
JSONObject json = WQL.getWO("EM_BI_DEVICEREPAIR001").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "mst.input_time DESC");
return json;
}

View File

@@ -27,6 +27,7 @@
输入.sparepart_only_id TYPEAS s_string
输入.material_code TYPEAS s_string
输入.devicerecord_id TYPEAS s_string
输入.deptIds TYPEAS f_string
[临时表]
@@ -423,6 +424,10 @@
mst.plan_start_date <= 输入.end_time
ENDOPTION
OPTION 输入.deptIds <> ""
d2.dept_id in 输入.deptIds
ENDOPTION
ENDSELECT
ENDPAGEQUERY
ENDIF