This commit is contained in:
1378012178@qq.com 2026-01-12 09:21:59 +08:00
commit c8dd22a559
10 changed files with 152 additions and 60 deletions

View File

@ -56,7 +56,7 @@ public class ServiceOrderApi {
@AutoLog(value = "服务指令工单-开始服务",clientType="app", operateType = 2) @AutoLog(value = "服务指令工单-开始服务",clientType="app", operateType = 2)
@PostMapping(value = "/startOrder") @PostMapping(value = "/startOrder")
public Result<String> startOrder(@RequestBody DirectiveOrderSubEntity directiveOrderSubEntity) { public Result<String> startOrder(@RequestBody DirectiveOrderSubEntity directiveOrderSubEntity) {
Map<String, Object> pddMap = directiveOrderApi.startOrder(directiveOrderSubEntity); Map<String, Object> result = directiveOrderApi.startOrder(directiveOrderSubEntity);
return Result.OK("操作成功!"); return Result.OK("操作成功!");
} }
@ -64,7 +64,7 @@ public class ServiceOrderApi {
@AutoLog(value = "服务指令工单-结束服务",clientType="app", operateType = 2) @AutoLog(value = "服务指令工单-结束服务",clientType="app", operateType = 2)
@PostMapping(value = "/endOrder") @PostMapping(value = "/endOrder")
public Result<String> endOrder(@RequestBody DirectiveOrderSubEntity directiveOrderSubEntity) { public Result<String> endOrder(@RequestBody DirectiveOrderSubEntity directiveOrderSubEntity) {
Map<String, Object> pddMap = directiveOrderApi.endOrder(directiveOrderSubEntity); Map<String, Object> result = directiveOrderApi.endOrder(directiveOrderSubEntity);
return Result.OK("操作成功!"); return Result.OK("操作成功!");
} }
@ -73,7 +73,7 @@ public class ServiceOrderApi {
@AutoLog(value = "服务指令工单-上传mp4",clientType="app", operateType = 2) @AutoLog(value = "服务指令工单-上传mp4",clientType="app", operateType = 2)
@PostMapping(value = "/editSubMp4") @PostMapping(value = "/editSubMp4")
public Result<String> editSubMp4(@RequestBody DirectiveOrderSubEntity directiveOrderSubEntity) { public Result<String> editSubMp4(@RequestBody DirectiveOrderSubEntity directiveOrderSubEntity) {
Map<String, Object> pddMap = directiveOrderApi.editSubMp4(directiveOrderSubEntity); Map<String, Object> result = directiveOrderApi.editSubMp4(directiveOrderSubEntity);
return Result.OK("操作成功!"); return Result.OK("操作成功!");
} }
@ -81,7 +81,7 @@ public class ServiceOrderApi {
@AutoLog(value = "服务指令工单-上传照片",clientType="app", operateType = 2) @AutoLog(value = "服务指令工单-上传照片",clientType="app", operateType = 2)
@PostMapping(value = "/editSubPicPath") @PostMapping(value = "/editSubPicPath")
public Result<String> editSubPicPath(@RequestBody DirectiveOrderSubEntity directiveOrderSubEntity) { public Result<String> editSubPicPath(@RequestBody DirectiveOrderSubEntity directiveOrderSubEntity) {
Map<String, Object> pddMap = directiveOrderApi.editSubPicPath(directiveOrderSubEntity); Map<String, Object> result = directiveOrderApi.editSubPicPath(directiveOrderSubEntity);
return Result.OK("操作成功!"); return Result.OK("操作成功!");
} }
@ -98,4 +98,13 @@ public class ServiceOrderApi {
IPage<DirectiveOrderEntity> pageList = directiveOrderApi.queryWorkOrderList(pageNo, pageSize, directiveOrderEntity,req); IPage<DirectiveOrderEntity> pageList = directiveOrderApi.queryWorkOrderList(pageNo, pageSize, directiveOrderEntity,req);
return Result.OK(pageList); return Result.OK(pageList);
} }
@ApiOperation(value="服务指令工单-生成即时指令工单", notes="服务指令工单-生成即时指令工单")
@AutoLog(value = "服务指令工单-生成即时指令工单",clientType="app", operateType = 2)
@PostMapping(value = "/generateInstant")
public Result<String> generateInstant(@RequestBody DirectiveOrderEntity directiveOrderEntity) {
Map<String, Object> result = directiveOrderApi.generateOrdersInstant(directiveOrderEntity);
return Result.OK("操作成功!");
}
} }

View File

@ -135,6 +135,8 @@ public class DirectiveOrderEntity implements Serializable {
private String remarks; private String remarks;
/**工单类型 1待执行 2已执行 3已完成 4已过期 5待执行或者已执行未完成 空是全部*/ /**工单类型 1待执行 2已执行 3已完成 4已过期 5待执行或者已执行未完成 空是全部*/
private String workType; private String workType;
/**发起模式 1主动触发工单派给发起人自己 2被动触发中控发起派单规则发送给员工*/
private String triggerMode;
/** /**
* 子表信息 * 子表信息
*/ */

View File

@ -4,6 +4,7 @@ import com.nu.entity.DirectiveOrderSubEntity;
import java.util.List; import java.util.List;
// 作废
public interface IDirectiveOrderApi { public interface IDirectiveOrderApi {
} }

View File

@ -49,4 +49,6 @@ public interface IDirectiveOrderApi {
List<DirectiveOrderEntity> queryCurrent(CareDirectiveEntity dto); List<DirectiveOrderEntity> queryCurrent(CareDirectiveEntity dto);
Map<String, Object> generateOrdersInstant(DirectiveOrderEntity directiveOrderEntity);
} }

View File

@ -194,4 +194,11 @@ public class DirectiveOrder implements Serializable {
//空闲状态提高3级 指定护理员提高2级 //空闲状态提高3级 指定护理员提高2级
@TableField(exist = false) @TableField(exist = false)
private Integer level; private Integer level;
/**发起模式 1主动触发工单派给发起人自己 2被动触发中控发起派单规则发送给员工*/
@TableField(exist = false)
private String triggerMode;
@TableField(exist = false)
private String tableName;//表名字
} }

