pad接口调整:

1、pad首页工单查询
2、服务指令集查询
3、开始工单调整
This commit is contained in:
1378012178@qq.com 2026-03-27 17:12:53 +08:00
parent 49d3a12259
commit 1db4c6c6ee
9 changed files with 479 additions and 323 deletions

View File

@ -39,18 +39,16 @@ public class ServiceOrderApi {
/**
* todo 改成服务指令集
* 返回服务指令集详细信息
*
* @param directiveOrderInfoEntity
* @param req
* @return
*/
@ApiOperation(value = "服务指令工单-查询工单详细信息", notes = "服务指令工单-查询工单详细信息")
@GetMapping(value = "/queryOrderInfoList")
public Result<List<DirectiveOrderInfoEntity>> queryOrderInfoList(DirectiveOrderInfoEntity directiveOrderInfoEntity, HttpServletRequest req) {
if(StringUtils.isBlank(directiveOrderInfoEntity.getMainId())){
return Result.error("请选择工单");
}
List<DirectiveOrderInfoEntity> pageList = directiveOrderApi.queryOrderInfoList(directiveOrderInfoEntity,req);
public Result<List<DirectiveOrderEntity>> queryOrderInfoList(DirectiveOrderEntity directiveOrderInfoEntity, HttpServletRequest req) {
List<DirectiveOrderEntity> pageList = directiveOrderApi.queryOrderInfoList(directiveOrderInfoEntity,req);
return Result.OK(pageList);
}

View File

@ -180,4 +180,148 @@ public class DirectiveOrderEntity implements Serializable {
/**所属部门*/
private String sysOrgCode;
/**
* 长者体型标签ID多个逗号分隔
*/
private String bodyTagIds;
/**
* 长者体型标签名称多个逗号分隔
*/
private String bodyTagNames;
/**
* 长者体型标签价格多个逗号分隔
*/
private String bodyTagPrice;
/**
* 长者情绪标签ID多个逗号分隔
*/
private String emotionTagIds;
/**
* 长者情绪标签名称多个逗号分隔
*/
private String emotionTagNames;
/**
* 长者情绪标签价格多个逗号分隔
*/
private String emotionTagPrice;
/**
* 实际执行员工ID多个逗号分隔 主要执行人+协助人
*/
private String employeeIds;
/**
* 实际执行员工姓名多个逗号分隔 主要执行人+协助人
*/
private String employeeNames;
/**
* 服务属性 ds定时 js计时
*/
private String serviceAttribute;
/**
* 服务预计开始时间
*/
private Date servStartTime;
/**
* 服务预计结束时间
*/
private Date servEndTime;
/**
* 员工预计开始时间
*/
private Date empStartTime;
/**
* 员工预计结束时间
*/
private Date empEndTime;
/**
* 服务工单预计开始时间
*/
private Date orderStartTime;
/**
* 服务工单预计结束时间
*/
private Date orderEndTime;
/**
* 工单执行状态0待执行1服务中2正常完成3超时完成 4未执行
*/
private String orderStatus;
/**
* tplink网络地址多个逗号分隔
*/
private String tplinkPath;
/**
* tplink监控视频上传任务ID
*/
private String tplinkTaskId;
/**
* tplink监控视频上传进度(千分制
*/
private String tplinkrocess;
/**
* tplink切片md5
*/
private String tplinkMd5;
/**
* tplink进度查询返回的状态码
*/
private String tplinkResultCode;
/**
* tplink切片下载次数次数到达乏值 - 系统参数 且没有 order_end_time 代表彻底失败
*/
private String tplinkDownCount;
/**
* 接单上限
*/
@TableField(exist = false)
private Integer orderCap;
/**
* 最大时间
*/
@TableField(exist = false)
private Date maxTime;
/**
* 单次
*/
@TableField(exist = false)
private Integer orderNum;
/**
* 总服务时长
*/
@TableField(exist = false)
private Integer totalDuration;
/**
* 总服务收益
*/
@TableField(exist = false)
private BigDecimal totalComPrice;
/**
* 是否空闲 1空闲 0非空闲
*/
@TableField(exist = false)
private Integer izFree;
/**
* 员工身上挂载的工单数未完成工单即为挂单
*/
@TableField(exist = false)
private Integer ownCn;
/**
* 服务指令id集合逗号分隔
*/
@TableField(exist = false)
private String directiveIds;
/**
* 优先级 数值越高优先级越高
*/
//空闲状态提高3级 指定护理员提高2级
@TableField(exist = false)
private Integer level;
@TableField(exist = false)
private String tableName;//表名字
/**
* 基础价格
*/
@TableField(exist = false)
private java.math.BigDecimal totalPrice;
}

View File

@ -31,7 +31,7 @@ public interface IDirectiveOrderApi {
IPage<DirectiveOrderEntity> queryOrderList(Integer pageNo, Integer pageSize, DirectiveOrderEntity directiveOrderEntity, HttpServletRequest req);
List<DirectiveOrderInfoEntity> queryOrderInfoList(DirectiveOrderInfoEntity directiveOrderInfoEntity, HttpServletRequest req);
List<DirectiveOrderEntity> queryOrderInfoList(DirectiveOrderEntity directiveOrderInfoEntity, HttpServletRequest req);
Map<String, Object> editSubMp4(DirectiveOrderEntity directiveOrderEntity);

View File

@ -216,7 +216,7 @@ public class DirectiveOrder implements Serializable {
/**
* tplink监控视频上传进度(千分制
*/
private String tplinkrocess;
private String tplinkProcess;
/**
* tplink切片md5
*/

View File

@ -3,6 +3,8 @@ package com.nu.modules.biz.order.mapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.nu.entity.DirectiveOrderEntity;
import com.nu.entity.DirectiveOrderInfoEntity;
import com.nu.modules.biz.order.entity.DirectiveOrderInfo;
import org.apache.ibatis.annotations.Param;
@ -18,5 +20,5 @@ public interface DirectiveOrderInfoMapper extends BaseMapper<DirectiveOrderInfo>
List<DirectiveOrderInfo> getDirectiveList(@Param("directiveId") String directiveId);
List<DirectiveOrderInfo> getSubDirectiveList(@Param("packageId") String packageId);
List<DirectiveOrderInfo> queryOrderInfoList(@Param(Constants.WRAPPER) QueryWrapper<DirectiveOrderInfo> queryWrapper);
List<DirectiveOrderEntity> queryOrderInfoList(@Param("dto") DirectiveOrderEntity queryWrapper);
}

View File

@ -1,6 +1,9 @@
package com.nu.modules.biz.order.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nu.entity.CareDirectiveEntity;
import com.nu.entity.DirectiveOrderEntity;
import com.nu.entity.DirectiveOrderInfoEntity;
@ -44,4 +47,7 @@ public interface DirectiveOrderMapper extends BaseMapper<DirectiveOrder> {
DirectiveOrder getPackageById(DirectiveOrder orders);
DirectiveOrder getEmployeeById(@Param("employeeId") String employeeId);
IPage<DirectiveOrderEntity> queryOrderList(Page<DirectiveOrder> page,
@Param("entity") DirectiveOrderEntity entity);
}

View File

@ -3,54 +3,52 @@
<mapper namespace="com.nu.modules.biz.order.mapper.DirectiveOrderInfoMapper">
<select id="getDirectiveList" resultType="com.nu.modules.biz.order.entity.DirectiveOrderInfo">
select
a.instruction_tag_id as instructionTagId,
b.instruction_name as instructionTagName,
a.category_id as categoryId,
c.category_name AS categoryName,
a.type_id as typeId,
d.type_name as typeName,
a.id as directiveId,
a.directive_name as directiveName,
a.preview_file as previewFile,
a.preview_file_small as previewFileSmall,
a.mp3_file as mp3File,
a.mp4_file as mp4File,
a.service_duration as serviceDuration,
a.service_content as serviceContent,
a.timeout_duration as timeoutDuration
select a.instruction_tag_id as instructionTagId,
b.instruction_name as instructionTagName,
a.category_id as categoryId,
c.category_name AS categoryName,
a.type_id as typeId,
d.type_name as typeName,
a.id as directiveId,
a.directive_name as directiveName,
a.preview_file as previewFile,
a.preview_file_small as previewFileSmall,
a.mp3_file as mp3File,
a.mp4_file as mp4File,
a.service_duration as serviceDuration,
a.service_content as serviceContent,
a.timeout_duration as timeoutDuration
from nu_config_service_directive a
left join nu_config_service_instruction_tag b on a.instruction_tag_id = b.id
left join nu_config_service_category c on a.category_id = c.id
left join nu_config_service_type d on a.type_id = d.id
left join nu_config_service_instruction_tag b on a.instruction_tag_id = b.id
left join nu_config_service_category c on a.category_id = c.id
left join nu_config_service_type d on a.type_id = d.id
where a.id = #{directiveId}
and a.del_flag = '0'
and a.iz_enabled = 'Y'
</select>
<select id="getSubDirectiveList" resultType="com.nu.modules.biz.order.entity.DirectiveOrderInfo">
SELECT
b.instruction_tag_id AS instructionTagId,
e.instruction_name AS instructionTagName,
b.category_id AS categoryId,
c.category_name AS categoryName,
b.type_id AS typeId,
d.type_name AS typeName,
b.id AS directiveId,
b.directive_name AS directiveName,
b.preview_file AS previewFile,
b.preview_file_small AS previewFileSmall,
b.mp3_file AS mp3File,
b.mp4_file AS mp4File,
b.service_duration AS serviceDuration,
b.service_content AS serviceContent,
b.timeout_duration AS timeoutDuration
SELECT b.instruction_tag_id AS instructionTagId,
e.instruction_name AS instructionTagName,
b.category_id AS categoryId,
c.category_name AS categoryName,
b.type_id AS typeId,
d.type_name AS typeName,
b.id AS directiveId,
b.directive_name AS directiveName,
b.preview_file AS previewFile,
b.preview_file_small AS previewFileSmall,
b.mp3_file AS mp3File,
b.mp4_file AS mp4File,
b.service_duration AS serviceDuration,
b.service_content AS serviceContent,
b.timeout_duration AS timeoutDuration
FROM nu_config_directive_package_main p
INNER JOIN nu_config_directive_package_item a ON p.id = a.package_id
LEFT JOIN nu_config_service_directive b ON a.directive_id = b.id
LEFT JOIN nu_config_service_category c ON b.category_id = c.id
LEFT JOIN nu_config_service_type d ON b.type_id = d.id
LEFT JOIN nu_config_service_instruction_tag e ON b.instruction_tag_id = e.id
INNER JOIN nu_config_directive_package_item a ON p.id = a.package_id
LEFT JOIN nu_config_service_directive b ON a.directive_id = b.id
LEFT JOIN nu_config_service_category c ON b.category_id = c.id
LEFT JOIN nu_config_service_type d ON b.type_id = d.id
LEFT JOIN nu_config_service_instruction_tag e ON b.instruction_tag_id = e.id
where a.package_id = #{packageId}
and p.del_flag = '0'
and p.iz_enabled = 'Y'
@ -59,9 +57,13 @@
</select>
<select id="queryOrderInfoList" resultType="com.nu.modules.biz.order.entity.DirectiveOrderInfo">
select a.*,b.immediate_file,b.immediate_file_focus from nu_biz_nu_directive_order_info a left join nu_config_service_directive b on a.directive_id = b.id
${ew.customSqlSegment}
<select id="queryOrderInfoList" resultType="com.nu.entity.DirectiveOrderEntity">
select a.*, b.immediate_file, b.immediate_file_focus
from nu_biz_directive_order a
left join nu_config_service_directive b on a.directive_id = b.id
where a.nu_id = #{dto.nuId}
and a.instruction_id = #{dto.instructionTagId}
and a.serv_start_time = #{dto.servStartTime}
</select>
</mapper>

View File

@ -22,13 +22,13 @@
<result column="cycle_type" property="cycleType"/>
<result column="cycle_value" property="cycleValue"/>
<result column="preview_file" property="previewFile"/>
<!-- <result column="net_preview_file" property="netPreviewFile"/>-->
<!-- <result column="net_preview_file" property="netPreviewFile"/>-->
<result column="preview_file_small" property="previewFileSmall"/>
<!-- <result column="net_preview_file_small" property="netPreviewFileSmall"/>-->
<!-- <result column="net_preview_file_small" property="netPreviewFileSmall"/>-->
<result column="mp3_file" property="mp3File"/>
<!-- <result column="net_mp3_file" property="netMp3File"/>-->
<!-- <result column="net_mp3_file" property="netMp3File"/>-->
<result column="mp4_file" property="mp4File"/>
<!-- <result column="net_mp4_file" property="netMp4File"/>-->
<!-- <result column="net_mp4_file" property="netMp4File"/>-->
<result column="service_duration" property="serviceDuration"/>
<result column="service_content" property="serviceContent"/>
<result column="package_id" property="packageId"/>
@ -80,13 +80,13 @@
<result column="sub_cycle_type" property="cycleType"/>
<result column="sub_cycle_value" property="cycleValue"/>
<result column="sub_preview_file" property="previewFile"/>
<!-- <result column="sub_net_preview_file" property="netPreviewFile"/>-->
<!-- <result column="sub_net_preview_file" property="netPreviewFile"/>-->
<result column="sub_preview_file_small" property="previewFileSmall"/>
<!-- <result column="sub_net_preview_file_small" property="netPreviewFileSmall"/>-->
<!-- <result column="sub_net_preview_file_small" property="netPreviewFileSmall"/>-->
<result column="sub_mp3_file" property="mp3File"/>
<!-- <result column="sub_net_mp3_file" property="netMp3File"/>-->
<!-- <result column="sub_net_mp3_file" property="netMp3File"/>-->
<result column="sub_mp4_file" property="mp4File"/>
<!-- <result column="sub_net_mp4_file" property="netMp4File"/>-->
<!-- <result column="sub_net_mp4_file" property="netMp4File"/>-->
<result column="sub_service_duration" property="serviceDuration"/>
<result column="sub_service_content" property="serviceContent"/>
<result column="sub_toll_price" property="tollPrice"/>
@ -113,99 +113,97 @@
</resultMap>
<select id="queryDataPoolList" resultType="com.nu.modules.biz.order.entity.DirectiveOrder">
select
a.id as poolId,
a.pool_type as orderType,
a.biz_id as bizId,
a.nu_id as nuId,
b.nu_name as nuName,
c.id as elderId,
c.name as elderName,
a.directive_id as directiveId,
a.cycle_type_id as cycleTypeId,
d.item_text as cycleType,
a.cycle_value as cycleValue,
a.iz_package as izPackage,
a.start_time as startTime,
(case when c.orderly is null then 2 else 1 end) as orderEmp
select a.id as poolId,
a.pool_type as orderType,
a.biz_id as bizId,
a.nu_id as nuId,
b.nu_name as nuName,
c.id as elderId,
c.name as elderName,
a.directive_id as directiveId,
a.cycle_type_id as cycleTypeId,
d.item_text as cycleType,
a.cycle_value as cycleValue,
a.iz_package as izPackage,
a.start_time as startTime,
(case when c.orderly is null then 2 else 1 end) as orderEmp
from nu_biz_nu_directive_data_pool a
inner join nu_base_info b on a.nu_id = b.nu_id and b.del_flag = '0'
left join nu_biz_elder_info c on b.elder_id = c.id and c.del_flag = '0'
left join view_sys_dict d on a.cycle_type_id = d.item_value and d.dict_code = 'period_type'
inner join nu_base_info b on a.nu_id = b.nu_id and b.del_flag = '0'
left join nu_biz_elder_info c on b.elder_id = c.id and c.del_flag = '0'
left join view_sys_dict d on a.cycle_type_id = d.item_value and d.dict_code = 'period_type'
where a.iz_orders = 'N'
order by a.start_time,orderEmp,a.nu_id
order by a.start_time, orderEmp, a.nu_id
</select>
<select id="queryDataPoolListBak" resultType="com.nu.modules.biz.order.entity.DirectiveOrder">
select
a.id as poolId,
a.pool_type as orderType,
a.biz_id as bizId,
a.nu_id as nuId,
a.nu_name as nuName,
a.elder_id as elderId,
a.elder_name as elderName,
a.directive_id as directiveId,
a.directive_name as directiveName,
a.cycle_type_id as cycleTypeId,
a.cycle_type as cycleType,
a.cycle_value as cycleValue,
a.preview_file as previewFile,
select a.id as poolId,
a.pool_type as orderType,
a.biz_id as bizId,
a.nu_id as nuId,
a.nu_name as nuName,
a.elder_id as elderId,
a.elder_name as elderName,
a.directive_id as directiveId,
a.directive_name as directiveName,
a.cycle_type_id as cycleTypeId,
a.cycle_type as cycleType,
a.cycle_value as cycleValue,
a.preview_file as previewFile,
-- a.net_preview_file as netPeviewFile,
a.preview_file_small as previewFileSmall,
a.preview_file_small as previewFileSmall,
-- a.net_preview_file_small as netPreviewFileSmall,
a.mp3_file as mp3File,
a.mp3_file as mp3File,
-- a.net_mp3_file as netMp3File,
a.mp4_file as mp4File,
a.mp4_file as mp4File,
-- a.net_mp4_file as netMp4File,
a.service_duration as serviceDuration,
a.service_content as serviceContent,
a.package_id as packageId,
a.package_name as packageName,
a.iz_package as izPackage,
a.start_time as startTime,
a.end_time as endTime,
(case when b.orderly is null then 2 else 1 end) as orderEmp
a.service_duration as serviceDuration,
a.service_content as serviceContent,
a.package_id as packageId,
a.package_name as packageName,
a.iz_package as izPackage,
a.start_time as startTime,
a.end_time as endTime,
(case when b.orderly is null then 2 else 1 end) as orderEmp
from nu_biz_nu_directive_data_pool a
left join nu_biz_elder_info b on a.elder_id = b.id
left join nu_biz_elder_info b on a.elder_id = b.id
where a.iz_orders = 'N'
order by a.start_time,orderEmp,a.nu_id
order by a.start_time, orderEmp, a.nu_id
</select>
<select id="getEmpPermissionAndOnline" resultType="com.nu.modules.biz.order.entity.DirectiveOrder">
select
distinct
a.id as employeeId,
a.name as employeeName,
a.order_cap as orderCap,
ifnull(e.orderNum,0) as orderNum,
ifnull(e.totalDuration,0) as totalDuration,
ifnull(e.totalComPrice,0) as totalComPrice,
e.maxTime,
ifnull(e.ownCn,0) as ownCn,
(case when ifnull(f.orderNum,0) = 0 then 1 else 0 end) as izFree,
0 as level
distinct
a.id as employeeId,
a.name as employeeName,
a.order_cap as orderCap,
ifnull(e.orderNum,0) as orderNum,
ifnull(e.totalDuration,0) as totalDuration,
ifnull(e.totalComPrice,0) as totalComPrice,
e.maxTime,
ifnull(e.ownCn,0) as ownCn,
(case when ifnull(f.orderNum,0) = 0 then 1 else 0 end) as izFree,
0 as level
from nu_biz_employees_info a
inner join nu_biz_employees_service_tags b on a.id = b.employees_id
inner join nu_service_tag_main c on c.id = b.tags_id
inner join nu_service_tag_info d on d.tag_id = c.id
left join (
select employee_id,count(*) as orderNum,
sum(service_duration) as totalDuration,
round(sum(ifnull(com_price,0)),4) as totalComPrice,
max(start_time) as maxTime,
sum(case when iz_finish='N' then 1 else 0 end) as ownCn
from nu_biz_nu_directive_order_info
where start_time >=DATE_FORMAT(NOW(), '%Y-%m-%d 00:00:00')
and start_time &lt;=DATE_FORMAT(NOW(), '%Y-%m-%d 23:59:59')
group by employee_id
select employee_id,count(*) as orderNum,
sum(service_duration) as totalDuration,
round(sum(ifnull(com_price,0)),4) as totalComPrice,
max(start_time) as maxTime,
sum(case when iz_finish='N' then 1 else 0 end) as ownCn
from nu_biz_nu_directive_order_info
where start_time >=DATE_FORMAT(NOW(), '%Y-%m-%d 00:00:00')
and start_time &lt;=DATE_FORMAT(NOW(), '%Y-%m-%d 23:59:59')
group by employee_id
) e on a.id = e.employee_id
left join (
select employee_id,sum(case when iz_finish='N' then 1 else 0 end) as orderNum
from nu_biz_nu_directive_order_info
where start_time = #{startTime}
or (start_time &lt; #{startTime} and end_time > #{startTime})
group by employee_id
select employee_id,sum(case when iz_finish='N' then 1 else 0 end) as orderNum
from nu_biz_nu_directive_order_info
where start_time = #{startTime}
or (start_time &lt; #{startTime} and end_time > #{startTime})
group by employee_id
) f on a.id = f.employee_id
where a.del_flag = '0'
and a.iz_freeze = 'N'
@ -342,61 +340,62 @@
o.iz_timeout,
o.opt_ids,
o.opt_names,
mainStatus.item_text as optTypeName,
s.id as sub_id,
s.order_type as sub_order_type,
s.main_id as sub_main_id,
s.nu_id as sub_nu_id,
s.nu_name as sub_nu_name,
s.elder_id as sub_elder_id,
s.elder_name as sub_elder_name,
s.employee_id as sub_employee_id,
s.employee_name as sub_employee_name,
s.instruction_tag_id as sub_instruction_tag_id,
s.instruction_tag_name as sub_instruction_tag_name,
s.category_id as sub_category_id,
s.category_name as sub_category_name,
s.type_id as sub_type_id,
s.type_name as sub_type_name,
s.directive_id as sub_directive_id,
s.directive_name as sub_directive_name,
s.cycle_type_id as sub_cycle_type_id,
s.cycle_type as sub_cycle_type,
s.cycle_value as sub_cycle_value,
s.preview_file as sub_preview_file,
mainStatus.item_text as optTypeName,
s.id as sub_id,
s.order_type as sub_order_type,
s.main_id as sub_main_id,
s.nu_id as sub_nu_id,
s.nu_name as sub_nu_name,
s.elder_id as sub_elder_id,
s.elder_name as sub_elder_name,
s.employee_id as sub_employee_id,
s.employee_name as sub_employee_name,
s.instruction_tag_id as sub_instruction_tag_id,
s.instruction_tag_name as sub_instruction_tag_name,
s.category_id as sub_category_id,
s.category_name as sub_category_name,
s.type_id as sub_type_id,
s.type_name as sub_type_name,
s.directive_id as sub_directive_id,
s.directive_name as sub_directive_name,
s.cycle_type_id as sub_cycle_type_id,
s.cycle_type as sub_cycle_type,
s.cycle_value as sub_cycle_value,
s.preview_file as sub_preview_file,
-- s.net_preview_file as sub_net_preview_file,
s.preview_file_small as sub_preview_file_small,
s.preview_file_small as sub_preview_file_small,
-- s.net_preview_file_small as sub_net_preview_file_small,
s.mp3_file as sub_mp3_file,
s.mp3_file as sub_mp3_file,
-- s.net_mp3_file as sub_net_mp3_file,
s.mp4_file as sub_mp4_file,
s.mp4_file as sub_mp4_file,
-- s.net_mp4_file as sub_net_mp4_file,
s.service_duration as sub_service_duration,
s.service_content as sub_service_content,
s.toll_price as sub_toll_price,
s.com_price as sub_com_price,
s.real_com_price as sub_real_com_price,
s.package_id as sub_package_id,
s.package_name as sub_package_name,
s.iz_package as sub_iz_package,
s.start_time as sub_start_time,
s.end_time as sub_end_time,
s.begin_time as sub_begin_time,
s.finish_time as sub_finish_time,
s.iz_start as sub_iz_start,
s.iz_finish as sub_iz_finish,
s.create_by as sub_create_by,
s.create_time as sub_create_time,
s.update_by as sub_update_by,
s.update_time as sub_update_time,
s.del_flag as sub_del_flag,
s.tplink_path as sub_tplink_path,
s.manually_pic_path as sub_manually_pic_path,
s.manually_mp4_path as sub_manually_mp4_path
s.service_duration as sub_service_duration,
s.service_content as sub_service_content,
s.toll_price as sub_toll_price,
s.com_price as sub_com_price,
s.real_com_price as sub_real_com_price,
s.package_id as sub_package_id,
s.package_name as sub_package_name,
s.iz_package as sub_iz_package,
s.start_time as sub_start_time,
s.end_time as sub_end_time,
s.begin_time as sub_begin_time,
s.finish_time as sub_finish_time,
s.iz_start as sub_iz_start,
s.iz_finish as sub_iz_finish,
s.create_by as sub_create_by,
s.create_time as sub_create_time,
s.update_by as sub_update_by,
s.update_time as sub_update_time,
s.del_flag as sub_del_flag,
s.tplink_path as sub_tplink_path,
s.manually_pic_path as sub_manually_pic_path,
s.manually_mp4_path as sub_manually_mp4_path
FROM nu_biz_directive_order o
LEFT JOIN nu_biz_nu_directive_order_info s ON o.id = s.main_id
LEFT JOIN sys_dict dict ON dict.dict_code = 'directive_order_opt_type'
LEFT JOIN sys_dict_item mainStatus ON mainStatus.dict_id = dict.id AND mainStatus.item_value = o.opt_type
LEFT JOIN sys_dict_item mainStatus
ON mainStatus.dict_id = dict.id AND mainStatus.item_value = o.opt_type
WHERE o.order_type = '1'
</sql>
@ -448,36 +447,35 @@
</select>
<select id="getInstantById" resultType="com.nu.modules.biz.order.entity.DirectiveOrder">
select
m.id as bizId,
m.nu_id as nuId,
b.nu_name as nuName,
c.id as elderId,
c.name as elderName,
m.directive_id as directiveId,
m.cycle_type_id as cycleTypeId,
d.item_text as cycleType,
iz_package,
(case when c.orderly is null then 2 else 1 end) as orderEmp
select m.id as bizId,
m.nu_id as nuId,
b.nu_name as nuName,
c.id as elderId,
c.name as elderName,
m.directive_id as directiveId,
m.cycle_type_id as cycleTypeId,
d.item_text as cycleType,
iz_package,
(case when c.orderly is null then 2 else 1 end) as orderEmp
from ${tableName} m
inner join nu_base_info b on m.nu_id = b.nu_id and b.del_flag = '0' and (case when b.area_flag = 1 then b.status = '2' else 1=1 end)
left join nu_biz_elder_info c on b.elder_id = c.id and c.del_flag = '0'
left join view_sys_dict d on m.cycle_type_id = d.item_value and d.dict_code = 'period_type'
inner join nu_base_info b on m.nu_id = b.nu_id and b.del_flag = '0' and
(case when b.area_flag = 1 then b.status = '2' else 1 = 1 end)
left join nu_biz_elder_info c on b.elder_id = c.id and c.del_flag = '0'
left join view_sys_dict d on m.cycle_type_id = d.item_value and d.dict_code = 'period_type'
where m.id = #{id}
and m.cycle_type_id = '2'
and m.cycle_type_id = '2'
</select>
<select id="getDirectiveById" resultType="com.nu.modules.biz.order.entity.DirectiveOrder">
select
a.id as directiveId,
a.directive_name as directiveName,
a.preview_file as previewFile,
a.preview_file_small as previewFileSmall,
a.mp3_file as mp3File,
a.mp4_file as mp4File,
a.service_duration as serviceDuration,
a.service_content as serviceContent,
a.timeout_duration as timeoutDuration
select a.id as directiveId,
a.directive_name as directiveName,
a.preview_file as previewFile,
a.preview_file_small as previewFileSmall,
a.mp3_file as mp3File,
a.mp4_file as mp4File,
a.service_duration as serviceDuration,
a.service_content as serviceContent,
a.timeout_duration as timeoutDuration
from nu_config_service_directive a
where a.id = #{directiveId}
and a.del_flag = '0'
@ -485,12 +483,11 @@
</select>
<select id="getPackageById" resultType="com.nu.modules.biz.order.entity.DirectiveOrder">
select
a.id as directiveId,
a.package_name as directiveName,
a.total_duration as serviceDuration,
a.description as serviceContent,
a.timeout_duration as timeoutDuration
select a.id as directiveId,
a.package_name as directiveName,
a.total_duration as serviceDuration,
a.description as serviceContent,
a.timeout_duration as timeoutDuration
from nu_config_directive_package_main a
where a.id = #{directiveId}
and a.del_flag = '0'
@ -504,4 +501,93 @@
where a.id = #{employeeId}
</select>
<select id="queryOrderList" resultType="com.nu.entity.DirectiveOrderEntity">
SELECT
t.id,
t.nu_id,
t.nu_name,
t.elder_id,
t.elder_name,
t.body_tag_ids,
t.body_tag_names,
t.body_tag_price,
t.emotion_tag_ids,
t.emotion_tag_names,
t.emotion_tag_price,
t.employee_id,
t.employee_name,
t.opt_type,
t.employee_ids,
t.employee_names,
t.instruction_id,
t.instruction_name,
t.category_id,
t.category_name,
t.type_id,
t.type_name,
t.directive_id,
t.directive_name,
t.service_attribute,
t.service_duration,
t.toll_price,
t.com_price,
t.serv_start_time,
t.serv_end_time,
t.emp_start_time,
t.emp_end_time,
t.order_start_time,
t.order_end_time,
t.order_status,
t.create_by,
t.create_time,
t.update_by,
t.update_time,
t.del_flag,
t.iz_multi,
t.tplink_path,
t.manually_pic_path,
t.manually_mp4_path,
t.tplink_task_id,
t.tplink_process,
t.tplink_md5,
t.tplink_result_code,
t.tplink_down_count,
CASE WHEN t.emp_start_time IS NULL THEN 'N' ELSE 'Y' END AS iz_start,
CASE WHEN t.emp_end_time IS NULL THEN 'N' ELSE 'Y' END AS iz_finish,
dire.preview_file
FROM nu_biz_directive_order t
LEFT JOIN nu_config_service_directive dire on t.directive_id = dire.id
WHERE t.nu_id = #{entity.nuId} AND t.employee_id = #{entity.employeeId}
<choose>
<when test="entity.workType == '1'">
AND t.serv_end_time >= NOW()
AND t.emp_start_time IS NULL
</when>
<when test="entity.workType == '2'">
AND DATE(t.serv_start_time) = CURDATE()
AND t.serv_end_time >= NOW()
AND t.emp_start_time IS NOT NULL
</when>
<when test="entity.workType == '3'">
AND DATE(t.serv_start_time) = CURDATE()
AND t.emp_end_time IS NOT NULL
</when>
<when test="entity.workType == '4'">
AND DATE(t.serv_start_time) = CURDATE()
AND t.serv_end_time <![CDATA[ < ]]> NOW()
AND t.emp_start_time IS NULL
</when>
<when test="entity.workType == '5'">
AND (
(t.serv_start_time <![CDATA[ <= ]]> NOW()
AND t.serv_end_time >= NOW()
AND t.emp_end_time IS NULL)
OR (t.emp_start_time IS NOT NULL AND t.emp_end_time IS NULL)
)
</when>
</choose>
ORDER BY t.serv_start_time ASC
</select>
</mapper>

View File

@ -12,8 +12,8 @@ import com.nu.modules.biz.order.entity.DirectiveOrder;
import com.nu.modules.biz.order.entity.DirectiveOrderBizLog;
import com.nu.modules.biz.order.entity.DirectiveOrderInfo;
import com.nu.modules.biz.order.mapper.DirectiveOrderBizLogMapper;
import com.nu.modules.biz.order.mapper.DirectiveOrderMapper;
import com.nu.modules.biz.order.mapper.DirectiveOrderInfoMapper;
import com.nu.modules.biz.order.mapper.DirectiveOrderMapper;
import com.nu.modules.biz.order.service.IDirectiveOrderInfoService;
import com.nu.modules.biz.order.service.IDirectiveOrderService;
import com.nu.modules.directiveorder.api.IDirectiveOrderLogApi;
@ -21,16 +21,17 @@ import com.nu.modules.order.api.IDirectiveOrderApi;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.DateUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import java.time.LocalDateTime;
import java.util.*;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Description: 服务指令工单主表
@ -79,110 +80,37 @@ public class DirectiveOrderPadServiceImpl extends ServiceImpl<DirectiveOrderMapp
*/
@Override
public IPage<DirectiveOrderEntity> queryOrderList(Integer pageNo, Integer pageSize, DirectiveOrderEntity directiveOrderEntity, HttpServletRequest req) {
String nowDate = DateUtils.formatDate(new Date(), "yyyy-MM-dd");
DirectiveOrder directiveOrder = new DirectiveOrder();
BeanUtils.copyProperties(directiveOrderEntity, directiveOrder);
QueryWrapper<DirectiveOrder> queryWrapper = new QueryWrapper<>();
//查询对应护理单元+员工身上的
queryWrapper.eq("nu_id", directiveOrderEntity.getNuId());
queryWrapper.eq(StringUtils.isNotBlank(directiveOrderEntity.getEmployeeId()), "employee_id", directiveOrderEntity.getEmployeeId());
//工单类型 1待执行 2已执行 3已完成 4已过期 5待执行或者已执行未完成 空是全部
//首页的对应5
if (StringUtils.equals("1", directiveOrderEntity.getWorkType())) {
// queryWrapper.like("start_time", nowDate);//默认查询当天
// queryWrapper.eq("iz_start", "N");
// queryWrapper.eq("iz_finish", "N");
// queryWrapper.apply("start_time > now()");
//待执行未到结束时间 未点开始
queryWrapper.and(wrapper ->
wrapper.ge("serv_end_time", new Date())
.isNull("emp_start_time")
);
} else if (StringUtils.equals("2", directiveOrderEntity.getWorkType())) {
// queryWrapper.like("start_time", nowDate);//默认查询当天
// queryWrapper.eq("iz_start", "Y");
// queryWrapper.eq("iz_finish", "N");
// queryWrapper.apply("DATE_ADD(end_time, INTERVAL ifnull(timeout_duration,0) MINUTE) > NOW()");
//已执行 看的是今天要开始执行的指令 没到或刚到最后时间 已经点了开始
queryWrapper.and(wrapper ->
wrapper.apply("DATE(serv_start_time) = CURDATE()")
.ge("serv_end_time", new Date())
.isNotNull("emp_start_time")
);
} else if (StringUtils.equals("3", directiveOrderEntity.getWorkType())) {
// queryWrapper.like("start_time", nowDate);//默认查询当天
// queryWrapper.eq("iz_start", "Y");
// queryWrapper.eq("iz_finish", "Y");
//已完成工单开始执行日期是今天 只要有完成时间就算
queryWrapper.and(wrapper ->
wrapper.apply("DATE(serv_start_time) = CURDATE()")
.isNotNull("emp_end_time")
);
} else if (StringUtils.equals("4", directiveOrderEntity.getWorkType())) {
// queryWrapper.like("start_time", nowDate);//默认查询当天
// queryWrapper.eq("iz_start", "N");
// queryWrapper.eq("iz_finish", "N");
// queryWrapper.apply("start_time < now()");
//已过期服务应该结束的那天的 过了最后时间了 还没点开始
queryWrapper.and(wrapper ->
wrapper.apply("DATE(serv_end_time) = CURDATE()")
.lt("serv_end_time", new Date())
.isNull("emp_start_time")
);
} else if (StringUtils.equals("5", directiveOrderEntity.getWorkType())) {
//首页展示的工单
//需求展示工单开始 ~ 结束时间范围内 未完成的单子 serv_start_time <= now <= serv_end_time and emp_end_time = null)
// 特殊情况工单点击开始了 只要不点结束就一直显示 or (emp_start_time !=null and emp_end_time = null)
queryWrapper.and(wrapper ->
wrapper.le("serv_start_time", new Date())
.ge("serv_end_time", new Date())
.isNull("emp_end_time")
).or(wrapper ->
wrapper.isNotNull("emp_start_time")
.isNull("emp_end_time")
);
}
queryWrapper.orderByAsc("serv_start_time");
Page<DirectiveOrder> page = new Page<>(pageNo, pageSize);
List<DirectiveOrder> list = baseMapper.selectList(page, queryWrapper);
IPage<DirectiveOrderEntity> entityPage = new Page<>(page.getCurrent(), page.getSize(), page.getTotal());
entityPage.setRecords(BeanUtil.copyToList(list, DirectiveOrderEntity.class));
return entityPage;
//workType工单类型 1待执行 2已执行 3已完成 4已过期 5待执行或者已执行未完成 空是全部
return baseMapper.queryOrderList(page, directiveOrderEntity);
}
@Override
public List<DirectiveOrderInfoEntity> queryOrderInfoList(DirectiveOrderInfoEntity directiveOrderInfoEntity, HttpServletRequest req) {
DirectiveOrderInfo directiveOrderInfo = new DirectiveOrderInfo();
BeanUtils.copyProperties(directiveOrderInfoEntity, directiveOrderInfo);
QueryWrapper<DirectiveOrderInfo> queryWrapper = QueryGenerator.initQueryWrapper(directiveOrderInfo, req.getParameterMap());
List<DirectiveOrderInfo> list = directiveOrderInfoMapper.queryOrderInfoList(queryWrapper);
List<DirectiveOrderInfoEntity> list1 = new ArrayList<>();
list1 = BeanUtil.copyToList(list, DirectiveOrderInfoEntity.class);
return list1;
public List<DirectiveOrderEntity> queryOrderInfoList(DirectiveOrderEntity directiveOrderInfoEntity, HttpServletRequest req) {
List<DirectiveOrderEntity> list = directiveOrderInfoMapper.queryOrderInfoList(directiveOrderInfoEntity);
return list;
}
@Override
public Map<String, Object> startOrder(DirectiveOrderEntity directiveOrderEntity) {
DirectiveOrder directiveOrder = baseMapper.selectById(directiveOrderEntity.getId());
directiveOrder.setIzStart("Y");
directiveOrder.setBeginTime(new Date());
directiveOrder.setEmpStartTime(new Date());
if (StringUtils.isEmpty(directiveOrder.getEmployeeIds())) {
//如果未进行转单协助等操作此时实际执行人字段都为空 需将实际执行人设置为派单时派发的员工
directiveOrder.setEmployeeIds(directiveOrder.getEmployeeId());
directiveOrder.setEmployeeNames(directiveOrder.getEmployeeNames());
}
baseMapper.updateById(directiveOrder);
QueryWrapper<DirectiveOrderInfo> queryWrapper = new QueryWrapper<>();
List<DirectiveOrderInfo> list = directiveOrderInfoMapper.selectList(queryWrapper);
// QueryWrapper<DirectiveOrderInfo> queryWrapper = new QueryWrapper<>();
// List<DirectiveOrderInfo> list = directiveOrderInfoMapper.selectList(queryWrapper);
Map<String, Object> map = new HashMap<>();
map.put("success", true);
map.put("message", "操作成功");
map.put("directiveOrder", directiveOrder);
map.put("directiveOrderInfo", list);
// map.put("directiveOrderInfo", list);
return map;
}
@ -268,11 +196,11 @@ public class DirectiveOrderPadServiceImpl extends ServiceImpl<DirectiveOrderMapp
directiveOrderService.updateById(directiveOrder);
//子表
DirectiveOrderInfo directiveOrderInfo = new DirectiveOrderInfo();
directiveOrderInfo.setManuallyMp4Path(directiveOrderEntity.getManuallyMp4Path());
UpdateWrapper<DirectiveOrderInfo> uw = new UpdateWrapper<>();
uw.eq("main_id", directiveOrderEntity.getId());
directiveOrderInfoService.update(directiveOrderInfo, uw);
// DirectiveOrderInfo directiveOrderInfo = new DirectiveOrderInfo();
// directiveOrderInfo.setManuallyMp4Path(directiveOrderEntity.getManuallyMp4Path());
// UpdateWrapper<DirectiveOrderInfo> uw = new UpdateWrapper<>();
// uw.eq("main_id", directiveOrderEntity.getId());
// directiveOrderInfoService.update(directiveOrderInfo, uw);
Map<String, Object> map = new HashMap<>();
map.put("success", true);
@ -289,11 +217,11 @@ public class DirectiveOrderPadServiceImpl extends ServiceImpl<DirectiveOrderMapp
directiveOrderService.updateById(directiveOrder);
//子表
DirectiveOrderInfo directiveOrderInfo = new DirectiveOrderInfo();
directiveOrderInfo.setManuallyPicPath(directiveOrderEntity.getManuallyPicPath());
UpdateWrapper<DirectiveOrderInfo> uw = new UpdateWrapper<>();
uw.eq("main_id", directiveOrderEntity.getId());
directiveOrderInfoService.update(directiveOrderInfo, uw);
// DirectiveOrderInfo directiveOrderInfo = new DirectiveOrderInfo();
// directiveOrderInfo.setManuallyPicPath(directiveOrderEntity.getManuallyPicPath());
// UpdateWrapper<DirectiveOrderInfo> uw = new UpdateWrapper<>();
// uw.eq("main_id", directiveOrderEntity.getId());
// directiveOrderInfoService.update(directiveOrderInfo, uw);
Map<String, Object> map = new HashMap<>();
map.put("success", true);
@ -317,31 +245,21 @@ public class DirectiveOrderPadServiceImpl extends ServiceImpl<DirectiveOrderMapp
@Override
public void transferOrder(DirectiveOrderInfoEntity dto) {
DirectiveOrder main = new DirectiveOrder();
DirectiveOrderInfo sub = new DirectiveOrderInfo();
String optType = "3";//转单
//执行类型
main.setOptType(optType);
sub.setOptType(optType);
//主要执行人
main.setEmployeeId(dto.getEmployeeId());
main.setEmployeeName(dto.getEmployeeName());
sub.setEmployeeId(dto.getEmployeeId());
sub.setEmployeeName(dto.getEmployeeName());
main.setEmployeeIds(dto.getEmployeeId());
main.setEmployeeNames(dto.getEmployeeName());
//实际执行人
main.setOptIds(dto.getEmployeeId());
main.setOptNames(dto.getEmployeeName());
sub.setOptIds(dto.getEmployeeId());
sub.setOptNames(dto.getEmployeeName());
//修改主表
main.setId(dto.getMainId());
directiveOrderService.updateById(main);
//修改子表
UpdateWrapper<DirectiveOrderInfo> subUW = new UpdateWrapper<>();
subUW.eq("main_id", dto.getMainId());
directiveOrderInfoMapper.update(sub, subUW);
//日志
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();