parent
49d3a12259
commit
1db4c6c6ee
|
|
@ -39,18 +39,16 @@ public class ServiceOrderApi {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* todo 改成服务指令集
|
* 返回服务指令集详细信息
|
||||||
|
*
|
||||||
* @param directiveOrderInfoEntity
|
* @param directiveOrderInfoEntity
|
||||||
* @param req
|
* @param req
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "服务指令工单-查询工单详细信息", notes = "服务指令工单-查询工单详细信息")
|
@ApiOperation(value = "服务指令工单-查询工单详细信息", notes = "服务指令工单-查询工单详细信息")
|
||||||
@GetMapping(value = "/queryOrderInfoList")
|
@GetMapping(value = "/queryOrderInfoList")
|
||||||
public Result<List<DirectiveOrderInfoEntity>> queryOrderInfoList(DirectiveOrderInfoEntity directiveOrderInfoEntity, HttpServletRequest req) {
|
public Result<List<DirectiveOrderEntity>> queryOrderInfoList(DirectiveOrderEntity directiveOrderInfoEntity, HttpServletRequest req) {
|
||||||
if(StringUtils.isBlank(directiveOrderInfoEntity.getMainId())){
|
List<DirectiveOrderEntity> pageList = directiveOrderApi.queryOrderInfoList(directiveOrderInfoEntity,req);
|
||||||
return Result.error("请选择工单");
|
|
||||||
}
|
|
||||||
List<DirectiveOrderInfoEntity> pageList = directiveOrderApi.queryOrderInfoList(directiveOrderInfoEntity,req);
|
|
||||||
return Result.OK(pageList);
|
return Result.OK(pageList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -180,4 +180,148 @@ public class DirectiveOrderEntity implements Serializable {
|
||||||
|
|
||||||
/**所属部门*/
|
/**所属部门*/
|
||||||
private String sysOrgCode;
|
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;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ public interface IDirectiveOrderApi {
|
||||||
|
|
||||||
IPage<DirectiveOrderEntity> queryOrderList(Integer pageNo, Integer pageSize, DirectiveOrderEntity directiveOrderEntity, HttpServletRequest req);
|
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);
|
Map<String, Object> editSubMp4(DirectiveOrderEntity directiveOrderEntity);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -216,7 +216,7 @@ public class DirectiveOrder implements Serializable {
|
||||||
/**
|
/**
|
||||||
* tplink监控视频上传进度(千分制)
|
* tplink监控视频上传进度(千分制)
|
||||||
*/
|
*/
|
||||||
private String tplinkrocess;
|
private String tplinkProcess;
|
||||||
/**
|
/**
|
||||||
* tplink切片md5
|
* tplink切片md5
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@ package com.nu.modules.biz.order.mapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
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 com.nu.modules.biz.order.entity.DirectiveOrderInfo;
|
||||||
import org.apache.ibatis.annotations.Param;
|
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> getDirectiveList(@Param("directiveId") String directiveId);
|
||||||
List<DirectiveOrderInfo> getSubDirectiveList(@Param("packageId") String packageId);
|
List<DirectiveOrderInfo> getSubDirectiveList(@Param("packageId") String packageId);
|
||||||
|
|
||||||
List<DirectiveOrderInfo> queryOrderInfoList(@Param(Constants.WRAPPER) QueryWrapper<DirectiveOrderInfo> queryWrapper);
|
List<DirectiveOrderEntity> queryOrderInfoList(@Param("dto") DirectiveOrderEntity queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
package com.nu.modules.biz.order.mapper;
|
package com.nu.modules.biz.order.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
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.CareDirectiveEntity;
|
||||||
import com.nu.entity.DirectiveOrderEntity;
|
import com.nu.entity.DirectiveOrderEntity;
|
||||||
import com.nu.entity.DirectiveOrderInfoEntity;
|
import com.nu.entity.DirectiveOrderInfoEntity;
|
||||||
|
|
@ -44,4 +47,7 @@ public interface DirectiveOrderMapper extends BaseMapper<DirectiveOrder> {
|
||||||
DirectiveOrder getPackageById(DirectiveOrder orders);
|
DirectiveOrder getPackageById(DirectiveOrder orders);
|
||||||
|
|
||||||
DirectiveOrder getEmployeeById(@Param("employeeId") String employeeId);
|
DirectiveOrder getEmployeeById(@Param("employeeId") String employeeId);
|
||||||
|
|
||||||
|
IPage<DirectiveOrderEntity> queryOrderList(Page<DirectiveOrder> page,
|
||||||
|
@Param("entity") DirectiveOrderEntity entity);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,54 +3,52 @@
|
||||||
<mapper namespace="com.nu.modules.biz.order.mapper.DirectiveOrderInfoMapper">
|
<mapper namespace="com.nu.modules.biz.order.mapper.DirectiveOrderInfoMapper">
|
||||||
|
|
||||||
<select id="getDirectiveList" resultType="com.nu.modules.biz.order.entity.DirectiveOrderInfo">
|
<select id="getDirectiveList" resultType="com.nu.modules.biz.order.entity.DirectiveOrderInfo">
|
||||||
select
|
select a.instruction_tag_id as instructionTagId,
|
||||||
a.instruction_tag_id as instructionTagId,
|
b.instruction_name as instructionTagName,
|
||||||
b.instruction_name as instructionTagName,
|
a.category_id as categoryId,
|
||||||
a.category_id as categoryId,
|
c.category_name AS categoryName,
|
||||||
c.category_name AS categoryName,
|
a.type_id as typeId,
|
||||||
a.type_id as typeId,
|
d.type_name as typeName,
|
||||||
d.type_name as typeName,
|
a.id as directiveId,
|
||||||
a.id as directiveId,
|
a.directive_name as directiveName,
|
||||||
a.directive_name as directiveName,
|
a.preview_file as previewFile,
|
||||||
a.preview_file as previewFile,
|
a.preview_file_small as previewFileSmall,
|
||||||
a.preview_file_small as previewFileSmall,
|
a.mp3_file as mp3File,
|
||||||
a.mp3_file as mp3File,
|
a.mp4_file as mp4File,
|
||||||
a.mp4_file as mp4File,
|
a.service_duration as serviceDuration,
|
||||||
a.service_duration as serviceDuration,
|
a.service_content as serviceContent,
|
||||||
a.service_content as serviceContent,
|
a.timeout_duration as timeoutDuration
|
||||||
a.timeout_duration as timeoutDuration
|
|
||||||
from nu_config_service_directive a
|
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_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_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_type d on a.type_id = d.id
|
||||||
where a.id = #{directiveId}
|
where a.id = #{directiveId}
|
||||||
and a.del_flag = '0'
|
and a.del_flag = '0'
|
||||||
and a.iz_enabled = 'Y'
|
and a.iz_enabled = 'Y'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getSubDirectiveList" resultType="com.nu.modules.biz.order.entity.DirectiveOrderInfo">
|
<select id="getSubDirectiveList" resultType="com.nu.modules.biz.order.entity.DirectiveOrderInfo">
|
||||||
SELECT
|
SELECT b.instruction_tag_id AS instructionTagId,
|
||||||
b.instruction_tag_id AS instructionTagId,
|
e.instruction_name AS instructionTagName,
|
||||||
e.instruction_name AS instructionTagName,
|
b.category_id AS categoryId,
|
||||||
b.category_id AS categoryId,
|
c.category_name AS categoryName,
|
||||||
c.category_name AS categoryName,
|
b.type_id AS typeId,
|
||||||
b.type_id AS typeId,
|
d.type_name AS typeName,
|
||||||
d.type_name AS typeName,
|
b.id AS directiveId,
|
||||||
b.id AS directiveId,
|
b.directive_name AS directiveName,
|
||||||
b.directive_name AS directiveName,
|
b.preview_file AS previewFile,
|
||||||
b.preview_file AS previewFile,
|
b.preview_file_small AS previewFileSmall,
|
||||||
b.preview_file_small AS previewFileSmall,
|
b.mp3_file AS mp3File,
|
||||||
b.mp3_file AS mp3File,
|
b.mp4_file AS mp4File,
|
||||||
b.mp4_file AS mp4File,
|
b.service_duration AS serviceDuration,
|
||||||
b.service_duration AS serviceDuration,
|
b.service_content AS serviceContent,
|
||||||
b.service_content AS serviceContent,
|
b.timeout_duration AS timeoutDuration
|
||||||
b.timeout_duration AS timeoutDuration
|
|
||||||
FROM nu_config_directive_package_main p
|
FROM nu_config_directive_package_main p
|
||||||
INNER JOIN nu_config_directive_package_item a ON p.id = a.package_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_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_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_type d ON b.type_id = d.id
|
||||||
LEFT JOIN nu_config_service_instruction_tag e ON b.instruction_tag_id = e.id
|
LEFT JOIN nu_config_service_instruction_tag e ON b.instruction_tag_id = e.id
|
||||||
where a.package_id = #{packageId}
|
where a.package_id = #{packageId}
|
||||||
and p.del_flag = '0'
|
and p.del_flag = '0'
|
||||||
and p.iz_enabled = 'Y'
|
and p.iz_enabled = 'Y'
|
||||||
|
|
@ -59,9 +57,13 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
<select id="queryOrderInfoList" resultType="com.nu.modules.biz.order.entity.DirectiveOrderInfo">
|
<select id="queryOrderInfoList" resultType="com.nu.entity.DirectiveOrderEntity">
|
||||||
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
|
select a.*, b.immediate_file, b.immediate_file_focus
|
||||||
${ew.customSqlSegment}
|
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>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -22,13 +22,13 @@
|
||||||
<result column="cycle_type" property="cycleType"/>
|
<result column="cycle_type" property="cycleType"/>
|
||||||
<result column="cycle_value" property="cycleValue"/>
|
<result column="cycle_value" property="cycleValue"/>
|
||||||
<result column="preview_file" property="previewFile"/>
|
<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="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="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="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_duration" property="serviceDuration"/>
|
||||||
<result column="service_content" property="serviceContent"/>
|
<result column="service_content" property="serviceContent"/>
|
||||||
<result column="package_id" property="packageId"/>
|
<result column="package_id" property="packageId"/>
|
||||||
|
|
@ -80,13 +80,13 @@
|
||||||
<result column="sub_cycle_type" property="cycleType"/>
|
<result column="sub_cycle_type" property="cycleType"/>
|
||||||
<result column="sub_cycle_value" property="cycleValue"/>
|
<result column="sub_cycle_value" property="cycleValue"/>
|
||||||
<result column="sub_preview_file" property="previewFile"/>
|
<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_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_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_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_duration" property="serviceDuration"/>
|
||||||
<result column="sub_service_content" property="serviceContent"/>
|
<result column="sub_service_content" property="serviceContent"/>
|
||||||
<result column="sub_toll_price" property="tollPrice"/>
|
<result column="sub_toll_price" property="tollPrice"/>
|
||||||
|
|
@ -113,99 +113,97 @@
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<select id="queryDataPoolList" resultType="com.nu.modules.biz.order.entity.DirectiveOrder">
|
<select id="queryDataPoolList" resultType="com.nu.modules.biz.order.entity.DirectiveOrder">
|
||||||
select
|
select a.id as poolId,
|
||||||
a.id as poolId,
|
a.pool_type as orderType,
|
||||||
a.pool_type as orderType,
|
a.biz_id as bizId,
|
||||||
a.biz_id as bizId,
|
a.nu_id as nuId,
|
||||||
a.nu_id as nuId,
|
b.nu_name as nuName,
|
||||||
b.nu_name as nuName,
|
c.id as elderId,
|
||||||
c.id as elderId,
|
c.name as elderName,
|
||||||
c.name as elderName,
|
a.directive_id as directiveId,
|
||||||
a.directive_id as directiveId,
|
a.cycle_type_id as cycleTypeId,
|
||||||
a.cycle_type_id as cycleTypeId,
|
d.item_text as cycleType,
|
||||||
d.item_text as cycleType,
|
a.cycle_value as cycleValue,
|
||||||
a.cycle_value as cycleValue,
|
a.iz_package as izPackage,
|
||||||
a.iz_package as izPackage,
|
a.start_time as startTime,
|
||||||
a.start_time as startTime,
|
(case when c.orderly is null then 2 else 1 end) as orderEmp
|
||||||
(case when c.orderly is null then 2 else 1 end) as orderEmp
|
|
||||||
from nu_biz_nu_directive_data_pool a
|
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'
|
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 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'
|
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'
|
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>
|
||||||
|
|
||||||
<select id="queryDataPoolListBak" resultType="com.nu.modules.biz.order.entity.DirectiveOrder">
|
<select id="queryDataPoolListBak" resultType="com.nu.modules.biz.order.entity.DirectiveOrder">
|
||||||
select
|
select a.id as poolId,
|
||||||
a.id as poolId,
|
a.pool_type as orderType,
|
||||||
a.pool_type as orderType,
|
a.biz_id as bizId,
|
||||||
a.biz_id as bizId,
|
a.nu_id as nuId,
|
||||||
a.nu_id as nuId,
|
a.nu_name as nuName,
|
||||||
a.nu_name as nuName,
|
a.elder_id as elderId,
|
||||||
a.elder_id as elderId,
|
a.elder_name as elderName,
|
||||||
a.elder_name as elderName,
|
a.directive_id as directiveId,
|
||||||
a.directive_id as directiveId,
|
a.directive_name as directiveName,
|
||||||
a.directive_name as directiveName,
|
a.cycle_type_id as cycleTypeId,
|
||||||
a.cycle_type_id as cycleTypeId,
|
a.cycle_type as cycleType,
|
||||||
a.cycle_type as cycleType,
|
a.cycle_value as cycleValue,
|
||||||
a.cycle_value as cycleValue,
|
a.preview_file as previewFile,
|
||||||
a.preview_file as previewFile,
|
|
||||||
-- a.net_preview_file as netPeviewFile,
|
-- 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.net_preview_file_small as netPreviewFileSmall,
|
||||||
a.mp3_file as mp3File,
|
a.mp3_file as mp3File,
|
||||||
-- a.net_mp3_file as netMp3File,
|
-- a.net_mp3_file as netMp3File,
|
||||||
a.mp4_file as mp4File,
|
a.mp4_file as mp4File,
|
||||||
-- a.net_mp4_file as netMp4File,
|
-- a.net_mp4_file as netMp4File,
|
||||||
a.service_duration as serviceDuration,
|
a.service_duration as serviceDuration,
|
||||||
a.service_content as serviceContent,
|
a.service_content as serviceContent,
|
||||||
a.package_id as packageId,
|
a.package_id as packageId,
|
||||||
a.package_name as packageName,
|
a.package_name as packageName,
|
||||||
a.iz_package as izPackage,
|
a.iz_package as izPackage,
|
||||||
a.start_time as startTime,
|
a.start_time as startTime,
|
||||||
a.end_time as endTime,
|
a.end_time as endTime,
|
||||||
(case when b.orderly is null then 2 else 1 end) as orderEmp
|
(case when b.orderly is null then 2 else 1 end) as orderEmp
|
||||||
from nu_biz_nu_directive_data_pool a
|
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'
|
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>
|
||||||
|
|
||||||
<select id="getEmpPermissionAndOnline" resultType="com.nu.modules.biz.order.entity.DirectiveOrder">
|
<select id="getEmpPermissionAndOnline" resultType="com.nu.modules.biz.order.entity.DirectiveOrder">
|
||||||
select
|
select
|
||||||
distinct
|
distinct
|
||||||
a.id as employeeId,
|
a.id as employeeId,
|
||||||
a.name as employeeName,
|
a.name as employeeName,
|
||||||
a.order_cap as orderCap,
|
a.order_cap as orderCap,
|
||||||
ifnull(e.orderNum,0) as orderNum,
|
ifnull(e.orderNum,0) as orderNum,
|
||||||
ifnull(e.totalDuration,0) as totalDuration,
|
ifnull(e.totalDuration,0) as totalDuration,
|
||||||
ifnull(e.totalComPrice,0) as totalComPrice,
|
ifnull(e.totalComPrice,0) as totalComPrice,
|
||||||
e.maxTime,
|
e.maxTime,
|
||||||
ifnull(e.ownCn,0) as ownCn,
|
ifnull(e.ownCn,0) as ownCn,
|
||||||
(case when ifnull(f.orderNum,0) = 0 then 1 else 0 end) as izFree,
|
(case when ifnull(f.orderNum,0) = 0 then 1 else 0 end) as izFree,
|
||||||
0 as level
|
0 as level
|
||||||
from nu_biz_employees_info a
|
from nu_biz_employees_info a
|
||||||
inner join nu_biz_employees_service_tags b on a.id = b.employees_id
|
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_main c on c.id = b.tags_id
|
||||||
inner join nu_service_tag_info d on d.tag_id = c.id
|
inner join nu_service_tag_info d on d.tag_id = c.id
|
||||||
left join (
|
left join (
|
||||||
select employee_id,count(*) as orderNum,
|
select employee_id,count(*) as orderNum,
|
||||||
sum(service_duration) as totalDuration,
|
sum(service_duration) as totalDuration,
|
||||||
round(sum(ifnull(com_price,0)),4) as totalComPrice,
|
round(sum(ifnull(com_price,0)),4) as totalComPrice,
|
||||||
max(start_time) as maxTime,
|
max(start_time) as maxTime,
|
||||||
sum(case when iz_finish='N' then 1 else 0 end) as ownCn
|
sum(case when iz_finish='N' then 1 else 0 end) as ownCn
|
||||||
from nu_biz_nu_directive_order_info
|
from nu_biz_nu_directive_order_info
|
||||||
where start_time >=DATE_FORMAT(NOW(), '%Y-%m-%d 00:00:00')
|
where start_time >=DATE_FORMAT(NOW(), '%Y-%m-%d 00:00:00')
|
||||||
and start_time <=DATE_FORMAT(NOW(), '%Y-%m-%d 23:59:59')
|
and start_time <=DATE_FORMAT(NOW(), '%Y-%m-%d 23:59:59')
|
||||||
group by employee_id
|
group by employee_id
|
||||||
) e on a.id = e.employee_id
|
) e on a.id = e.employee_id
|
||||||
left join (
|
left join (
|
||||||
select employee_id,sum(case when iz_finish='N' then 1 else 0 end) as orderNum
|
select employee_id,sum(case when iz_finish='N' then 1 else 0 end) as orderNum
|
||||||
from nu_biz_nu_directive_order_info
|
from nu_biz_nu_directive_order_info
|
||||||
where start_time = #{startTime}
|
where start_time = #{startTime}
|
||||||
or (start_time < #{startTime} and end_time > #{startTime})
|
or (start_time < #{startTime} and end_time > #{startTime})
|
||||||
group by employee_id
|
group by employee_id
|
||||||
) f on a.id = f.employee_id
|
) f on a.id = f.employee_id
|
||||||
where a.del_flag = '0'
|
where a.del_flag = '0'
|
||||||
and a.iz_freeze = 'N'
|
and a.iz_freeze = 'N'
|
||||||
|
|
@ -342,61 +340,62 @@
|
||||||
o.iz_timeout,
|
o.iz_timeout,
|
||||||
o.opt_ids,
|
o.opt_ids,
|
||||||
o.opt_names,
|
o.opt_names,
|
||||||
mainStatus.item_text as optTypeName,
|
mainStatus.item_text as optTypeName,
|
||||||
s.id as sub_id,
|
s.id as sub_id,
|
||||||
s.order_type as sub_order_type,
|
s.order_type as sub_order_type,
|
||||||
s.main_id as sub_main_id,
|
s.main_id as sub_main_id,
|
||||||
s.nu_id as sub_nu_id,
|
s.nu_id as sub_nu_id,
|
||||||
s.nu_name as sub_nu_name,
|
s.nu_name as sub_nu_name,
|
||||||
s.elder_id as sub_elder_id,
|
s.elder_id as sub_elder_id,
|
||||||
s.elder_name as sub_elder_name,
|
s.elder_name as sub_elder_name,
|
||||||
s.employee_id as sub_employee_id,
|
s.employee_id as sub_employee_id,
|
||||||
s.employee_name as sub_employee_name,
|
s.employee_name as sub_employee_name,
|
||||||
s.instruction_tag_id as sub_instruction_tag_id,
|
s.instruction_tag_id as sub_instruction_tag_id,
|
||||||
s.instruction_tag_name as sub_instruction_tag_name,
|
s.instruction_tag_name as sub_instruction_tag_name,
|
||||||
s.category_id as sub_category_id,
|
s.category_id as sub_category_id,
|
||||||
s.category_name as sub_category_name,
|
s.category_name as sub_category_name,
|
||||||
s.type_id as sub_type_id,
|
s.type_id as sub_type_id,
|
||||||
s.type_name as sub_type_name,
|
s.type_name as sub_type_name,
|
||||||
s.directive_id as sub_directive_id,
|
s.directive_id as sub_directive_id,
|
||||||
s.directive_name as sub_directive_name,
|
s.directive_name as sub_directive_name,
|
||||||
s.cycle_type_id as sub_cycle_type_id,
|
s.cycle_type_id as sub_cycle_type_id,
|
||||||
s.cycle_type as sub_cycle_type,
|
s.cycle_type as sub_cycle_type,
|
||||||
s.cycle_value as sub_cycle_value,
|
s.cycle_value as sub_cycle_value,
|
||||||
s.preview_file as sub_preview_file,
|
s.preview_file as sub_preview_file,
|
||||||
-- s.net_preview_file as sub_net_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.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.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.net_mp4_file as sub_net_mp4_file,
|
||||||
s.service_duration as sub_service_duration,
|
s.service_duration as sub_service_duration,
|
||||||
s.service_content as sub_service_content,
|
s.service_content as sub_service_content,
|
||||||
s.toll_price as sub_toll_price,
|
s.toll_price as sub_toll_price,
|
||||||
s.com_price as sub_com_price,
|
s.com_price as sub_com_price,
|
||||||
s.real_com_price as sub_real_com_price,
|
s.real_com_price as sub_real_com_price,
|
||||||
s.package_id as sub_package_id,
|
s.package_id as sub_package_id,
|
||||||
s.package_name as sub_package_name,
|
s.package_name as sub_package_name,
|
||||||
s.iz_package as sub_iz_package,
|
s.iz_package as sub_iz_package,
|
||||||
s.start_time as sub_start_time,
|
s.start_time as sub_start_time,
|
||||||
s.end_time as sub_end_time,
|
s.end_time as sub_end_time,
|
||||||
s.begin_time as sub_begin_time,
|
s.begin_time as sub_begin_time,
|
||||||
s.finish_time as sub_finish_time,
|
s.finish_time as sub_finish_time,
|
||||||
s.iz_start as sub_iz_start,
|
s.iz_start as sub_iz_start,
|
||||||
s.iz_finish as sub_iz_finish,
|
s.iz_finish as sub_iz_finish,
|
||||||
s.create_by as sub_create_by,
|
s.create_by as sub_create_by,
|
||||||
s.create_time as sub_create_time,
|
s.create_time as sub_create_time,
|
||||||
s.update_by as sub_update_by,
|
s.update_by as sub_update_by,
|
||||||
s.update_time as sub_update_time,
|
s.update_time as sub_update_time,
|
||||||
s.del_flag as sub_del_flag,
|
s.del_flag as sub_del_flag,
|
||||||
s.tplink_path as sub_tplink_path,
|
s.tplink_path as sub_tplink_path,
|
||||||
s.manually_pic_path as sub_manually_pic_path,
|
s.manually_pic_path as sub_manually_pic_path,
|
||||||
s.manually_mp4_path as sub_manually_mp4_path
|
s.manually_mp4_path as sub_manually_mp4_path
|
||||||
FROM nu_biz_directive_order o
|
FROM nu_biz_directive_order o
|
||||||
LEFT JOIN nu_biz_nu_directive_order_info s ON o.id = s.main_id
|
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 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'
|
WHERE o.order_type = '1'
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
|
@ -448,36 +447,35 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getInstantById" resultType="com.nu.modules.biz.order.entity.DirectiveOrder">
|
<select id="getInstantById" resultType="com.nu.modules.biz.order.entity.DirectiveOrder">
|
||||||
select
|
select m.id as bizId,
|
||||||
m.id as bizId,
|
m.nu_id as nuId,
|
||||||
m.nu_id as nuId,
|
b.nu_name as nuName,
|
||||||
b.nu_name as nuName,
|
c.id as elderId,
|
||||||
c.id as elderId,
|
c.name as elderName,
|
||||||
c.name as elderName,
|
m.directive_id as directiveId,
|
||||||
m.directive_id as directiveId,
|
m.cycle_type_id as cycleTypeId,
|
||||||
m.cycle_type_id as cycleTypeId,
|
d.item_text as cycleType,
|
||||||
d.item_text as cycleType,
|
iz_package,
|
||||||
iz_package,
|
(case when c.orderly is null then 2 else 1 end) as orderEmp
|
||||||
(case when c.orderly is null then 2 else 1 end) as orderEmp
|
|
||||||
from ${tableName} m
|
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)
|
inner join nu_base_info b on m.nu_id = b.nu_id and b.del_flag = '0' and
|
||||||
left join nu_biz_elder_info c on b.elder_id = c.id and c.del_flag = '0'
|
(case when b.area_flag = 1 then b.status = '2' else 1 = 1 end)
|
||||||
left join view_sys_dict d on m.cycle_type_id = d.item_value and d.dict_code = 'period_type'
|
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}
|
where m.id = #{id}
|
||||||
and m.cycle_type_id = '2'
|
and m.cycle_type_id = '2'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getDirectiveById" resultType="com.nu.modules.biz.order.entity.DirectiveOrder">
|
<select id="getDirectiveById" resultType="com.nu.modules.biz.order.entity.DirectiveOrder">
|
||||||
select
|
select a.id as directiveId,
|
||||||
a.id as directiveId,
|
a.directive_name as directiveName,
|
||||||
a.directive_name as directiveName,
|
a.preview_file as previewFile,
|
||||||
a.preview_file as previewFile,
|
a.preview_file_small as previewFileSmall,
|
||||||
a.preview_file_small as previewFileSmall,
|
a.mp3_file as mp3File,
|
||||||
a.mp3_file as mp3File,
|
a.mp4_file as mp4File,
|
||||||
a.mp4_file as mp4File,
|
a.service_duration as serviceDuration,
|
||||||
a.service_duration as serviceDuration,
|
a.service_content as serviceContent,
|
||||||
a.service_content as serviceContent,
|
a.timeout_duration as timeoutDuration
|
||||||
a.timeout_duration as timeoutDuration
|
|
||||||
from nu_config_service_directive a
|
from nu_config_service_directive a
|
||||||
where a.id = #{directiveId}
|
where a.id = #{directiveId}
|
||||||
and a.del_flag = '0'
|
and a.del_flag = '0'
|
||||||
|
|
@ -485,12 +483,11 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getPackageById" resultType="com.nu.modules.biz.order.entity.DirectiveOrder">
|
<select id="getPackageById" resultType="com.nu.modules.biz.order.entity.DirectiveOrder">
|
||||||
select
|
select a.id as directiveId,
|
||||||
a.id as directiveId,
|
a.package_name as directiveName,
|
||||||
a.package_name as directiveName,
|
a.total_duration as serviceDuration,
|
||||||
a.total_duration as serviceDuration,
|
a.description as serviceContent,
|
||||||
a.description as serviceContent,
|
a.timeout_duration as timeoutDuration
|
||||||
a.timeout_duration as timeoutDuration
|
|
||||||
from nu_config_directive_package_main a
|
from nu_config_directive_package_main a
|
||||||
where a.id = #{directiveId}
|
where a.id = #{directiveId}
|
||||||
and a.del_flag = '0'
|
and a.del_flag = '0'
|
||||||
|
|
@ -504,4 +501,93 @@
|
||||||
where a.id = #{employeeId}
|
where a.id = #{employeeId}
|
||||||
</select>
|
</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>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -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.DirectiveOrderBizLog;
|
||||||
import com.nu.modules.biz.order.entity.DirectiveOrderInfo;
|
import com.nu.modules.biz.order.entity.DirectiveOrderInfo;
|
||||||
import com.nu.modules.biz.order.mapper.DirectiveOrderBizLogMapper;
|
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.DirectiveOrderInfoMapper;
|
||||||
|
import com.nu.modules.biz.order.mapper.DirectiveOrderMapper;
|
||||||
import com.nu.modules.biz.order.service.IDirectiveOrderInfoService;
|
import com.nu.modules.biz.order.service.IDirectiveOrderInfoService;
|
||||||
import com.nu.modules.biz.order.service.IDirectiveOrderService;
|
import com.nu.modules.biz.order.service.IDirectiveOrderService;
|
||||||
import com.nu.modules.directiveorder.api.IDirectiveOrderLogApi;
|
import com.nu.modules.directiveorder.api.IDirectiveOrderLogApi;
|
||||||
|
|
@ -21,16 +21,17 @@ import com.nu.modules.order.api.IDirectiveOrderApi;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.shiro.SecurityUtils;
|
import org.apache.shiro.SecurityUtils;
|
||||||
import org.jeecg.common.system.query.QueryGenerator;
|
|
||||||
import org.jeecg.common.system.vo.LoginUser;
|
import org.jeecg.common.system.vo.LoginUser;
|
||||||
import org.jeecg.common.util.DateUtils;
|
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.*;
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 服务指令工单主表
|
* @Description: 服务指令工单主表
|
||||||
|
|
@ -79,110 +80,37 @@ public class DirectiveOrderPadServiceImpl extends ServiceImpl<DirectiveOrderMapp
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public IPage<DirectiveOrderEntity> queryOrderList(Integer pageNo, Integer pageSize, DirectiveOrderEntity directiveOrderEntity, HttpServletRequest req) {
|
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);
|
Page<DirectiveOrder> page = new Page<>(pageNo, pageSize);
|
||||||
List<DirectiveOrder> list = baseMapper.selectList(page, queryWrapper);
|
//workType工单类型 1待执行 2已执行 3已完成 4已过期 5待执行或者已执行未完成 空是全部
|
||||||
IPage<DirectiveOrderEntity> entityPage = new Page<>(page.getCurrent(), page.getSize(), page.getTotal());
|
return baseMapper.queryOrderList(page, directiveOrderEntity);
|
||||||
entityPage.setRecords(BeanUtil.copyToList(list, DirectiveOrderEntity.class));
|
|
||||||
return entityPage;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DirectiveOrderInfoEntity> queryOrderInfoList(DirectiveOrderInfoEntity directiveOrderInfoEntity, HttpServletRequest req) {
|
public List<DirectiveOrderEntity> queryOrderInfoList(DirectiveOrderEntity directiveOrderInfoEntity, HttpServletRequest req) {
|
||||||
DirectiveOrderInfo directiveOrderInfo = new DirectiveOrderInfo();
|
List<DirectiveOrderEntity> list = directiveOrderInfoMapper.queryOrderInfoList(directiveOrderInfoEntity);
|
||||||
BeanUtils.copyProperties(directiveOrderInfoEntity, directiveOrderInfo);
|
return list;
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> startOrder(DirectiveOrderEntity directiveOrderEntity) {
|
public Map<String, Object> startOrder(DirectiveOrderEntity directiveOrderEntity) {
|
||||||
DirectiveOrder directiveOrder = baseMapper.selectById(directiveOrderEntity.getId());
|
DirectiveOrder directiveOrder = baseMapper.selectById(directiveOrderEntity.getId());
|
||||||
directiveOrder.setIzStart("Y");
|
directiveOrder.setEmpStartTime(new Date());
|
||||||
directiveOrder.setBeginTime(new Date());
|
if (StringUtils.isEmpty(directiveOrder.getEmployeeIds())) {
|
||||||
|
//如果未进行转单、协助等操作,此时实际执行人字段都为空 需将实际执行人设置为派单时派发的员工
|
||||||
|
directiveOrder.setEmployeeIds(directiveOrder.getEmployeeId());
|
||||||
|
directiveOrder.setEmployeeNames(directiveOrder.getEmployeeNames());
|
||||||
|
}
|
||||||
baseMapper.updateById(directiveOrder);
|
baseMapper.updateById(directiveOrder);
|
||||||
|
|
||||||
QueryWrapper<DirectiveOrderInfo> queryWrapper = new QueryWrapper<>();
|
// QueryWrapper<DirectiveOrderInfo> queryWrapper = new QueryWrapper<>();
|
||||||
List<DirectiveOrderInfo> list = directiveOrderInfoMapper.selectList(queryWrapper);
|
// List<DirectiveOrderInfo> list = directiveOrderInfoMapper.selectList(queryWrapper);
|
||||||
|
|
||||||
|
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
map.put("success", true);
|
map.put("success", true);
|
||||||
map.put("message", "操作成功");
|
map.put("message", "操作成功");
|
||||||
map.put("directiveOrder", directiveOrder);
|
map.put("directiveOrder", directiveOrder);
|
||||||
map.put("directiveOrderInfo", list);
|
// map.put("directiveOrderInfo", list);
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -268,11 +196,11 @@ public class DirectiveOrderPadServiceImpl extends ServiceImpl<DirectiveOrderMapp
|
||||||
directiveOrderService.updateById(directiveOrder);
|
directiveOrderService.updateById(directiveOrder);
|
||||||
|
|
||||||
//子表
|
//子表
|
||||||
DirectiveOrderInfo directiveOrderInfo = new DirectiveOrderInfo();
|
// DirectiveOrderInfo directiveOrderInfo = new DirectiveOrderInfo();
|
||||||
directiveOrderInfo.setManuallyMp4Path(directiveOrderEntity.getManuallyMp4Path());
|
// directiveOrderInfo.setManuallyMp4Path(directiveOrderEntity.getManuallyMp4Path());
|
||||||
UpdateWrapper<DirectiveOrderInfo> uw = new UpdateWrapper<>();
|
// UpdateWrapper<DirectiveOrderInfo> uw = new UpdateWrapper<>();
|
||||||
uw.eq("main_id", directiveOrderEntity.getId());
|
// uw.eq("main_id", directiveOrderEntity.getId());
|
||||||
directiveOrderInfoService.update(directiveOrderInfo, uw);
|
// directiveOrderInfoService.update(directiveOrderInfo, uw);
|
||||||
|
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
map.put("success", true);
|
map.put("success", true);
|
||||||
|
|
@ -289,11 +217,11 @@ public class DirectiveOrderPadServiceImpl extends ServiceImpl<DirectiveOrderMapp
|
||||||
directiveOrderService.updateById(directiveOrder);
|
directiveOrderService.updateById(directiveOrder);
|
||||||
|
|
||||||
//子表
|
//子表
|
||||||
DirectiveOrderInfo directiveOrderInfo = new DirectiveOrderInfo();
|
// DirectiveOrderInfo directiveOrderInfo = new DirectiveOrderInfo();
|
||||||
directiveOrderInfo.setManuallyPicPath(directiveOrderEntity.getManuallyPicPath());
|
// directiveOrderInfo.setManuallyPicPath(directiveOrderEntity.getManuallyPicPath());
|
||||||
UpdateWrapper<DirectiveOrderInfo> uw = new UpdateWrapper<>();
|
// UpdateWrapper<DirectiveOrderInfo> uw = new UpdateWrapper<>();
|
||||||
uw.eq("main_id", directiveOrderEntity.getId());
|
// uw.eq("main_id", directiveOrderEntity.getId());
|
||||||
directiveOrderInfoService.update(directiveOrderInfo, uw);
|
// directiveOrderInfoService.update(directiveOrderInfo, uw);
|
||||||
|
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
map.put("success", true);
|
map.put("success", true);
|
||||||
|
|
@ -317,31 +245,21 @@ public class DirectiveOrderPadServiceImpl extends ServiceImpl<DirectiveOrderMapp
|
||||||
@Override
|
@Override
|
||||||
public void transferOrder(DirectiveOrderInfoEntity dto) {
|
public void transferOrder(DirectiveOrderInfoEntity dto) {
|
||||||
DirectiveOrder main = new DirectiveOrder();
|
DirectiveOrder main = new DirectiveOrder();
|
||||||
DirectiveOrderInfo sub = new DirectiveOrderInfo();
|
|
||||||
|
|
||||||
String optType = "3";//转单
|
String optType = "3";//转单
|
||||||
|
|
||||||
//执行类型
|
//执行类型
|
||||||
main.setOptType(optType);
|
main.setOptType(optType);
|
||||||
sub.setOptType(optType);
|
|
||||||
//主要执行人
|
//主要执行人
|
||||||
main.setEmployeeId(dto.getEmployeeId());
|
main.setEmployeeIds(dto.getEmployeeId());
|
||||||
main.setEmployeeName(dto.getEmployeeName());
|
main.setEmployeeNames(dto.getEmployeeName());
|
||||||
sub.setEmployeeId(dto.getEmployeeId());
|
|
||||||
sub.setEmployeeName(dto.getEmployeeName());
|
|
||||||
//实际执行人
|
//实际执行人
|
||||||
main.setOptIds(dto.getEmployeeId());
|
main.setOptIds(dto.getEmployeeId());
|
||||||
main.setOptNames(dto.getEmployeeName());
|
main.setOptNames(dto.getEmployeeName());
|
||||||
sub.setOptIds(dto.getEmployeeId());
|
|
||||||
sub.setOptNames(dto.getEmployeeName());
|
|
||||||
|
|
||||||
//修改主表
|
//修改主表
|
||||||
main.setId(dto.getMainId());
|
main.setId(dto.getMainId());
|
||||||
directiveOrderService.updateById(main);
|
directiveOrderService.updateById(main);
|
||||||
//修改子表
|
|
||||||
UpdateWrapper<DirectiveOrderInfo> subUW = new UpdateWrapper<>();
|
|
||||||
subUW.eq("main_id", dto.getMainId());
|
|
||||||
directiveOrderInfoMapper.update(sub, subUW);
|
|
||||||
|
|
||||||
//日志
|
//日志
|
||||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue