服务指令-工单子表改名
This commit is contained in:
parent
1b63590722
commit
8988a0ce79
|
|
@ -41,11 +41,11 @@ public class ServiceOrderApi {
|
|||
|
||||
@ApiOperation(value = "服务指令工单-查询工单详细信息", notes = "服务指令工单-查询工单详细信息")
|
||||
@GetMapping(value = "/queryOrderInfoList")
|
||||
public Result<List<DirectiveOrderSubEntity>> queryOrderInfoList(DirectiveOrderSubEntity directiveOrderSubEntity, HttpServletRequest req) {
|
||||
if(StringUtils.isBlank(directiveOrderSubEntity.getMainId())){
|
||||
public Result<List<DirectiveOrderInfoEntity>> queryOrderInfoList(DirectiveOrderInfoEntity directiveOrderInfoEntity, HttpServletRequest req) {
|
||||
if(StringUtils.isBlank(directiveOrderInfoEntity.getMainId())){
|
||||
return Result.error("请选择工单");
|
||||
}
|
||||
List<DirectiveOrderSubEntity> pageList = directiveOrderApi.queryOrderInfoList(directiveOrderSubEntity,req);
|
||||
List<DirectiveOrderInfoEntity> pageList = directiveOrderApi.queryOrderInfoList(directiveOrderInfoEntity,req);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
|
|
@ -107,7 +107,7 @@ public class ServiceOrderApi {
|
|||
@ApiOperation(value="服务指令工单-转单", notes="服务指令工单-转单")
|
||||
@AutoLog(value = "服务指令工单-转单",clientType="app", operateType = 3)
|
||||
@PostMapping(value = "/transferOrder")
|
||||
public Result<String> transferOrder(@RequestBody DirectiveOrderSubEntity dto) {
|
||||
public Result<String> transferOrder(@RequestBody DirectiveOrderInfoEntity dto) {
|
||||
if(StringUtils.isBlank(dto.getMainId()) ){
|
||||
return Result.error("缺少参数");
|
||||
}
|
||||
|
|
@ -118,7 +118,7 @@ public class ServiceOrderApi {
|
|||
@ApiOperation(value="服务指令工单-协助执行", notes="服务指令工单-协助执行")
|
||||
@AutoLog(value = "服务指令工单-协助执行",clientType="app", operateType = 3)
|
||||
@PostMapping(value = "/assistOrder")
|
||||
public Result<String> assistOrder(@RequestBody DirectiveOrderSubEntity dto) {
|
||||
public Result<String> assistOrder(@RequestBody DirectiveOrderInfoEntity dto) {
|
||||
if(StringUtils.isBlank(dto.getMainId()) ){
|
||||
return Result.error("缺少参数");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ package com.nu.modules.centercontrol;
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nu.entity.DirectiveOrderSubEntity;
|
||||
import com.nu.entity.DirectiveOrderInfoEntity;
|
||||
import com.nu.entity.NuBaseInfoEntity;
|
||||
import com.nu.modules.order.api.IDirectiveOrderApi;
|
||||
import com.nu.modules.nubaseinfo.api.INuBaseInfoApi;
|
||||
|
|
@ -52,7 +52,7 @@ public class CenterControlController {
|
|||
*/
|
||||
@ApiOperation(value="中控-查询护理单元对应指令", notes="中控-查询护理单元对应指令")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<DirectiveOrderSubEntity>> queryPageList(DirectiveOrderSubEntity dto) {
|
||||
public Result<List<DirectiveOrderInfoEntity>> queryPageList(DirectiveOrderInfoEntity dto) {
|
||||
return Result.OK(directiveOrderApi.queryList(dto));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ public class DirectiveOrderEntity implements Serializable {
|
|||
/**
|
||||
* 子表信息
|
||||
*/
|
||||
private List<DirectiveOrderSubEntity> subList;
|
||||
private List<DirectiveOrderInfoEntity> infoList;
|
||||
|
||||
// 历史成功hisOk 历史失败hisFaild 正在执行current 待执行future
|
||||
private String executeStatus;
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import java.util.Date;
|
|||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
public class DirectiveOrderSubEntity implements Serializable {
|
||||
public class DirectiveOrderInfoEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**ID*/
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package com.nu.modules.directiveorder.api;
|
||||
|
||||
import com.nu.entity.DirectiveOrderSubEntity;
|
||||
import com.nu.entity.DirectiveOrderInfoEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
|
|||
|
|
@ -27,11 +27,11 @@ public interface IDirectiveOrderApi {
|
|||
*/
|
||||
DirectiveOrderEntity selectInfoById(String id);
|
||||
|
||||
List<DirectiveOrderSubEntity> queryList(DirectiveOrderSubEntity directiveOrderSubEntity);
|
||||
List<DirectiveOrderInfoEntity> queryList(DirectiveOrderInfoEntity directiveOrderInfoEntity);
|
||||
|
||||
IPage<DirectiveOrderEntity> queryOrderList(Integer pageNo, Integer pageSize, DirectiveOrderEntity directiveOrderEntity, HttpServletRequest req);
|
||||
|
||||
List<DirectiveOrderSubEntity> queryOrderInfoList(DirectiveOrderSubEntity directiveOrderSubEntity, HttpServletRequest req);
|
||||
List<DirectiveOrderInfoEntity> queryOrderInfoList(DirectiveOrderInfoEntity directiveOrderInfoEntity, HttpServletRequest req);
|
||||
|
||||
Map<String, Object> editSubMp4(DirectiveOrderEntity directiveOrderEntity);
|
||||
|
||||
|
|
@ -51,9 +51,9 @@ public interface IDirectiveOrderApi {
|
|||
|
||||
Map<String, Object> generateOrdersInstant(DirectiveOrderEntity directiveOrderEntity);
|
||||
|
||||
void transferOrder(DirectiveOrderSubEntity dto);
|
||||
void transferOrder(DirectiveOrderInfoEntity dto);
|
||||
|
||||
void assistOrder(DirectiveOrderSubEntity dto);
|
||||
void assistOrder(DirectiveOrderInfoEntity dto);
|
||||
|
||||
Map<String, Object> addBizLog(DirectiveOrderBizLogEntity directiveOrderBizLogEntity);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ public interface AppraisalSubMapper extends BaseMapper<AppraisalSub> {
|
|||
* 通过主表id查询子表数据
|
||||
*
|
||||
* @param mainId 主表id
|
||||
* @return List<NuBizNuDirectiveOrderSub>
|
||||
* @return List<NuBizNuDirectiveOrderInfo>
|
||||
*/
|
||||
List<AppraisalSub> selectByMainId(@Param("mainId") String mainId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ public interface IAppraisalSubService extends IService<AppraisalSub> {
|
|||
* 通过主表id查询子表数据
|
||||
*
|
||||
* @param mainId 主表id
|
||||
* @return List<NuBizNuDirectiveOrderSub>
|
||||
* @return List<NuBizNuDirectiveOrderInfo>
|
||||
*/
|
||||
List<AppraisalSub> selectByMainId(String mainId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ package com.nu.modules.biz.order.controller;
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nu.modules.biz.order.entity.DirectiveOrderSub;
|
||||
import com.nu.modules.biz.order.service.IDirectiveOrderSubService;
|
||||
import com.nu.modules.biz.order.entity.DirectiveOrderInfo;
|
||||
import com.nu.modules.biz.order.service.IDirectiveOrderInfoService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
|
@ -29,16 +29,16 @@ import java.util.Arrays;
|
|||
*/
|
||||
@Api(tags="护理单元-服务指令-工单子表")
|
||||
@RestController
|
||||
@RequestMapping("/services/directiveOrderSub")
|
||||
@RequestMapping("/services/directiveOrderInfo")
|
||||
@Slf4j
|
||||
public class DirectiveOrderSubController extends JeecgController<DirectiveOrderSub, IDirectiveOrderSubService> {
|
||||
public class DirectiveOrderInfoController extends JeecgController<DirectiveOrderInfo, IDirectiveOrderInfoService> {
|
||||
@Autowired
|
||||
private IDirectiveOrderSubService directiveOrderSubService;
|
||||
private IDirectiveOrderInfoService directiveOrderInfoService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param directiveOrderSub
|
||||
* @param directiveOrderInfo
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
|
|
@ -47,43 +47,43 @@ public class DirectiveOrderSubController extends JeecgController<DirectiveOrderS
|
|||
//@AutoLog(value = "护理单元-服务指令-工单子表-分页列表查询")
|
||||
@ApiOperation(value="护理单元-服务指令-工单子表-分页列表查询", notes="护理单元-服务指令-工单子表-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<DirectiveOrderSub>> queryPageList(DirectiveOrderSub directiveOrderSub,
|
||||
public Result<IPage<DirectiveOrderInfo>> queryPageList(DirectiveOrderInfo directiveOrderInfo,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<DirectiveOrderSub> queryWrapper = QueryGenerator.initQueryWrapper(directiveOrderSub, req.getParameterMap());
|
||||
Page<DirectiveOrderSub> page = new Page<DirectiveOrderSub>(pageNo, pageSize);
|
||||
IPage<DirectiveOrderSub> pageList = directiveOrderSubService.page(page, queryWrapper);
|
||||
QueryWrapper<DirectiveOrderInfo> queryWrapper = QueryGenerator.initQueryWrapper(directiveOrderInfo, req.getParameterMap());
|
||||
Page<DirectiveOrderInfo> page = new Page<DirectiveOrderInfo>(pageNo, pageSize);
|
||||
IPage<DirectiveOrderInfo> pageList = directiveOrderInfoService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param directiveOrderSub
|
||||
* @param directiveOrderInfo
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "护理单元-服务指令-工单子表-添加")
|
||||
@ApiOperation(value="护理单元-服务指令-工单子表-添加", notes="护理单元-服务指令-工单子表-添加")
|
||||
@RequiresPermissions("centercontrol:nu_biz_nu_directive_order_sub:add")
|
||||
@RequiresPermissions("centercontrol:nu_biz_nu_directive_order_info:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody DirectiveOrderSub directiveOrderSub) {
|
||||
directiveOrderSubService.save(directiveOrderSub);
|
||||
public Result<String> add(@RequestBody DirectiveOrderInfo directiveOrderInfo) {
|
||||
directiveOrderInfoService.save(directiveOrderInfo);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param directiveOrderSub
|
||||
* @param directiveOrderInfo
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "护理单元-服务指令-工单子表-编辑")
|
||||
@ApiOperation(value="护理单元-服务指令-工单子表-编辑", notes="护理单元-服务指令-工单子表-编辑")
|
||||
@RequiresPermissions("centercontrol:nu_biz_nu_directive_order_sub:edit")
|
||||
@RequiresPermissions("centercontrol:nu_biz_nu_directive_order_info:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody DirectiveOrderSub directiveOrderSub) {
|
||||
directiveOrderSubService.updateById(directiveOrderSub);
|
||||
public Result<String> edit(@RequestBody DirectiveOrderInfo directiveOrderInfo) {
|
||||
directiveOrderInfoService.updateById(directiveOrderInfo);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
|
|
@ -95,10 +95,10 @@ public class DirectiveOrderSubController extends JeecgController<DirectiveOrderS
|
|||
*/
|
||||
@AutoLog(value = "护理单元-服务指令-工单子表-通过id删除")
|
||||
@ApiOperation(value="护理单元-服务指令-工单子表-通过id删除", notes="护理单元-服务指令-工单子表-通过id删除")
|
||||
@RequiresPermissions("centercontrol:nu_biz_nu_directive_order_sub:delete")
|
||||
@RequiresPermissions("centercontrol:nu_biz_nu_directive_order_info:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
directiveOrderSubService.removeById(id);
|
||||
directiveOrderInfoService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
|
|
@ -110,10 +110,10 @@ public class DirectiveOrderSubController extends JeecgController<DirectiveOrderS
|
|||
*/
|
||||
@AutoLog(value = "护理单元-服务指令-工单子表-批量删除")
|
||||
@ApiOperation(value="护理单元-服务指令-工单子表-批量删除", notes="护理单元-服务指令-工单子表-批量删除")
|
||||
@RequiresPermissions("centercontrol:nu_biz_nu_directive_order_sub:deleteBatch")
|
||||
@RequiresPermissions("centercontrol:nu_biz_nu_directive_order_info:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.directiveOrderSubService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
this.directiveOrderInfoService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
|
|
@ -126,24 +126,24 @@ public class DirectiveOrderSubController extends JeecgController<DirectiveOrderS
|
|||
//@AutoLog(value = "护理单元-服务指令-工单子表-通过id查询")
|
||||
@ApiOperation(value="护理单元-服务指令-工单子表-通过id查询", notes="护理单元-服务指令-工单子表-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<DirectiveOrderSub> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
DirectiveOrderSub directiveOrderSub = directiveOrderSubService.getById(id);
|
||||
if(directiveOrderSub==null) {
|
||||
public Result<DirectiveOrderInfo> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
DirectiveOrderInfo directiveOrderInfo = directiveOrderInfoService.getById(id);
|
||||
if(directiveOrderInfo==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(directiveOrderSub);
|
||||
return Result.OK(directiveOrderInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param directiveOrderSub
|
||||
* @param directiveOrderInfo
|
||||
*/
|
||||
@RequiresPermissions("centercontrol:nu_biz_nu_directive_order_sub:exportXls")
|
||||
@RequiresPermissions("centercontrol:nu_biz_nu_directive_order_info:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, DirectiveOrderSub directiveOrderSub) {
|
||||
return super.exportXls(request, directiveOrderSub, DirectiveOrderSub.class, "护理单元-服务指令-工单子表");
|
||||
public ModelAndView exportXls(HttpServletRequest request, DirectiveOrderInfo directiveOrderInfo) {
|
||||
return super.exportXls(request, directiveOrderInfo, DirectiveOrderInfo.class, "护理单元-服务指令-工单子表");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -153,10 +153,10 @@ public class DirectiveOrderSubController extends JeecgController<DirectiveOrderS
|
|||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("centercontrol:nu_biz_nu_directive_order_sub:importExcel")
|
||||
@RequiresPermissions("centercontrol:nu_biz_nu_directive_order_info:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, DirectiveOrderSub.class);
|
||||
return super.importExcel(request, response, DirectiveOrderInfo.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -26,7 +26,7 @@ import java.util.Date;
|
|||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="nu_biz_nu_directive_order_info对象", description="服务指令工单子表")
|
||||
public class DirectiveOrderSub implements Serializable {
|
||||
public class DirectiveOrderInfo implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**id*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
package com.nu.modules.biz.order.job;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.nu.modules.biz.order.entity.DirectiveOrderSub;
|
||||
import com.nu.modules.biz.order.service.IDirectiveOrderSubService;
|
||||
import com.nu.modules.biz.order.entity.DirectiveOrderInfo;
|
||||
import com.nu.modules.biz.order.service.IDirectiveOrderInfoService;
|
||||
import com.nu.modules.tplink.camera.service.ICameraInfoService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
|
@ -24,42 +24,42 @@ public class CareSubDownTplinkJob implements Job {
|
|||
|
||||
|
||||
@Autowired
|
||||
private IDirectiveOrderSubService careOrdersSubService;
|
||||
private IDirectiveOrderInfoService careOrdersSubService;
|
||||
|
||||
@Autowired
|
||||
private ICameraInfoService tplinkService;
|
||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||
log.error("OrdersJob:{}-{}", DateUtils.now(),"护理类指令池批量生成工单开始");
|
||||
|
||||
QueryWrapper<DirectiveOrderSub> queryWrapper = new QueryWrapper<>();
|
||||
QueryWrapper<DirectiveOrderInfo> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.isNull("tplink_path");
|
||||
queryWrapper.eq("iz_finish","Y");
|
||||
List<DirectiveOrderSub> directiveOrderSubList = careOrdersSubService.list(queryWrapper);
|
||||
for (DirectiveOrderSub directiveOrderSubEntity : directiveOrderSubList){
|
||||
List<DirectiveOrderInfo> directiveOrderInfoList = careOrdersSubService.list(queryWrapper);
|
||||
for (DirectiveOrderInfo directiveOrderInfoEntity : directiveOrderInfoList){
|
||||
try {
|
||||
String serviceDuration = directiveOrderSubEntity.getServiceDuration();
|
||||
String serviceDuration = directiveOrderInfoEntity.getServiceDuration();
|
||||
if(!StringUtils.isBlank(serviceDuration)){
|
||||
Date beginTime = directiveOrderSubEntity.getBeginTime();
|
||||
Date finishTime = directiveOrderSubEntity.getFinishTime();
|
||||
Date beginTime = directiveOrderInfoEntity.getBeginTime();
|
||||
Date finishTime = directiveOrderInfoEntity.getFinishTime();
|
||||
long diffInMillis = Math.abs(finishTime.getTime() - beginTime.getTime());
|
||||
long diffMinutes = TimeUnit.MILLISECONDS.toMinutes(diffInMillis);
|
||||
long sj = Long.parseLong(serviceDuration);
|
||||
if(diffMinutes>sj){
|
||||
finishTime = new Date(finishTime.getTime() + Math.abs(sj/2) * 60 * 1000);
|
||||
}
|
||||
String nuId = directiveOrderSubEntity.getNuId();
|
||||
String startTime = DateUtils.formatDate(directiveOrderSubEntity.getBeginTime(),"yyyy-MM-dd HH:mm:ss");
|
||||
String nuId = directiveOrderInfoEntity.getNuId();
|
||||
String startTime = DateUtils.formatDate(directiveOrderInfoEntity.getBeginTime(),"yyyy-MM-dd HH:mm:ss");
|
||||
String endTime = DateUtils.formatDate(finishTime,"yyyy-MM-dd HH:mm:ss");
|
||||
System.out.println("nuId:"+nuId);
|
||||
System.out.println("startTime:"+startTime);
|
||||
System.out.println("endTime:"+endTime);
|
||||
String resultTplink = tplinkService.zdyTplinkVideo(nuId,startTime,endTime);
|
||||
if(!StringUtils.equals("error",resultTplink)){
|
||||
directiveOrderSubEntity.setTplinkPath(resultTplink);
|
||||
careOrdersSubService.updateById(directiveOrderSubEntity);
|
||||
directiveOrderInfoEntity.setTplinkPath(resultTplink);
|
||||
careOrdersSubService.updateById(directiveOrderInfoEntity);
|
||||
}else{
|
||||
directiveOrderSubEntity.setTplinkPath("error");
|
||||
careOrdersSubService.updateById(directiveOrderSubEntity);
|
||||
directiveOrderInfoEntity.setTplinkPath("error");
|
||||
careOrdersSubService.updateById(directiveOrderInfoEntity);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
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.modules.biz.order.entity.DirectiveOrderInfo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令工单子表
|
||||
* @Author: caolei
|
||||
* @Date: 2025-11-18
|
||||
* @Version: V1.0
|
||||
*/
|
||||
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);
|
||||
}
|
||||
|
|
@ -3,7 +3,7 @@ package com.nu.modules.biz.order.mapper;
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.nu.entity.CareDirectiveEntity;
|
||||
import com.nu.entity.DirectiveOrderEntity;
|
||||
import com.nu.entity.DirectiveOrderSubEntity;
|
||||
import com.nu.entity.DirectiveOrderInfoEntity;
|
||||
import com.nu.modules.biz.order.entity.DirectiveOrder;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,23 +0,0 @@
|
|||
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.modules.biz.order.entity.DirectiveOrder;
|
||||
import com.nu.modules.biz.order.entity.DirectiveOrderSub;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令工单子表
|
||||
* @Author: caolei
|
||||
* @Date: 2025-11-18
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface DirectiveOrderSubMapper extends BaseMapper<DirectiveOrderSub> {
|
||||
List<DirectiveOrderSub> getDirectiveList(@Param("directiveId") String directiveId);
|
||||
List<DirectiveOrderSub> getSubDirectiveList(@Param("packageId") String packageId);
|
||||
|
||||
List<DirectiveOrderSub> queryOrderInfoList(@Param(Constants.WRAPPER) QueryWrapper<DirectiveOrderSub> queryWrapper);
|
||||
}
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nu.modules.biz.order.mapper.DirectiveOrderSubMapper">
|
||||
<mapper namespace="com.nu.modules.biz.order.mapper.DirectiveOrderInfoMapper">
|
||||
|
||||
<select id="getDirectiveList" resultType="com.nu.modules.biz.order.entity.DirectiveOrderSub">
|
||||
<select id="getDirectiveList" resultType="com.nu.modules.biz.order.entity.DirectiveOrderInfo">
|
||||
select
|
||||
a.instruction_tag_id as instructionTagId,
|
||||
b.instruction_name as instructionTagName,
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
and a.iz_enabled = 'Y'
|
||||
</select>
|
||||
|
||||
<select id="getSubDirectiveList" resultType="com.nu.modules.biz.order.entity.DirectiveOrderSub">
|
||||
<select id="getSubDirectiveList" resultType="com.nu.modules.biz.order.entity.DirectiveOrderInfo">
|
||||
SELECT
|
||||
b.instruction_tag_id AS instructionTagId,
|
||||
e.instruction_name AS instructionTagName,
|
||||
|
|
@ -59,7 +59,7 @@
|
|||
</select>
|
||||
|
||||
|
||||
<select id="queryOrderInfoList" resultType="com.nu.modules.biz.order.entity.DirectiveOrderSub">
|
||||
<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>
|
||||
|
|
@ -58,7 +58,7 @@
|
|||
<result column="opt_ids" property="optIds"/>
|
||||
<result column="opt_names" property="optNames"/>
|
||||
<result column="optTypeName" property="optTypeName"/>
|
||||
<collection property="subList" ofType="com.nu.entity.DirectiveOrderSubEntity">
|
||||
<collection property="subList" ofType="com.nu.entity.DirectiveOrderInfoEntity">
|
||||
<id column="sub_id" property="id"/>
|
||||
<result column="sub_order_type" property="orderType"/>
|
||||
<result column="sub_main_id" property="mainId"/>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
package com.nu.modules.biz.order.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.nu.modules.biz.order.entity.DirectiveOrderInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令工单子表
|
||||
* @Author: caolei
|
||||
* @Date: 2025-11-18
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IDirectiveOrderInfoService extends IService<DirectiveOrderInfo> {
|
||||
List<DirectiveOrderInfo> getDirectiveList(String directiveId);
|
||||
List<DirectiveOrderInfo> getSubDirectiveList(String packageId);
|
||||
}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
package com.nu.modules.biz.order.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.nu.modules.biz.order.entity.DirectiveOrder;
|
||||
import com.nu.modules.biz.order.entity.DirectiveOrderSub;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令工单子表
|
||||
* @Author: caolei
|
||||
* @Date: 2025-11-18
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IDirectiveOrderSubService extends IService<DirectiveOrderSub> {
|
||||
List<DirectiveOrderSub> getDirectiveList(String directiveId);
|
||||
List<DirectiveOrderSub> getSubDirectiveList(String packageId);
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package com.nu.modules.biz.order.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nu.modules.biz.order.entity.DirectiveOrderInfo;
|
||||
import com.nu.modules.biz.order.mapper.DirectiveOrderInfoMapper;
|
||||
import com.nu.modules.biz.order.service.IDirectiveOrderInfoService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令工单子表
|
||||
* @Author: caolei
|
||||
* @Date: 2025-11-18
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class DirectiveOrderInfoServiceImpl extends ServiceImpl<DirectiveOrderInfoMapper, DirectiveOrderInfo> implements IDirectiveOrderInfoService {
|
||||
|
||||
@Override
|
||||
public List<DirectiveOrderInfo> getDirectiveList(String directiveId){
|
||||
return baseMapper.getDirectiveList(directiveId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DirectiveOrderInfo> getSubDirectiveList(String packageId){
|
||||
return baseMapper.getSubDirectiveList(packageId);
|
||||
}
|
||||
}
|
||||
|
|
@ -10,10 +10,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||
import com.nu.entity.*;
|
||||
import com.nu.modules.biz.order.entity.DirectiveOrder;
|
||||
import com.nu.modules.biz.order.entity.DirectiveOrderBizLog;
|
||||
import com.nu.modules.biz.order.entity.DirectiveOrderSub;
|
||||
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.DirectiveOrderSubMapper;
|
||||
import com.nu.modules.biz.order.mapper.DirectiveOrderInfoMapper;
|
||||
import com.nu.modules.biz.order.service.IDirectiveOrderService;
|
||||
import com.nu.modules.directiveorder.api.IDirectiveOrderLogApi;
|
||||
import com.nu.modules.order.api.IDirectiveOrderApi;
|
||||
|
|
@ -44,20 +44,20 @@ public class DirectiveOrderPadServiceImpl extends ServiceImpl<DirectiveOrderMapp
|
|||
@Autowired
|
||||
private IDirectiveOrderService directiveOrderService;
|
||||
@Autowired
|
||||
private DirectiveOrderSubMapper directiveOrderSubMapper;
|
||||
private DirectiveOrderInfoMapper directiveOrderInfoMapper;
|
||||
@Autowired
|
||||
private DirectiveOrderBizLogMapper directiveOrderBizLogMapper;
|
||||
@Autowired
|
||||
private IDirectiveOrderLogApi directiveOrderLogApi;
|
||||
|
||||
@Override
|
||||
public List<DirectiveOrderSubEntity> queryList(DirectiveOrderSubEntity dto) {
|
||||
LambdaQueryWrapper<DirectiveOrderSub> qw = new LambdaQueryWrapper<>();
|
||||
qw.eq(StringUtils.isNotBlank(dto.getNuId()), DirectiveOrderSub::getNuId, dto.getNuId());
|
||||
public List<DirectiveOrderInfoEntity> queryList(DirectiveOrderInfoEntity dto) {
|
||||
LambdaQueryWrapper<DirectiveOrderInfo> qw = new LambdaQueryWrapper<>();
|
||||
qw.eq(StringUtils.isNotBlank(dto.getNuId()), DirectiveOrderInfo::getNuId, dto.getNuId());
|
||||
if (dto.getStartTime() != null && dto.getStartTime() != null) {
|
||||
qw.between(true, DirectiveOrderSub::getStartTime, dto.getStartTime(), dto.getEndTime());
|
||||
qw.between(true, DirectiveOrderInfo::getStartTime, dto.getStartTime(), dto.getEndTime());
|
||||
}
|
||||
return BeanUtil.copyToList(directiveOrderSubMapper.selectList(qw), DirectiveOrderSubEntity.class);
|
||||
return BeanUtil.copyToList(directiveOrderInfoMapper.selectList(qw), DirectiveOrderInfoEntity.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -104,13 +104,13 @@ public class DirectiveOrderPadServiceImpl extends ServiceImpl<DirectiveOrderMapp
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<DirectiveOrderSubEntity> queryOrderInfoList(DirectiveOrderSubEntity directiveOrderSubEntity, HttpServletRequest req) {
|
||||
DirectiveOrderSub directiveOrderSub = new DirectiveOrderSub();
|
||||
BeanUtils.copyProperties(directiveOrderSubEntity, directiveOrderSub);
|
||||
QueryWrapper<DirectiveOrderSub> queryWrapper = QueryGenerator.initQueryWrapper(directiveOrderSub, req.getParameterMap());
|
||||
List<DirectiveOrderSub> list = directiveOrderSubMapper.queryOrderInfoList(queryWrapper);
|
||||
List<DirectiveOrderSubEntity> list1 = new ArrayList<>();
|
||||
list1 = BeanUtil.copyToList(list, DirectiveOrderSubEntity.class);
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
@ -121,15 +121,15 @@ public class DirectiveOrderPadServiceImpl extends ServiceImpl<DirectiveOrderMapp
|
|||
directiveOrder.setBeginTime(new Date());
|
||||
baseMapper.updateById(directiveOrder);
|
||||
|
||||
QueryWrapper<DirectiveOrderSub> queryWrapper = new QueryWrapper<>();
|
||||
List<DirectiveOrderSub> list = directiveOrderSubMapper.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("directiveOrderSub", list);
|
||||
map.put("directiveOrderInfo", list);
|
||||
return map;
|
||||
}
|
||||
|
||||
|
|
@ -143,13 +143,13 @@ public class DirectiveOrderPadServiceImpl extends ServiceImpl<DirectiveOrderMapp
|
|||
directiveOrder.setComPrice(directivePrice.getComPrice());
|
||||
baseMapper.updateById(directiveOrder);
|
||||
|
||||
List<DirectiveOrderSub> list = directiveOrderSubMapper.selectList(new QueryWrapper<DirectiveOrderSub>().eq("main_id", directiveOrder.getId()));
|
||||
List<DirectiveOrderInfo> list = directiveOrderInfoMapper.selectList(new QueryWrapper<DirectiveOrderInfo>().eq("main_id", directiveOrder.getId()));
|
||||
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("success", true);
|
||||
map.put("message", "操作成功");
|
||||
map.put("directiveOrder", directiveOrder);
|
||||
map.put("directiveOrderSub", list);
|
||||
map.put("directiveOrderInfo", list);
|
||||
return map;
|
||||
}
|
||||
|
||||
|
|
@ -244,9 +244,9 @@ public class DirectiveOrderPadServiceImpl extends ServiceImpl<DirectiveOrderMapp
|
|||
}
|
||||
|
||||
@Override
|
||||
public void transferOrder(DirectiveOrderSubEntity dto) {
|
||||
public void transferOrder(DirectiveOrderInfoEntity dto) {
|
||||
DirectiveOrder main = new DirectiveOrder();
|
||||
DirectiveOrderSub sub = new DirectiveOrderSub();
|
||||
DirectiveOrderInfo sub = new DirectiveOrderInfo();
|
||||
|
||||
String optType = "3";//转单
|
||||
|
||||
|
|
@ -268,9 +268,9 @@ public class DirectiveOrderPadServiceImpl extends ServiceImpl<DirectiveOrderMapp
|
|||
main.setId(dto.getMainId());
|
||||
directiveOrderService.updateById(main);
|
||||
//修改子表
|
||||
UpdateWrapper<DirectiveOrderSub> subUW = new UpdateWrapper<>();
|
||||
UpdateWrapper<DirectiveOrderInfo> subUW = new UpdateWrapper<>();
|
||||
subUW.eq("main_id",dto.getMainId());
|
||||
directiveOrderSubMapper.update(sub,subUW);
|
||||
directiveOrderInfoMapper.update(sub,subUW);
|
||||
|
||||
//日志
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
|
|
@ -288,9 +288,9 @@ public class DirectiveOrderPadServiceImpl extends ServiceImpl<DirectiveOrderMapp
|
|||
}
|
||||
|
||||
@Override
|
||||
public void assistOrder(DirectiveOrderSubEntity dto) {
|
||||
public void assistOrder(DirectiveOrderInfoEntity dto) {
|
||||
DirectiveOrder main = new DirectiveOrder();
|
||||
DirectiveOrderSub sub = new DirectiveOrderSub();
|
||||
DirectiveOrderInfo sub = new DirectiveOrderInfo();
|
||||
|
||||
String optType = "2";//协助
|
||||
|
||||
|
|
@ -307,9 +307,9 @@ public class DirectiveOrderPadServiceImpl extends ServiceImpl<DirectiveOrderMapp
|
|||
main.setId(dto.getMainId());
|
||||
directiveOrderService.updateById(main);
|
||||
//修改子表
|
||||
UpdateWrapper<DirectiveOrderSub> subUW = new UpdateWrapper<>();
|
||||
UpdateWrapper<DirectiveOrderInfo> subUW = new UpdateWrapper<>();
|
||||
subUW.eq("main_id",dto.getMainId());
|
||||
directiveOrderSubMapper.update(sub,subUW);
|
||||
directiveOrderInfoMapper.update(sub,subUW);
|
||||
|
||||
//日志
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ import com.alibaba.fastjson.JSONObject;
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nu.modules.biz.order.entity.DirectiveOrder;
|
||||
import com.nu.modules.biz.order.entity.DirectiveOrderSub;
|
||||
import com.nu.modules.biz.order.entity.DirectiveOrderInfo;
|
||||
import com.nu.modules.biz.order.mapper.DirectiveOrderMapper;
|
||||
import com.nu.modules.biz.order.service.IDirectiveOrderService;
|
||||
import com.nu.modules.biz.order.service.IDirectiveOrderSubService;
|
||||
import com.nu.modules.biz.order.service.IDirectiveOrderInfoService;
|
||||
import com.nu.modules.config.sendorderrule.entity.SendOrderRule;
|
||||
import com.nu.modules.config.sendorderrule.entity.SendOrderRuleInfo;
|
||||
import com.nu.modules.config.sendorderrule.service.ISendOrderRuleService;
|
||||
|
|
@ -37,11 +37,11 @@ import java.util.stream.Collectors;
|
|||
public class DirectiveOrderServiceImpl extends ServiceImpl<DirectiveOrderMapper, DirectiveOrder> implements IDirectiveOrderService {
|
||||
|
||||
@Autowired
|
||||
IDirectiveOrderSubService ordersSubService;
|
||||
IDirectiveOrderInfoService ordersInfoService;
|
||||
@Autowired
|
||||
ISendOrderRuleService sendOrderRuleService;
|
||||
@Autowired
|
||||
ISendOrderRuleInfoService sendOrderRuleSubService;
|
||||
ISendOrderRuleInfoService sendOrderRuleInfoService;
|
||||
@Autowired
|
||||
private ISysBaseAPI sysBaseAPI;
|
||||
SendOrderRule sendOrderRule;
|
||||
|
|
@ -62,7 +62,7 @@ public class DirectiveOrderServiceImpl extends ServiceImpl<DirectiveOrderMapper,
|
|||
subqw.eq("iz_enabled", "Y");
|
||||
subqw.eq("main_id", sendOrderRule.getId());
|
||||
subqw.orderByAsc("sort");
|
||||
ruleSubList = sendOrderRuleSubService.list(subqw);
|
||||
ruleSubList = sendOrderRuleInfoService.list(subqw);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -193,9 +193,9 @@ public class DirectiveOrderServiceImpl extends ServiceImpl<DirectiveOrderMapper,
|
|||
private void generateOrdersSub(DirectiveOrder orders) {
|
||||
// System.out.println("护理单元:" + orders.getNuId() + ",服务时间" + orders.getStartTime());
|
||||
if (orders.getIzPackage().equals("N")) {
|
||||
List<DirectiveOrderSub> ordersSubList = ordersSubService.getDirectiveList(orders.getDirectiveId());
|
||||
if(ordersSubList!=null&&ordersSubList.size()>0){
|
||||
String directiveIds = ordersSubList.stream().map(DirectiveOrderSub::getDirectiveId).collect(Collectors.joining(","));
|
||||
List<DirectiveOrderInfo> ordersInfoList = ordersInfoService.getDirectiveList(orders.getDirectiveId());
|
||||
if(ordersInfoList!=null&&ordersInfoList.size()>0){
|
||||
String directiveIds = ordersInfoList.stream().map(DirectiveOrderInfo::getDirectiveId).collect(Collectors.joining(","));
|
||||
//获取满足条件的员工
|
||||
DirectiveOrder employee = employeeScreening(directiveIds, orders.getElderId(), null, orders.getStartTime());
|
||||
if(employee!=null){
|
||||
|
|
@ -204,9 +204,9 @@ public class DirectiveOrderServiceImpl extends ServiceImpl<DirectiveOrderMapper,
|
|||
orders.setOptIds(employee.getEmployeeId());
|
||||
orders.setOptNames(employee.getEmployeeName());
|
||||
this.save(orders);//生成工单主表
|
||||
for (int i = 0; i < ordersSubList.size(); i++) {
|
||||
DirectiveOrderSub ordersSub = ordersSubList.get(i);
|
||||
ordersSub.setOrderNo(getOrderSubNo(orders.getOrderNo()));
|
||||
for (int i = 0; i < ordersInfoList.size(); i++) {
|
||||
DirectiveOrderInfo ordersSub = ordersInfoList.get(i);
|
||||
ordersSub.setOrderNo(getOrderInfoNo(orders.getOrderNo()));
|
||||
ordersSub.setOrderType(orders.getOrderType());
|
||||
ordersSub.setMainId(orders.getId());
|
||||
ordersSub.setNuId(orders.getNuId());
|
||||
|
|
@ -228,7 +228,7 @@ public class DirectiveOrderServiceImpl extends ServiceImpl<DirectiveOrderMapper,
|
|||
ordersSub.setDelFlag("0");
|
||||
ordersSub.setOptIds(employee.getEmployeeId());
|
||||
ordersSub.setOptNames(employee.getEmployeeName());
|
||||
ordersSubService.save(ordersSub);//生成工单子表
|
||||
ordersInfoService.save(ordersSub);//生成工单子表
|
||||
}
|
||||
baseMapper.updatePoolIzOrder(orders.getPoolId());
|
||||
// System.out.println("护理单元:" + orders.getNuId() + ",服务时间:" + orders.getStartTime() + ",服务员工:" + employee.getEmployeeName() + ",获得积分:" + employee.getLevel());
|
||||
|
|
@ -240,12 +240,12 @@ public class DirectiveOrderServiceImpl extends ServiceImpl<DirectiveOrderMapper,
|
|||
}
|
||||
} else {
|
||||
|
||||
List<DirectiveOrderSub> ordersSubList = ordersSubService.getSubDirectiveList(orders.getDirectiveId());
|
||||
if(ordersSubList!=null&&ordersSubList.size()>0){
|
||||
String directiveIds = ordersSubList.stream().map(DirectiveOrderSub::getDirectiveId).collect(Collectors.joining(","));
|
||||
List<DirectiveOrderInfo> ordersInfoList = ordersInfoService.getSubDirectiveList(orders.getDirectiveId());
|
||||
if(ordersInfoList!=null&&ordersInfoList.size()>0){
|
||||
String directiveIds = ordersInfoList.stream().map(DirectiveOrderInfo::getDirectiveId).collect(Collectors.joining(","));
|
||||
|
||||
List<DirectiveOrder> emps = baseMapper.getPermissionEmps(directiveIds);//获取服务标签中的员工和数量
|
||||
emps.removeIf(data -> data.getOwnCn() < ordersSubList.size());//删除没有权限的数据
|
||||
emps.removeIf(data -> data.getOwnCn() < ordersInfoList.size());//删除没有权限的数据
|
||||
String employeeIds = emps.stream().map(DirectiveOrder::getEmployeeId).collect(Collectors.joining(","));
|
||||
DirectiveOrder employee = employeeScreening(directiveIds,orders.getElderId(),employeeIds,orders.getStartTime());
|
||||
if(employee!=null){
|
||||
|
|
@ -254,9 +254,9 @@ public class DirectiveOrderServiceImpl extends ServiceImpl<DirectiveOrderMapper,
|
|||
orders.setOptIds(employee.getEmployeeId());
|
||||
orders.setOptNames(employee.getEmployeeName());
|
||||
this.save(orders);//生成工单主表
|
||||
for (int i = 0; i < ordersSubList.size(); i++) {
|
||||
DirectiveOrderSub ordersSub = ordersSubList.get(i);
|
||||
ordersSub.setOrderNo(getOrderSubNo(orders.getOrderNo()));
|
||||
for (int i = 0; i < ordersInfoList.size(); i++) {
|
||||
DirectiveOrderInfo ordersSub = ordersInfoList.get(i);
|
||||
ordersSub.setOrderNo(getOrderInfoNo(orders.getOrderNo()));
|
||||
ordersSub.setOrderType(orders.getOrderType());
|
||||
ordersSub.setMainId(orders.getId());
|
||||
ordersSub.setNuId(orders.getNuId());
|
||||
|
|
@ -282,7 +282,7 @@ public class DirectiveOrderServiceImpl extends ServiceImpl<DirectiveOrderMapper,
|
|||
ordersSub.setDelFlag("0");
|
||||
ordersSub.setOptIds(employee.getEmployeeId());
|
||||
ordersSub.setOptNames(employee.getEmployeeName());
|
||||
ordersSubService.save(ordersSub);//生成工单子表
|
||||
ordersInfoService.save(ordersSub);//生成工单子表
|
||||
}
|
||||
baseMapper.updatePoolIzOrder(orders.getPoolId());
|
||||
// System.out.println("护理单元:" + orders.getNuId() + ",服务时间:" + orders.getStartTime() + ",服务员工:" + employee.getEmployeeName() + ",获得积分:" + employee.getLevel());
|
||||
|
|
@ -690,13 +690,13 @@ public class DirectiveOrderServiceImpl extends ServiceImpl<DirectiveOrderMapper,
|
|||
*
|
||||
* @return
|
||||
*/
|
||||
private String getOrderSubNo(String mainOrderNo) {
|
||||
QueryWrapper<DirectiveOrderSub> qw = new QueryWrapper<>();
|
||||
private String getOrderInfoNo(String mainOrderNo) {
|
||||
QueryWrapper<DirectiveOrderInfo> qw = new QueryWrapper<>();
|
||||
qw.likeRight("order_no", mainOrderNo);
|
||||
qw.select("order_no");
|
||||
qw.orderByDesc("order_no");
|
||||
qw.last("limit 1");
|
||||
DirectiveOrderSub entity = ordersSubService.getOne(qw);
|
||||
DirectiveOrderInfo entity = ordersInfoService.getOne(qw);
|
||||
int todayNo = 0;
|
||||
if (entity != null) {
|
||||
String orderNo = entity.getOrderNo();
|
||||
|
|
@ -741,7 +741,7 @@ public class DirectiveOrderServiceImpl extends ServiceImpl<DirectiveOrderMapper,
|
|||
}
|
||||
|
||||
DirectiveOrder orders = baseMapper.getInstantById(directiveOrder);
|
||||
List<DirectiveOrderSub> subList = null;
|
||||
List<DirectiveOrderInfo> infoList = null;
|
||||
String employeeId = "";
|
||||
String employeeName = "";
|
||||
Calendar c = Calendar.getInstance();
|
||||
|
|
@ -793,8 +793,8 @@ public class DirectiveOrderServiceImpl extends ServiceImpl<DirectiveOrderMapper,
|
|||
orders.setStartTime(startTime);
|
||||
orders.setEndTime(endTime);
|
||||
if(orders.getIzPackage().equals("N")){
|
||||
subList = ordersSubService.getDirectiveList(orders.getDirectiveId());
|
||||
String directiveIds = subList.stream().map(DirectiveOrderSub::getDirectiveId).collect(Collectors.joining(","));
|
||||
infoList = ordersInfoService.getDirectiveList(orders.getDirectiveId());
|
||||
String directiveIds = infoList.stream().map(DirectiveOrderInfo::getDirectiveId).collect(Collectors.joining(","));
|
||||
if(!directiveOrder.getTriggerMode().equals("1")){
|
||||
getSendOrderRule();
|
||||
DirectiveOrder employee = employeeScreening(directiveIds,orders.getElderId(),null,orders.getStartTime());
|
||||
|
|
@ -802,13 +802,13 @@ public class DirectiveOrderServiceImpl extends ServiceImpl<DirectiveOrderMapper,
|
|||
employeeName = employee.getEmployeeName();
|
||||
}
|
||||
}else{
|
||||
subList = ordersSubService.getSubDirectiveList(orders.getDirectiveId());
|
||||
String directiveIds = subList.stream().map(DirectiveOrderSub::getDirectiveId).collect(Collectors.joining(","));
|
||||
infoList = ordersInfoService.getSubDirectiveList(orders.getDirectiveId());
|
||||
String directiveIds = infoList.stream().map(DirectiveOrderInfo::getDirectiveId).collect(Collectors.joining(","));
|
||||
if(!directiveOrder.getTriggerMode().equals("1")){
|
||||
getSendOrderRule();
|
||||
List<DirectiveOrder> emps = baseMapper.getPermissionEmps(directiveIds);//获取服务标签中的员工和数量
|
||||
if(subList!=null){
|
||||
int size = subList.size();
|
||||
if(infoList!=null){
|
||||
int size = infoList.size();
|
||||
emps.removeIf(data -> data.getOwnCn() < size);//删除没有权限的数据
|
||||
}
|
||||
String employeeIds = emps.stream().map(DirectiveOrder::getEmployeeId).collect(Collectors.joining(","));
|
||||
|
|
@ -838,35 +838,35 @@ public class DirectiveOrderServiceImpl extends ServiceImpl<DirectiveOrderMapper,
|
|||
orders.setOptNames(employeeName);
|
||||
orders.setDelFlag("0");
|
||||
this.save(orders);//生成工单主表
|
||||
if(subList!=null){
|
||||
for(int i=0;i<subList.size();i++){
|
||||
DirectiveOrderSub ordersSub = subList.get(i);
|
||||
ordersSub.setOrderNo(getOrderSubNo(orderNo));
|
||||
ordersSub.setOrderType(orderType);
|
||||
ordersSub.setMainId(orders.getId());
|
||||
ordersSub.setNuId(orders.getNuId());
|
||||
ordersSub.setNuName(orders.getNuName());
|
||||
ordersSub.setElderId(orders.getElderId());
|
||||
ordersSub.setElderName(orders.getElderName());
|
||||
ordersSub.setEmployeeId(employeeId);
|
||||
ordersSub.setEmployeeName(employeeName);
|
||||
ordersSub.setCycleTypeId(orders.getCycleTypeId());
|
||||
ordersSub.setCycleType(orders.getCycleType());
|
||||
ordersSub.setIzPackage(orders.getIzPackage());
|
||||
if(infoList!=null){
|
||||
for(int i=0;i<infoList.size();i++){
|
||||
DirectiveOrderInfo ordersInfo = infoList.get(i);
|
||||
ordersInfo.setOrderNo(getOrderInfoNo(orderNo));
|
||||
ordersInfo.setOrderType(orderType);
|
||||
ordersInfo.setMainId(orders.getId());
|
||||
ordersInfo.setNuId(orders.getNuId());
|
||||
ordersInfo.setNuName(orders.getNuName());
|
||||
ordersInfo.setElderId(orders.getElderId());
|
||||
ordersInfo.setElderName(orders.getElderName());
|
||||
ordersInfo.setEmployeeId(employeeId);
|
||||
ordersInfo.setEmployeeName(employeeName);
|
||||
ordersInfo.setCycleTypeId(orders.getCycleTypeId());
|
||||
ordersInfo.setCycleType(orders.getCycleType());
|
||||
ordersInfo.setIzPackage(orders.getIzPackage());
|
||||
if(!orders.getIzPackage().equals("N")){
|
||||
ordersSub.setPackageId(orders.getDirectiveId());
|
||||
ordersSub.setPackageName(orders.getDirectiveName());
|
||||
ordersInfo.setPackageId(orders.getDirectiveId());
|
||||
ordersInfo.setPackageName(orders.getDirectiveName());
|
||||
}
|
||||
ordersSub.setStartTime(startTime);
|
||||
ordersSub.setEndTime(endTime);
|
||||
ordersSub.setIzStart("N");
|
||||
ordersSub.setIzFinish("N");
|
||||
ordersSub.setOptType("1");
|
||||
ordersSub.setIzTimeout("N");
|
||||
ordersSub.setOptIds(employeeId);
|
||||
ordersSub.setOptNames(employeeName);
|
||||
ordersSub.setDelFlag("0");
|
||||
ordersSubService.save(ordersSub);//生成工单子表
|
||||
ordersInfo.setStartTime(startTime);
|
||||
ordersInfo.setEndTime(endTime);
|
||||
ordersInfo.setIzStart("N");
|
||||
ordersInfo.setIzFinish("N");
|
||||
ordersInfo.setOptType("1");
|
||||
ordersInfo.setIzTimeout("N");
|
||||
ordersInfo.setOptIds(employeeId);
|
||||
ordersInfo.setOptNames(employeeName);
|
||||
ordersInfo.setDelFlag("0");
|
||||
ordersInfoService.save(ordersInfo);//生成工单子表
|
||||
}
|
||||
}
|
||||
//todo
|
||||
|
|
|
|||
|
|
@ -1,31 +0,0 @@
|
|||
package com.nu.modules.biz.order.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nu.modules.biz.order.entity.DirectiveOrder;
|
||||
import com.nu.modules.biz.order.entity.DirectiveOrderSub;
|
||||
import com.nu.modules.biz.order.mapper.DirectiveOrderSubMapper;
|
||||
import com.nu.modules.biz.order.service.IDirectiveOrderSubService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令工单子表
|
||||
* @Author: caolei
|
||||
* @Date: 2025-11-18
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class DirectiveOrderSubServiceImpl extends ServiceImpl<DirectiveOrderSubMapper, DirectiveOrderSub> implements IDirectiveOrderSubService {
|
||||
|
||||
@Override
|
||||
public List<DirectiveOrderSub> getDirectiveList(String directiveId){
|
||||
return baseMapper.getDirectiveList(directiveId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DirectiveOrderSub> getSubDirectiveList(String packageId){
|
||||
return baseMapper.getSubDirectiveList(packageId);
|
||||
}
|
||||
}
|
||||
|
|
@ -2,7 +2,7 @@ package com.nu.modules.biz.plan.care.controller;
|
|||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.beust.jcommander.internal.Maps;
|
||||
import com.nu.entity.DirectiveOrderSubEntity;
|
||||
import com.nu.entity.DirectiveOrderInfoEntity;
|
||||
import com.nu.modules.biz.plan.care.entity.CareDirectivePlan;
|
||||
import com.nu.modules.biz.plan.care.service.ICareDirectivePlanService;
|
||||
import com.nu.modules.biz.plan.invoicing.entity.InvoicingDirectivePlan;
|
||||
|
|
|
|||
|
|
@ -22,13 +22,9 @@
|
|||
<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="preview_file_small" property="previewFileSmall"/>
|
||||
<result column="net_preview_file_small" property="netPreviewFileSmall"/>
|
||||
<result column="mp3_file" property="mp3File"/>
|
||||
<result column="net_mp3_file" property="netMp3File"/>
|
||||
<result column="mp4_file" property="mp4File"/>
|
||||
<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"/>
|
||||
|
|
@ -55,7 +51,7 @@
|
|||
<result column="update_time" property="updateTime"/>
|
||||
<result column="del_flag" property="delFlag"/>
|
||||
<result column="remarks" property="remarks"/>
|
||||
<collection property="subList" ofType="com.nu.entity.DirectiveOrderSubEntity">
|
||||
<collection property="infoList" ofType="com.nu.entity.DirectiveOrderInfoEntity">
|
||||
<id column="sub_id" property="id"/>
|
||||
<result column="sub_order_type" property="orderType"/>
|
||||
<result column="sub_main_id" property="mainId"/>
|
||||
|
|
@ -77,13 +73,9 @@
|
|||
<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_preview_file_small" property="previewFileSmall"/>
|
||||
<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_mp4_file" property="mp4File"/>
|
||||
<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"/>
|
||||
|
|
|
|||
Loading…
Reference in New Issue