View File

@ -37,4 +37,5 @@ public interface DirectiveOrderMapper extends BaseMapper<DirectiveOrder> {
List<DirectiveOrderEntity> queryCurrent(@Param("dto") CareDirectiveEntity dto); List<DirectiveOrderEntity> queryCurrent(@Param("dto") CareDirectiveEntity dto);
DirectiveOrder getDirectiveById(DirectiveOrder orders);
} }

View File

@ -109,73 +109,74 @@
</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 a.id as poolId, select
a.biz_id as bizId, a.id as poolId,
a.nu_id as nuId, a.biz_id as bizId,
a.nu_name as nuName, a.nu_id as nuId,
a.elder_id as elderId, a.nu_name as nuName,
a.elder_name as elderName, a.elder_id as elderId,
a.directive_id as directiveId, a.elder_name as elderName,
a.directive_name as directiveName, a.directive_id as directiveId,
a.cycle_type_id as cycleTypeId, a.directive_name as directiveName,
a.cycle_type as cycleType, a.cycle_type_id as cycleTypeId,
a.cycle_value as cycleValue, a.cycle_type as cycleType,
a.preview_file as previewFile, a.cycle_value as cycleValue,
a.net_preview_file as netPeviewFile, a.preview_file as previewFile,
a.preview_file_small as previewFileSmall, a.net_preview_file as netPeviewFile,
a.net_preview_file_small as netPreviewFileSmall, a.preview_file_small as previewFileSmall,
a.mp3_file as mp3File, a.net_preview_file_small as netPreviewFileSmall,
a.net_mp3_file as netMp3File, a.mp3_file as mp3File,
a.mp4_file as mp4File, a.net_mp3_file as netMp3File,
a.net_mp4_file as netMp4File, a.mp4_file as mp4File,
a.service_duration as serviceDuration, a.net_mp4_file as netMp4File,
a.service_content as serviceContent, a.service_duration as serviceDuration,
a.package_id as packageId, a.service_content as serviceContent,
a.package_name as packageName, a.package_id as packageId,
a.iz_package as izPackage, a.package_name as packageName,
a.start_time as startTime, a.iz_package as izPackage,
a.end_time as endTime, a.start_time as startTime,
(case when b.orderly is null then 2 else 1 end) as orderEmp a.end_time as endTime,
(case when b.orderly is null then 2 else 1 end) as orderEmp
from nu_biz_nu_care_directive_data_pool a from nu_biz_nu_care_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_servcie_tags b on a.id = b.employees_id inner join nu_biz_employees_servcie_tags b on a.id = b.employees_id
inner join nu_service_tag c on c.id = b.tags_id inner join nu_service_tag c on c.id = b.tags_id
inner join nu_servtag_directive d on d.tag_id = c.id inner join nu_servtag_directive 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_sub from nu_biz_nu_directive_order_sub
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 &lt;=DATE_FORMAT(NOW(), '%Y-%m-%d 23:59:59') and start_time &lt;=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_sub from nu_biz_nu_directive_order_sub
where start_time = #{startTime} where start_time = #{startTime}
or (start_time &lt; #{startTime} and end_time > #{startTime}) or (start_time &lt; #{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'
@ -410,4 +411,11 @@
<include refid="commonConditions"/> <include refid="commonConditions"/>
ORDER BY o.start_time, s.start_time ORDER BY o.start_time, s.start_time
</select> </select>
<select id="getDirectiveById" resultType="com.nu.modules.biz.order.entity.DirectiveOrder">
select m.*
from ${tableName} m
where m.id = #{id}
</select>
</mapper> </mapper>

View File

@ -2,8 +2,11 @@ package com.nu.modules.biz.order.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.nu.modules.biz.order.entity.DirectiveOrder; import com.nu.modules.biz.order.entity.DirectiveOrder;
import org.apache.ibatis.annotations.Param;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
import java.util.Map;
/** /**
* @Description: 服务指令工单主表 * @Description: 服务指令工单主表
* @Author: caolei * @Author: caolei
@ -12,4 +15,5 @@ import org.jeecg.common.api.vo.Result;
*/ */
public interface IDirectiveOrderService extends IService<DirectiveOrder> { public interface IDirectiveOrderService extends IService<DirectiveOrder> {
Result<?> generateOrdersBatch(); Result<?> generateOrdersBatch();
Map<String, Object> generateOrdersInstant(DirectiveOrder directiveOrder);
} }

View File

@ -13,6 +13,7 @@ import com.nu.modules.biz.order.entity.DirectiveOrder;
import com.nu.modules.biz.order.entity.DirectiveOrderSub; import com.nu.modules.biz.order.entity.DirectiveOrderSub;
import com.nu.modules.biz.order.mapper.DirectiveOrderMapper; import com.nu.modules.biz.order.mapper.DirectiveOrderMapper;
import com.nu.modules.biz.order.mapper.DirectiveOrderSubMapper; import com.nu.modules.biz.order.mapper.DirectiveOrderSubMapper;
import com.nu.modules.biz.order.service.IDirectiveOrderService;
import com.nu.modules.order.api.IDirectiveOrderApi; 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;
@ -36,7 +37,7 @@ import java.util.*;
public class DirectiveOrderPadServiceImpl extends ServiceImpl<DirectiveOrderMapper, DirectiveOrder> implements IDirectiveOrderApi { public class DirectiveOrderPadServiceImpl extends ServiceImpl<DirectiveOrderMapper, DirectiveOrder> implements IDirectiveOrderApi {
@Autowired @Autowired
private DirectiveOrderMapper directiveOrderMapper; private IDirectiveOrderService directiveOrderService;
@Autowired @Autowired
private DirectiveOrderSubMapper directiveOrderSubMapper; private DirectiveOrderSubMapper directiveOrderSubMapper;
@ -53,7 +54,7 @@ public class DirectiveOrderPadServiceImpl extends ServiceImpl<DirectiveOrderMapp
@Override @Override
public DirectiveOrderEntity selectInfoById(String id) { public DirectiveOrderEntity selectInfoById(String id) {
DirectiveOrderEntity result = new DirectiveOrderEntity(); DirectiveOrderEntity result = new DirectiveOrderEntity();
BeanUtils.copyProperties(directiveOrderMapper.selectInfoById(id),result); BeanUtils.copyProperties(baseMapper.selectInfoById(id),result);
return result; return result;
} }
@ -212,4 +213,16 @@ public class DirectiveOrderPadServiceImpl extends ServiceImpl<DirectiveOrderMapp
return map; return map;
} }
/**
* 生成即时服务指令工单
* @param directiveOrderEntity
* @return
*/
@Override
public Map<String, Object> generateOrdersInstant(DirectiveOrderEntity directiveOrderEntity){
DirectiveOrder directiveOrder = new DirectiveOrder();
BeanUtils.copyProperties(directiveOrderEntity,directiveOrder);
return directiveOrderService.generateOrdersInstant(directiveOrder);
}
} }

