Merge branch 'master' of http://47.115.223.229:8888/yangjun/nursing_unit_java
This commit is contained in:
commit
c8dd22a559
|
|
@ -56,7 +56,7 @@ public class ServiceOrderApi {
|
|||
@AutoLog(value = "服务指令工单-开始服务",clientType="app", operateType = 2)
|
||||
@PostMapping(value = "/startOrder")
|
||||
public Result<String> startOrder(@RequestBody DirectiveOrderSubEntity directiveOrderSubEntity) {
|
||||
Map<String, Object> pddMap = directiveOrderApi.startOrder(directiveOrderSubEntity);
|
||||
Map<String, Object> result = directiveOrderApi.startOrder(directiveOrderSubEntity);
|
||||
return Result.OK("操作成功!");
|
||||
}
|
||||
|
||||
|
|
@ -64,7 +64,7 @@ public class ServiceOrderApi {
|
|||
@AutoLog(value = "服务指令工单-结束服务",clientType="app", operateType = 2)
|
||||
@PostMapping(value = "/endOrder")
|
||||
public Result<String> endOrder(@RequestBody DirectiveOrderSubEntity directiveOrderSubEntity) {
|
||||
Map<String, Object> pddMap = directiveOrderApi.endOrder(directiveOrderSubEntity);
|
||||
Map<String, Object> result = directiveOrderApi.endOrder(directiveOrderSubEntity);
|
||||
return Result.OK("操作成功!");
|
||||
}
|
||||
|
||||
|
|
@ -73,7 +73,7 @@ public class ServiceOrderApi {
|
|||
@AutoLog(value = "服务指令工单-上传mp4",clientType="app", operateType = 2)
|
||||
@PostMapping(value = "/editSubMp4")
|
||||
public Result<String> editSubMp4(@RequestBody DirectiveOrderSubEntity directiveOrderSubEntity) {
|
||||
Map<String, Object> pddMap = directiveOrderApi.editSubMp4(directiveOrderSubEntity);
|
||||
Map<String, Object> result = directiveOrderApi.editSubMp4(directiveOrderSubEntity);
|
||||
return Result.OK("操作成功!");
|
||||
}
|
||||
|
||||
|
|
@ -81,7 +81,7 @@ public class ServiceOrderApi {
|
|||
@AutoLog(value = "服务指令工单-上传照片",clientType="app", operateType = 2)
|
||||
@PostMapping(value = "/editSubPicPath")
|
||||
public Result<String> editSubPicPath(@RequestBody DirectiveOrderSubEntity directiveOrderSubEntity) {
|
||||
Map<String, Object> pddMap = directiveOrderApi.editSubPicPath(directiveOrderSubEntity);
|
||||
Map<String, Object> result = directiveOrderApi.editSubPicPath(directiveOrderSubEntity);
|
||||
return Result.OK("操作成功!");
|
||||
}
|
||||
|
||||
|
|
@ -98,4 +98,13 @@ public class ServiceOrderApi {
|
|||
IPage<DirectiveOrderEntity> pageList = directiveOrderApi.queryWorkOrderList(pageNo, pageSize, directiveOrderEntity,req);
|
||||
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("操作成功!");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -135,6 +135,8 @@ public class DirectiveOrderEntity implements Serializable {
|
|||
private String remarks;
|
||||
/**工单类型 1待执行 2已执行 3已完成 4已过期 5待执行或者已执行未完成 空是全部*/
|
||||
private String workType;
|
||||
/**发起模式 1主动触发,工单派给发起人自己 2被动触发,中控发起,派单规则发送给员工*/
|
||||
private String triggerMode;
|
||||
/**
|
||||
* 子表信息
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.nu.entity.DirectiveOrderSubEntity;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
// 作废
|
||||
public interface IDirectiveOrderApi {
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,4 +49,6 @@ public interface IDirectiveOrderApi {
|
|||
|
||||
List<DirectiveOrderEntity> queryCurrent(CareDirectiveEntity dto);
|
||||
|
||||
Map<String, Object> generateOrdersInstant(DirectiveOrderEntity directiveOrderEntity);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -194,4 +194,11 @@ public class DirectiveOrder implements Serializable {
|
|||
//空闲状态提高3级 指定护理员提高2级
|
||||
@TableField(exist = false)
|
||||
private Integer level;
|
||||
|
||||
/**发起模式 1主动触发,工单派给发起人自己 2被动触发,中控发起,派单规则发送给员工*/
|
||||
@TableField(exist = false)
|
||||
private String triggerMode;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String tableName;//表名字
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,4 +37,5 @@ public interface DirectiveOrderMapper extends BaseMapper<DirectiveOrder> {
|
|||
|
||||
List<DirectiveOrderEntity> queryCurrent(@Param("dto") CareDirectiveEntity dto);
|
||||
|
||||
DirectiveOrder getDirectiveById(DirectiveOrder orders);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,73 +109,74 @@
|
|||
</resultMap>
|
||||
|
||||
<select id="queryDataPoolList" resultType="com.nu.modules.biz.order.entity.DirectiveOrder">
|
||||
select a.id as poolId,
|
||||
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.net_preview_file_small as netPreviewFileSmall,
|
||||
a.mp3_file as mp3File,
|
||||
a.net_mp3_file as netMp3File,
|
||||
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
|
||||
select
|
||||
a.id as poolId,
|
||||
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.net_preview_file_small as netPreviewFileSmall,
|
||||
a.mp3_file as mp3File,
|
||||
a.net_mp3_file as netMp3File,
|
||||
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
|
||||
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'
|
||||
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_servcie_tags b on a.id = b.employees_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
|
||||
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_sub
|
||||
where start_time >=DATE_FORMAT(NOW(), '%Y-%m-%d 00:00:00')
|
||||
and start_time <=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_sub
|
||||
where start_time >=DATE_FORMAT(NOW(), '%Y-%m-%d 00:00:00')
|
||||
and start_time <=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_sub
|
||||
where start_time = #{startTime}
|
||||
or (start_time < #{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_sub
|
||||
where start_time = #{startTime}
|
||||
or (start_time < #{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'
|
||||
|
|
@ -410,4 +411,11 @@
|
|||
<include refid="commonConditions"/>
|
||||
ORDER BY o.start_time, s.start_time
|
||||
</select>
|
||||
|
||||
<select id="getDirectiveById" resultType="com.nu.modules.biz.order.entity.DirectiveOrder">
|
||||
select m.*
|
||||
from ${tableName} m
|
||||
where m.id = #{id}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -2,8 +2,11 @@ package com.nu.modules.biz.order.service;
|
|||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.nu.modules.biz.order.entity.DirectiveOrder;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令工单主表
|
||||
* @Author: caolei
|
||||
|
|
@ -12,4 +15,5 @@ import org.jeecg.common.api.vo.Result;
|
|||
*/
|
||||
public interface IDirectiveOrderService extends IService<DirectiveOrder> {
|
||||
Result<?> generateOrdersBatch();
|
||||
Map<String, Object> generateOrdersInstant(DirectiveOrder directiveOrder);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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.mapper.DirectiveOrderMapper;
|
||||
import com.nu.modules.biz.order.mapper.DirectiveOrderSubMapper;
|
||||
import com.nu.modules.biz.order.service.IDirectiveOrderService;
|
||||
import com.nu.modules.order.api.IDirectiveOrderApi;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
|
@ -36,7 +37,7 @@ import java.util.*;
|
|||
public class DirectiveOrderPadServiceImpl extends ServiceImpl<DirectiveOrderMapper, DirectiveOrder> implements IDirectiveOrderApi {
|
||||
|
||||
@Autowired
|
||||
private DirectiveOrderMapper directiveOrderMapper;
|
||||
private IDirectiveOrderService directiveOrderService;
|
||||
@Autowired
|
||||
private DirectiveOrderSubMapper directiveOrderSubMapper;
|
||||
|
||||
|
|
@ -53,7 +54,7 @@ public class DirectiveOrderPadServiceImpl extends ServiceImpl<DirectiveOrderMapp
|
|||
@Override
|
||||
public DirectiveOrderEntity selectInfoById(String id) {
|
||||
DirectiveOrderEntity result = new DirectiveOrderEntity();
|
||||
BeanUtils.copyProperties(directiveOrderMapper.selectInfoById(id),result);
|
||||
BeanUtils.copyProperties(baseMapper.selectInfoById(id),result);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
@ -212,4 +213,16 @@ public class DirectiveOrderPadServiceImpl extends ServiceImpl<DirectiveOrderMapp
|
|||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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.ISendOrderRuleSubService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
|
@ -579,4 +581,47 @@ public class DirectiveOrderServiceImpl extends ServiceImpl<DirectiveOrderMapper,
|
|||
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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue