服务指令-护理类非包每日生成数据池、工单测试

This commit is contained in:
曹磊 2026-01-19 16:35:00 +08:00
parent 24bc000f8d
commit 17133fffd6
3 changed files with 57 additions and 8 deletions

View File

@ -29,8 +29,6 @@ public class CareOrdersSubEntity implements Serializable {
private String orderNo;
/**主表id*/
private String mainId;
/**数据池子表ID*/
private String poolSubId;
/**护理单元id*/
private String nuId;
/**护理单元名称*/

View File

@ -36,8 +36,6 @@ public class DirectiveOrderSub implements Serializable {
private String orderType;
/**主表id*/
private String mainId;
/**数据池子表ID*/
private String poolSubId;
/**护理单元id*/
private String nuId;
/**护理单元名称*/

View File

@ -141,6 +141,25 @@ public class DirectiveOrderServiceImpl extends ServiceImpl<DirectiveOrderMapper,
orders.setServiceDuration(packageEntity.getServiceDuration());
orders.setTimeoutDuration(packageEntity.getTimeoutDuration());
}
//生成结束时间
String duration = orders.getServiceDuration();
Calendar c = Calendar.getInstance();
if(duration.equals("")||duration.equals("0")){
c.set(Calendar.YEAR,3000);
c.set(Calendar.MONTH,Calendar.DECEMBER);
c.set(Calendar.DAY_OF_MONTH,31);
c.set(Calendar.HOUR_OF_DAY,0);
c.set(Calendar.MINUTE,0);
c.set(Calendar.SECOND,0);
c.set(Calendar.MILLISECOND,0);
}else{
c.setTime(orders.getStartTime());
c.add(Calendar.MINUTE,Integer.valueOf(duration));
}
Date endTime = c.getTime();
orders.setEndTime(endTime);
getNetImages(orders);
String orderNo = getOrderNo(orders.getOrderType());
orders.setOrderNo(orderNo);
@ -162,7 +181,7 @@ public class DirectiveOrderServiceImpl extends ServiceImpl<DirectiveOrderMapper,
message.put("data", orders);//业务数据
String messageJson = message.toJSONString();
//发送给单个用户
sdWebsocket.sendMessage(orders.getEmployeeId(), messageJson);
// sdWebsocket.sendMessage(orders.getEmployeeId(), messageJson);
log.info("【ws消息推送】发送给用户 {}: {}", orders.getEmployeeId(), messageJson);
} catch (Exception e) {
log.error("ws发送消息失败", e);
@ -193,13 +212,23 @@ public class DirectiveOrderServiceImpl extends ServiceImpl<DirectiveOrderMapper,
for (int i = 0; i < ordersSubList.size(); i++) {
DirectiveOrderSub ordersSub = ordersSubList.get(i);
ordersSub.setOrderNo(getOrderSubNo(orders.getOrderNo()));
ordersSub.setOrderType(orders.getOrderType());
ordersSub.setMainId(orders.getId());
ordersSub.setNuId(orders.getNuId());
ordersSub.setNuName(orders.getNuName());
ordersSub.setElderId(orders.getElderId());
ordersSub.setElderName(orders.getElderName());
ordersSub.setEmployeeId(employee.getEmployeeId());
ordersSub.setEmployeeName(employee.getEmployeeName());
ordersSub.setCycleValue(orders.getCycleValue());
ordersSub.setIzPackage(orders.getIzPackage());
ordersSub.setStartTime(orders.getStartTime());
ordersSub.setEndTime(orders.getEndTime());
ordersSub.setOptType("1");
ordersSub.setIzStart("N");
ordersSub.setIzFinish("N");
ordersSub.setOptType("1");
ordersSub.setIzTimeout("N");
ordersSub.setDelFlag("0");
ordersSub.setOptIds(employee.getEmployeeId());
ordersSub.setOptNames(employee.getEmployeeName());
ordersSubService.save(ordersSub);//生成工单子表
@ -231,13 +260,27 @@ public class DirectiveOrderServiceImpl extends ServiceImpl<DirectiveOrderMapper,
for (int i = 0; i < ordersSubList.size(); i++) {
DirectiveOrderSub ordersSub = ordersSubList.get(i);
ordersSub.setOrderNo(getOrderSubNo(orders.getOrderNo()));
ordersSub.setOrderType(orders.getOrderType());
ordersSub.setMainId(orders.getId());
ordersSub.setNuId(orders.getNuId());
ordersSub.setNuName(orders.getNuName());
ordersSub.setElderId(orders.getElderId());
ordersSub.setElderName(orders.getElderName());
ordersSub.setEmployeeId(employee.getEmployeeId());
ordersSub.setEmployeeName(employee.getEmployeeName());
ordersSub.setCycleValue(orders.getCycleValue());
ordersSub.setIzPackage(orders.getIzPackage());
if(!orders.getIzPackage().equals("N")){
ordersSub.setPackageId(orders.getDirectiveId());
ordersSub.setPackageName(orders.getDirectiveName());
}
ordersSub.setStartTime(orders.getStartTime());
ordersSub.setEndTime(orders.getEndTime());
ordersSub.setOptType("1");
ordersSub.setIzStart("N");
ordersSub.setIzFinish("N");
ordersSub.setOptType("1");
ordersSub.setIzTimeout("N");
ordersSub.setDelFlag("0");
ordersSub.setOptIds(employee.getEmployeeId());
ordersSub.setOptNames(employee.getEmployeeName());
ordersSubService.save(ordersSub);//生成工单子表
@ -707,6 +750,11 @@ public class DirectiveOrderServiceImpl extends ServiceImpl<DirectiveOrderMapper,
if(orders.getIzPackage().equals("N")){
//获取服务指令
DirectiveOrder directiveEntity = baseMapper.getDirectiveById(orders);
if(directiveEntity==null){
map.put("success", false);
map.put("message", "服务指令无效");
return map;
}
orders.setDirectiveName(directiveEntity.getDirectiveName());
orders.setPreviewFile(directiveEntity.getPreviewFile());
orders.setPreviewFileSmall(directiveEntity.getPreviewFileSmall());
@ -718,13 +766,18 @@ public class DirectiveOrderServiceImpl extends ServiceImpl<DirectiveOrderMapper,
}else{
//获取服务指令包
DirectiveOrder packageEntity = baseMapper.getPackageById(orders);
if(packageEntity==null){
map.put("success", false);
map.put("message", "服务指令包无效");
return map;
}
orders.setDirectiveName(packageEntity.getDirectiveName());
orders.setServiceContent(packageEntity.getServiceContent());
orders.setServiceDuration(packageEntity.getServiceDuration());
orders.setTimeoutDuration(packageEntity.getTimeoutDuration());
}
//需改造
//生成结束时间
String duration = orders.getServiceDuration();
if(duration.equals("")||duration.equals("0")){
c.set(Calendar.YEAR,3000);