View File

@ -13,8 +13,10 @@ import com.nu.modules.config.sendorderrule.entity.SendOrderRuleSub;
import com.nu.modules.config.sendorderrule.service.ISendOrderRuleService; import com.nu.modules.config.sendorderrule.service.ISendOrderRuleService;
import com.nu.modules.config.sendorderrule.service.ISendOrderRuleSubService; import com.nu.modules.config.sendorderrule.service.ISendOrderRuleSubService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.api.ISysBaseAPI; import org.jeecg.common.system.api.ISysBaseAPI;
import org.jeecg.common.system.vo.LoginUser;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -579,4 +581,47 @@ public class DirectiveOrderServiceImpl extends ServiceImpl<DirectiveOrderMapper,
return mainOrderNo+frontNo; return mainOrderNo+frontNo;
} }
/**
* 生成即时服务指令工单
* @param directiveOrder
* @return
*/
@Override
public Map<String, Object> generateOrdersInstant(DirectiveOrder directiveOrder){
Map<String, Object> map = new HashMap<>();
map.put("success",true);
map.put("message","操作成功");
String orderType = directiveOrder.getOrderType();
if(orderType.equals("1")){
//护理即时
directiveOrder.setTableName("nu_biz_nu_care_directive_plan_instant");
}
if(orderType.equals("2")){
//医疗即时
directiveOrder.setTableName("nu_biz_nu_medical_directive_plan_instant");
}
if(orderType.equals("3")){
//仓库即时
directiveOrder.setTableName("nu_biz_nu_invoicing_directive_plan_instant");
}
if(orderType.equals("4")){
//后勤即时
directiveOrder.setTableName("nu_biz_nu_logistics_directive_plan_instant");
}
DirectiveOrder directiveInfo = baseMapper.getDirectiveById(directiveOrder);
if(directiveOrder.getTriggerMode().equals("1")){
//直接派单给发起人
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String employeeId = sysUser.getEmployessId();
}else{
//按规则派单
getSendOrderRule();
}
return map;
}
} }