parent
e33d8497fb
commit
774a6331b2
|
|
@ -1,188 +0,0 @@
|
|||
package com.nu.modules.mediamanage.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import com.nu.modules.mediamanage.entity.MediaManage;
|
||||
import com.nu.modules.mediamanage.service.IMediaManageService;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
|
||||
/**
|
||||
* @Description: 媒体资源管理
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-05-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="媒体资源管理")
|
||||
@RestController
|
||||
@RequestMapping("/mediamanage/mediaManage")
|
||||
@Slf4j
|
||||
public class MediaManageController extends JeecgController<MediaManage, IMediaManageService> {
|
||||
@Autowired
|
||||
private IMediaManageService mediaManageService;
|
||||
@Autowired
|
||||
private ISysBaseAPI sysBaseAPI;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param mediaManage
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "媒体资源管理-分页列表查询")
|
||||
@ApiOperation(value="媒体资源管理-分页列表查询", notes="媒体资源管理-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<MediaManage>> queryPageList(MediaManage mediaManage,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
JSONObject deptInfo = sysBaseAPI.getDeptInfo();
|
||||
String url = deptInfo.getString("url");
|
||||
QueryWrapper<MediaManage> queryWrapper = QueryGenerator.initQueryWrapper(mediaManage, req.getParameterMap());
|
||||
Page<MediaManage> page = new Page<MediaManage>(pageNo, pageSize);
|
||||
IPage<MediaManage> pageList = mediaManageService.page(page, queryWrapper);
|
||||
List<MediaManage> records = pageList.getRecords();
|
||||
records.stream().forEach(m -> {
|
||||
if("net".equals(m.getIzNetUrl())){
|
||||
m.setNetFilePath(url+m.getFilePath());
|
||||
}
|
||||
});
|
||||
pageList.setRecords(records);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param mediaManage
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "媒体资源管理-添加")
|
||||
@ApiOperation(value="媒体资源管理-添加", notes="媒体资源管理-添加")
|
||||
@RequiresPermissions("mediamanage:nu_media_manage:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody MediaManage mediaManage) {
|
||||
mediaManageService.save(mediaManage);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param mediaManage
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "媒体资源管理-编辑")
|
||||
@ApiOperation(value="媒体资源管理-编辑", notes="媒体资源管理-编辑")
|
||||
@RequiresPermissions("mediamanage:nu_media_manage:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody MediaManage mediaManage) {
|
||||
mediaManageService.updateById(mediaManage);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "媒体资源管理-通过id删除")
|
||||
@ApiOperation(value="媒体资源管理-通过id删除", notes="媒体资源管理-通过id删除")
|
||||
@RequiresPermissions("mediamanage:nu_media_manage:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
mediaManageService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "媒体资源管理-批量删除")
|
||||
@ApiOperation(value="媒体资源管理-批量删除", notes="媒体资源管理-批量删除")
|
||||
@RequiresPermissions("mediamanage:nu_media_manage:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.mediaManageService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "媒体资源管理-通过id查询")
|
||||
@ApiOperation(value="媒体资源管理-通过id查询", notes="媒体资源管理-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<MediaManage> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
MediaManage mediaManage = mediaManageService.getById(id);
|
||||
if(mediaManage==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(mediaManage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param mediaManage
|
||||
*/
|
||||
@RequiresPermissions("mediamanage:nu_media_manage:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, MediaManage mediaManage) {
|
||||
return super.exportXls(request, mediaManage, MediaManage.class, "媒体资源管理");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("mediamanage:nu_media_manage:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, MediaManage.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取协议、域名
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/getUrl", method = RequestMethod.GET)
|
||||
public Result<?> getUrl() {
|
||||
JSONObject deptInfo = sysBaseAPI.getDeptInfo();
|
||||
return Result.OK(deptInfo);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,90 +0,0 @@
|
|||
package com.nu.modules.mediamanage.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import org.jeecg.common.constant.ProvinceCityArea;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @Description: 媒体资源管理
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-05-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("nu_media_manage")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="nu_media_manage对象", description="媒体资源管理")
|
||||
public class MediaManage implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private java.lang.String id;
|
||||
/**名称*/
|
||||
@Excel(name = "名称", width = 15)
|
||||
@ApiModelProperty(value = "名称")
|
||||
private java.lang.String name;
|
||||
/**备注*/
|
||||
@Excel(name = "备注", width = 15)
|
||||
@ApiModelProperty(value = "备注")
|
||||
private java.lang.String descr;
|
||||
/**文件类型*/
|
||||
@Excel(name = "文件类型", width = 15)
|
||||
@ApiModelProperty(value = "文件类型")
|
||||
@Dict(dicCode = "file_type")
|
||||
private java.lang.String fileType;
|
||||
/**系统功能*/
|
||||
@Excel(name = "系统功能", width = 15)
|
||||
@ApiModelProperty(value = "系统功能")
|
||||
@Dict(dicCode = "sys_function")
|
||||
private java.lang.String sysFunc;
|
||||
/**文件路径*/
|
||||
@Excel(name = "文件路径", width = 15)
|
||||
@ApiModelProperty(value = "文件路径")
|
||||
private java.lang.String filePath;
|
||||
/**是否网络资源*/
|
||||
@Excel(name = "是否网络资源", width = 15)
|
||||
@ApiModelProperty(value = "是否网络资源")
|
||||
@Dict(dicCode = "iz_net_url")
|
||||
private java.lang.String izNetUrl;
|
||||
/**是否删除*/
|
||||
@Excel(name = "是否删除", width = 15)
|
||||
@ApiModelProperty(value = "是否删除")
|
||||
@TableLogic
|
||||
private java.lang.String delFlag;
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private java.lang.String createBy;
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private java.util.Date createTime;
|
||||
/**更新人*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private java.lang.String updateBy;
|
||||
/**更新日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新日期")
|
||||
private java.util.Date updateTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String netFilePath;
|
||||
}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
package com.nu.modules.mediamanage.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.nu.modules.mediamanage.entity.MediaManage;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 媒体资源管理
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-05-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface MediaManageMapper extends BaseMapper<MediaManage> {
|
||||
|
||||
List<MediaManage> selectByDirectiveIds(@Param("ids") List<String> idList);
|
||||
}
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
<?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.mediamanage.mapper.MediaManageMapper">
|
||||
|
||||
<select id="selectByDirectiveIds" resultType="com.nu.modules.mediamanage.entity.MediaManage">
|
||||
SELECT
|
||||
id,
|
||||
name,
|
||||
descr,
|
||||
file_type,
|
||||
sys_func,
|
||||
file_path,
|
||||
del_flag,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
iz_net_url
|
||||
FROM nu_media_manage
|
||||
<where>
|
||||
<if test="ids!=null and ids.size()>0">
|
||||
id IN (
|
||||
SELECT preview_file FROM nu_config_service_directive WHERE id IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
UNION
|
||||
SELECT immediate_file FROM nu_config_service_directive WHERE id IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
UNION
|
||||
SELECT mp3_file FROM nu_config_service_directive WHERE id IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
UNION
|
||||
SELECT mp4_file FROM nu_config_service_directive WHERE id IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
)
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
package com.nu.modules.mediamanage.service;
|
||||
|
||||
import com.nu.modules.mediamanage.entity.MediaManage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: 媒体资源管理
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-05-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IMediaManageService extends IService<MediaManage> {
|
||||
|
||||
}
|
||||
|
|
@ -1,178 +0,0 @@
|
|||
package com.nu.modules.mediamanage.service.impl;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nu.modules.mediamanage.entity.MediaManage;
|
||||
import com.nu.modules.mediamanage.entity.MediaManageDto;
|
||||
import com.nu.modules.mediamanage.mapper.MediaManageMapper;
|
||||
import com.nu.modules.mediamanage.service.IMediaManageApi;
|
||||
import com.nu.modules.mediamanage.service.IMediaManageService;
|
||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 媒体资源管理
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-05-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class MediaManageServiceImpl extends ServiceImpl<MediaManageMapper, MediaManage> implements IMediaManageService, IMediaManageApi {
|
||||
|
||||
@Autowired
|
||||
private ISysBaseAPI sysBaseAPI;
|
||||
|
||||
@Override
|
||||
public List<JSONObject> queryByIds(List<String> ids) {
|
||||
if(CollectionUtils.isEmpty(ids)){
|
||||
return List.of();
|
||||
}
|
||||
QueryWrapper<MediaManage> qw = new QueryWrapper<>();
|
||||
qw.in("id", ids);
|
||||
List<MediaManage> mediaManages = baseMapper.selectList(qw);
|
||||
|
||||
List<JSONObject> result = new ArrayList<>();
|
||||
for (MediaManage media : mediaManages) {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("id", media.getId());
|
||||
json.put("name", media.getName());
|
||||
json.put("descr", media.getDescr());
|
||||
json.put("sysFunc", media.getSysFunc());
|
||||
json.put("fileType", media.getFileType());
|
||||
json.put("filePath", media.getFilePath());
|
||||
json.put("izNetUrl",media.getIzNetUrl());
|
||||
json.put("delFlag", media.getDelFlag());
|
||||
json.put("createBy", media.getCreateBy());
|
||||
json.put("createTime", media.getCreateTime());
|
||||
json.put("updateBy", media.getUpdateBy());
|
||||
json.put("updateTime", media.getUpdateTime());
|
||||
result.add(json);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> queryByIdsHandlePath(List<String> ids) {
|
||||
com.alibaba.fastjson.JSONObject deptInfo = sysBaseAPI.getDeptInfo();
|
||||
|
||||
QueryWrapper<MediaManage> qw = new QueryWrapper<>();
|
||||
qw.in("id", ids);
|
||||
List<MediaManage> mediaManages = baseMapper.selectList(qw);
|
||||
|
||||
List<JSONObject> result = new ArrayList<>();
|
||||
for (MediaManage media : mediaManages) {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("id", media.getId());
|
||||
json.put("name", media.getName());
|
||||
json.put("descr", media.getDescr());
|
||||
json.put("fileType", media.getFileType());
|
||||
if ("net".equals(media.getIzNetUrl())) {
|
||||
json.put("filePath", deptInfo.getString("url") + media.getFilePath());
|
||||
} else {
|
||||
json.put("filePath", media.getFilePath());
|
||||
}
|
||||
json.put("izNetUrl",media.getIzNetUrl());
|
||||
json.put("delFlag", media.getDelFlag());
|
||||
json.put("createBy", media.getCreateBy());
|
||||
json.put("createTime", media.getCreateTime());
|
||||
json.put("updateBy", media.getUpdateBy());
|
||||
json.put("updateTime", media.getUpdateTime());
|
||||
result.add(json);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String saveByPath(String filePath, Map<String, String> params) {
|
||||
MediaManage mediaManage = new MediaManage();
|
||||
mediaManage.setName(params.get("fileName") == null ? null : params.get("fileName"));
|
||||
mediaManage.setDescr(params.get("descr") == null ? null : params.get("descr"));
|
||||
mediaManage.setSysFunc(params.get("sysFunc") == null ? null : params.get("sysFunc"));
|
||||
mediaManage.setFilePath(filePath);
|
||||
mediaManage.setFileType(getFileTypeByPath(filePath));
|
||||
baseMapper.insert(mediaManage);
|
||||
return mediaManage.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("#dataSourceCode")
|
||||
public List<JSONObject> selectByDirectiveIds(String dataSourceCode, List<String> idList) {
|
||||
List<MediaManage> list = baseMapper.selectByDirectiveIds(idList);
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
List<JSONObject> result = new ArrayList<>();
|
||||
for (MediaManage item : list) {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("id", item.getId());
|
||||
json.put("name", item.getName());
|
||||
json.put("descr", item.getDescr());
|
||||
json.put("fileType", item.getFileType());
|
||||
json.put("sysFunc", item.getSysFunc());
|
||||
json.put("filePath", item.getFilePath());
|
||||
json.put("delFlag", item.getDelFlag());
|
||||
json.put("createBy", item.getCreateBy());
|
||||
json.put("createTime", item.getCreateTime());
|
||||
json.put("updateBy", item.getUpdateBy());
|
||||
json.put("updateTime", item.getUpdateTime());
|
||||
json.put("izNetUrl", item.getIzNetUrl());
|
||||
result.add(json);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private String getFileTypeByPath(String filePath) {
|
||||
// 获取文件后缀名(转为小写)
|
||||
String extension = "";
|
||||
int lastDotIndex = filePath.lastIndexOf('.');
|
||||
if (lastDotIndex > 0) {
|
||||
extension = filePath.substring(lastDotIndex + 1).toLowerCase();
|
||||
}
|
||||
|
||||
// 图片类型
|
||||
if (extension.matches("jpg|jpeg|png|gif|bmp|webp|svg")) {
|
||||
return "image";
|
||||
}
|
||||
// 视频类型
|
||||
else if (extension.matches("mp4|avi|mov|wmv|flv|mkv|webm")) {
|
||||
return "video";
|
||||
}
|
||||
// 音频类型
|
||||
else if (extension.matches("mp3|wav|ogg|aac|flac|m4a")) {
|
||||
return "audio";
|
||||
}
|
||||
// 文档类型
|
||||
else if (extension.matches("pdf|doc|docx|xls|xlsx|ppt|pptx|txt")) {
|
||||
return "document";
|
||||
}
|
||||
// 其他类型
|
||||
else {
|
||||
return "other";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveOrUpdate(MediaManageDto m, boolean isSave) {
|
||||
MediaManage mediaManage = new MediaManage();
|
||||
BeanUtils.copyProperties(m, mediaManage);
|
||||
if (isSave) {
|
||||
baseMapper.insert(mediaManage);
|
||||
} else {
|
||||
baseMapper.updateById(mediaManage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -2,14 +2,14 @@ package com.nu.modules.pad.directiveplan.api;
|
|||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.nu.entity.*;
|
||||
import com.nu.entity.CareDirectiveEntity;
|
||||
import com.nu.entity.CareDirectivePackageEntity;
|
||||
import com.nu.entity.DirectiveInstructionTagEntity;
|
||||
import com.nu.entity.DirectiveOrderEntity;
|
||||
import com.nu.modules.care.api.ICareDirectivePlanApi;
|
||||
import com.nu.modules.care.api.IDirectivePlanDateApi;
|
||||
import com.nu.modules.config.IDirectiveConfigApi;
|
||||
import com.nu.modules.care.api.ICareDirectivePlanApi;
|
||||
import com.nu.modules.invoicing.api.IInvoicingDirectivePlanApi;
|
||||
import com.nu.modules.logistics.api.ILogisticsDirectivePlanApi;
|
||||
import com.nu.modules.order.api.IDirectiveOrderApi;
|
||||
import com.nu.modules.servicepackage.IDirectivePackageApi;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.compress.utils.Lists;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
|
@ -19,7 +19,10 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 护理类服务指令计划API
|
||||
|
|
@ -40,12 +43,6 @@ public class CareDirectiveApi {
|
|||
@Autowired
|
||||
private IDirectiveOrderApi directiveOrderApi;
|
||||
@Autowired
|
||||
private IDirectivePackageApi directivePackageApi;
|
||||
@Autowired
|
||||
private IInvoicingDirectivePlanApi invoicingDirectivePlanApi;
|
||||
@Autowired
|
||||
private ILogisticsDirectivePlanApi logisticsDirectivePlanApi;
|
||||
@Autowired
|
||||
private IDirectivePlanDateApi directivePlanDateApi;
|
||||
|
||||
/**
|
||||
|
|
@ -85,19 +82,6 @@ public class CareDirectiveApi {
|
|||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指令包集合数据
|
||||
*
|
||||
* @param careDirectivePackageEntity
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/getNcPackagelist")
|
||||
public Result<List<CareDirectivePackageEntity>> getNcPackagelist(CareDirectivePackageEntity careDirectivePackageEntity) {
|
||||
// careDirectivePackageEntity.setInstructionTagId("1");
|
||||
List<CareDirectivePackageEntity> pageList = directivePackageApi.getNcPackagelist(careDirectivePackageEntity, null);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* PAD端保存长者标签
|
||||
*
|
||||
|
|
@ -224,7 +208,8 @@ public class CareDirectiveApi {
|
|||
current = directiveOrderApi.queryCurrent(dto);
|
||||
//将来
|
||||
dto.setQueryFuture(true);
|
||||
future = careDirectivePlanApi.queryFuture(dto);
|
||||
//todo 待完成
|
||||
// future = careDirectivePlanApi.queryFuture(dto);
|
||||
dto.setQueryFuture(null);
|
||||
}
|
||||
|
||||
|
|
@ -243,60 +228,6 @@ public class CareDirectiveApi {
|
|||
item.setExecuteStatus("hisOk");
|
||||
}
|
||||
});
|
||||
//旧版逻辑
|
||||
// history.stream().forEach(item -> {
|
||||
// if ("N".equals(item.getIzStart())) {
|
||||
// // 未开始
|
||||
// item.setExecuteStatus("hisUnExe");
|
||||
// } else {
|
||||
// // 已开始
|
||||
// Date ygjssj = item.getEndTime(); // 应该结束时间
|
||||
// Date sjkssj = item.getBeginTime(); // 实际开始时间
|
||||
// Date sjjssj = item.getFinishTime(); // 实际结束时间
|
||||
// String cssc = item.getTimeoutDuration(); // 超时时长(分钟)
|
||||
// String fwsc = item.getServiceDuration(); // 服务时长(分钟)
|
||||
//
|
||||
// // 判断是否超时
|
||||
// boolean isTimeout = false;
|
||||
//
|
||||
// // 条件1:如果实际开始时间 > (应该结束时间 + 超时时长)
|
||||
// if (sjkssj != null && ygjssj != null && cssc != null) {
|
||||
// try {
|
||||
// int csscInt = Integer.parseInt(cssc);
|
||||
// Calendar calendar = Calendar.getInstance();
|
||||
// calendar.setTime(ygjssj);
|
||||
// calendar.add(Calendar.MINUTE, csscInt);
|
||||
// Date latestAllowedTime = calendar.getTime(); // 最晚允许开始时间
|
||||
//
|
||||
// if (sjkssj.after(latestAllowedTime)) {
|
||||
// isTimeout = true;
|
||||
// }
|
||||
// } catch (NumberFormatException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // 条件2:如果实际结束时间-实际开始时间 > 服务时长
|
||||
// if (!isTimeout && sjkssj != null && sjjssj != null && fwsc != null) {
|
||||
// try {
|
||||
// long actualServiceMinutes = (sjjssj.getTime() - sjkssj.getTime()) / (1000 * 60);
|
||||
// int fwscInt = Integer.parseInt(fwsc);
|
||||
//
|
||||
// if (actualServiceMinutes > fwscInt) {
|
||||
// isTimeout = true;
|
||||
// }
|
||||
// } catch (NumberFormatException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if (isTimeout) {
|
||||
// item.setExecuteStatus("hisTimeOut");
|
||||
// } else {
|
||||
// item.setExecuteStatus("hisOk");
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(current)) {
|
||||
current.stream().forEach(item -> {
|
||||
|
|
@ -361,7 +292,9 @@ public class CareDirectiveApi {
|
|||
|
||||
//待执行
|
||||
dto.setQueryFuture(true);
|
||||
List<DirectiveOrderEntity> dzxList = careDirectivePlanApi.queryFuture(dto);
|
||||
List<DirectiveOrderEntity> dzxList = new ArrayList<>();
|
||||
//todo 待完成
|
||||
// careDirectivePlanApi.queryFuture(dto)
|
||||
|
||||
hlResult.put("yzx", yzx);//已执行
|
||||
hlResult.put("dzx", dzxList.size());//待执行
|
||||
|
|
@ -410,7 +343,9 @@ public class CareDirectiveApi {
|
|||
|
||||
//待执行
|
||||
dto.setQueryFuture(true);
|
||||
List<DirectiveOrderEntity> dzxList = careDirectivePlanApi.queryFuture(dto);
|
||||
List<DirectiveOrderEntity> dzxList = new ArrayList<>();
|
||||
//todo 待完成
|
||||
// careDirectivePlanApi.queryFuture(dto)
|
||||
|
||||
ckResult.put("yzx", yzx);//已执行
|
||||
ckResult.put("dzx", dzxList.size());//待执行
|
||||
|
|
@ -449,7 +384,9 @@ public class CareDirectiveApi {
|
|||
|
||||
//待执行
|
||||
dto.setQueryFuture(true);
|
||||
List<DirectiveOrderEntity> dzxList = careDirectivePlanApi.queryFuture(dto);
|
||||
List<DirectiveOrderEntity> dzxList = new ArrayList<>();
|
||||
//todo 待完成
|
||||
// careDirectivePlanApi.queryFuture(dto)
|
||||
|
||||
hqResult.put("yzx", yzx);//已执行
|
||||
hqResult.put("dzx", dzxList.size());//待执行
|
||||
|
|
@ -478,7 +415,7 @@ public class CareDirectiveApi {
|
|||
|
||||
/**
|
||||
* PAD端编排护理流程-点击保存按钮
|
||||
* 更新日期快照表数据 分类标签会传进来多个
|
||||
* 更新日期快照表数据 分类标签会传进来多个
|
||||
*
|
||||
* @param careDirectiveEntity
|
||||
* @return
|
||||
|
|
|
|||
|
|
@ -1,91 +0,0 @@
|
|||
package com.nu.modules.pad.directiveplan.api;
|
||||
|
||||
import com.nu.entity.InvoicingDirectiveInstantEntity;
|
||||
import com.nu.entity.InvoicingDirectiveEntity;
|
||||
import com.nu.modules.config.IDirectiveConfigApi;
|
||||
import com.nu.modules.invoicing.api.IInvoicingDirectivePlanApi;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 库房类服务指令计划API
|
||||
* @Author: caolei
|
||||
* @Date: 2025-11-28
|
||||
* @Version: V1.0
|
||||
*/
|
||||
//弃用
|
||||
@RestController
|
||||
@RequestMapping("/api/pad/invoicing/directive/qiyong")
|
||||
@Slf4j
|
||||
public class InvoicingDirectiveApi {
|
||||
|
||||
@Autowired
|
||||
private IDirectiveConfigApi directiveConfigApi;
|
||||
|
||||
@Autowired
|
||||
private IInvoicingDirectivePlanApi invoicingDirectivePlanApi;
|
||||
|
||||
/**
|
||||
* 获取库房类服务指令树-配置数据
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/getServiceTree")
|
||||
public Result<Map<String, Object>> getServiceTree() {
|
||||
return Result.OK(directiveConfigApi.getServiceTree("3"));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* PAD端获取服务指令计划表格数据
|
||||
*
|
||||
* @param invoicingDirectiveEntity
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/getNclist")
|
||||
public Result<Map<String,Object>> getPlanList(InvoicingDirectiveEntity invoicingDirectiveEntity) {
|
||||
Map<String,Object> pageList = invoicingDirectivePlanApi.getPlanList(invoicingDirectiveEntity);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* PAD端编排护理流程-新增服务指令
|
||||
*
|
||||
* @param invoicingDirectiveEntity
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/addDirective")
|
||||
public Result<InvoicingDirectiveEntity> addDirective(@RequestBody InvoicingDirectiveEntity invoicingDirectiveEntity) {
|
||||
return Result.OK(invoicingDirectivePlanApi.addDirective(invoicingDirectiveEntity));
|
||||
}
|
||||
|
||||
/**
|
||||
* PAD端编排护理流程-修改服务指令
|
||||
*
|
||||
* @param invoicingDirectiveEntity
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/editDirective")
|
||||
public Result<String> editDirective(@RequestBody InvoicingDirectiveEntity invoicingDirectiveEntity) {
|
||||
invoicingDirectivePlanApi.editDirective(invoicingDirectiveEntity);
|
||||
return Result.OK("操作成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* PAD端编排护理流程-删除服务指令
|
||||
*
|
||||
* @param invoicingDirectiveEntity
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/deleteDirective")
|
||||
public Result<String> deleteDirective(@RequestBody InvoicingDirectiveEntity invoicingDirectiveEntity) {
|
||||
invoicingDirectivePlanApi.deleteDirective(invoicingDirectiveEntity);
|
||||
return Result.OK("操作成功");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,93 +0,0 @@
|
|||
package com.nu.modules.pad.directiveplan.api;
|
||||
|
||||
import com.nu.entity.InvoicingDirectiveEntity;
|
||||
import com.nu.entity.InvoicingDirectiveInstantEntity;
|
||||
import com.nu.entity.LogisticsDirectiveEntity;
|
||||
import com.nu.entity.LogisticsDirectiveInstantEntity;
|
||||
import com.nu.modules.config.IDirectiveConfigApi;
|
||||
import com.nu.modules.logistics.api.ILogisticsDirectivePlanApi;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 后勤服务指令计划API
|
||||
* @Author: caolei
|
||||
* @Date: 2026-1-6
|
||||
* @Version: V1.0
|
||||
*/
|
||||
//弃用
|
||||
@RestController
|
||||
@RequestMapping("/api/pad/logistics/directive/qiyong")
|
||||
@Slf4j
|
||||
public class LogisticsDirectiveApi {
|
||||
|
||||
@Autowired
|
||||
private IDirectiveConfigApi directiveConfigApi;
|
||||
|
||||
@Autowired
|
||||
private ILogisticsDirectivePlanApi logisticsDirectivePlanApi;
|
||||
|
||||
/**
|
||||
* 获取库房类服务指令树-配置数据
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/getServiceTree")
|
||||
public Result<Map<String, Object>> getServiceTree() {
|
||||
return Result.OK(directiveConfigApi.getServiceTree("4"));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* PAD端获取服务指令计划表格数据
|
||||
*
|
||||
* @param logisticsDirectiveEntity
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/getNclist")
|
||||
public Result<Map<String, Object>> getPlanList(LogisticsDirectiveEntity logisticsDirectiveEntity) {
|
||||
Map<String, Object> pageList = logisticsDirectivePlanApi.getPlanList(logisticsDirectiveEntity);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* PAD端编排护理流程-新增服务指令
|
||||
*
|
||||
* @param logisticsDirectiveEntity
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/addDirective")
|
||||
public Result<LogisticsDirectiveEntity> addDirective(@RequestBody LogisticsDirectiveEntity logisticsDirectiveEntity) {
|
||||
return Result.OK(logisticsDirectivePlanApi.addDirective(logisticsDirectiveEntity));
|
||||
}
|
||||
|
||||
/**
|
||||
* PAD端编排护理流程-修改服务指令
|
||||
*
|
||||
* @param logisticsDirectiveEntity
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/editDirective")
|
||||
public Result<String> editDirective(@RequestBody LogisticsDirectiveEntity logisticsDirectiveEntity) {
|
||||
logisticsDirectivePlanApi.editDirective(logisticsDirectiveEntity);
|
||||
return Result.OK("操作成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* PAD端编排护理流程-删除服务指令
|
||||
*
|
||||
* @param logisticsDirectiveEntity
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/deleteDirective")
|
||||
public Result<String> deleteDirective(@RequestBody LogisticsDirectiveEntity logisticsDirectiveEntity) {
|
||||
logisticsDirectivePlanApi.deleteDirective(logisticsDirectiveEntity);
|
||||
return Result.OK("操作成功");
|
||||
}
|
||||
}
|
||||
|
|
@ -1,24 +1,16 @@
|
|||
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.DirectiveOrderInfoEntity;
|
||||
import com.nu.entity.NuBaseInfoEntity;
|
||||
import com.nu.modules.order.api.IDirectiveOrderApi;
|
||||
import com.nu.modules.nubaseinfo.api.INuBaseInfoApi;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -33,8 +25,6 @@ import java.util.List;
|
|||
@Slf4j
|
||||
public class CenterControlController {
|
||||
|
||||
@Autowired
|
||||
private IDirectiveOrderApi directiveOrderApi;
|
||||
@Autowired
|
||||
private INuBaseInfoApi nuBaseInfoApi;
|
||||
|
||||
|
|
@ -44,15 +34,4 @@ public class CenterControlController {
|
|||
return Result.ok(nuBaseInfoApi.queryNuAndCameraInfo(new NuBaseInfoEntity()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 中控-查询护理单元对应指令
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value="中控-查询护理单元对应指令", notes="中控-查询护理单元对应指令")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<DirectiveOrderInfoEntity>> queryPageList(DirectiveOrderInfoEntity dto) {
|
||||
return Result.OK(directiveOrderApi.queryList(dto));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,8 +40,6 @@ public class DirectiveOrderEntity implements Serializable {
|
|||
private String optIds;
|
||||
/**实际执行人名称(多个); 主要执行人+协助人*/
|
||||
private String optNames;
|
||||
/**数据池主表ID,nu_biz_nu_directive_data_pool.id*/
|
||||
private String poolId;
|
||||
/**服务指令计划ID,nu_biz_nu_customer_care_server.id;即时指令计划ID,nu_biz_nu_customer_care_server_instant.id*/
|
||||
private String bizId;
|
||||
/**业务类型*/
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ public class DirectiveOrderInfoEntity implements Serializable {
|
|||
private String orderNo;
|
||||
/**主表ID,nu_biz_directive_order.id*/
|
||||
private String mainId;
|
||||
/**数据池子表ID,nu_biz_nu_directive_data_pool_sub.id*/
|
||||
private String nuId;
|
||||
/**护理单元名称*/
|
||||
private String nuName;
|
||||
|
|
|
|||
|
|
@ -383,14 +383,6 @@ public class NuInvoicingCgdMainServiceImpl extends ServiceImpl<NuInvoicingCgdMai
|
|||
}
|
||||
redisUtil.set("qgd"+qgdDate,qgdXlhInt);
|
||||
|
||||
|
||||
DirectiveOrderBizLogEntity qgdInfoEntityDto = new DirectiveOrderBizLogEntity();
|
||||
qgdInfoEntityDto.setBizTypeCode("CGD");
|
||||
qgdInfoEntityDto.setBizType("采购单");
|
||||
qgdInfoEntityDto.setBizNo(cgdNo);
|
||||
qgdInfoEntityDto.setOptType("生成采购单信息");
|
||||
directiveOrderApi.addBizLog(qgdInfoEntityDto);
|
||||
|
||||
}
|
||||
cgdMainList = BeanUtil.copyToList(mapList2,CgdMainEntity.class);
|
||||
|
||||
|
|
@ -574,12 +566,6 @@ public class NuInvoicingCgdMainServiceImpl extends ServiceImpl<NuInvoicingCgdMai
|
|||
baseMapper.updateById(cgdMain);
|
||||
|
||||
|
||||
DirectiveOrderBizLogEntity qgdInfoEntityDto = new DirectiveOrderBizLogEntity();
|
||||
qgdInfoEntityDto.setBizTypeCode("CGD");
|
||||
qgdInfoEntityDto.setBizType("采购单");
|
||||
qgdInfoEntityDto.setBizNo(cgdMainPar.getCgdNo());
|
||||
qgdInfoEntityDto.setOptType("作废采购单信息");
|
||||
directiveOrderApi.addBizLog(qgdInfoEntityDto);
|
||||
return "1";
|
||||
}
|
||||
|
||||
|
|
@ -836,13 +822,6 @@ public class NuInvoicingCgdMainServiceImpl extends ServiceImpl<NuInvoicingCgdMai
|
|||
}
|
||||
|
||||
|
||||
NuInvoicingCgdMain cgdMainPar = baseMapper.selectById(cgdSxdEntityDto.getCgdId());
|
||||
DirectiveOrderBizLogEntity qgdInfoEntityDto = new DirectiveOrderBizLogEntity();
|
||||
qgdInfoEntityDto.setBizTypeCode("CGD");// 业务类型编码(如:ql)
|
||||
qgdInfoEntityDto.setBizType("采购单");// 业务类型名称(如:请领)
|
||||
qgdInfoEntityDto.setBizNo(cgdMainPar.getCgdNo());//业务主表单号(如:Q10120260109001)
|
||||
qgdInfoEntityDto.setOptType("添加随行单");//操作类型(如:提交)
|
||||
directiveOrderApi.addBizLog(qgdInfoEntityDto);
|
||||
return "1";
|
||||
}
|
||||
|
||||
|
|
@ -1155,13 +1134,6 @@ public class NuInvoicingCgdMainServiceImpl extends ServiceImpl<NuInvoicingCgdMai
|
|||
result.put("cgdInfo",map);
|
||||
result.put("cgdTotalPrice",cgdMain.getTotalPrice());
|
||||
|
||||
DirectiveOrderBizLogEntity qgdInfoEntityDto = new DirectiveOrderBizLogEntity();
|
||||
qgdInfoEntityDto.setBizTypeCode("CGD");// 业务类型编码(如:ql)
|
||||
qgdInfoEntityDto.setBizType("采购单");// 业务类型名称(如:请领)
|
||||
qgdInfoEntityDto.setBizNo(cgdMain.getCgdNo());//业务主表单号(如:Q10120260109001)
|
||||
qgdInfoEntityDto.setOptType("拣货");//操作类型(如:提交)
|
||||
directiveOrderApi.addBizLog(qgdInfoEntityDto);
|
||||
|
||||
|
||||
|
||||
return result;
|
||||
|
|
@ -1194,14 +1166,6 @@ public class NuInvoicingCgdMainServiceImpl extends ServiceImpl<NuInvoicingCgdMai
|
|||
|
||||
map.put("totalPrice",totalPrice.toString());
|
||||
|
||||
NuInvoicingCgdMain cgdMainNo = cgdMainMapper.selectById(cgdId);
|
||||
DirectiveOrderBizLogEntity qgdInfoEntityDto = new DirectiveOrderBizLogEntity();
|
||||
qgdInfoEntityDto.setBizTypeCode("CGD");// 业务类型编码(如:ql)
|
||||
qgdInfoEntityDto.setBizType("采购单");// 业务类型名称(如:请领)
|
||||
qgdInfoEntityDto.setBizNo(cgdMainNo.getCgdNo());//业务主表单号(如:Q10120260109001)
|
||||
qgdInfoEntityDto.setOptType("改价");//操作类型(如:提交)
|
||||
directiveOrderApi.addBizLog(qgdInfoEntityDto);
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
|
|
@ -1531,14 +1495,6 @@ public class NuInvoicingCgdMainServiceImpl extends ServiceImpl<NuInvoicingCgdMai
|
|||
qgdInfoMapper.deleteById(id);
|
||||
}
|
||||
|
||||
|
||||
DirectiveOrderBizLogEntity qgdInfoEntityDto = new DirectiveOrderBizLogEntity();
|
||||
qgdInfoEntityDto.setBizTypeCode("CGD");
|
||||
qgdInfoEntityDto.setBizType("采购单");
|
||||
qgdInfoEntityDto.setBizNo(cgdMain.getCgdNo());
|
||||
qgdInfoEntityDto.setOptType("生成采购单信息");
|
||||
directiveOrderApi.addBizLog(qgdInfoEntityDto);
|
||||
|
||||
}
|
||||
//像管理平台发送采购单信息
|
||||
List<CgdMainDto> addCgtdDtoList = BeanUtil.copyToList(mapList2,CgdMainDto.class);
|
||||
|
|
|
|||
|
|
@ -320,7 +320,6 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
qgdInfoEntityDto.setBizType("请领");// 业务类型名称
|
||||
qgdInfoEntityDto.setBizNo(dto.getQldNo());//业务主表单号
|
||||
qgdInfoEntityDto.setOptType("提交");//操作类型
|
||||
directiveOrderApi.addBizLog(qgdInfoEntityDto);
|
||||
|
||||
result.put("success", true);
|
||||
result.put("message", "提交成功");
|
||||
|
|
@ -824,7 +823,6 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
qgdInfoEntityDto.setBizType("请领");// 业务类型名称
|
||||
qgdInfoEntityDto.setBizNo(dto.getQldNo());//业务主表单号
|
||||
qgdInfoEntityDto.setOptType("收货");//操作类型
|
||||
directiveOrderApi.addBizLog(qgdInfoEntityDto);
|
||||
|
||||
result.put("success", true);
|
||||
result.put("message", "收货完成");
|
||||
|
|
@ -955,7 +953,6 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
qgdInfoEntityDto.setBizType("请领");// 业务类型名称
|
||||
qgdInfoEntityDto.setBizNo(dto.getQldNo());//业务主表单号
|
||||
qgdInfoEntityDto.setOptType("出库");//操作类型
|
||||
directiveOrderApi.addBizLog(qgdInfoEntityDto);
|
||||
|
||||
map.put("success", true);
|
||||
map.put("message", "出库成功");
|
||||
|
|
|
|||
|
|
@ -506,7 +506,6 @@ public class ThdServiceImpl implements ITuiHuoApi {
|
|||
qgdInfoEntityDto.setBizType("退货");// 业务类型名称
|
||||
qgdInfoEntityDto.setBizNo(main.getThdNo());//业务主表单号
|
||||
qgdInfoEntityDto.setOptType("入库");//操作类型
|
||||
directiveOrderApi.addBizLog(qgdInfoEntityDto);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ public interface ICareDirectivePlanApi {
|
|||
Result<?> addDirective(CareDirectiveEntity careDirectiveEntity);
|
||||
void editDirective(CareDirectiveEntity careDirectiveEntity);
|
||||
void deleteDirective(CareDirectiveEntity careDirectiveEntity);
|
||||
List<DirectiveOrderEntity> queryFuture(CareDirectiveEntity dto);
|
||||
List<DirectiveOrderEntity> queryListByDateTime(CareDirectiveEntity dto);
|
||||
|
||||
List<DirectiveOrderEntity> queryImmediatelyOrderList(CareDirectiveEntity dto);
|
||||
|
|
|
|||
|
|
@ -1,9 +0,0 @@
|
|||
package com.nu.modules.directiveorder.api;
|
||||
|
||||
import com.nu.entity.DirectiveOrderLogEntity;
|
||||
|
||||
// 作废
|
||||
public interface IDirectiveOrderLogApi {
|
||||
|
||||
void addLog(DirectiveOrderLogEntity log);
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
package com.nu.modules.invoicing.api;
|
||||
|
||||
import com.nu.entity.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface IInvoicingDirectivePlanApi {
|
||||
Map<String,Object> getPlanList(InvoicingDirectiveEntity invoicingDirectiveEntity);
|
||||
InvoicingDirectiveEntity addDirective(InvoicingDirectiveEntity invoicingDirectiveEntity);
|
||||
void editDirective(InvoicingDirectiveEntity invoicingDirectiveEntity);
|
||||
void deleteDirective(InvoicingDirectiveEntity invoicingDirectiveEntity);
|
||||
|
||||
List<DirectiveOrderEntity> queryImmediatelyOrderList(CareDirectiveEntity dto);
|
||||
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
package com.nu.modules.logistics.api;
|
||||
|
||||
import com.nu.entity.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface ILogisticsDirectivePlanApi {
|
||||
Map<String,Object> getPlanList(LogisticsDirectiveEntity logisticsDirectiveEntity);
|
||||
LogisticsDirectiveEntity addDirective(LogisticsDirectiveEntity logisticsDirectiveEntity);
|
||||
void editDirective(LogisticsDirectiveEntity logisticsDirectiveEntity);
|
||||
void deleteDirective(LogisticsDirectiveEntity logisticsDirectiveEntity);
|
||||
|
||||
List<DirectiveOrderEntity> queryImmediatelyOrderList(CareDirectiveEntity dto);
|
||||
}
|
||||
|
|
@ -9,17 +9,6 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
|
||||
public interface IDirectiveOrderApi {
|
||||
/**
|
||||
* 点击开始
|
||||
* @param directiveOrderEntity
|
||||
*/
|
||||
// Map<String,Object> beginOrder(DirectiveOrderEntity directiveOrderEntity);
|
||||
|
||||
/**
|
||||
* 点击完成
|
||||
* @param directiveOrderEntity
|
||||
*/
|
||||
// Map<String,Object> finishOrder(DirectiveOrderEntity directiveOrderEntity);
|
||||
|
||||
/**
|
||||
* 根据工单id查询工单信息+对应服务指令信息
|
||||
|
|
@ -29,12 +18,8 @@ public interface IDirectiveOrderApi {
|
|||
*/
|
||||
DirectiveOrderEntity selectInfoById(String id);
|
||||
|
||||
List<DirectiveOrderInfoEntity> queryList(DirectiveOrderInfoEntity directiveOrderInfoEntity);
|
||||
|
||||
List<DirectiveOrderEntity> queryOrderList(DirectiveOrderEntity directiveOrderEntity, HttpServletRequest req);
|
||||
|
||||
List<DirectiveOrderEntity> queryOrderInfoList(DirectiveOrderEntity directiveOrderInfoEntity, HttpServletRequest req);
|
||||
|
||||
Map<String, Object> editSubMp4(DirectiveOrderEntity directiveOrderEntity);
|
||||
|
||||
Map<String, Object> editSubPicPath(DirectiveOrderEntity directiveOrderEntity);
|
||||
|
|
@ -45,8 +30,6 @@ public interface IDirectiveOrderApi {
|
|||
|
||||
IPage<DirectiveOrderEntity> queryWorkOrderList(Integer pageNo, Integer pageSize, DirectiveOrderEntity directiveOrderEntity, HttpServletRequest req);
|
||||
|
||||
int queryTodayFinishedTotal(String type, String nuId, String elderId);
|
||||
|
||||
List<DirectiveOrderEntity> queryHistory(CareDirectiveEntity dto);
|
||||
|
||||
List<DirectiveOrderEntity> queryCurrent(CareDirectiveEntity dto);
|
||||
|
|
@ -57,5 +40,6 @@ public interface IDirectiveOrderApi {
|
|||
|
||||
Result<String> assistOrder(DirectiveOrderInfoEntity dto);
|
||||
|
||||
Map<String, Object> addBizLog(DirectiveOrderBizLogEntity directiveOrderBizLogEntity);
|
||||
List<DirectiveOrderEntity> queryOrderInfoList(DirectiveOrderEntity directiveOrderInfoEntity, HttpServletRequest req);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
package com.nu.modules.servicepackage;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.nu.entity.CareDirectivePackageEntity;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface IDirectivePackageApi {
|
||||
public List<CareDirectivePackageEntity> getNcPackagelist(CareDirectivePackageEntity directivePackageEntity, List<CareDirectivePackageEntity> pageList);
|
||||
}
|
||||
|
|
@ -1,119 +0,0 @@
|
|||
package com.nu.modules.biz.datapool.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令数据池主表
|
||||
* @Author: caolei
|
||||
* @Date: 2026-1-6
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("nu_biz_nu_directive_data_pool")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="nu_biz_nu_directive_data_pool对象", description="服务指令数据池主表")
|
||||
public class DirectiveDataPool implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
/**id*/
|
||||
private String id;
|
||||
/**数据池类型 1护理;2医疗:3库房;4行政*/
|
||||
private String poolType;
|
||||
/**业务id,服务指令计划id,即时指令计划id*/
|
||||
private String bizId;
|
||||
|
||||
/**护理单元id*/
|
||||
private String nuId;
|
||||
|
||||
/**服务指令id*/
|
||||
private String directiveId;
|
||||
|
||||
/**指令类型ID 1每天 2即时 3星期 4日期 5频次*/
|
||||
private String cycleTypeId;
|
||||
|
||||
/**周期值*/
|
||||
private String cycleValue;
|
||||
|
||||
/**是否是服务指令包 Y是 N否*/
|
||||
private String izPackage;
|
||||
|
||||
/**开始时间*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date startTime;
|
||||
|
||||
/**操作时间,用于频次计算*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@TableField(exist = false)
|
||||
private Date optTime;
|
||||
|
||||
/**执行次数,0不限次数 非0具体次数,用于频次类型计算 */
|
||||
@TableField(exist = false)
|
||||
private Integer optCount;
|
||||
|
||||
/**结束时间*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@TableField(exist = false)
|
||||
private Date endTime;
|
||||
|
||||
/**是否生成工单 Y是 N否*/
|
||||
private String izOrders;
|
||||
|
||||
/**是否开始 0否 1是*/
|
||||
private String izStart;
|
||||
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
/**更新人*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updateBy;
|
||||
|
||||
/**更新日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
/**是否删除 0未删除 1删除*/
|
||||
private String delFlag;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String tableName;//表名字
|
||||
|
||||
@TableField(exist = false)
|
||||
private String operationFlag;//操作标记 1正常删除入库 2撤回删除入库
|
||||
|
||||
/**员工ID*/
|
||||
@TableField(exist = false)
|
||||
private String employeeId;
|
||||
/**员工姓名*/
|
||||
@TableField(exist = false)
|
||||
private String employeeName;
|
||||
|
||||
/**备注*/
|
||||
@TableField(exist = false)
|
||||
private String remarks;
|
||||
}
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
package com.nu.modules.biz.datapool.job;
|
||||
|
||||
import com.nu.modules.biz.datapool.service.ICareDataPoolService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.util.DateUtils;
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
/**
|
||||
* 指令计划批量生成到指令池-护理指令
|
||||
*/
|
||||
@Slf4j
|
||||
public class CareDataPoolJob implements Job {
|
||||
|
||||
@Autowired
|
||||
ICareDataPoolService service;
|
||||
|
||||
@Override
|
||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||
log.error("DataPoolJob:{}-{}", DateUtils.now(),"护理类指令计划批量生成到指令池开始");
|
||||
Result<?> result = service.generateDataPoolBatch();
|
||||
log.error("DataPoolJob:{}-{}", DateUtils.now(),result.getMessage());
|
||||
}
|
||||
}
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
package com.nu.modules.biz.datapool.job;
|
||||
|
||||
import com.nu.modules.biz.datapool.service.IInvoicingDataPoolService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.util.DateUtils;
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
/**
|
||||
* 指令计划批量生成到指令池-库房指令
|
||||
*/
|
||||
@Slf4j
|
||||
public class InvoicingDataPoolJob implements Job {
|
||||
|
||||
@Autowired
|
||||
IInvoicingDataPoolService service;
|
||||
|
||||
@Override
|
||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||
log.error("DataPoolJob:{}-{}", DateUtils.now(),"库房类指令计划批量生成到指令池开始");
|
||||
Result<?> result = service.generateDataPoolBatch();
|
||||
log.error("DataPoolJob:{}-{}", DateUtils.now(),result.getMessage());
|
||||
}
|
||||
}
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
package com.nu.modules.biz.datapool.job;
|
||||
|
||||
import com.nu.modules.biz.datapool.service.ILogisticsDataPoolService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.util.DateUtils;
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
/**
|
||||
* 指令计划批量生成到指令池-后勤指令
|
||||
*/
|
||||
@Slf4j
|
||||
public class LogisticsDataPoolJob implements Job {
|
||||
|
||||
@Autowired
|
||||
ILogisticsDataPoolService service;
|
||||
|
||||
@Override
|
||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||
log.error("DataPoolJob:{}-{}", DateUtils.now(),"后勤类指令计划批量生成到指令池开始");
|
||||
Result<?> result = service.generateDataPoolBatch();
|
||||
log.error("DataPoolJob:{}-{}", DateUtils.now(),result.getMessage());
|
||||
}
|
||||
}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
package com.nu.modules.biz.datapool.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.nu.modules.biz.datapool.entity.DirectiveDataPool;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令数据池管理
|
||||
* @Author: caolei
|
||||
* @Date: 2026-1-6
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface CareDataPoolMapper extends BaseMapper<DirectiveDataPool> {
|
||||
List<DirectiveDataPool> queryPlanList(DirectiveDataPool dataPool);
|
||||
DirectiveDataPool queryPlanById(@Param("id") String id);
|
||||
int getOrderOptCount(DirectiveDataPool dataPool);
|
||||
}
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
package com.nu.modules.biz.datapool.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.nu.modules.biz.datapool.entity.DirectiveDataPool;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令数据池管理
|
||||
* @Author: caolei
|
||||
* @Date: 2026-1-6
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface DirectiveDataPoolMapper extends BaseMapper<DirectiveDataPool> {
|
||||
|
||||
DirectiveDataPool queryPoolOne(DirectiveDataPool dataPool);
|
||||
|
||||
DirectiveDataPool getDirectiveById(@Param("id") String id);
|
||||
|
||||
DirectiveDataPool getPackageById(@Param("id") String id);
|
||||
|
||||
void createDataPoolLog(DirectiveDataPool dataPool);
|
||||
|
||||
void addDataPoolLog(DirectiveDataPool dataPool);
|
||||
|
||||
void deleteDataPool(DirectiveDataPool dataPool);
|
||||
|
||||
void createOrdersLog(DirectiveDataPool dataPool);
|
||||
|
||||
void addOrdersLog(DirectiveDataPool dataPool);
|
||||
|
||||
DirectiveDataPool queryOrdersOne(DirectiveDataPool dataPool);
|
||||
void deleteOrders(DirectiveDataPool dataPool);
|
||||
void deleteOrdersSub(DirectiveDataPool dataPool);
|
||||
}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
package com.nu.modules.biz.datapool.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.nu.modules.biz.datapool.entity.DirectiveDataPool;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令数据池管理
|
||||
* @Author: caolei
|
||||
* @Date: 2026-1-6
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface InvoicingDataPoolMapper extends BaseMapper<DirectiveDataPool> {
|
||||
List<DirectiveDataPool> queryPlanList(DirectiveDataPool dataPool);
|
||||
DirectiveDataPool queryPlanById(@Param("id") String id);
|
||||
int getOrderOptCount(DirectiveDataPool dataPool);
|
||||
}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
package com.nu.modules.biz.datapool.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.nu.modules.biz.datapool.entity.DirectiveDataPool;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令数据池管理
|
||||
* @Author: caolei
|
||||
* @Date: 2026-1-6
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface LogisticsDataPoolMapper extends BaseMapper<DirectiveDataPool> {
|
||||
List<DirectiveDataPool> queryPlanList(DirectiveDataPool dataPool);
|
||||
DirectiveDataPool queryPlanById(@Param("id") String id);
|
||||
int getOrderOptCount(DirectiveDataPool dataPool);
|
||||
}
|
||||
|
|
@ -1,58 +0,0 @@
|
|||
<?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.datapool.mapper.CareDataPoolMapper">
|
||||
|
||||
<select id="queryPlanList" resultType="com.nu.modules.biz.datapool.entity.DirectiveDataPool">
|
||||
select
|
||||
'1' as poolType,
|
||||
a.id as bizId,
|
||||
a.nu_id as nuId,
|
||||
a.directive_id as directiveId,
|
||||
a.cycle_type_id as cycleTypeId,
|
||||
a.cycle_value as cycleValue,
|
||||
a.iz_package as izPackage,
|
||||
CONCAT(CURDATE(), ' ',STR_TO_DATE(a.start_time, '%H:%i')) as startTime,
|
||||
a.opt_time as optTime,
|
||||
a.opt_count as optCount
|
||||
from nu_biz_directive_plan a
|
||||
where a.cycle_type_id != '2'
|
||||
<if test="nuId != null and nuId != ''">
|
||||
AND nu_id = #{nuId}
|
||||
</if>
|
||||
<if test="directiveId != null and directiveId != ''">
|
||||
AND directive_id = #{directiveId}
|
||||
</if>
|
||||
<if test="startTime != null">
|
||||
AND CONCAT(CURDATE(), ' ',STR_TO_DATE(start_time, '%H:%i')) >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
AND CONCAT(CURDATE(), ' ',STR_TO_DATE(start_time, '%H:%i')) <= #{endTime}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="queryPlanById" resultType="com.nu.modules.biz.datapool.entity.DirectiveDataPool">
|
||||
select
|
||||
'1' as poolType,
|
||||
a.id as bizId,
|
||||
a.nu_id as nuId,
|
||||
a.directive_id as directiveId,
|
||||
a.cycle_type_id as cycleTypeId,
|
||||
a.cycle_value as cycleValue,
|
||||
a.iz_package as izPackage,
|
||||
CONCAT(CURDATE(), ' ',STR_TO_DATE(a.start_time, '%H:%i')) as startTime,
|
||||
a.opt_time as optTime,
|
||||
a.opt_count as optCount
|
||||
from nu_biz_directive_plan a
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="getOrderOptCount" resultType="int">
|
||||
select count(*)
|
||||
from nu_biz_directive_order
|
||||
where nu_id = #{nuId}
|
||||
and start_time >= #{optTime}
|
||||
and directive_id = #{directiveId}
|
||||
and cycle_type_id = #{cycleTypeId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -1,357 +0,0 @@
|
|||
<?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.datapool.mapper.DirectiveDataPoolMapper">
|
||||
|
||||
<select id="queryPoolOne" resultType="com.nu.modules.biz.datapool.entity.DirectiveDataPool">
|
||||
select
|
||||
id,
|
||||
pool_type,
|
||||
biz_id,
|
||||
nu_id,
|
||||
directive_id,
|
||||
cycle_type_id,
|
||||
cycle_value,
|
||||
iz_package,
|
||||
start_time,
|
||||
iz_orders,
|
||||
iz_start
|
||||
from nu_biz_nu_directive_data_pool
|
||||
<where>
|
||||
<if test="poolType != null and poolType != ''">
|
||||
AND pool_type = #{poolType}
|
||||
</if>
|
||||
<if test="bizId != null and bizId != ''">
|
||||
AND biz_id = #{bizId}
|
||||
</if>
|
||||
<if test="nuId != null and nuId != ''">
|
||||
AND nu_id = #{nuId}
|
||||
</if>
|
||||
<if test="directiveId != null and directiveId != ''">
|
||||
AND directive_id = #{directiveId}
|
||||
</if>
|
||||
<if test="startTime != null">
|
||||
AND start_time = #{startTime}
|
||||
</if>
|
||||
<if test="izStart != null and izStart != ''">
|
||||
AND iz_start = #{izStart}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getDirectiveById" resultType="com.nu.modules.biz.datapool.entity.DirectiveDataPool">
|
||||
select
|
||||
a.id as directiveId,
|
||||
a.directive_name as directiveName,
|
||||
a.preview_file as previewFile,
|
||||
a.preview_file_small as previewFileSmall,
|
||||
a.mp3_file as mp3File,
|
||||
a.mp4_file as mp4File,
|
||||
a.service_duration as serviceDuration,
|
||||
a.service_content as serviceContent,
|
||||
a.timeout_duration as timeoutDuration
|
||||
from nu_config_service_directive a
|
||||
where a.id = #{id}
|
||||
and a.del_flag = '0'
|
||||
and a.iz_enabled = 'Y'
|
||||
</select>
|
||||
|
||||
<select id="getPackageById" resultType="com.nu.modules.biz.datapool.entity.DirectiveDataPool">
|
||||
select
|
||||
a.id as directiveId,
|
||||
a.package_name as directiveName,
|
||||
a.total_duration as serviceDuration,
|
||||
a.description as serviceContent,
|
||||
a.timeout_duration as timeoutDuration
|
||||
from nu_config_directive_package_main a
|
||||
where a.id = #{id}
|
||||
and a.del_flag = '0'
|
||||
and a.iz_enabled = 'Y'
|
||||
</select>
|
||||
|
||||
<update id="createDataPoolLog">
|
||||
CREATE TABLE IF NOT EXISTS ${tableName} (
|
||||
id varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID',
|
||||
pool_type varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '数据池类型 1护理;2医疗:3库房;4行政',
|
||||
biz_id varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '服务指令计划ID,nu_biz_directive_plan.id;即时指令计划ID,nu_biz_nu_care_directive_plan_instant.id',
|
||||
nu_id varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '护理单元ID,nu_base_info.id',
|
||||
directive_id varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '服务指令ID,nu_config_service_directive.id',
|
||||
cycle_type_id varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '指令类型ID',
|
||||
cycle_value varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '周期值',
|
||||
iz_package varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '是否是服务指令包 Y是 N否',
|
||||
start_time datetime(0) NULL DEFAULT NULL COMMENT '开始时间',
|
||||
iz_orders varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '是否生成工单 Y是 N否',
|
||||
iz_start varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '是否开始 Y是 N否',
|
||||
create_by varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人',
|
||||
create_time datetime(0) NULL DEFAULT NULL COMMENT '创建日期',
|
||||
update_by varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人',
|
||||
update_time datetime(0) NULL DEFAULT NULL COMMENT '更新日期',
|
||||
del_flag varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '是否删除 0未删除 1删除',
|
||||
operation_flag varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '操作标记 1正常删除入库 2撤回删除入库',
|
||||
PRIMARY KEY (id) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '护理单元-服务指令-数据池日志主表' ROW_FORMAT = Dynamic;
|
||||
</update>
|
||||
|
||||
<update id="addDataPoolLog">
|
||||
insert into ${tableName} (
|
||||
id,
|
||||
pool_type,
|
||||
biz_id,
|
||||
nu_id,
|
||||
directive_id,
|
||||
cycle_type_id,
|
||||
cycle_value,
|
||||
iz_package,
|
||||
start_time,
|
||||
iz_orders,
|
||||
iz_start,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
del_flag,
|
||||
operation_flag
|
||||
)
|
||||
select
|
||||
id,
|
||||
pool_type,
|
||||
biz_id,
|
||||
nu_id,
|
||||
directive_id,
|
||||
cycle_type_id,
|
||||
cycle_value,
|
||||
iz_package,
|
||||
start_time,
|
||||
iz_orders,
|
||||
iz_start,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
del_flag,
|
||||
#{operationFlag}
|
||||
from nu_biz_nu_directive_data_pool
|
||||
<where>
|
||||
<if test="id != null and id != ''">
|
||||
AND id = #{id}
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
AND a.create_time <= #{endTime}
|
||||
</if>
|
||||
</where>
|
||||
</update>
|
||||
|
||||
<update id="deleteDataPool">
|
||||
delete from nu_biz_nu_directive_data_pool a
|
||||
<where>
|
||||
<if test="id != null and id != ''">
|
||||
AND id = #{id}
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
AND a.create_time <= #{endTime}
|
||||
</if>
|
||||
</where>
|
||||
</update>
|
||||
|
||||
<update id="createOrdersLog">
|
||||
CREATE TABLE IF NOT EXISTS ${tableName} (
|
||||
id varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID',
|
||||
order_no varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '单号',
|
||||
order_type varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '工单类型 1护理;2医疗:3库房;4行政',
|
||||
opt_type varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '执行类型 1单人 2协助 3转单',
|
||||
pool_id varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '数据池主表ID,nu_biz_nu_directive_data_pool.id',
|
||||
biz_id varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '业务单号,预留',
|
||||
biz_type varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '业务类型,预留',
|
||||
nu_id varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '护理单元ID,nu_base_info.id',
|
||||
nu_name varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '护理单元名称',
|
||||
elder_id varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '长者ID,nu_biz_elder_info.id',
|
||||
elder_name varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '长者名称',
|
||||
employee_id varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '员工ID',
|
||||
employee_name varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '员工姓名',
|
||||
directive_id varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '服务指令ID,nu_config_service_directive.id',
|
||||
directive_name varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '服务指令名称',
|
||||
cycle_type_id varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '指令类型ID',
|
||||
cycle_type varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '指令类型',
|
||||
cycle_value varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '周期值',
|
||||
preview_file varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '服务指令图片大图',
|
||||
preview_file_small varchar(300) CHARACTER SET utf32 COLLATE utf32_general_ci NULL DEFAULT NULL COMMENT '服务指令图片小图',
|
||||
mp3_file varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '语音文件',
|
||||
mp4_file varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '视频文件',
|
||||
service_duration varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '服务时长(分钟)',
|
||||
service_content varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '服务说明',
|
||||
iz_package varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '是否是服务指令包 Y是 N否',
|
||||
toll_price decimal(12,4) NULL DEFAULT NULL COMMENT '基础价格',
|
||||
com_price decimal(12,4) NULL DEFAULT NULL COMMENT '提成价格',
|
||||
real_com_price decimal(12,4) NULL DEFAULT NULL COMMENT '实际提成价格',
|
||||
start_time datetime(0) NULL DEFAULT NULL COMMENT '开始时间',
|
||||
end_time datetime(0) NULL DEFAULT NULL COMMENT '结束时间',
|
||||
begin_emp varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '实际开始员工',
|
||||
begin_time datetime(0) NULL DEFAULT NULL COMMENT '实际开始时间',
|
||||
finish_emp varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '实际结束员工',
|
||||
finish_time datetime(0) NULL DEFAULT NULL COMMENT '实际结束时间',
|
||||
iz_start varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '是否开始 Y是 N否',
|
||||
iz_finish varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '是否开始 Y是 N否',
|
||||
initiator_id varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '发起人ID',
|
||||
initiator_name varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '发起人姓名',
|
||||
create_emp varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建员工ID',
|
||||
create_by varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人',
|
||||
create_time datetime(0) NULL DEFAULT NULL COMMENT '创建日期',
|
||||
update_emp varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新员工ID',
|
||||
update_by varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人',
|
||||
update_time datetime(0) NULL DEFAULT NULL COMMENT '更新日期',
|
||||
del_flag varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '是否删除 0未删除 1删除',
|
||||
remarks varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
|
||||
PRIMARY KEY (id) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '护理单元-服务指令-工单日志主表' ROW_FORMAT = Dynamic;
|
||||
</update>
|
||||
|
||||
<select id="queryOrdersOne" resultType="com.nu.modules.biz.datapool.entity.DirectiveDataPool">
|
||||
select
|
||||
id,
|
||||
nu_id,
|
||||
nu_name,
|
||||
elder_id,
|
||||
elder_name,
|
||||
employee_id,
|
||||
employee_name,
|
||||
directive_id,
|
||||
directive_name,
|
||||
cycle_type_id,
|
||||
cycle_type,
|
||||
cycle_value,
|
||||
preview_file,
|
||||
net_preview_file,
|
||||
preview_file_small,
|
||||
net_preview_file_small,
|
||||
mp3_file,
|
||||
net_mp3_file,
|
||||
mp4_file,
|
||||
net_mp4_file,
|
||||
service_duration,
|
||||
service_content,
|
||||
package_id,
|
||||
package_name,
|
||||
iz_package,
|
||||
start_time,
|
||||
end_time,
|
||||
iz_start
|
||||
from nu_biz_directive_order
|
||||
where pool_id = #{id}
|
||||
<if test="izStart != null and izStart != ''">
|
||||
AND iz_start = #{izStart}
|
||||
</if>
|
||||
<if test="startTime != null">
|
||||
AND start_time >= #{startTime}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<update id="addOrdersLog">
|
||||
insert into ${tableName} (
|
||||
id,
|
||||
order_no,
|
||||
order_type,
|
||||
opt_type,
|
||||
pool_id,
|
||||
biz_id,
|
||||
biz_type,
|
||||
nu_id,
|
||||
nu_name,
|
||||
elder_id,
|
||||
elder_name,
|
||||
employee_id,
|
||||
employee_name,
|
||||
directive_id,
|
||||
directive_name,
|
||||
cycle_type_id,
|
||||
cycle_type,
|
||||
cycle_value,
|
||||
preview_file,
|
||||
preview_file_small,
|
||||
mp3_file,
|
||||
mp4_file,
|
||||
service_duration,
|
||||
service_content,
|
||||
iz_package,
|
||||
toll_price,
|
||||
com_price,
|
||||
real_com_price,
|
||||
start_time,
|
||||
end_time,
|
||||
begin_emp,
|
||||
begin_time,
|
||||
finish_emp,
|
||||
finish_time,
|
||||
iz_start,
|
||||
iz_finish,
|
||||
initiator_id,
|
||||
initiator_name,
|
||||
create_emp,
|
||||
create_by,
|
||||
create_time,
|
||||
update_emp,
|
||||
update_by,
|
||||
update_time,
|
||||
del_flag,
|
||||
remarks
|
||||
)
|
||||
select
|
||||
id,
|
||||
order_no,
|
||||
order_type,
|
||||
opt_type,
|
||||
pool_id,
|
||||
biz_id,
|
||||
biz_type,
|
||||
nu_id,
|
||||
nu_name,
|
||||
elder_id,
|
||||
elder_name,
|
||||
employee_id,
|
||||
employee_name,
|
||||
directive_id,
|
||||
directive_name,
|
||||
cycle_type_id,
|
||||
cycle_type,
|
||||
cycle_value,
|
||||
preview_file,
|
||||
preview_file_small,
|
||||
mp3_file,
|
||||
mp4_file,
|
||||
service_duration,
|
||||
service_content,
|
||||
iz_package,
|
||||
toll_price,
|
||||
com_price,
|
||||
real_com_price,
|
||||
start_time,
|
||||
end_time,
|
||||
begin_emp,
|
||||
begin_time,
|
||||
finish_emp,
|
||||
finish_time,
|
||||
iz_start,
|
||||
iz_finish,
|
||||
initiator_id,
|
||||
initiator_name,
|
||||
create_emp,
|
||||
create_by,
|
||||
create_time,
|
||||
update_emp,
|
||||
update_by,
|
||||
update_time,
|
||||
del_flag,
|
||||
#{remarks}
|
||||
from nu_biz_directive_order
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="deleteOrders">
|
||||
delete from nu_biz_directive_order
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="deleteOrdersSub">
|
||||
delete from nu_biz_nu_directive_order_info a
|
||||
where main_id = #{id}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -1,58 +0,0 @@
|
|||
<?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.datapool.mapper.InvoicingDataPoolMapper">
|
||||
|
||||
<select id="queryPlanList" resultType="com.nu.modules.biz.datapool.entity.DirectiveDataPool">
|
||||
select
|
||||
'3' as poolType,
|
||||
a.id as bizId,
|
||||
a.nu_id as nuId,
|
||||
a.directive_id as directiveId,
|
||||
a.cycle_type_id as cycleTypeId,
|
||||
a.cycle_value as cycleValue,
|
||||
a.iz_package as izPackage,
|
||||
CONCAT(CURDATE(), ' ',STR_TO_DATE(a.start_time, '%H:%i')) as startTime,
|
||||
a.opt_time as optTime,
|
||||
a.opt_count as optCount
|
||||
from nu_biz_nu_invoicing_directive_plan a
|
||||
where a.cycle_type_id != '2'
|
||||
<if test="nuId != null and nuId != ''">
|
||||
AND nu_id = #{nuId}
|
||||
</if>
|
||||
<if test="directiveId != null and directiveId != ''">
|
||||
AND directive_id = #{directiveId}
|
||||
</if>
|
||||
<if test="startTime != null">
|
||||
AND CONCAT(CURDATE(), ' ',STR_TO_DATE(start_time, '%H:%i')) >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
AND CONCAT(CURDATE(), ' ',STR_TO_DATE(start_time, '%H:%i')) <= #{endTime}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="queryPlanById" resultType="com.nu.modules.biz.datapool.entity.DirectiveDataPool">
|
||||
select
|
||||
'3' as poolType,
|
||||
a.id as bizId,
|
||||
a.nu_id as nuId,
|
||||
a.directive_id as directiveId,
|
||||
a.cycle_type_id as cycleTypeId,
|
||||
a.cycle_value as cycleValue,
|
||||
a.iz_package as izPackage,
|
||||
CONCAT(CURDATE(), ' ',STR_TO_DATE(a.start_time, '%H:%i')) as startTime,
|
||||
a.opt_time as optTime,
|
||||
a.opt_count as optCount
|
||||
from nu_biz_nu_invoicing_directive_plan a
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="getOrderOptCount" resultType="int">
|
||||
select count(*)
|
||||
from nu_biz_directive_order
|
||||
where nu_id = #{nuId}
|
||||
and start_time >= #{optTime}
|
||||
and directive_id = #{directiveId}
|
||||
and cycle_type_id = #{cycleTypeId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -1,58 +0,0 @@
|
|||
<?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.datapool.mapper.LogisticsDataPoolMapper">
|
||||
|
||||
<select id="queryPlanList" resultType="com.nu.modules.biz.datapool.entity.DirectiveDataPool">
|
||||
select
|
||||
'4' as poolType,
|
||||
a.id as bizId,
|
||||
a.nu_id as nuId,
|
||||
a.directive_id as directiveId,
|
||||
a.cycle_type_id as cycleTypeId,
|
||||
a.cycle_value as cycleValue,
|
||||
a.iz_package as izPackage,
|
||||
CONCAT(CURDATE(), ' ',STR_TO_DATE(a.start_time, '%H:%i')) as startTime,
|
||||
a.opt_time as optTime,
|
||||
a.opt_count as optCount
|
||||
from nu_biz_nu_logistics_directive_plan a
|
||||
where a.cycle_type_id != '2'
|
||||
<if test="nuId != null and nuId != ''">
|
||||
AND nu_id = #{nuId}
|
||||
</if>
|
||||
<if test="directiveId != null and directiveId != ''">
|
||||
AND directive_id = #{directiveId}
|
||||
</if>
|
||||
<if test="startTime != null">
|
||||
AND CONCAT(CURDATE(), ' ',STR_TO_DATE(start_time, '%H:%i')) >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
AND CONCAT(CURDATE(), ' ',STR_TO_DATE(start_time, '%H:%i')) <= #{endTime}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="queryPlanById" resultType="com.nu.modules.biz.datapool.entity.DirectiveDataPool">
|
||||
select
|
||||
'4' as poolType,
|
||||
a.id as bizId,
|
||||
a.nu_id as nuId,
|
||||
a.directive_id as directiveId,
|
||||
a.cycle_type_id as cycleTypeId,
|
||||
a.cycle_value as cycleValue,
|
||||
a.iz_package as izPackage,
|
||||
CONCAT(CURDATE(), ' ',STR_TO_DATE(a.start_time, '%H:%i')) as startTime,
|
||||
a.opt_time as optTime,
|
||||
a.opt_count as optCount
|
||||
from nu_biz_nu_logistics_directive_plan a
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="getOrderOptCount" resultType="int">
|
||||
select count(*)
|
||||
from nu_biz_directive_order
|
||||
where nu_id = #{nuId}
|
||||
and start_time >= #{optTime}
|
||||
and directive_id = #{directiveId}
|
||||
and cycle_type_id = #{cycleTypeId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
package com.nu.modules.biz.datapool.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.nu.modules.biz.datapool.entity.DirectiveDataPool;
|
||||
import com.nu.modules.biz.plan.care.entity.CareDirectivePlan;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令数据池管理-护理类
|
||||
* @Author: caolei
|
||||
* @Date: 2026-1-6
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ICareDataPoolService extends IService<DirectiveDataPool> {
|
||||
|
||||
/**
|
||||
* 批量生成
|
||||
*/
|
||||
Result<?> generateDataPoolBatch();
|
||||
|
||||
/**
|
||||
* 单一生成
|
||||
* @param careDirectivePlan
|
||||
*/
|
||||
void generateDataPool(CareDirectivePlan careDirectivePlan);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param careDirectivePlan
|
||||
*/
|
||||
void deleteDataPool(CareDirectivePlan careDirectivePlan);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param careDirectivePlan
|
||||
*/
|
||||
void editDataPool(CareDirectivePlan careDirectivePlan);
|
||||
|
||||
// Result<?> addInstant(DirectiveDataPool dataPool);
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
package com.nu.modules.biz.datapool.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.nu.modules.biz.datapool.entity.DirectiveDataPool;
|
||||
import com.nu.modules.biz.plan.care.entity.CareDirectivePlan;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令数据池管理
|
||||
* @Author: caolei
|
||||
* @Date: 2026-1-6
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IDirectiveDataPoolService extends IService<DirectiveDataPool> {
|
||||
|
||||
DirectiveDataPool queryPoolOne(DirectiveDataPool directiveDataPool);
|
||||
|
||||
DirectiveDataPool getDirectiveById(String id);
|
||||
|
||||
DirectiveDataPool getPackageById(String id);
|
||||
|
||||
void deleteOrders(String dateStr, DirectiveDataPool dataPool);
|
||||
|
||||
void addDataPoolLog(String dateStr,String id);
|
||||
|
||||
/**
|
||||
* 清理
|
||||
*/
|
||||
void cleanDataPool();
|
||||
|
||||
}
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
package com.nu.modules.biz.datapool.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.nu.modules.biz.datapool.entity.DirectiveDataPool;
|
||||
import com.nu.modules.biz.plan.invoicing.entity.InvoicingDirectivePlan;
|
||||
import com.nu.modules.biz.plan.logistics.entity.LogisticsDirectivePlan;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令数据池管理-库房类
|
||||
* @Author: caolei
|
||||
* @Date: 2026-1-6
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IInvoicingDataPoolService extends IService<DirectiveDataPool> {
|
||||
|
||||
/**
|
||||
* 批量生成
|
||||
*/
|
||||
Result<?> generateDataPoolBatch();
|
||||
|
||||
/**
|
||||
* 单一生成
|
||||
* @param invoicingDirectivePlan
|
||||
*/
|
||||
void generateDataPool(InvoicingDirectivePlan invoicingDirectivePlan);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param invoicingDirectivePlan
|
||||
*/
|
||||
void deleteDataPool(InvoicingDirectivePlan invoicingDirectivePlan);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param invoicingDirectivePlan
|
||||
*/
|
||||
void editDataPool(InvoicingDirectivePlan invoicingDirectivePlan);
|
||||
|
||||
}
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
package com.nu.modules.biz.datapool.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.nu.modules.biz.datapool.entity.DirectiveDataPool;
|
||||
import com.nu.modules.biz.plan.logistics.entity.LogisticsDirectivePlan;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令数据池管理-后勤
|
||||
* @Author: caolei
|
||||
* @Date: 2026-1-6
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ILogisticsDataPoolService extends IService<DirectiveDataPool> {
|
||||
|
||||
/**
|
||||
* 批量生成
|
||||
*/
|
||||
Result<?> generateDataPoolBatch();
|
||||
|
||||
/**
|
||||
* 单一生成
|
||||
* @param logisticsDirectivePlan
|
||||
*/
|
||||
void generateDataPool(LogisticsDirectivePlan logisticsDirectivePlan);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param logisticsDirectivePlan
|
||||
*/
|
||||
void deleteDataPool(LogisticsDirectivePlan logisticsDirectivePlan);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param logisticsDirectivePlan
|
||||
*/
|
||||
void editDataPool(LogisticsDirectivePlan logisticsDirectivePlan);
|
||||
|
||||
// Result<?> addInstant(DirectiveDataPool dataPool);
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,269 +0,0 @@
|
|||
package com.nu.modules.biz.datapool.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nu.modules.biz.datapool.entity.DirectiveDataPool;
|
||||
import com.nu.modules.biz.datapool.mapper.CareDataPoolMapper;
|
||||
import com.nu.modules.biz.datapool.service.ICareDataPoolService;
|
||||
import com.nu.modules.biz.datapool.service.IDirectiveDataPoolService;
|
||||
import com.nu.modules.biz.plan.care.entity.CareDirectivePlan;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.util.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令数据池管理-护理类
|
||||
* @Author: caolei
|
||||
* @Date: 2025-11-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class CareDataPoolServiceImpl extends ServiceImpl<CareDataPoolMapper, DirectiveDataPool> implements ICareDataPoolService {
|
||||
|
||||
@Autowired
|
||||
IDirectiveDataPoolService dataPoolService;
|
||||
|
||||
/**
|
||||
* 批量生成数据池
|
||||
*/
|
||||
@Override
|
||||
public Result<?> generateDataPoolBatch() {
|
||||
DirectiveDataPool entity = new DirectiveDataPool();
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.set(Calendar.SECOND,0);
|
||||
c.set(Calendar.MILLISECOND,0);
|
||||
entity.setStartTime(c.getTime());
|
||||
c.add(Calendar.MINUTE,5);
|
||||
entity.setEndTime(c.getTime());
|
||||
try{
|
||||
List<DirectiveDataPool> planList = baseMapper.queryPlanList(entity);//获取计划
|
||||
if(planList.size()>0){
|
||||
for(DirectiveDataPool plan : planList){
|
||||
DirectiveDataPool pool = dataPoolService.queryPoolOne(plan);
|
||||
if(pool!=null){
|
||||
continue;
|
||||
}
|
||||
if(plan.getIzPackage().equals("N")){
|
||||
DirectiveDataPool directiveEntity = dataPoolService.getDirectiveById(plan.getDirectiveId());
|
||||
if(directiveEntity==null){
|
||||
continue;
|
||||
}
|
||||
}else{
|
||||
DirectiveDataPool packageEntity = dataPoolService.getPackageById(plan.getDirectiveId());
|
||||
if(packageEntity==null){
|
||||
continue;
|
||||
}
|
||||
}
|
||||
addDataPool(plan);
|
||||
}
|
||||
}
|
||||
}catch(Exception e){
|
||||
log.error("计划批量生成指令池错误:{}-{}", DateUtils.now(),e.getMessage());
|
||||
return Result.error("计划批量生成指令池错误");
|
||||
}
|
||||
return Result.OK("计划批量生成指令池成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 指令生成数据池
|
||||
*/
|
||||
private void addDataPool(DirectiveDataPool dataPool){
|
||||
Date dataTime = dataPool.getStartTime();
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.set(Calendar.SECOND,0);
|
||||
c.set(Calendar.MILLISECOND,0);
|
||||
Date startTime = c.getTime();
|
||||
c.add(Calendar.MINUTE,10);
|
||||
Date endTime = c.getTime();
|
||||
if(dataTime.getTime()>=startTime.getTime()){
|
||||
if(dataTime.getTime()<=endTime.getTime()){
|
||||
dataPool.setIzOrders("N");
|
||||
dataPool.setIzStart("N");
|
||||
dataPool.setDelFlag("0");
|
||||
String typeId = dataPool.getCycleTypeId();
|
||||
if(typeId!=null){
|
||||
//每天
|
||||
if(typeId.equals("1")){
|
||||
addDaily(dataPool);
|
||||
}
|
||||
//星期
|
||||
if(typeId.equals("3")){
|
||||
addWeekDay(dataPool);
|
||||
}
|
||||
//日期
|
||||
if(typeId.equals("4")){
|
||||
addMonthDay(dataPool);
|
||||
}
|
||||
//频率
|
||||
if(typeId.equals("5")){
|
||||
addFrequency(dataPool);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 日常指令生成数据池子表
|
||||
*/
|
||||
private void addDaily(DirectiveDataPool dataPool){
|
||||
//入指令池主表
|
||||
this.save(dataPool);
|
||||
}
|
||||
|
||||
/**
|
||||
* 星期指令生成数据池子表
|
||||
*/
|
||||
private void addWeekDay(DirectiveDataPool dataPool){
|
||||
String cycleValue = dataPool.getCycleValue();
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK); //1周日 2周一 3周二 4周三 5周四 6周五 7周六
|
||||
// cycleValue 存js的星期 0周一 1周二 2周三 3周四 4周五 5周六 6周日 js +2 2 3 4 5 6 7 8 /7 %
|
||||
Integer cv = Integer.valueOf(cycleValue);
|
||||
//处理js星期,使其能和java的星期进行比较
|
||||
cv = cv + 2;
|
||||
if(cv-7>0){
|
||||
cv = cv -7;
|
||||
}
|
||||
//计划执行星期几是当天,则入指令池
|
||||
if(dayOfWeek == cv){
|
||||
addDaily(dataPool);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 日期指令生成数据池子表
|
||||
*/
|
||||
private void addMonthDay(DirectiveDataPool dataPool){
|
||||
String cycleValue = dataPool.getCycleValue();
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
int dayOfMonth = calendar.get(Calendar.DAY_OF_MONTH);
|
||||
Integer cv = Integer.valueOf(cycleValue);
|
||||
//计划执行月中的几号是当天,则入指令池
|
||||
if(dayOfMonth == cv){
|
||||
addDaily(dataPool);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 频次指令生成数据池子表
|
||||
*/
|
||||
private void addFrequency(DirectiveDataPool dataPool){
|
||||
String cycleValue = dataPool.getCycleValue();
|
||||
Integer cv = Integer.valueOf(cycleValue);
|
||||
cv = cv + 1;
|
||||
Date optTime = dataPool.getOptTime();
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
int dayOfMonth = calendar.get(Calendar.DAY_OF_MONTH);
|
||||
//计算间隔执行的日期
|
||||
calendar.setTime(optTime);
|
||||
int optDay = calendar.get(Calendar.DAY_OF_MONTH);
|
||||
int resDay = dayOfMonth - optDay;
|
||||
int resCv = resDay%cv;
|
||||
//派单间隔日期否是当前日期
|
||||
if(resCv == 0){
|
||||
int optCount = dataPool.getOptCount();
|
||||
if(optCount == 0){
|
||||
addDaily(dataPool);
|
||||
}else{
|
||||
int orderOptCount = baseMapper.getOrderOptCount(dataPool);
|
||||
if(orderOptCount<optCount){
|
||||
addDaily(dataPool);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 单一指令生成到数据池
|
||||
* @param careDirectivePlan
|
||||
*/
|
||||
@Override
|
||||
public void generateDataPool(CareDirectivePlan careDirectivePlan){
|
||||
String cycleTypeId = careDirectivePlan.getCycleTypeId();
|
||||
if(cycleTypeId!=null&&!cycleTypeId.equals("2")){
|
||||
DirectiveDataPool dataPool = new DirectiveDataPool();
|
||||
dataPool.setPoolType("1");
|
||||
dataPool.setBizId(careDirectivePlan.getId());
|
||||
dataPool.setNuId(careDirectivePlan.getNuId());
|
||||
dataPool.setDirectiveId(careDirectivePlan.getDirectiveId());
|
||||
dataPool.setCycleTypeId(careDirectivePlan.getCycleTypeId());
|
||||
dataPool.setCycleValue(careDirectivePlan.getCycleValue());
|
||||
dataPool.setIzPackage(careDirectivePlan.getIzPackage());
|
||||
String startTime = careDirectivePlan.getStartTime();
|
||||
String[] starts = startTime.split(":");
|
||||
String hour = starts[0];
|
||||
String minute = starts[1];
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.set(Calendar.HOUR_OF_DAY,Integer.valueOf(hour));
|
||||
c.set(Calendar.MINUTE,Integer.valueOf(minute));
|
||||
c.set(Calendar.SECOND,0);
|
||||
c.set(Calendar.MILLISECOND,0);
|
||||
dataPool.setStartTime(c.getTime());
|
||||
dataPool.setOptTime(careDirectivePlan.getOptTime());
|
||||
dataPool.setOptCount(careDirectivePlan.getOptCount());
|
||||
addDataPool(dataPool);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据池
|
||||
* @param careDirectivePlan
|
||||
*/
|
||||
@Override
|
||||
public void deleteDataPool(CareDirectivePlan careDirectivePlan) {
|
||||
String cycleTypeId = careDirectivePlan.getCycleTypeId();
|
||||
if(cycleTypeId!=null&&!cycleTypeId.equals("2")) {
|
||||
String startTime = careDirectivePlan.getStartTime();
|
||||
String[] starts = startTime.split(":");
|
||||
String hour = starts[0];
|
||||
String minute = starts[1];
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.set(Calendar.HOUR_OF_DAY, Integer.valueOf(hour));
|
||||
c.set(Calendar.MINUTE, Integer.valueOf(minute));
|
||||
c.set(Calendar.SECOND, 0);
|
||||
c.set(Calendar.MILLISECOND, 0);
|
||||
DirectiveDataPool dataPool = new DirectiveDataPool();
|
||||
dataPool.setPoolType("1");
|
||||
dataPool.setBizId(careDirectivePlan.getId());
|
||||
dataPool.setNuId(careDirectivePlan.getNuId());
|
||||
dataPool.setDirectiveId(careDirectivePlan.getDirectiveId());
|
||||
dataPool.setStartTime(c.getTime());
|
||||
// dataPool.setIzStart("N"); //不判断是否开始,只针对时间
|
||||
DirectiveDataPool pool = dataPoolService.queryPoolOne(dataPool);
|
||||
if (pool != null) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
String dateStr = sdf.format(c.getTime());
|
||||
if (pool.getIzOrders().equals("Y")) {
|
||||
//删除派单
|
||||
dataPoolService.deleteOrders(dateStr, pool);
|
||||
}
|
||||
dataPoolService.addDataPoolLog(dateStr, pool.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑数据池
|
||||
* @param careDirectivePlan
|
||||
*/
|
||||
@Override
|
||||
public void editDataPool(CareDirectivePlan careDirectivePlan) {
|
||||
String cycleTypeId = careDirectivePlan.getCycleTypeId();
|
||||
if(cycleTypeId!=null&&!cycleTypeId.equals("2")) {
|
||||
deleteDataPool(careDirectivePlan);
|
||||
DirectiveDataPool dataPool = baseMapper.queryPlanById(careDirectivePlan.getId());
|
||||
DirectiveDataPool pool = dataPoolService.queryPoolOne(dataPool);
|
||||
if (pool == null) {
|
||||
addDataPool(dataPool);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,128 +0,0 @@
|
|||
package com.nu.modules.biz.datapool.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nu.modules.biz.datapool.entity.DirectiveDataPool;
|
||||
import com.nu.modules.biz.datapool.mapper.DirectiveDataPoolMapper;
|
||||
import com.nu.modules.biz.datapool.service.IDirectiveDataPoolService;
|
||||
import com.nu.modules.sysconfig.ISysConfigApi;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令数据池管理
|
||||
* @Author: caolei
|
||||
* @Date: 2025-11-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class DirectiveDataPoolServiceImpl extends ServiceImpl<DirectiveDataPoolMapper, DirectiveDataPool> implements IDirectiveDataPoolService {
|
||||
|
||||
/**
|
||||
* 创建工单日志表
|
||||
*/
|
||||
private void addOrdersLog(String dateStr, DirectiveDataPool dataPool){
|
||||
String tableName = "nu_biz_nu_directive_order_log_"+dateStr.substring(2, 4)+dateStr.substring(5, 7);
|
||||
dataPool.setTableName(tableName);
|
||||
baseMapper.createOrdersLog(dataPool);//创建日志主表
|
||||
dataPool.setRemarks("计划删除,删除未开始工单");
|
||||
baseMapper.addOrdersLog(dataPool);//保存数据池数据到日志主表
|
||||
baseMapper.deleteOrders(dataPool);//删除昨天及之前的数据
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询数据池
|
||||
* @param directiveDataPool
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public DirectiveDataPool queryPoolOne(DirectiveDataPool directiveDataPool){
|
||||
return baseMapper.queryPoolOne(directiveDataPool);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DirectiveDataPool getDirectiveById(String id){
|
||||
return baseMapper.getDirectiveById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DirectiveDataPool getPackageById(String id){
|
||||
return baseMapper.getPackageById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除派单
|
||||
* @param dateStr
|
||||
* @param dataPool
|
||||
*/
|
||||
@Override
|
||||
public void deleteOrders(String dateStr, DirectiveDataPool dataPool){
|
||||
//获取未开始的工单
|
||||
DirectiveDataPool entity = new DirectiveDataPool();
|
||||
entity.setId(dataPool.getId());
|
||||
entity.setStartTime(new Date());
|
||||
// entity.setIzStart("N");//不判断是否开始,只针对时间
|
||||
DirectiveDataPool order = baseMapper.queryOrdersOne(entity);
|
||||
if(order!=null){
|
||||
//删除工单
|
||||
addOrdersLog(dateStr,order);
|
||||
//ws发送通知给员工,员工端删除次工单(待完善)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建日志表
|
||||
* @param dateStr
|
||||
* @param id
|
||||
*/
|
||||
@Override
|
||||
public void addDataPoolLog(String dateStr,String id){
|
||||
String tableName = "nu_biz_nu_directive_data_pool_log_"+dateStr.substring(2, 4)+dateStr.substring(5, 7);
|
||||
DirectiveDataPool dataPool = new DirectiveDataPool();
|
||||
dataPool.setTableName(tableName);
|
||||
baseMapper.createDataPoolLog(dataPool);//创建日志主表
|
||||
dataPool.setId(id);
|
||||
dataPool.setOperationFlag("2");
|
||||
baseMapper.addDataPoolLog(dataPool);//保存数据池数据到日志主表
|
||||
baseMapper.deleteDataPool(dataPool);//删除昨天及之前的数据
|
||||
}
|
||||
|
||||
/**
|
||||
* 清理数据池数据
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public void cleanDataPool() {
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.add(Calendar.DAY_OF_MONTH,-1);
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
String dateStr = sdf.format(c.getTime());
|
||||
//创建日志表,保存数据池数据到日志表,删除昨天及之前的数据
|
||||
addDataPoolLogByClean(dateStr);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建日志表
|
||||
*/
|
||||
private void addDataPoolLogByClean(String dateStr){
|
||||
String tableName = "nu_biz_nu_directive_data_pool_log_"+dateStr.substring(2, 4)+dateStr.substring(5, 7);
|
||||
DirectiveDataPool dataPool = new DirectiveDataPool();
|
||||
dataPool.setTableName(tableName);
|
||||
baseMapper.createDataPoolLog(dataPool);//创建日志主表
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.set(Calendar.HOUR_OF_DAY,0);
|
||||
c.set(Calendar.MINUTE,0);
|
||||
c.set(Calendar.SECOND,0);
|
||||
c.set(Calendar.MILLISECOND,0);
|
||||
dataPool.setEndTime(c.getTime());
|
||||
dataPool.setOperationFlag("1");
|
||||
baseMapper.addDataPoolLog(dataPool);//保存数据池数据到日志主表
|
||||
baseMapper.deleteDataPool(dataPool);//删除昨天及之前的数据
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,269 +0,0 @@
|
|||
package com.nu.modules.biz.datapool.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nu.modules.biz.datapool.entity.DirectiveDataPool;
|
||||
import com.nu.modules.biz.datapool.mapper.InvoicingDataPoolMapper;
|
||||
import com.nu.modules.biz.datapool.service.IDirectiveDataPoolService;
|
||||
import com.nu.modules.biz.datapool.service.IInvoicingDataPoolService;
|
||||
import com.nu.modules.biz.plan.invoicing.entity.InvoicingDirectivePlan;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.util.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令数据池管理-库房类
|
||||
* @Author: caolei
|
||||
* @Date: 2026-1-6
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class InvoicingDataPoolServiceImpl extends ServiceImpl<InvoicingDataPoolMapper, DirectiveDataPool> implements IInvoicingDataPoolService {
|
||||
|
||||
@Autowired
|
||||
IDirectiveDataPoolService dataPoolService;
|
||||
|
||||
/**
|
||||
* 批量生成数据池
|
||||
*/
|
||||
@Override
|
||||
public Result<?> generateDataPoolBatch() {
|
||||
DirectiveDataPool entity = new DirectiveDataPool();
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.set(Calendar.SECOND,0);
|
||||
c.set(Calendar.MILLISECOND,0);
|
||||
entity.setStartTime(c.getTime());
|
||||
c.add(Calendar.MINUTE,5);
|
||||
entity.setEndTime(c.getTime());
|
||||
try{
|
||||
List<DirectiveDataPool> planList = baseMapper.queryPlanList(entity);//获取计划
|
||||
if(planList.size()>0){
|
||||
for(DirectiveDataPool plan : planList){
|
||||
DirectiveDataPool pool = dataPoolService.queryPoolOne(plan);
|
||||
if(pool!=null){
|
||||
continue;
|
||||
}
|
||||
if(plan.getIzPackage().equals("N")){
|
||||
DirectiveDataPool directiveEntity = dataPoolService.getDirectiveById(plan.getDirectiveId());
|
||||
if(directiveEntity==null){
|
||||
continue;
|
||||
}
|
||||
}else{
|
||||
DirectiveDataPool packageEntity = dataPoolService.getPackageById(plan.getDirectiveId());
|
||||
if(packageEntity==null){
|
||||
continue;
|
||||
}
|
||||
}
|
||||
addDataPool(plan);
|
||||
}
|
||||
}
|
||||
}catch(Exception e){
|
||||
log.error("计划批量生成指令池错误:{}-{}", DateUtils.now(),e.getMessage());
|
||||
return Result.error("计划批量生成指令池错误");
|
||||
}
|
||||
return Result.OK("计划批量生成指令池成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 指令生成数据池
|
||||
*/
|
||||
private void addDataPool(DirectiveDataPool dataPool){
|
||||
Date dataTime = dataPool.getStartTime();
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.set(Calendar.SECOND,0);
|
||||
c.set(Calendar.MILLISECOND,0);
|
||||
Date startTime = c.getTime();
|
||||
c.add(Calendar.MINUTE,10);
|
||||
Date endTime = c.getTime();
|
||||
if(dataTime.getTime()>=startTime.getTime()){
|
||||
if(dataTime.getTime()<=endTime.getTime()){
|
||||
dataPool.setIzOrders("N");
|
||||
dataPool.setIzStart("N");
|
||||
dataPool.setDelFlag("0");
|
||||
String typeId = dataPool.getCycleTypeId();
|
||||
if(typeId!=null){
|
||||
//每天
|
||||
if(typeId.equals("1")){
|
||||
addDaily(dataPool);
|
||||
}
|
||||
//星期
|
||||
if(typeId.equals("3")){
|
||||
addWeekDay(dataPool);
|
||||
}
|
||||
//日期
|
||||
if(typeId.equals("4")){
|
||||
addMonthDay(dataPool);
|
||||
}
|
||||
//频率
|
||||
if(typeId.equals("5")){
|
||||
addFrequency(dataPool);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 日常指令生成数据池子表(非包)
|
||||
*/
|
||||
private void addDaily(DirectiveDataPool dataPool){
|
||||
//入指令池主表
|
||||
this.save(dataPool);
|
||||
}
|
||||
|
||||
/**
|
||||
* 星期周期指令生成数据池子表(非包)
|
||||
*/
|
||||
private void addWeekDay(DirectiveDataPool dataPool){
|
||||
String cycleValue = dataPool.getCycleValue();
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK); //1周日 2周一 3周二 4周三 5周四 6周五 7周六
|
||||
// cycleValue 存js的星期 0周一 1周二 2周三 3周四 4周五 5周六 6周日 js +2 2 3 4 5 6 7 8 /7 %
|
||||
Integer cv = Integer.valueOf(cycleValue);
|
||||
//处理js星期,使其能和java的星期进行比较
|
||||
cv = cv + 2;
|
||||
if(cv-7>0){
|
||||
cv = cv -7;
|
||||
}
|
||||
//计划执行星期几是当天,则入指令池
|
||||
if(dayOfWeek == cv){
|
||||
addDaily(dataPool);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 月周期指令生成数据池子表(非包)
|
||||
*/
|
||||
private void addMonthDay(DirectiveDataPool dataPool){
|
||||
String cycleValue = dataPool.getCycleValue();
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
int dayOfMonth = calendar.get(Calendar.DAY_OF_MONTH);
|
||||
Integer cv = Integer.valueOf(cycleValue);
|
||||
//计划执行月中的几号是当天,则入指令池
|
||||
if(dayOfMonth == cv){
|
||||
addDaily(dataPool);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 频次指令生成数据池子表
|
||||
*/
|
||||
private void addFrequency(DirectiveDataPool dataPool){
|
||||
String cycleValue = dataPool.getCycleValue();
|
||||
Integer cv = Integer.valueOf(cycleValue);
|
||||
cv = cv + 1;
|
||||
Date optTime = dataPool.getOptTime();
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
int dayOfMonth = calendar.get(Calendar.DAY_OF_MONTH);
|
||||
//计算间隔执行的日期
|
||||
calendar.setTime(optTime);
|
||||
int optDay = calendar.get(Calendar.DAY_OF_MONTH);
|
||||
int resDay = dayOfMonth - optDay;
|
||||
int resCv = resDay%cv;
|
||||
//派单间隔日期否是当前日期
|
||||
if(resCv == 0){
|
||||
int optCount = dataPool.getOptCount();
|
||||
if(optCount == 0){
|
||||
addDaily(dataPool);
|
||||
}else{
|
||||
int orderOptCount = baseMapper.getOrderOptCount(dataPool);
|
||||
if(orderOptCount<optCount){
|
||||
addDaily(dataPool);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 单一指令生成到数据池
|
||||
* @param invoicingDirectivePlan
|
||||
*/
|
||||
@Override
|
||||
public void generateDataPool(InvoicingDirectivePlan invoicingDirectivePlan){
|
||||
String cycleTypeId = invoicingDirectivePlan.getCycleTypeId();
|
||||
if(cycleTypeId!=null&&!cycleTypeId.equals("2")) {
|
||||
DirectiveDataPool dataPool = new DirectiveDataPool();
|
||||
dataPool.setPoolType("3");
|
||||
dataPool.setBizId(invoicingDirectivePlan.getId());
|
||||
dataPool.setNuId(invoicingDirectivePlan.getNuId());
|
||||
dataPool.setDirectiveId(invoicingDirectivePlan.getDirectiveId());
|
||||
dataPool.setCycleTypeId(invoicingDirectivePlan.getCycleTypeId());
|
||||
dataPool.setCycleValue(invoicingDirectivePlan.getCycleValue());
|
||||
dataPool.setIzPackage(invoicingDirectivePlan.getIzPackage());
|
||||
String startTime = invoicingDirectivePlan.getStartTime();
|
||||
String[] starts = startTime.split(":");
|
||||
String hour = starts[0];
|
||||
String minute = starts[1];
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.set(Calendar.HOUR_OF_DAY, Integer.valueOf(hour));
|
||||
c.set(Calendar.MINUTE, Integer.valueOf(minute));
|
||||
c.set(Calendar.SECOND, 0);
|
||||
c.set(Calendar.MILLISECOND, 0);
|
||||
dataPool.setStartTime(c.getTime());
|
||||
dataPool.setOptTime(invoicingDirectivePlan.getOptTime());
|
||||
dataPool.setOptCount(invoicingDirectivePlan.getOptCount());
|
||||
addDataPool(dataPool);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据池
|
||||
* @param invoicingDirectivePlan
|
||||
*/
|
||||
@Override
|
||||
public void deleteDataPool(InvoicingDirectivePlan invoicingDirectivePlan) {
|
||||
String cycleTypeId = invoicingDirectivePlan.getCycleTypeId();
|
||||
if(cycleTypeId!=null&&!cycleTypeId.equals("2")) {
|
||||
String startTime = invoicingDirectivePlan.getStartTime();
|
||||
String[] starts = startTime.split(":");
|
||||
String hour = starts[0];
|
||||
String minute = starts[1];
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.set(Calendar.HOUR_OF_DAY, Integer.valueOf(hour));
|
||||
c.set(Calendar.MINUTE, Integer.valueOf(minute));
|
||||
c.set(Calendar.SECOND, 0);
|
||||
c.set(Calendar.MILLISECOND, 0);
|
||||
DirectiveDataPool dataPool = new DirectiveDataPool();
|
||||
dataPool.setPoolType("3");
|
||||
dataPool.setBizId(invoicingDirectivePlan.getId());
|
||||
dataPool.setNuId(invoicingDirectivePlan.getNuId());
|
||||
dataPool.setDirectiveId(invoicingDirectivePlan.getDirectiveId());
|
||||
dataPool.setStartTime(c.getTime());
|
||||
// dataPool.setIzStart("N");
|
||||
DirectiveDataPool pool = dataPoolService.queryPoolOne(dataPool);
|
||||
if (pool != null) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
String dateStr = sdf.format(c.getTime());
|
||||
if (pool.getIzOrders().equals("Y")) {
|
||||
//删除派单
|
||||
dataPoolService.deleteOrders(dateStr, pool);
|
||||
}
|
||||
dataPoolService.addDataPoolLog(dateStr, pool.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑数据池
|
||||
* @param invoicingDirectivePlan
|
||||
*/
|
||||
@Override
|
||||
public void editDataPool(InvoicingDirectivePlan invoicingDirectivePlan) {
|
||||
String cycleTypeId = invoicingDirectivePlan.getCycleTypeId();
|
||||
if(cycleTypeId!=null&&!cycleTypeId.equals("2")) {
|
||||
deleteDataPool(invoicingDirectivePlan);
|
||||
DirectiveDataPool dataPool = baseMapper.queryPlanById(invoicingDirectivePlan.getId());
|
||||
DirectiveDataPool pool = dataPoolService.queryPoolOne(dataPool);
|
||||
if (pool == null) {
|
||||
addDataPool(dataPool);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,269 +0,0 @@
|
|||
package com.nu.modules.biz.datapool.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nu.modules.biz.datapool.entity.DirectiveDataPool;
|
||||
import com.nu.modules.biz.datapool.mapper.LogisticsDataPoolMapper;
|
||||
import com.nu.modules.biz.datapool.service.IDirectiveDataPoolService;
|
||||
import com.nu.modules.biz.datapool.service.ILogisticsDataPoolService;
|
||||
import com.nu.modules.biz.plan.logistics.entity.LogisticsDirectivePlan;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.util.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令数据池管理-后勤类
|
||||
* @Author: caolei
|
||||
* @Date: 2026-1-6
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class LogisticsDataPoolServiceImpl extends ServiceImpl<LogisticsDataPoolMapper, DirectiveDataPool> implements ILogisticsDataPoolService {
|
||||
|
||||
@Autowired
|
||||
IDirectiveDataPoolService dataPoolService;
|
||||
|
||||
/**
|
||||
* 批量生成数据池
|
||||
*/
|
||||
@Override
|
||||
public Result<?> generateDataPoolBatch() {
|
||||
DirectiveDataPool entity = new DirectiveDataPool();
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.set(Calendar.SECOND,0);
|
||||
c.set(Calendar.MILLISECOND,0);
|
||||
entity.setStartTime(c.getTime());
|
||||
c.add(Calendar.MINUTE,5);
|
||||
entity.setEndTime(c.getTime());
|
||||
try{
|
||||
List<DirectiveDataPool> planList = baseMapper.queryPlanList(entity);//获取计划
|
||||
if(planList.size()>0){
|
||||
for(DirectiveDataPool plan : planList){
|
||||
DirectiveDataPool pool = dataPoolService.queryPoolOne(plan);
|
||||
if(pool!=null){
|
||||
continue;
|
||||
}
|
||||
if(plan.getIzPackage().equals("N")){
|
||||
DirectiveDataPool directiveEntity = dataPoolService.getDirectiveById(plan.getDirectiveId());
|
||||
if(directiveEntity==null){
|
||||
continue;
|
||||
}
|
||||
}else{
|
||||
DirectiveDataPool packageEntity = dataPoolService.getPackageById(plan.getDirectiveId());
|
||||
if(packageEntity==null){
|
||||
continue;
|
||||
}
|
||||
}
|
||||
addDataPool(plan);
|
||||
}
|
||||
}
|
||||
}catch(Exception e){
|
||||
log.error("计划批量生成指令池错误:{}-{}", DateUtils.now(),e.getMessage());
|
||||
return Result.error("计划批量生成指令池错误");
|
||||
}
|
||||
return Result.OK("计划批量生成指令池成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 指令生成数据池
|
||||
*/
|
||||
private void addDataPool(DirectiveDataPool dataPool){
|
||||
Date dataTime = dataPool.getStartTime();
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.set(Calendar.SECOND,0);
|
||||
c.set(Calendar.MILLISECOND,0);
|
||||
Date startTime = c.getTime();
|
||||
c.add(Calendar.MINUTE,10);
|
||||
Date endTime = c.getTime();
|
||||
if(dataTime.getTime()>=startTime.getTime()){
|
||||
if(dataTime.getTime()<=endTime.getTime()){
|
||||
dataPool.setIzOrders("N");
|
||||
dataPool.setIzStart("N");
|
||||
dataPool.setDelFlag("0");
|
||||
String typeId = dataPool.getCycleTypeId();
|
||||
if(typeId!=null){
|
||||
//每天
|
||||
if(typeId.equals("1")){
|
||||
addDaily(dataPool);
|
||||
}
|
||||
//星期
|
||||
if(typeId.equals("3")){
|
||||
addWeekDay(dataPool);
|
||||
}
|
||||
//日期
|
||||
if(typeId.equals("4")){
|
||||
addMonthDay(dataPool);
|
||||
}
|
||||
//频率
|
||||
if(typeId.equals("5")){
|
||||
addFrequency(dataPool);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 日常指令生成数据池子表(非包)
|
||||
*/
|
||||
private void addDaily(DirectiveDataPool dataPool){
|
||||
//入指令池主表
|
||||
this.save(dataPool);
|
||||
}
|
||||
|
||||
/**
|
||||
* 星期周期指令生成数据池子表(非包)
|
||||
*/
|
||||
private void addWeekDay(DirectiveDataPool dataPool){
|
||||
String cycleValue = dataPool.getCycleValue();
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK); //1周日 2周一 3周二 4周三 5周四 6周五 7周六
|
||||
// cycleValue 存js的星期 0周一 1周二 2周三 3周四 4周五 5周六 6周日 js +2 2 3 4 5 6 7 8 /7 %
|
||||
Integer cv = Integer.valueOf(cycleValue);
|
||||
//处理js星期,使其能和java的星期进行比较
|
||||
cv = cv + 2;
|
||||
if(cv-7>0){
|
||||
cv = cv -7;
|
||||
}
|
||||
//计划执行星期几是当天,则入指令池
|
||||
if(dayOfWeek == cv){
|
||||
addDaily(dataPool);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 月周期指令生成数据池子表(非包)
|
||||
*/
|
||||
private void addMonthDay(DirectiveDataPool dataPool){
|
||||
String cycleValue = dataPool.getCycleValue();
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
int dayOfMonth = calendar.get(Calendar.DAY_OF_MONTH);
|
||||
Integer cv = Integer.valueOf(cycleValue);
|
||||
//计划执行月中的几号是当天,则入指令池
|
||||
if(dayOfMonth == cv){
|
||||
addDaily(dataPool);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 频次指令生成数据池子表
|
||||
*/
|
||||
private void addFrequency(DirectiveDataPool dataPool){
|
||||
String cycleValue = dataPool.getCycleValue();
|
||||
Integer cv = Integer.valueOf(cycleValue);
|
||||
cv = cv + 1;
|
||||
Date optTime = dataPool.getOptTime();
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
int dayOfMonth = calendar.get(Calendar.DAY_OF_MONTH);
|
||||
//计算间隔执行的日期
|
||||
calendar.setTime(optTime);
|
||||
int optDay = calendar.get(Calendar.DAY_OF_MONTH);
|
||||
int resDay = dayOfMonth - optDay;
|
||||
int resCv = resDay%cv;
|
||||
//派单间隔日期否是当前日期
|
||||
if(resCv == 0){
|
||||
int optCount = dataPool.getOptCount();
|
||||
if(optCount == 0){
|
||||
addDaily(dataPool);
|
||||
}else{
|
||||
int orderOptCount = baseMapper.getOrderOptCount(dataPool);
|
||||
if(orderOptCount<optCount){
|
||||
addDaily(dataPool);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 单一指令生成到数据池
|
||||
* @param logisticsDirectivePlan
|
||||
*/
|
||||
@Override
|
||||
public void generateDataPool(LogisticsDirectivePlan logisticsDirectivePlan){
|
||||
String cycleTypeId = logisticsDirectivePlan.getCycleTypeId();
|
||||
if(cycleTypeId!=null&&!cycleTypeId.equals("2")) {
|
||||
DirectiveDataPool dataPool = new DirectiveDataPool();
|
||||
dataPool.setPoolType("4");
|
||||
dataPool.setBizId(logisticsDirectivePlan.getId());
|
||||
dataPool.setNuId(logisticsDirectivePlan.getNuId());
|
||||
dataPool.setDirectiveId(logisticsDirectivePlan.getDirectiveId());
|
||||
dataPool.setCycleTypeId(logisticsDirectivePlan.getCycleTypeId());
|
||||
dataPool.setCycleValue(logisticsDirectivePlan.getCycleValue());
|
||||
dataPool.setIzPackage(logisticsDirectivePlan.getIzPackage());
|
||||
String startTime = logisticsDirectivePlan.getStartTime();
|
||||
String[] starts = startTime.split(":");
|
||||
String hour = starts[0];
|
||||
String minute = starts[1];
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.set(Calendar.HOUR_OF_DAY, Integer.valueOf(hour));
|
||||
c.set(Calendar.MINUTE, Integer.valueOf(minute));
|
||||
c.set(Calendar.SECOND, 0);
|
||||
c.set(Calendar.MILLISECOND, 0);
|
||||
dataPool.setStartTime(c.getTime());
|
||||
dataPool.setOptTime(logisticsDirectivePlan.getOptTime());
|
||||
dataPool.setOptCount(logisticsDirectivePlan.getOptCount());
|
||||
addDataPool(dataPool);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据池
|
||||
* @param logisticsDirectivePlan
|
||||
*/
|
||||
@Override
|
||||
public void deleteDataPool(LogisticsDirectivePlan logisticsDirectivePlan) {
|
||||
String cycleTypeId = logisticsDirectivePlan.getCycleTypeId();
|
||||
if(cycleTypeId!=null&&!cycleTypeId.equals("2")) {
|
||||
String startTime = logisticsDirectivePlan.getStartTime();
|
||||
String[] starts = startTime.split(":");
|
||||
String hour = starts[0];
|
||||
String minute = starts[1];
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.set(Calendar.HOUR_OF_DAY, Integer.valueOf(hour));
|
||||
c.set(Calendar.MINUTE, Integer.valueOf(minute));
|
||||
c.set(Calendar.SECOND, 0);
|
||||
c.set(Calendar.MILLISECOND, 0);
|
||||
DirectiveDataPool dataPool = new DirectiveDataPool();
|
||||
dataPool.setPoolType("4");
|
||||
dataPool.setBizId(logisticsDirectivePlan.getId());
|
||||
dataPool.setNuId(logisticsDirectivePlan.getNuId());
|
||||
dataPool.setDirectiveId(logisticsDirectivePlan.getDirectiveId());
|
||||
dataPool.setStartTime(c.getTime());
|
||||
// dataPool.setIzStart("N");
|
||||
DirectiveDataPool pool = dataPoolService.queryPoolOne(dataPool);
|
||||
if (pool != null) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
String dateStr = sdf.format(c.getTime());
|
||||
if (pool.getIzOrders().equals("Y")) {
|
||||
//删除派单
|
||||
dataPoolService.deleteOrders(dateStr, pool);
|
||||
}
|
||||
dataPoolService.addDataPoolLog(dateStr, pool.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑数据池
|
||||
* @param logisticsDirectivePlan
|
||||
*/
|
||||
@Override
|
||||
public void editDataPool(LogisticsDirectivePlan logisticsDirectivePlan) {
|
||||
String cycleTypeId = logisticsDirectivePlan.getCycleTypeId();
|
||||
if(cycleTypeId!=null&&!cycleTypeId.equals("2")) {
|
||||
deleteDataPool(logisticsDirectivePlan);
|
||||
DirectiveDataPool dataPool = baseMapper.queryPlanById(logisticsDirectivePlan.getId());
|
||||
DirectiveDataPool pool = dataPoolService.queryPoolOne(dataPool);
|
||||
if (pool == null) {
|
||||
addDataPool(dataPool);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,162 +0,0 @@
|
|||
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.DirectiveOrderInfo;
|
||||
import com.nu.modules.biz.order.service.IDirectiveOrderInfoService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @Description: 护理单元-服务指令-工单子表
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2026-01-05
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="护理单元-服务指令-工单子表")
|
||||
@RestController
|
||||
@RequestMapping("/services/directiveOrderInfo")
|
||||
@Slf4j
|
||||
public class DirectiveOrderInfoController extends JeecgController<DirectiveOrderInfo, IDirectiveOrderInfoService> {
|
||||
@Autowired
|
||||
private IDirectiveOrderInfoService directiveOrderInfoService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param directiveOrderInfo
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "护理单元-服务指令-工单子表-分页列表查询")
|
||||
@ApiOperation(value="护理单元-服务指令-工单子表-分页列表查询", notes="护理单元-服务指令-工单子表-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<DirectiveOrderInfo>> queryPageList(DirectiveOrderInfo directiveOrderInfo,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
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 directiveOrderInfo
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "护理单元-服务指令-工单子表-添加")
|
||||
@ApiOperation(value="护理单元-服务指令-工单子表-添加", notes="护理单元-服务指令-工单子表-添加")
|
||||
@RequiresPermissions("centercontrol:nu_biz_nu_directive_order_info:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody DirectiveOrderInfo directiveOrderInfo) {
|
||||
directiveOrderInfoService.save(directiveOrderInfo);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param directiveOrderInfo
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "护理单元-服务指令-工单子表-编辑")
|
||||
@ApiOperation(value="护理单元-服务指令-工单子表-编辑", notes="护理单元-服务指令-工单子表-编辑")
|
||||
@RequiresPermissions("centercontrol:nu_biz_nu_directive_order_info:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody DirectiveOrderInfo directiveOrderInfo) {
|
||||
directiveOrderInfoService.updateById(directiveOrderInfo);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "护理单元-服务指令-工单子表-通过id删除")
|
||||
@ApiOperation(value="护理单元-服务指令-工单子表-通过id删除", notes="护理单元-服务指令-工单子表-通过id删除")
|
||||
@RequiresPermissions("centercontrol:nu_biz_nu_directive_order_info:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
directiveOrderInfoService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "护理单元-服务指令-工单子表-批量删除")
|
||||
@ApiOperation(value="护理单元-服务指令-工单子表-批量删除", notes="护理单元-服务指令-工单子表-批量删除")
|
||||
@RequiresPermissions("centercontrol:nu_biz_nu_directive_order_info:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.directiveOrderInfoService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "护理单元-服务指令-工单子表-通过id查询")
|
||||
@ApiOperation(value="护理单元-服务指令-工单子表-通过id查询", notes="护理单元-服务指令-工单子表-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
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(directiveOrderInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param directiveOrderInfo
|
||||
*/
|
||||
@RequiresPermissions("centercontrol:nu_biz_nu_directive_order_info:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, DirectiveOrderInfo directiveOrderInfo) {
|
||||
return super.exportXls(request, directiveOrderInfo, DirectiveOrderInfo.class, "护理单元-服务指令-工单子表");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@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, DirectiveOrderInfo.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,180 +0,0 @@
|
|||
package com.nu.modules.biz.order.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import com.nu.modules.biz.order.entity.DirectiveOrderLog;
|
||||
import com.nu.modules.biz.order.service.IDirectiveOrderLogService;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
|
||||
/**
|
||||
* @Description: 护理单元-服务指令-工单变更日志
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2026-01-14
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="护理单元-服务指令-工单变更日志")
|
||||
@RestController
|
||||
@RequestMapping("/order/directiveOrderLog")
|
||||
@Slf4j
|
||||
public class DirectiveOrderLogController extends JeecgController<DirectiveOrderLog, IDirectiveOrderLogService> {
|
||||
@Autowired
|
||||
private IDirectiveOrderLogService directiveOrderLogService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param directiveOrderLog
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "护理单元-服务指令-工单变更日志-分页列表查询")
|
||||
@ApiOperation(value="护理单元-服务指令-工单变更日志-分页列表查询", notes="护理单元-服务指令-工单变更日志-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<DirectiveOrderLog>> queryPageList(DirectiveOrderLog directiveOrderLog,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<DirectiveOrderLog> queryWrapper = QueryGenerator.initQueryWrapper(directiveOrderLog, req.getParameterMap());
|
||||
Page<DirectiveOrderLog> page = new Page<DirectiveOrderLog>(pageNo, pageSize);
|
||||
IPage<DirectiveOrderLog> pageList = directiveOrderLogService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param directiveOrderLog
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "护理单元-服务指令-工单变更日志-添加")
|
||||
@ApiOperation(value="护理单元-服务指令-工单变更日志-添加", notes="护理单元-服务指令-工单变更日志-添加")
|
||||
@RequiresPermissions("order:nu_biz_nu_directive_order_log:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody DirectiveOrderLog directiveOrderLog) {
|
||||
directiveOrderLogService.save(directiveOrderLog);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param directiveOrderLog
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "护理单元-服务指令-工单变更日志-编辑")
|
||||
@ApiOperation(value="护理单元-服务指令-工单变更日志-编辑", notes="护理单元-服务指令-工单变更日志-编辑")
|
||||
@RequiresPermissions("order:nu_biz_nu_directive_order_log:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody DirectiveOrderLog directiveOrderLog) {
|
||||
directiveOrderLogService.updateById(directiveOrderLog);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "护理单元-服务指令-工单变更日志-通过id删除")
|
||||
@ApiOperation(value="护理单元-服务指令-工单变更日志-通过id删除", notes="护理单元-服务指令-工单变更日志-通过id删除")
|
||||
@RequiresPermissions("order:nu_biz_nu_directive_order_log:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
directiveOrderLogService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "护理单元-服务指令-工单变更日志-批量删除")
|
||||
@ApiOperation(value="护理单元-服务指令-工单变更日志-批量删除", notes="护理单元-服务指令-工单变更日志-批量删除")
|
||||
@RequiresPermissions("order:nu_biz_nu_directive_order_log:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.directiveOrderLogService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "护理单元-服务指令-工单变更日志-通过id查询")
|
||||
@ApiOperation(value="护理单元-服务指令-工单变更日志-通过id查询", notes="护理单元-服务指令-工单变更日志-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<DirectiveOrderLog> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
DirectiveOrderLog directiveOrderLog = directiveOrderLogService.getById(id);
|
||||
if(directiveOrderLog==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(directiveOrderLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param directiveOrderLog
|
||||
*/
|
||||
@RequiresPermissions("order:nu_biz_nu_directive_order_log:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, DirectiveOrderLog directiveOrderLog) {
|
||||
return super.exportXls(request, directiveOrderLog, DirectiveOrderLog.class, "护理单元-服务指令-工单变更日志");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("order:nu_biz_nu_directive_order_log:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, DirectiveOrderLog.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -23,7 +23,7 @@ import java.util.Date;
|
|||
@TableName("nu_biz_directive_order")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "nu_biz_nu_directive_order对象", description = "服务指令工单主表")
|
||||
@ApiModel(value = "nu_biz_directive_order对象", description = "服务指令工单主表")
|
||||
public class DirectiveOrder implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,63 +0,0 @@
|
|||
package com.nu.modules.biz.order.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令工单业务操作日志表
|
||||
* @Author: caolei
|
||||
* @Date: 2026-1-13
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("nu_biz_nu_directive_order_biz_log")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="nu_biz_nu_directive_order_biz_log对象", description="服务指令工单业务操作日志表")
|
||||
public class DirectiveOrderBizLog implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**id*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
/**指令工单id nu_biz_directive_order.id*/
|
||||
private String directiveOrderId;
|
||||
/**业务类型编码*/
|
||||
private String bizTypeCode;
|
||||
/**业务类型*/
|
||||
private String bizType;
|
||||
/**业务主表单号*/
|
||||
private String bizNo;
|
||||
/**操作类型*/
|
||||
private String optType;
|
||||
/**操作员工ID*/
|
||||
private String optEmpId;
|
||||
/**操作员工*/
|
||||
private String optEmpName;
|
||||
/**操作时间*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date optTime;
|
||||
/**创建人*/
|
||||
private String createBy;
|
||||
/**创建时间*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
/**更新人*/
|
||||
private String updateBy;
|
||||
/**更新日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
/**是否删除 0未删除 1删除*/
|
||||
private String delFlag;
|
||||
}
|
||||
|
|
@ -1,336 +0,0 @@
|
|||
package com.nu.modules.biz.order.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令工单主表
|
||||
* @Author: caolei
|
||||
* @Date: 2025-11-14
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("nu_biz_nu_directive_order_info")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="nu_biz_nu_directive_order_info对象", description="服务指令工单子表")
|
||||
public class DirectiveOrderInfo implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**ID*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "ID")
|
||||
private java.lang.String id;
|
||||
/**主表id*/
|
||||
@Excel(name = "主表id", width = 15)
|
||||
@ApiModelProperty(value = "主表id")
|
||||
private java.lang.String mainId;
|
||||
/**单号*/
|
||||
@Excel(name = "单号", width = 15)
|
||||
@ApiModelProperty(value = "单号")
|
||||
private java.lang.String orderNo;
|
||||
/**工单类型 1护理;2医疗:3库房;4行政*/
|
||||
@Excel(name = "工单类型 1护理;2医疗:3库房;4行政", width = 15)
|
||||
@ApiModelProperty(value = "工单类型 1护理;2医疗:3库房;4行政")
|
||||
private java.lang.String orderType;
|
||||
/**护理单元ID,nu_base_info.id*/
|
||||
@Excel(name = "护理单元ID,nu_base_info.id", width = 15, dictTable = "nu_base_info", dicText = "nu_name", dicCode = "nu_id")
|
||||
@Dict(dictTable = "nu_base_info", dicText = "nu_name", dicCode = "nu_id")
|
||||
@ApiModelProperty(value = "护理单元ID,nu_base_info.id")
|
||||
private java.lang.String nuId;
|
||||
/**护理单元名称*/
|
||||
@Excel(name = "护理单元名称", width = 15)
|
||||
@ApiModelProperty(value = "护理单元名称")
|
||||
private java.lang.String nuName;
|
||||
/**长者ID,nu_biz_elder_info.id*/
|
||||
@Excel(name = "长者ID,nu_biz_elder_info.id", width = 15)
|
||||
@ApiModelProperty(value = "长者ID,nu_biz_elder_info.id")
|
||||
private java.lang.String elderId;
|
||||
/**长者名称*/
|
||||
@Excel(name = "长者名称", width = 15)
|
||||
@ApiModelProperty(value = "长者名称")
|
||||
private java.lang.String elderName;
|
||||
/**员工ID*/
|
||||
@Excel(name = "员工ID", width = 15)
|
||||
@ApiModelProperty(value = "员工ID")
|
||||
private java.lang.String employeeId;
|
||||
/**员工姓名*/
|
||||
@Excel(name = "员工姓名", width = 15)
|
||||
@ApiModelProperty(value = "员工姓名")
|
||||
private java.lang.String employeeName;
|
||||
/**分类标签*/
|
||||
@Excel(name = "分类标签", width = 15, dictTable = "nu_config_service_instruction_tag", dicText = "instruction_name", dicCode = "id")
|
||||
@Dict(dictTable = "nu_config_service_instruction_tag", dicText = "instruction_name", dicCode = "id")
|
||||
@ApiModelProperty(value = "分类标签")
|
||||
private java.lang.String instructionTagId;
|
||||
/**分类标签名称*/
|
||||
@Excel(name = "分类标签名称", width = 15)
|
||||
@ApiModelProperty(value = "分类标签名称")
|
||||
private java.lang.String instructionTagName;
|
||||
/**服务类别ID,nu_config_service_category.id*/
|
||||
@Excel(name = "服务类别ID,nu_config_service_category.id", width = 15, dictTable = "nu_config_service_category", dicText = "category_name", dicCode = "id")
|
||||
@Dict(dictTable = "nu_config_service_category", dicText = "category_name", dicCode = "id")
|
||||
@ApiModelProperty(value = "服务类别ID,nu_config_service_category.id")
|
||||
private java.lang.String categoryId;
|
||||
/**服务类别名称*/
|
||||
@Excel(name = "服务类别名称", width = 15)
|
||||
@ApiModelProperty(value = "服务类别名称")
|
||||
private java.lang.String categoryName;
|
||||
/**服务类型ID,nu_config_service_type.id*/
|
||||
@Excel(name = "服务类型ID,nu_config_service_type.id", width = 15, dictTable = "nu_config_service_type", dicText = "type_name", dicCode = "id")
|
||||
@Dict(dictTable = "nu_config_service_type", dicText = "type_name", dicCode = "id")
|
||||
@ApiModelProperty(value = "服务类型ID,nu_config_service_type.id")
|
||||
private java.lang.String typeId;
|
||||
/**服务属性 ds定时 js计时*/
|
||||
@Excel(name = "服务属性 ds定时 js计时", width = 15)
|
||||
@ApiModelProperty(value = "服务属性 ds定时 js计时")
|
||||
@Dict(dicCode = "service_attribute")
|
||||
private java.lang.String serviceAttribute;
|
||||
/**服务类型名称*/
|
||||
@Excel(name = "服务类型名称", width = 15)
|
||||
@ApiModelProperty(value = "服务类型名称")
|
||||
private java.lang.String typeName;
|
||||
/**服务指令ID,nu_config_service_directive.id*/
|
||||
@Excel(name = "服务指令ID,nu_config_service_directive.id", width = 15)
|
||||
@ApiModelProperty(value = "服务指令ID,nu_config_service_directive.id")
|
||||
private java.lang.String directiveId;
|
||||
/**服务指令名称*/
|
||||
@Excel(name = "服务指令名称", width = 15)
|
||||
@ApiModelProperty(value = "服务指令名称")
|
||||
private java.lang.String directiveName;
|
||||
/**周期类型ID*/
|
||||
@Excel(name = "周期类型ID", width = 15)
|
||||
@ApiModelProperty(value = "周期类型ID")
|
||||
private java.lang.String cycleTypeId;
|
||||
/**周期类型*/
|
||||
@Excel(name = "周期类型", width = 15)
|
||||
@ApiModelProperty(value = "周期类型")
|
||||
private java.lang.String cycleType;
|
||||
/**周期值*/
|
||||
@Excel(name = "周期值", width = 15)
|
||||
@ApiModelProperty(value = "周期值")
|
||||
private java.lang.String cycleValue;
|
||||
/**服务时长(分钟)*/
|
||||
@Excel(name = "服务时长(分钟)", width = 15)
|
||||
@ApiModelProperty(value = "服务时长(分钟)")
|
||||
private java.lang.String serviceDuration;
|
||||
/**服务说明*/
|
||||
@Excel(name = "服务说明", width = 15)
|
||||
@ApiModelProperty(value = "服务说明")
|
||||
private java.lang.String serviceContent;
|
||||
/**基础价格*/
|
||||
@Excel(name = "基础价格", width = 15)
|
||||
@ApiModelProperty(value = "基础价格")
|
||||
private java.math.BigDecimal tollPrice;
|
||||
/**提成价格*/
|
||||
@Excel(name = "提成价格", width = 15)
|
||||
@ApiModelProperty(value = "提成价格")
|
||||
private java.math.BigDecimal comPrice;
|
||||
/**标签总价格*/
|
||||
@Excel(name = "标签总价格", width = 15)
|
||||
@ApiModelProperty(value = "标签总价格")
|
||||
private java.math.BigDecimal tagTotalPrice;
|
||||
/**应收提成价格*/
|
||||
@Excel(name = "应收提成价格", width = 15)
|
||||
@ApiModelProperty(value = "应收提成价格")
|
||||
private java.math.BigDecimal ysComPrice;
|
||||
/**实收提成价格*/
|
||||
@Excel(name = "实收提成价格", width = 15)
|
||||
@ApiModelProperty(value = "实收提成价格")
|
||||
private java.math.BigDecimal realComPrice;
|
||||
/**服务指令包ID*/
|
||||
@Excel(name = "服务指令包ID", width = 15)
|
||||
@ApiModelProperty(value = "服务指令包ID")
|
||||
private java.lang.String packageId;
|
||||
/**服务指令包名称*/
|
||||
@Excel(name = "服务指令包名称", width = 15)
|
||||
@ApiModelProperty(value = "服务指令包名称")
|
||||
private java.lang.String packageName;
|
||||
/**是否是服务指令包 Y是 N否*/
|
||||
@Excel(name = "是否是服务指令包 Y是 N否", width = 15)
|
||||
@ApiModelProperty(value = "是否是服务指令包 Y是 N否")
|
||||
private java.lang.String izPackage;
|
||||
/**开始时间*/
|
||||
@Excel(name = "开始时间", width = 15, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "开始时间")
|
||||
private java.util.Date startTime;
|
||||
/**结束时间*/
|
||||
@Excel(name = "结束时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "结束时间")
|
||||
private java.util.Date endTime;
|
||||
/**实际开始时间*/
|
||||
@Excel(name = "实际开始时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "实际开始时间")
|
||||
private java.util.Date beginTime;
|
||||
/**实际结束时间*/
|
||||
@Excel(name = "实际结束时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "实际结束时间")
|
||||
private java.util.Date finishTime;
|
||||
/**是否开始 Y是 N否*/
|
||||
@Excel(name = "是否开始 Y是 N否", width = 15)
|
||||
@ApiModelProperty(value = "是否开始 Y是 N否")
|
||||
private java.lang.String izStart;
|
||||
/**是否完成 Y是 N否*/
|
||||
@Excel(name = "是否完成 Y是 N否", width = 15)
|
||||
@ApiModelProperty(value = "是否完成 Y是 N否")
|
||||
private java.lang.String izFinish;
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private java.lang.String createBy;
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private java.util.Date createTime;
|
||||
/**更新人*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private java.lang.String updateBy;
|
||||
/**更新日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新日期")
|
||||
private java.util.Date updateTime;
|
||||
/**tplink下载地址*/
|
||||
@Excel(name = "tplink下载地址", width = 15)
|
||||
@ApiModelProperty(value = "tplink下载地址")
|
||||
private java.lang.String tplinkPath;
|
||||
/**手动拍照*/
|
||||
@Excel(name = "手动拍照", width = 15)
|
||||
@ApiModelProperty(value = "手动拍照")
|
||||
private java.lang.String manuallyPicPath;
|
||||
/**手动录制*/
|
||||
@Excel(name = "手动录制", width = 15)
|
||||
@ApiModelProperty(value = "手动录制")
|
||||
private java.lang.String manuallyMp4Path;
|
||||
/**执行类型 1单人 2协助 3转单*/
|
||||
@Excel(name = "执行类型 1单人 2协助 3转单", width = 15, dicCode = "directive_order_opt_type")
|
||||
@Dict(dicCode = "directive_order_opt_type")
|
||||
@ApiModelProperty(value = "执行类型 1单人 2协助 3转单")
|
||||
private java.lang.String optType;
|
||||
/**执行状态 1正常 2未执行 3超时*/
|
||||
@Excel(name = "执行状态 1正常 2未执行 3超时", width = 15, dicCode = "directive_order_opt_status")
|
||||
@Dict(dicCode = "directive_order_opt_status")
|
||||
@ApiModelProperty(value = "执行状态 1正常 2未执行 3超时")
|
||||
private java.lang.String optStatus;
|
||||
/**实际执行人id(多个); 主要执行人+协助人*/
|
||||
@Excel(name = "实际执行人id(多个); 主要执行人+协助人", width = 15)
|
||||
@ApiModelProperty(value = "实际执行人id(多个); 主要执行人+协助人")
|
||||
private java.lang.String optIds;
|
||||
/**实际执行人名称(多个); 主要执行人+协助人*/
|
||||
@Excel(name = "实际执行人名称(多个); 主要执行人+协助人", width = 15)
|
||||
@ApiModelProperty(value = "实际执行人名称(多个); 主要执行人+协助人")
|
||||
private java.lang.String optNames;
|
||||
/**审核状态 0待审核 1通过 2未通过*/
|
||||
@Excel(name = "审核状态 1待审核 2通过 3未通过", width = 15, dicCode = "appraisal_status")
|
||||
@Dict(dicCode = "appraisal_status")
|
||||
@ApiModelProperty(value = "审核状态 0待审核 1通过 2未通过")
|
||||
private java.lang.String status;
|
||||
/**驳回原因*/
|
||||
@Excel(name = "驳回原因", width = 15)
|
||||
@ApiModelProperty(value = "驳回原因")
|
||||
private java.lang.String content;
|
||||
/**撤回人(汉字)*/
|
||||
@Excel(name = "撤回人(汉字)", width = 15)
|
||||
@ApiModelProperty(value = "撤回人(汉字)")
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@Column(nullable = true, updatable = true)
|
||||
private java.lang.String revocation;
|
||||
/**撤回时间*/
|
||||
@Excel(name = "撤回时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "撤回时间")
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@Column(nullable = true, updatable = true)
|
||||
private java.util.Date revocationTime;
|
||||
|
||||
/**接单上限*/
|
||||
@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 employeeIds;
|
||||
|
||||
/**服务指令id集合逗号分隔*/
|
||||
@TableField(exist = false)
|
||||
private String directiveIds;
|
||||
|
||||
/**优先级 数值越高优先级越高*/
|
||||
//空闲状态提高3级 指定护理员提高2级
|
||||
@TableField(exist = false)
|
||||
private Integer level;
|
||||
|
||||
/**发起模式 1主动触发,工单派给发起人自己 2被动触发,中控发起,派单规则发送给员工*/
|
||||
@TableField(exist = false)
|
||||
private String triggerMode;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String tableName;//表名字
|
||||
|
||||
/**服务指令图片大图*/
|
||||
@TableField(exist = false)
|
||||
private String previewFile;
|
||||
/**服务指令图片小图*/
|
||||
@TableField(exist = false)
|
||||
private String previewFileSmall;
|
||||
/**语音文件*/
|
||||
@TableField(exist = false)
|
||||
private String mp3File;
|
||||
/**视频文件*/
|
||||
@TableField(exist = false)
|
||||
private String mp4File;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String immediateFile;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String immediateFileFocus;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String packDirectives;
|
||||
}
|
||||
|
|
@ -1,81 +0,0 @@
|
|||
package com.nu.modules.biz.order.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import org.jeecg.common.constant.ProvinceCityArea;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @Description: 护理单元-服务指令-工单变更日志
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2026-01-14
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("nu_biz_nu_directive_order_log")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="nu_biz_nu_directive_order_log对象", description="护理单元-服务指令-工单变更日志")
|
||||
public class DirectiveOrderLog implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**ID*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "ID")
|
||||
private java.lang.String id;
|
||||
/**单号 nu_biz_directive_order.id*/
|
||||
@Excel(name = "单号 nu_biz_directive_order.id", width = 15)
|
||||
@ApiModelProperty(value = "单号 nu_biz_directive_order.id")
|
||||
private java.lang.String orderNo;
|
||||
/**执行类型名称*/
|
||||
@Excel(name = "执行类型名称", width = 15)
|
||||
@ApiModelProperty(value = "执行类型名称")
|
||||
private java.lang.String optType;
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private java.util.Date createTime;
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private java.lang.String createBy;
|
||||
/**操作人*/
|
||||
@Excel(name = "操作人", width = 15)
|
||||
@ApiModelProperty(value = "操作人")
|
||||
private java.lang.String optBy;
|
||||
/**操作人名称*/
|
||||
@Excel(name = "操作人名称", width = 15)
|
||||
@ApiModelProperty(value = "操作人名称")
|
||||
private java.lang.String optByName;
|
||||
/**变更前是谁*/
|
||||
@Excel(name = "变更前是谁", width = 15)
|
||||
@ApiModelProperty(value = "变更前是谁")
|
||||
private java.lang.String beforeChange;
|
||||
/**变更前谁是(中文名)*/
|
||||
@Excel(name = "变更前谁是(中文名)", width = 15)
|
||||
@ApiModelProperty(value = "变更前谁是(中文名)")
|
||||
private java.lang.String beforeChangeName;
|
||||
/**变更给了谁*/
|
||||
@Excel(name = "变更给了谁", width = 15)
|
||||
@ApiModelProperty(value = "变更给了谁")
|
||||
private java.lang.String afterChange;
|
||||
/**变更给了谁(中文名)*/
|
||||
@Excel(name = "变更给了谁(中文名)", width = 15)
|
||||
@ApiModelProperty(value = "变更给了谁(中文名)")
|
||||
private java.lang.String afterChangeName;
|
||||
}
|
||||
|
|
@ -1,71 +0,0 @@
|
|||
package com.nu.modules.biz.order.job;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
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;
|
||||
import org.jeecg.common.util.DateUtils;
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* 指令工单之后,获取服务指令视频生成MP4
|
||||
*/
|
||||
@Slf4j
|
||||
public class CareSubDownTplinkJob implements Job {
|
||||
|
||||
|
||||
@Autowired
|
||||
private IDirectiveOrderInfoService careOrdersSubService;
|
||||
|
||||
@Autowired
|
||||
private ICameraInfoService tplinkService;
|
||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||
log.error("OrdersJob:{}-{}", DateUtils.now(),"护理类指令池批量生成工单开始");
|
||||
|
||||
QueryWrapper<DirectiveOrderInfo> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.isNull("tplink_path");
|
||||
queryWrapper.eq("iz_finish","Y");
|
||||
List<DirectiveOrderInfo> directiveOrderInfoList = careOrdersSubService.list(queryWrapper);
|
||||
for (DirectiveOrderInfo directiveOrderInfoEntity : directiveOrderInfoList){
|
||||
try {
|
||||
String serviceDuration = directiveOrderInfoEntity.getServiceDuration();
|
||||
if(!StringUtils.isBlank(serviceDuration)){
|
||||
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 = 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)){
|
||||
directiveOrderInfoEntity.setTplinkPath(resultTplink);
|
||||
careOrdersSubService.updateById(directiveOrderInfoEntity);
|
||||
}else{
|
||||
directiveOrderInfoEntity.setTplinkPath("error");
|
||||
careOrdersSubService.updateById(directiveOrderInfoEntity);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,58 +0,0 @@
|
|||
package com.nu.modules.biz.order.job;
|
||||
|
||||
import com.nu.modules.biz.order.entity.DirectiveOrder;
|
||||
import com.nu.modules.biz.order.service.IDirectiveOrderJobService;
|
||||
import com.nu.utils.CosFileUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jeecg.common.util.DateUtils;
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 删除错误的视频
|
||||
*/
|
||||
@Slf4j
|
||||
public class CosDeleteErrorFilesJob implements Job {
|
||||
|
||||
|
||||
@Autowired
|
||||
private IDirectiveOrderJobService directiveOrderService;
|
||||
@Autowired
|
||||
private CosFileUtil cosFileUtil;
|
||||
|
||||
/**
|
||||
* 删除COS中错误的视频
|
||||
*
|
||||
* @param jobExecutionContext
|
||||
* @throws JobExecutionException
|
||||
*/
|
||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||
log.info("OrdersJob:{}-{}", DateUtils.now(), "删除COS中错误的视频");
|
||||
List<DirectiveOrder> list = directiveOrderService.findErrorFiles();
|
||||
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
List<String> files = list.stream()
|
||||
.map(DirectiveOrder::getTplinkPath)
|
||||
.filter(StringUtils::isNotBlank)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
cosFileUtil.deleteFiles(files);
|
||||
|
||||
List<String> ids = list.stream()
|
||||
.map(DirectiveOrder::getId)
|
||||
.filter(StringUtils::isNotBlank)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
directiveOrderService.cleanErrorFilePath(ids);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
package com.nu.modules.biz.order.job;
|
||||
|
||||
import com.nu.modules.biz.order.service.IDirectiveOrderService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.util.DateUtils;
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
/**
|
||||
* 指令池批量生成工单
|
||||
*/
|
||||
@Slf4j
|
||||
public class DirectiveOrdersJob implements Job {
|
||||
|
||||
@Autowired
|
||||
IDirectiveOrderService service;
|
||||
|
||||
@Override
|
||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||
log.error("OrdersJob:{}-{}", DateUtils.now(),"护理类指令池批量生成工单开始");
|
||||
Result<?> result = service.generateOrdersBatch();
|
||||
log.error("OrdersJob:{}-{}", DateUtils.now(),result.getMessage());
|
||||
}
|
||||
}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
package com.nu.modules.biz.order.job;
|
||||
|
||||
import com.nu.modules.biz.order.entity.DirectiveOrder;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ITplinkTaskIDProcessJob {
|
||||
|
||||
void processGroupAsync(List<DirectiveOrder> group);
|
||||
|
||||
void getUploadToServerProcessAsync(DirectiveOrder order) throws InterruptedException;
|
||||
}
|
||||
|
|
@ -1,139 +0,0 @@
|
|||
package com.nu.modules.biz.order.job;
|
||||
|
||||
import com.nu.modules.biz.order.entity.DirectiveOrder;
|
||||
import com.nu.modules.biz.order.service.IDirectiveOrderJobService;
|
||||
import com.nu.modules.tplink.camera.service.ICameraInfoJobService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.util.DateUtils;
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* tplink进度查询
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class TplinkTaskIDProcessJob implements Job, ITplinkTaskIDProcessJob {
|
||||
|
||||
|
||||
@Autowired
|
||||
private IDirectiveOrderJobService directiveOrderService;
|
||||
@Autowired
|
||||
private ICameraInfoJobService tplinkService;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private ITplinkTaskIDProcessJob ownService;
|
||||
|
||||
/**
|
||||
* tplink进度查询
|
||||
*
|
||||
* @param jobExecutionContext
|
||||
* @throws JobExecutionException
|
||||
*/
|
||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||
log.info("OrdersJob:{}-{}", DateUtils.now(), "tplink进度查询");
|
||||
log.info("【主线程】execute 方法 - 线程名称: {}, 线程ID: {}", Thread.currentThread().getName(), Thread.currentThread().getId());
|
||||
|
||||
List<DirectiveOrder> directiveOrderList = directiveOrderService.getTplinkProcessing();
|
||||
|
||||
// 将数据分成30个一组
|
||||
List<List<DirectiveOrder>> groups = new ArrayList<>();
|
||||
for (int i = 0; i < directiveOrderList.size(); i += 30) {
|
||||
int end = Math.min(i + 30, directiveOrderList.size());
|
||||
groups.add(directiveOrderList.subList(i, end));
|
||||
}
|
||||
|
||||
log.info("【主线程】总共{}条数据,分成{}组,每组最多30条", directiveOrderList.size(), groups.size());
|
||||
|
||||
// 每组开一个线程单独处理
|
||||
for (List<DirectiveOrder> group : groups) {
|
||||
ownService.processGroupAsync(group);
|
||||
}
|
||||
}
|
||||
|
||||
@Async
|
||||
public void processGroupAsync(List<DirectiveOrder> group) {
|
||||
log.info("【分组线程】开始处理一组数据,本组{}条 - 线程名称: {}, 线程ID: {}",
|
||||
group.size(), Thread.currentThread().getName(), Thread.currentThread().getId());
|
||||
|
||||
for (DirectiveOrder order : group) {
|
||||
try {
|
||||
Map<String, Object> tplinkProcessMap = tplinkService.getUploadToServerProcess(order.getTplinkTaskId());
|
||||
if ("success".equals((String) tplinkProcessMap.get("result"))) {
|
||||
String processStr = (String) tplinkProcessMap.get("process");
|
||||
int process = Integer.parseInt(processStr);
|
||||
if (process == 1000) {
|
||||
String url = (String) tplinkProcessMap.get("url");
|
||||
long videoSize = getVideoSize(url);
|
||||
order.setTplinkLen(videoSize + "");
|
||||
//如果长度是-1 需要开线程5秒查一次 最多查3次 有不是-1就记作正常 失效直接记为失败 最后一次还是-1记作失败
|
||||
if (videoSize == -1) {
|
||||
ownService.getUploadToServerProcessAsync(order);
|
||||
} else {
|
||||
directiveOrderService.taskSuccess(order);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
directiveOrderService.taskFaild(order.getTplinkTaskId());
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
directiveOrderService.taskFaild(order.getTplinkTaskId());
|
||||
}
|
||||
}
|
||||
|
||||
log.info("【分组线程】本组处理完成 - 线程名称: {}, 线程ID: {}", Thread.currentThread().getName(), Thread.currentThread().getId());
|
||||
}
|
||||
|
||||
@Async
|
||||
public void getUploadToServerProcessAsync(DirectiveOrder order) throws InterruptedException {
|
||||
log.info("【异步方法】进入 getUploadToServerProcessAsync - 线程名称: {}, 线程ID: {}", Thread.currentThread().getName(), Thread.currentThread().getId());
|
||||
boolean izSuccess = false;
|
||||
for (int i = 0; i < 3; i++) {
|
||||
Map<String, Object> tplinkProcessMap = tplinkService.getUploadToServerProcess(order.getTplinkTaskId());
|
||||
if (!"success".equals((String) tplinkProcessMap.get("result"))) {
|
||||
//taskID失效了(能进这个里面都是已经成功的,突然失败了说明失效了)
|
||||
break;
|
||||
}
|
||||
String url = (String) tplinkProcessMap.get("url");
|
||||
long videoSize = getVideoSize(url);
|
||||
order.setTplinkLen(videoSize + "");
|
||||
//如果长度是-1 需要开线程5秒查一次 最多查3次 有不是-1就记作正常 失效直接记为失败 最后一次还是-1记作失败
|
||||
if (videoSize != -1) {
|
||||
//能够查到文件大小了
|
||||
izSuccess = true;
|
||||
directiveOrderService.taskSuccess(order);
|
||||
break;
|
||||
}
|
||||
Thread.sleep(1000);
|
||||
}
|
||||
|
||||
if (!izSuccess) {
|
||||
directiveOrderService.taskFaild(order.getTplinkTaskId());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private long getVideoSize(String videoUrl) {
|
||||
try {
|
||||
HttpURLConnection conn = (HttpURLConnection) new URL(videoUrl).openConnection();
|
||||
conn.setRequestMethod("HEAD");
|
||||
conn.setConnectTimeout(5000);
|
||||
return conn.getContentLengthLong();
|
||||
} catch (Exception e) {
|
||||
log.error("获取视频大小失败: {}", e.getMessage());
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
package com.nu.modules.biz.order.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.nu.modules.biz.order.entity.DirectiveOrderBizLog;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令工单业务操作日志表
|
||||
* @Author: caolei
|
||||
* @Date: 2026-1-13
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface DirectiveOrderBizLogMapper extends BaseMapper<DirectiveOrderBizLog> {
|
||||
|
||||
}
|
||||
|
|
@ -1,24 +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.entity.DirectiveOrderEntity;
|
||||
import com.nu.entity.DirectiveOrderInfoEntity;
|
||||
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<DirectiveOrderEntity> queryOrderInfoList(@Param("dto") DirectiveOrderEntity queryWrapper);
|
||||
}
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
package com.nu.modules.biz.order.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.nu.modules.biz.order.entity.DirectiveOrderLog;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 护理单元-服务指令-工单变更日志
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2026-01-14
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface DirectiveOrderLogMapper extends BaseMapper<DirectiveOrderLog> {
|
||||
|
||||
}
|
||||
|
|
@ -1,16 +1,11 @@
|
|||
package com.nu.modules.biz.order.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nu.entity.CareDirectiveEntity;
|
||||
import com.nu.entity.DirectiveOrderEntity;
|
||||
import com.nu.entity.DirectiveOrderInfoEntity;
|
||||
import com.nu.modules.biz.order.entity.DirectiveOrder;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -20,32 +15,13 @@ import java.util.List;
|
|||
* @Version: V1.0
|
||||
*/
|
||||
public interface DirectiveOrderMapper extends BaseMapper<DirectiveOrder> {
|
||||
List<DirectiveOrder> queryDataPoolList(DirectiveOrder orders);
|
||||
|
||||
List<DirectiveOrder> getEmpPermissionAndOnline(@Param("directiveIds") String directiveIds, @Param("employeeIds") String employeeIds, @Param("startTime") Date startTime);
|
||||
|
||||
DirectiveOrder getEmpOrderly(@Param("elderId") String elderId);
|
||||
|
||||
List<DirectiveOrder> getPermissionEmps(@Param("directiveIds") String directiveIds);
|
||||
|
||||
void updatePoolIzOrder(@Param("poolId") String poolId);
|
||||
|
||||
DirectiveOrder getDirectivePrice(@Param("directiveId") String directiveId);
|
||||
|
||||
DirectiveOrder selectInfoById(@Param("id") String id);
|
||||
|
||||
int queryTodayFinishedTotal(@Param("type") String type, @Param("nuId") String nuId, @Param("elderId") String elderId);
|
||||
|
||||
List<DirectiveOrderEntity> queryHistory(@Param("dto") CareDirectiveEntity dto);
|
||||
|
||||
List<DirectiveOrderEntity> queryCurrent(@Param("dto") CareDirectiveEntity dto);
|
||||
|
||||
DirectiveOrder getInstantById(DirectiveOrder orders);
|
||||
|
||||
DirectiveOrder getDirectiveById(DirectiveOrder orders);
|
||||
|
||||
DirectiveOrder getPackageById(DirectiveOrder orders);
|
||||
|
||||
DirectiveOrder getEmployeeById(@Param("employeeId") String employeeId);
|
||||
|
||||
List<DirectiveOrderEntity> queryOrderList(@Param("entity") DirectiveOrderEntity entity);
|
||||
|
|
@ -66,9 +42,8 @@ public interface DirectiveOrderMapper extends BaseMapper<DirectiveOrder> {
|
|||
|
||||
int taskFaild(@Param("tplinkTaskId") String tplinkTaskId);
|
||||
|
||||
List<DirectiveOrder> findErrorFiles();
|
||||
|
||||
int cleanErrorFilePath(@Param("ids") List<String> ids);
|
||||
|
||||
int updateEmpEndTimeByJob();
|
||||
|
||||
List<DirectiveOrderEntity> queryOrderInfoList(@Param("dto") DirectiveOrderEntity queryWrapper);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +0,0 @@
|
|||
<?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.DirectiveOrderBizLogMapper">
|
||||
|
||||
</mapper>
|
||||
|
|
@ -1,69 +0,0 @@
|
|||
<?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.DirectiveOrderInfoMapper">
|
||||
|
||||
<select id="getDirectiveList" resultType="com.nu.modules.biz.order.entity.DirectiveOrderInfo">
|
||||
select a.instruction_tag_id as instructionTagId,
|
||||
b.instruction_name as instructionTagName,
|
||||
a.category_id as categoryId,
|
||||
c.category_name AS categoryName,
|
||||
a.type_id as typeId,
|
||||
d.type_name as typeName,
|
||||
a.id as directiveId,
|
||||
a.directive_name as directiveName,
|
||||
a.preview_file as previewFile,
|
||||
a.preview_file_small as previewFileSmall,
|
||||
a.mp3_file as mp3File,
|
||||
a.mp4_file as mp4File,
|
||||
a.service_duration as serviceDuration,
|
||||
a.service_content as serviceContent,
|
||||
a.timeout_duration as timeoutDuration
|
||||
from nu_config_service_directive a
|
||||
left join nu_config_service_instruction_tag b on a.instruction_tag_id = b.id
|
||||
left join nu_config_service_category c on a.category_id = c.id
|
||||
left join nu_config_service_type d on a.type_id = d.id
|
||||
where a.id = #{directiveId}
|
||||
and a.del_flag = '0'
|
||||
and a.iz_enabled = 'Y'
|
||||
</select>
|
||||
|
||||
<select id="getSubDirectiveList" resultType="com.nu.modules.biz.order.entity.DirectiveOrderInfo">
|
||||
SELECT b.instruction_tag_id AS instructionTagId,
|
||||
e.instruction_name AS instructionTagName,
|
||||
b.category_id AS categoryId,
|
||||
c.category_name AS categoryName,
|
||||
b.type_id AS typeId,
|
||||
d.type_name AS typeName,
|
||||
b.id AS directiveId,
|
||||
b.directive_name AS directiveName,
|
||||
b.preview_file AS previewFile,
|
||||
b.preview_file_small AS previewFileSmall,
|
||||
b.mp3_file AS mp3File,
|
||||
b.mp4_file AS mp4File,
|
||||
b.service_duration AS serviceDuration,
|
||||
b.service_content AS serviceContent,
|
||||
b.timeout_duration AS timeoutDuration
|
||||
FROM nu_config_directive_package_main p
|
||||
INNER JOIN nu_config_directive_package_item a ON p.id = a.package_id
|
||||
LEFT JOIN nu_config_service_directive b ON a.directive_id = b.id
|
||||
LEFT JOIN nu_config_service_category c ON b.category_id = c.id
|
||||
LEFT JOIN nu_config_service_type d ON b.type_id = d.id
|
||||
LEFT JOIN nu_config_service_instruction_tag e ON b.instruction_tag_id = e.id
|
||||
where a.package_id = #{packageId}
|
||||
and p.del_flag = '0'
|
||||
and p.iz_enabled = 'Y'
|
||||
and b.del_flag = '0'
|
||||
and b.iz_enabled = 'Y'
|
||||
</select>
|
||||
|
||||
|
||||
<select id="queryOrderInfoList" resultType="com.nu.entity.DirectiveOrderEntity">
|
||||
select a.*, b.immediate_file, b.immediate_file_focus
|
||||
from nu_biz_directive_order a
|
||||
left join nu_config_service_directive b on a.directive_id = b.id
|
||||
where a.nu_id = #{dto.nuId}
|
||||
and a.instruction_id = #{dto.instructionTagId}
|
||||
and a.serv_start_time = #{dto.servStartTime}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
<?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.DirectiveOrderLogMapper">
|
||||
|
||||
</mapper>
|
||||
|
|
@ -7,7 +7,6 @@
|
|||
<result column="order_no" property="orderNo"/>
|
||||
<result column="order_type" property="orderType"/>
|
||||
<result column="opt_type" property="optType"/>
|
||||
<result column="pool_id" property="poolId"/>
|
||||
<result column="biz_id" property="bizId"/>
|
||||
<result column="biz_type" property="bizType"/>
|
||||
<result column="nu_id" property="nuId"/>
|
||||
|
|
@ -22,13 +21,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"/>
|
||||
|
|
@ -62,7 +57,6 @@
|
|||
<id column="sub_id" property="id"/>
|
||||
<result column="sub_order_type" property="orderType"/>
|
||||
<result column="sub_main_id" property="mainId"/>
|
||||
<result column="sub_nu_id" property="nuId"/>
|
||||
<result column="sub_nu_name" property="nuName"/>
|
||||
<result column="sub_elder_id" property="elderId"/>
|
||||
<result column="sub_elder_name" property="elderName"/>
|
||||
|
|
@ -80,13 +74,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"/>
|
||||
|
|
@ -112,145 +102,6 @@
|
|||
</collection>
|
||||
</resultMap>
|
||||
|
||||
<select id="queryDataPoolList" resultType="com.nu.modules.biz.order.entity.DirectiveOrder">
|
||||
select a.id as poolId,
|
||||
a.pool_type as orderType,
|
||||
a.biz_id as bizId,
|
||||
a.nu_id as nuId,
|
||||
b.nu_name as nuName,
|
||||
c.id as elderId,
|
||||
c.name as elderName,
|
||||
a.directive_id as directiveId,
|
||||
a.cycle_type_id as cycleTypeId,
|
||||
d.item_text as cycleType,
|
||||
a.cycle_value as cycleValue,
|
||||
a.iz_package as izPackage,
|
||||
a.start_time as startTime,
|
||||
(case when c.orderly is null then 2 else 1 end) as orderEmp
|
||||
from nu_biz_nu_directive_data_pool a
|
||||
inner join nu_base_info b on a.nu_id = b.nu_id and b.del_flag = '0'
|
||||
left join nu_biz_elder_info c on b.elder_id = c.id and c.del_flag = '0'
|
||||
left join view_sys_dict d on a.cycle_type_id = d.item_value and d.dict_code = 'period_type'
|
||||
where a.iz_orders = 'N'
|
||||
order by a.start_time, orderEmp, a.nu_id
|
||||
</select>
|
||||
|
||||
<select id="queryDataPoolListBak" resultType="com.nu.modules.biz.order.entity.DirectiveOrder">
|
||||
select a.id as poolId,
|
||||
a.pool_type as orderType,
|
||||
a.biz_id as bizId,
|
||||
a.nu_id as nuId,
|
||||
a.nu_name as nuName,
|
||||
a.elder_id as elderId,
|
||||
a.elder_name as elderName,
|
||||
a.directive_id as directiveId,
|
||||
a.directive_name as directiveName,
|
||||
a.cycle_type_id as cycleTypeId,
|
||||
a.cycle_type as cycleType,
|
||||
a.cycle_value as cycleValue,
|
||||
a.preview_file as previewFile,
|
||||
-- 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_directive_data_pool a
|
||||
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
|
||||
</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
|
||||
from nu_biz_employees_info a
|
||||
inner join nu_biz_employees_service_tags b on a.id = b.employees_id
|
||||
inner join nu_service_tag_main c on c.id = b.tags_id
|
||||
inner join nu_service_tag_info d on d.tag_id = c.id
|
||||
left join (
|
||||
select employee_id,count(*) as orderNum,
|
||||
sum(service_duration) as totalDuration,
|
||||
round(sum(ifnull(com_price,0)),4) as totalComPrice,
|
||||
max(start_time) as maxTime,
|
||||
sum(case when iz_finish='N' then 1 else 0 end) as ownCn
|
||||
from nu_biz_nu_directive_order_info
|
||||
where start_time >=DATE_FORMAT(NOW(), '%Y-%m-%d 00:00:00')
|
||||
and start_time <=DATE_FORMAT(NOW(), '%Y-%m-%d 23:59:59')
|
||||
group by employee_id
|
||||
) e on a.id = e.employee_id
|
||||
left join (
|
||||
select employee_id,sum(case when iz_finish='N' then 1 else 0 end) as orderNum
|
||||
from nu_biz_nu_directive_order_info
|
||||
where start_time = #{startTime}
|
||||
or (start_time < #{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'
|
||||
and a.iz_online = 'Y'
|
||||
and c.del_flag = '0'
|
||||
and c.iz_enabled = 'Y'
|
||||
<if test="directiveIds != null and directiveIds != ''">
|
||||
AND d.directive_id in
|
||||
<foreach item="directiveId" index="index" collection="directiveIds.split(',')"
|
||||
open="(" separator="," close=")">
|
||||
#{directiveId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="employeeIds != null and employeeIds != ''">
|
||||
AND a.id in
|
||||
<foreach item="employeeId" index="index" collection="employeeIds.split(',')"
|
||||
open="(" separator="," close=")">
|
||||
#{employeeId}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getEmpOrderly" resultType="com.nu.modules.biz.order.entity.DirectiveOrder">
|
||||
select orderly as employeeIds
|
||||
from nu_biz_elder_info
|
||||
where id = #{elderId}
|
||||
</select>
|
||||
|
||||
<select id="getPermissionEmps" resultType="com.nu.modules.biz.order.entity.DirectiveOrder">
|
||||
select a.id as employeeId,count(*) as ownCn
|
||||
from nu_biz_employees_info a
|
||||
inner join nu_biz_employees_service_tags b on a.id = b.employees_id
|
||||
inner join nu_service_tag_main c on c.id = b.tags_id
|
||||
inner join nu_service_tag_info d on d.tag_id = c.id
|
||||
where d.directive_id in
|
||||
<foreach item="directiveId" index="index" collection="directiveIds.split(',')"
|
||||
open="(" separator="," close=")">
|
||||
#{directiveId}
|
||||
</foreach>
|
||||
group by a.id
|
||||
</select>
|
||||
|
||||
<update id="updatePoolIzOrder">
|
||||
update nu_biz_nu_directive_data_pool
|
||||
set iz_orders = 'Y'
|
||||
where id = #{poolId}
|
||||
</update>
|
||||
<update id="taskSuccess">
|
||||
update nu_biz_directive_order
|
||||
set tplink_task_id = null,
|
||||
|
|
@ -265,14 +116,6 @@
|
|||
where tplink_task_id = #{tplinkTaskId}
|
||||
</update>
|
||||
|
||||
<update id="cleanErrorFilePath">
|
||||
update nu_biz_directive_order
|
||||
set tplink_path = null,cos_status = '3'
|
||||
where id in
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
<update id="updateEmpEndTimeByJob">
|
||||
UPDATE nu_biz_directive_order
|
||||
SET emp_end_time = DATE_FORMAT(emp_start_time, '%Y-%m-%d 23:59:59'),
|
||||
|
|
@ -282,12 +125,6 @@
|
|||
AND DATE(emp_start_time) = CURDATE()
|
||||
</update>
|
||||
|
||||
<select id="getDirectivePrice" resultType="com.nu.modules.biz.order.entity.DirectiveOrder">
|
||||
select toll_price as tollPrice,
|
||||
com_price as comPrice
|
||||
from nu_config_service_directive
|
||||
where id = #{directiveId}
|
||||
</select>
|
||||
|
||||
<select id="selectInfoById" resultType="com.nu.modules.biz.order.entity.DirectiveOrder">
|
||||
select a.*,
|
||||
|
|
@ -298,24 +135,6 @@
|
|||
ON mainStatus.dict_id = dict.id AND mainStatus.item_value = a.opt_type
|
||||
where a.id = #{id}
|
||||
</select>
|
||||
<select id="queryTodayFinishedTotal" resultType="java.lang.Integer">
|
||||
SELECT COUNT(*) as total_count
|
||||
FROM nu_biz_nu_directive_order_info
|
||||
<where>
|
||||
iz_finish = 'Y'
|
||||
AND DATE(start_time) = CURDATE()
|
||||
<if test="type != null">
|
||||
AND order_type = #{type}
|
||||
</if>
|
||||
<if test="nuId != null">
|
||||
AND nu_id = #{nuId}
|
||||
</if>
|
||||
<if test="elderId != null">
|
||||
AND elder_id = #{elderId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<sql id="baseSelect">
|
||||
SELECT o.id,
|
||||
|
|
@ -370,59 +189,8 @@
|
|||
o.iz_timeout,
|
||||
o.opt_ids,
|
||||
o.opt_names,
|
||||
mainStatus.item_text as optTypeName,
|
||||
s.id as sub_id,
|
||||
s.order_type as sub_order_type,
|
||||
s.main_id as sub_main_id,
|
||||
s.nu_id as sub_nu_id,
|
||||
s.nu_name as sub_nu_name,
|
||||
s.elder_id as sub_elder_id,
|
||||
s.elder_name as sub_elder_name,
|
||||
s.employee_id as sub_employee_id,
|
||||
s.employee_name as sub_employee_name,
|
||||
s.instruction_tag_id as sub_instruction_tag_id,
|
||||
s.instruction_tag_name as sub_instruction_tag_name,
|
||||
s.category_id as sub_category_id,
|
||||
s.category_name as sub_category_name,
|
||||
s.type_id as sub_type_id,
|
||||
s.type_name as sub_type_name,
|
||||
s.directive_id as sub_directive_id,
|
||||
s.directive_name as sub_directive_name,
|
||||
s.cycle_type_id as sub_cycle_type_id,
|
||||
s.cycle_type as sub_cycle_type,
|
||||
s.cycle_value as sub_cycle_value,
|
||||
s.preview_file as sub_preview_file,
|
||||
-- s.net_preview_file as sub_net_preview_file,
|
||||
s.preview_file_small as sub_preview_file_small,
|
||||
-- s.net_preview_file_small as sub_net_preview_file_small,
|
||||
s.mp3_file as sub_mp3_file,
|
||||
-- s.net_mp3_file as sub_net_mp3_file,
|
||||
s.mp4_file as sub_mp4_file,
|
||||
-- s.net_mp4_file as sub_net_mp4_file,
|
||||
s.service_duration as sub_service_duration,
|
||||
s.service_content as sub_service_content,
|
||||
s.toll_price as sub_toll_price,
|
||||
s.com_price as sub_com_price,
|
||||
s.real_com_price as sub_real_com_price,
|
||||
s.package_id as sub_package_id,
|
||||
s.package_name as sub_package_name,
|
||||
s.iz_package as sub_iz_package,
|
||||
s.start_time as sub_start_time,
|
||||
s.end_time as sub_end_time,
|
||||
s.begin_time as sub_begin_time,
|
||||
s.finish_time as sub_finish_time,
|
||||
s.iz_start as sub_iz_start,
|
||||
s.iz_finish as sub_iz_finish,
|
||||
s.create_by as sub_create_by,
|
||||
s.create_time as sub_create_time,
|
||||
s.update_by as sub_update_by,
|
||||
s.update_time as sub_update_time,
|
||||
s.del_flag as sub_del_flag,
|
||||
s.tplink_path as sub_tplink_path,
|
||||
s.manually_pic_path as sub_manually_pic_path,
|
||||
s.manually_mp4_path as sub_manually_mp4_path
|
||||
mainStatus.item_text as optTypeName
|
||||
FROM nu_biz_directive_order o
|
||||
LEFT JOIN nu_biz_nu_directive_order_info s ON o.id = s.main_id
|
||||
LEFT JOIN sys_dict dict ON dict.dict_code = 'directive_order_opt_type'
|
||||
LEFT JOIN sys_dict_item mainStatus
|
||||
ON mainStatus.dict_id = dict.id AND mainStatus.item_value = o.opt_type
|
||||
|
|
@ -476,54 +244,6 @@
|
|||
ORDER BY o.start_time, s.start_time
|
||||
</select>
|
||||
|
||||
<select id="getInstantById" resultType="com.nu.modules.biz.order.entity.DirectiveOrder">
|
||||
select m.id as bizId,
|
||||
m.nu_id as nuId,
|
||||
b.nu_name as nuName,
|
||||
c.id as elderId,
|
||||
c.name as elderName,
|
||||
m.directive_id as directiveId,
|
||||
m.cycle_type_id as cycleTypeId,
|
||||
d.item_text as cycleType,
|
||||
iz_package,
|
||||
(case when c.orderly is null then 2 else 1 end) as orderEmp
|
||||
from ${tableName} m
|
||||
inner join nu_base_info b on m.nu_id = b.nu_id and b.del_flag = '0' and
|
||||
(case when b.area_flag = 1 then b.status = '2' else 1 = 1 end)
|
||||
left join nu_biz_elder_info c on b.elder_id = c.id and c.del_flag = '0'
|
||||
left join view_sys_dict d on m.cycle_type_id = d.item_value and d.dict_code = 'period_type'
|
||||
where m.id = #{id}
|
||||
and m.cycle_type_id = '2'
|
||||
</select>
|
||||
|
||||
<select id="getDirectiveById" resultType="com.nu.modules.biz.order.entity.DirectiveOrder">
|
||||
select a.id as directiveId,
|
||||
a.directive_name as directiveName,
|
||||
a.preview_file as previewFile,
|
||||
a.preview_file_small as previewFileSmall,
|
||||
a.mp3_file as mp3File,
|
||||
a.mp4_file as mp4File,
|
||||
a.service_duration as serviceDuration,
|
||||
a.service_content as serviceContent,
|
||||
a.timeout_duration as timeoutDuration
|
||||
from nu_config_service_directive a
|
||||
where a.id = #{directiveId}
|
||||
and a.del_flag = '0'
|
||||
and a.iz_enabled = 'Y'
|
||||
</select>
|
||||
|
||||
<select id="getPackageById" resultType="com.nu.modules.biz.order.entity.DirectiveOrder">
|
||||
select a.id as directiveId,
|
||||
a.package_name as directiveName,
|
||||
a.total_duration as serviceDuration,
|
||||
a.description as serviceContent,
|
||||
a.timeout_duration as timeoutDuration
|
||||
from nu_config_directive_package_main a
|
||||
where a.id = #{directiveId}
|
||||
and a.del_flag = '0'
|
||||
and a.iz_enabled = 'Y'
|
||||
</select>
|
||||
|
||||
<select id="getEmployeeById" resultType="com.nu.modules.biz.order.entity.DirectiveOrder">
|
||||
select a.id as employeeId,
|
||||
a.name as employeeName
|
||||
|
|
@ -758,11 +478,13 @@
|
|||
from nu_biz_directive_order ord
|
||||
where ord.tplink_task_id is not null
|
||||
</select>
|
||||
<select id="findErrorFiles" resultType="com.nu.modules.biz.order.entity.DirectiveOrder">
|
||||
select *
|
||||
from nu_biz_directive_order
|
||||
where tplink_path is not null
|
||||
and (cos_status = '3' or cos_len = '0')
|
||||
</select>
|
||||
|
||||
<select id="queryOrderInfoList" resultType="com.nu.entity.DirectiveOrderEntity">
|
||||
select a.*, b.immediate_file, b.immediate_file_focus
|
||||
from nu_biz_directive_order a
|
||||
left join nu_config_service_directive b on a.directive_id = b.id
|
||||
where a.nu_id = #{dto.nuId}
|
||||
and a.instruction_id = #{dto.instructionTagId}
|
||||
and a.serv_start_time = #{dto.servStartTime}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -1,17 +0,0 @@
|
|||
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);
|
||||
}
|
||||
|
|
@ -21,13 +21,4 @@ public interface IDirectiveOrderJobService extends IService<DirectiveOrder> {
|
|||
|
||||
List<DirectiveOrder> getUploadingTplink();
|
||||
|
||||
List<DirectiveOrder> getTplinkProcessing();
|
||||
|
||||
void taskSuccess(DirectiveOrder order);
|
||||
|
||||
void taskFaild(@Param("tplinkTaskId") String tplinkTaskId);
|
||||
|
||||
List<DirectiveOrder> findErrorFiles();
|
||||
|
||||
void cleanErrorFilePath(List<String> ids);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
package com.nu.modules.biz.order.service;
|
||||
|
||||
import com.nu.modules.biz.order.entity.DirectiveOrderLog;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: 护理单元-服务指令-工单变更日志
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2026-01-14
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IDirectiveOrderLogService extends IService<DirectiveOrderLog> {
|
||||
|
||||
}
|
||||
|
|
@ -14,8 +14,6 @@ import java.util.Map;
|
|||
* @Version: V1.0
|
||||
*/
|
||||
public interface IDirectiveOrderService extends IService<DirectiveOrder> {
|
||||
Result<?> generateOrdersBatch();
|
||||
Map<String, Object> generateOrdersInstant(DirectiveOrder directiveOrder);
|
||||
String getEmployeeName(String employeeId);
|
||||
|
||||
void updateEmpEndTimeByJob();
|
||||
|
|
|
|||
|
|
@ -1,30 +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.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);
|
||||
}
|
||||
}
|
||||
|
|
@ -29,28 +29,4 @@ public class DirectiveOrderJobServiceImpl extends ServiceImpl<DirectiveOrderMapp
|
|||
return baseMapper.getUploadingTplink();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DirectiveOrder> getTplinkProcessing() {
|
||||
return baseMapper.getTplinkProcessing();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void taskSuccess(DirectiveOrder order) {
|
||||
baseMapper.taskSuccess(order);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void taskFaild(String tplinkTaskId) {
|
||||
baseMapper.taskFaild(tplinkTaskId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DirectiveOrder> findErrorFiles() {
|
||||
return baseMapper.findErrorFiles();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cleanErrorFilePath(List<String> ids) {
|
||||
baseMapper.cleanErrorFilePath(ids);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,27 +0,0 @@
|
|||
package com.nu.modules.biz.order.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nu.entity.DirectiveOrderLogEntity;
|
||||
import com.nu.modules.biz.order.entity.DirectiveOrderLog;
|
||||
import com.nu.modules.biz.order.mapper.DirectiveOrderLogMapper;
|
||||
import com.nu.modules.biz.order.service.IDirectiveOrderLogService;
|
||||
import com.nu.modules.directiveorder.api.IDirectiveOrderLogApi;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @Description: 护理单元-服务指令-工单变更日志
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2026-01-14
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class DirectiveOrderLogServiceImpl extends ServiceImpl<DirectiveOrderLogMapper, DirectiveOrderLog> implements IDirectiveOrderLogService, IDirectiveOrderLogApi {
|
||||
|
||||
@Override
|
||||
public void addLog(DirectiveOrderLogEntity log) {
|
||||
DirectiveOrderLog data = new DirectiveOrderLog();
|
||||
BeanUtils.copyProperties(log,data);
|
||||
baseMapper.insert(data);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,33 +1,24 @@
|
|||
package com.nu.modules.biz.order.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.io.unit.DataUnit;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nu.entity.*;
|
||||
import com.nu.entity.CareDirectiveEntity;
|
||||
import com.nu.entity.DirectiveOrderEntity;
|
||||
import com.nu.entity.DirectiveOrderInfoEntity;
|
||||
import com.nu.modules.biz.order.entity.DirectiveOrder;
|
||||
import com.nu.modules.biz.order.entity.DirectiveOrderBizLog;
|
||||
import com.nu.modules.biz.order.entity.DirectiveOrderInfo;
|
||||
import com.nu.modules.biz.order.mapper.DirectiveOrderBizLogMapper;
|
||||
import com.nu.modules.biz.order.mapper.DirectiveOrderInfoMapper;
|
||||
import com.nu.modules.biz.order.mapper.DirectiveOrderMapper;
|
||||
import com.nu.modules.biz.order.service.IDirectiveOrderInfoService;
|
||||
import com.nu.modules.biz.order.service.IDirectiveOrderService;
|
||||
import com.nu.modules.biz.plan.care.entity.DirectivePlanDate;
|
||||
import com.nu.modules.directiveorder.api.IDirectiveOrderLogApi;
|
||||
import com.nu.modules.order.api.IDirectiveOrderApi;
|
||||
import com.nu.modules.sysconfig.ISysConfigApi;
|
||||
import com.nu.websocket.SdWebsocket;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -50,27 +41,10 @@ public class DirectiveOrderPadServiceImpl extends ServiceImpl<DirectiveOrderMapp
|
|||
@Autowired
|
||||
private IDirectiveOrderService directiveOrderService;
|
||||
@Autowired
|
||||
private DirectiveOrderInfoMapper directiveOrderInfoMapper;
|
||||
@Autowired
|
||||
private DirectiveOrderBizLogMapper directiveOrderBizLogMapper;
|
||||
@Autowired
|
||||
private IDirectiveOrderLogApi directiveOrderLogApi;
|
||||
@Autowired
|
||||
private IDirectiveOrderInfoService directiveOrderInfoService;
|
||||
@Autowired
|
||||
private SdWebsocket sdWebsocket;
|
||||
@Autowired
|
||||
private ISysConfigApi sysConfigApi;
|
||||
|
||||
@Override
|
||||
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, DirectiveOrderInfo::getStartTime, dto.getStartTime(), dto.getEndTime());
|
||||
}
|
||||
return BeanUtil.copyToList(directiveOrderInfoMapper.selectList(qw), DirectiveOrderInfoEntity.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DirectiveOrderEntity selectInfoById(String id) {
|
||||
|
|
@ -233,12 +207,6 @@ public class DirectiveOrderPadServiceImpl extends ServiceImpl<DirectiveOrderMapp
|
|||
return mainEntity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DirectiveOrderEntity> queryOrderInfoList(DirectiveOrderEntity directiveOrderInfoEntity, HttpServletRequest req) {
|
||||
List<DirectiveOrderEntity> list = directiveOrderInfoMapper.queryOrderInfoList(directiveOrderInfoEntity);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> startOrder(DirectiveOrderEntity directiveOrderEntity) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
|
|
@ -281,12 +249,6 @@ public class DirectiveOrderPadServiceImpl extends ServiceImpl<DirectiveOrderMapp
|
|||
}
|
||||
baseMapper.update(upData, uw);
|
||||
|
||||
// QueryWrapper<DirectiveOrderInfo> queryWrapper = new QueryWrapper<>();
|
||||
// List<DirectiveOrderInfo> list = directiveOrderInfoMapper.selectList(queryWrapper);
|
||||
|
||||
|
||||
// map.put("directiveOrder", directiveOrder);
|
||||
// map.put("directiveOrderInfo", list);
|
||||
return map;
|
||||
}
|
||||
|
||||
|
|
@ -308,12 +270,8 @@ public class DirectiveOrderPadServiceImpl extends ServiceImpl<DirectiveOrderMapp
|
|||
}
|
||||
baseMapper.updateById(directiveOrder);
|
||||
|
||||
// List<DirectiveOrderInfo> list = directiveOrderInfoMapper.selectList(new QueryWrapper<DirectiveOrderInfo>().eq("main_id", directiveOrder.getId()));
|
||||
|
||||
map.put("success", true);
|
||||
map.put("message", "操作成功");
|
||||
// map.put("directiveOrder", directiveOrder);
|
||||
// map.put("directiveOrderInfo", list);
|
||||
return map;
|
||||
}
|
||||
|
||||
|
|
@ -355,11 +313,6 @@ public class DirectiveOrderPadServiceImpl extends ServiceImpl<DirectiveOrderMapp
|
|||
return entityPage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int queryTodayFinishedTotal(String type, String nuId, String elderId) {
|
||||
return baseMapper.queryTodayFinishedTotal(type, nuId, elderId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DirectiveOrderEntity> queryHistory(CareDirectiveEntity dto) {
|
||||
return baseMapper.queryHistory(dto);
|
||||
|
|
@ -378,12 +331,6 @@ public class DirectiveOrderPadServiceImpl extends ServiceImpl<DirectiveOrderMapp
|
|||
directiveOrder.setManuallyMp4Path(directiveOrderEntity.getManuallyMp4Path());
|
||||
directiveOrderService.updateById(directiveOrder);
|
||||
|
||||
//子表
|
||||
// DirectiveOrderInfo directiveOrderInfo = new DirectiveOrderInfo();
|
||||
// directiveOrderInfo.setManuallyMp4Path(directiveOrderEntity.getManuallyMp4Path());
|
||||
// UpdateWrapper<DirectiveOrderInfo> uw = new UpdateWrapper<>();
|
||||
// uw.eq("main_id", directiveOrderEntity.getId());
|
||||
// directiveOrderInfoService.update(directiveOrderInfo, uw);
|
||||
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("success", true);
|
||||
|
|
@ -399,13 +346,6 @@ public class DirectiveOrderPadServiceImpl extends ServiceImpl<DirectiveOrderMapp
|
|||
directiveOrder.setManuallyPicPath(directiveOrderEntity.getManuallyPicPath());
|
||||
directiveOrderService.updateById(directiveOrder);
|
||||
|
||||
//子表
|
||||
// DirectiveOrderInfo directiveOrderInfo = new DirectiveOrderInfo();
|
||||
// directiveOrderInfo.setManuallyPicPath(directiveOrderEntity.getManuallyPicPath());
|
||||
// UpdateWrapper<DirectiveOrderInfo> uw = new UpdateWrapper<>();
|
||||
// uw.eq("main_id", directiveOrderEntity.getId());
|
||||
// directiveOrderInfoService.update(directiveOrderInfo, uw);
|
||||
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("success", true);
|
||||
map.put("message", "操作成功");
|
||||
|
|
@ -453,19 +393,6 @@ public class DirectiveOrderPadServiceImpl extends ServiceImpl<DirectiveOrderMapp
|
|||
//修改主表
|
||||
baseMapper.update(upData, uw);
|
||||
|
||||
//日志
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
DirectiveOrderLogEntity log = new DirectiveOrderLogEntity();
|
||||
log.setOrderNo(dto.getId());//服务指令工单id
|
||||
log.setOptType("转单");//操作描述
|
||||
log.setOptBy(sysUser.getEmployeesId());//操作人employeeId
|
||||
log.setOptByName(sysUser.getRealname());//操作人名
|
||||
log.setBeforeChange(StringUtils.isBlank(beforeData.getEmployeeIds()) ? beforeData.getEmployeeId() : beforeData.getEmployeeIds());//操作前人
|
||||
log.setBeforeChangeName(StringUtils.isBlank(beforeData.getEmployeeNames()) ? beforeData.getEmployeeName() : beforeData.getEmployeeNames());//操作前人名
|
||||
log.setAfterChange(dto.getEmployeeId());//操作后人
|
||||
log.setAfterChangeName(dto.getEmployeeName());//操作后人名
|
||||
directiveOrderLogApi.addLog(log);
|
||||
|
||||
return Result.ok("操作成功");
|
||||
}
|
||||
|
||||
|
|
@ -509,19 +436,6 @@ public class DirectiveOrderPadServiceImpl extends ServiceImpl<DirectiveOrderMapp
|
|||
//修改主表
|
||||
baseMapper.update(upData, uw);
|
||||
|
||||
//日志
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
DirectiveOrderLogEntity log = new DirectiveOrderLogEntity();
|
||||
log.setOrderNo(dto.getId());//服务指令工单id
|
||||
log.setOptType("协助执行");//操作描述
|
||||
log.setOptBy(sysUser.getEmployeesId());//操作人employeeId
|
||||
log.setOptByName(sysUser.getRealname());//操作人名
|
||||
log.setBeforeChange(StringUtils.isBlank(beforeData.getEmployeeIds()) ? beforeData.getEmployeeId() : beforeData.getEmployeeIds());//操作前人
|
||||
log.setBeforeChangeName(StringUtils.isBlank(beforeData.getEmployeeNames()) ? beforeData.getEmployeeName() : beforeData.getEmployeeNames());//操作前人名
|
||||
log.setAfterChange(dto.getEmployeeId());//操作后人
|
||||
log.setAfterChangeName(dto.getEmployeeName());//操作后人名
|
||||
directiveOrderLogApi.addLog(log);
|
||||
|
||||
return Result.ok("操作成功");
|
||||
|
||||
}
|
||||
|
|
@ -538,9 +452,6 @@ public class DirectiveOrderPadServiceImpl extends ServiceImpl<DirectiveOrderMapp
|
|||
String empId = obj.getString("configValue");
|
||||
|
||||
Date startTime = new Date();
|
||||
String nuId = directiveOrderEntity.getNuId();
|
||||
String instructionId = directiveOrderEntity.getInstructionId();
|
||||
String directiveId = directiveOrderEntity.getDirectiveId();
|
||||
|
||||
DirectiveOrderEntity directiveInfo = baseMapper.queryOrderNeedDirectiveInfo(directiveOrderEntity);
|
||||
DirectiveOrderEntity baseInfo = baseMapper.queryOrderNeedBaseInfo(directiveOrderEntity);
|
||||
|
|
@ -602,23 +513,12 @@ public class DirectiveOrderPadServiceImpl extends ServiceImpl<DirectiveOrderMapp
|
|||
log.error("ws发送消息失败", e);
|
||||
}
|
||||
|
||||
return Result.OK("派发成功,执行员工:" + "王伟东");
|
||||
return Result.OK("派发成功,执行员工:" + "滕浩达");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> addBizLog(DirectiveOrderBizLogEntity directiveOrderBizLogEntity) {
|
||||
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
directiveOrderBizLogEntity.setOptEmpId(sysUser.getEmployeesId());
|
||||
directiveOrderBizLogEntity.setOptTime(new Date());
|
||||
DirectiveOrderBizLog directiveOrderBizLog = new DirectiveOrderBizLog();
|
||||
BeanUtils.copyProperties(directiveOrderBizLogEntity, directiveOrderBizLog);
|
||||
String optEmpName = directiveOrderService.getEmployeeName(directiveOrderBizLogEntity.getOptEmpId());
|
||||
directiveOrderBizLog.setOptEmpName(optEmpName);
|
||||
directiveOrderBizLogMapper.insert(directiveOrderBizLog);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("success", true);
|
||||
map.put("message", "操作成功");
|
||||
return map;
|
||||
public List<DirectiveOrderEntity> queryOrderInfoList(DirectiveOrderEntity directiveOrderInfoEntity, HttpServletRequest req) {
|
||||
List<DirectiveOrderEntity> list = baseMapper.queryOrderInfoList(directiveOrderInfoEntity);
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,31 +1,12 @@
|
|||
package com.nu.modules.biz.order.service.impl;
|
||||
|
||||
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.DirectiveOrderInfo;
|
||||
import com.nu.modules.biz.order.mapper.DirectiveOrderMapper;
|
||||
import com.nu.modules.biz.order.service.IDirectiveOrderService;
|
||||
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;
|
||||
import com.nu.modules.config.sendorderrule.service.ISendOrderRuleInfoService;
|
||||
import com.nu.websocket.SdWebsocket;
|
||||
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;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令工单主表
|
||||
* @Author: caolei
|
||||
|
|
@ -36,854 +17,6 @@ import java.util.stream.Collectors;
|
|||
@Slf4j
|
||||
public class DirectiveOrderServiceImpl extends ServiceImpl<DirectiveOrderMapper, DirectiveOrder> implements IDirectiveOrderService {
|
||||
|
||||
@Autowired
|
||||
IDirectiveOrderInfoService ordersInfoService;
|
||||
@Autowired
|
||||
ISendOrderRuleService sendOrderRuleService;
|
||||
@Autowired
|
||||
ISendOrderRuleInfoService sendOrderRuleInfoService;
|
||||
@Autowired
|
||||
private ISysBaseAPI sysBaseAPI;
|
||||
SendOrderRule sendOrderRule;
|
||||
List<SendOrderRuleInfo> ruleSubList;
|
||||
|
||||
@Autowired
|
||||
private SdWebsocket sdWebsocket;
|
||||
|
||||
/**
|
||||
* 获取派单规则
|
||||
*/
|
||||
private void getSendOrderRule() {
|
||||
if (sendOrderRule == null) {
|
||||
QueryWrapper<SendOrderRule> qw = new QueryWrapper<>();
|
||||
qw.eq("iz_enabled", "Y");
|
||||
sendOrderRule = sendOrderRuleService.getOne(qw);
|
||||
QueryWrapper<SendOrderRuleInfo> subqw = new QueryWrapper<>();
|
||||
subqw.eq("iz_enabled", "Y");
|
||||
subqw.eq("main_id", sendOrderRule.getId());
|
||||
subqw.orderByAsc("sort");
|
||||
ruleSubList = sendOrderRuleInfoService.list(subqw);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取在线,有指令权限的员工,并获取员工的接单上限、收益、服务时长、单次
|
||||
*
|
||||
* @param directiveId
|
||||
* @return
|
||||
*/
|
||||
private List<DirectiveOrder> getEmpPermissionAndOnline(String directiveId, String employeeIds, Date startTime) {
|
||||
return baseMapper.getEmpPermissionAndOnline(directiveId, employeeIds, startTime);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取长者指定所有护理员
|
||||
*
|
||||
* @param elderId
|
||||
* @return
|
||||
*/
|
||||
private Map<String, String> getEmpOrderly(String elderId) {
|
||||
Map<String, String> map = null;
|
||||
DirectiveOrder orders = baseMapper.getEmpOrderly(elderId);
|
||||
if (orders != null) {
|
||||
String empIds = orders.getEmployeeIds();
|
||||
if (empIds != null && !empIds.equals("")) {
|
||||
String[] pairs = empIds.split(",");
|
||||
if (pairs.length > 0) {
|
||||
map = new HashMap<>();
|
||||
for (String pair : pairs) {
|
||||
map.put(pair, pair);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 指令池批量生成工单-定时调用
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Result<?> generateOrdersBatch() {
|
||||
//获取派单规则
|
||||
getSendOrderRule();
|
||||
List<DirectiveOrder> ordersList = baseMapper.queryDataPoolList(null);
|
||||
for (int i = 0; i < ordersList.size(); i++) {
|
||||
DirectiveOrder orders = ordersList.get(i);
|
||||
if (orders.getIzPackage().equals("N")) {
|
||||
//获取有效服务指令
|
||||
DirectiveOrder directiveEntity = baseMapper.getDirectiveById(orders);
|
||||
if (directiveEntity == null) {
|
||||
continue;
|
||||
}
|
||||
orders.setDirectiveName(directiveEntity.getDirectiveName());
|
||||
orders.setPreviewFile(directiveEntity.getPreviewFile());
|
||||
orders.setPreviewFileSmall(directiveEntity.getPreviewFileSmall());
|
||||
orders.setMp3File(directiveEntity.getMp3File());
|
||||
orders.setMp4File(directiveEntity.getMp4File());
|
||||
orders.setServiceContent(directiveEntity.getServiceContent());
|
||||
orders.setServiceDuration(directiveEntity.getServiceDuration());
|
||||
orders.setTimeoutDuration(directiveEntity.getTimeoutDuration());
|
||||
} else {
|
||||
//获取有效服务指令包
|
||||
DirectiveOrder packageEntity = baseMapper.getPackageById(orders);
|
||||
if (packageEntity == null) {
|
||||
continue;
|
||||
}
|
||||
orders.setDirectiveName(packageEntity.getDirectiveName());
|
||||
orders.setServiceContent(packageEntity.getServiceContent());
|
||||
orders.setServiceDuration(packageEntity.getServiceDuration());
|
||||
orders.setTimeoutDuration(packageEntity.getTimeoutDuration());
|
||||
}
|
||||
|
||||
//生成结束时间
|
||||
String duration = orders.getServiceDuration();
|
||||
Calendar c = Calendar.getInstance();
|
||||
if (duration.equals("") || duration.equals("0")) {
|
||||
c.set(Calendar.YEAR, 3000);
|
||||
c.set(Calendar.MONTH, Calendar.DECEMBER);
|
||||
c.set(Calendar.DAY_OF_MONTH, 31);
|
||||
c.set(Calendar.HOUR_OF_DAY, 0);
|
||||
c.set(Calendar.MINUTE, 0);
|
||||
c.set(Calendar.SECOND, 0);
|
||||
c.set(Calendar.MILLISECOND, 0);
|
||||
} else {
|
||||
c.setTime(orders.getStartTime());
|
||||
c.add(Calendar.MINUTE, Integer.valueOf(duration));
|
||||
}
|
||||
Date endTime = c.getTime();
|
||||
orders.setEndTime(endTime);
|
||||
|
||||
String orderNo = getOrderNo(orders.getOrderType());
|
||||
orders.setOrderNo(orderNo);
|
||||
orders.setOptType("1");
|
||||
orders.setIzStart("N");
|
||||
orders.setIzFinish("N");
|
||||
orders.setIzTimeout("N");
|
||||
orders.setDelFlag("0");
|
||||
|
||||
generateOrdersSub(orders);
|
||||
//发送websocket消息
|
||||
try {
|
||||
// 发送数据
|
||||
JSONObject message = new JSONObject();
|
||||
message.put("type", "directiveOrder");//消息类型
|
||||
message.put("timestamp", System.currentTimeMillis());
|
||||
message.put("from", "system");//发送者
|
||||
message.put("to", orders.getEmployeeId());//接收用户
|
||||
message.put("data", orders);//业务数据
|
||||
String messageJson = message.toJSONString();
|
||||
//发送给单个用户
|
||||
sdWebsocket.sendMessage(orders.getEmployeeId(), messageJson);
|
||||
log.info("【ws消息推送】发送给用户 {}: {}", orders.getEmployeeId(), messageJson);
|
||||
} catch (Exception e) {
|
||||
log.error("ws发送消息失败", e);
|
||||
}
|
||||
}
|
||||
return Result.OK();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取工单子表数据,并进行处理
|
||||
*
|
||||
* @param orders
|
||||
*/
|
||||
private void generateOrdersSub(DirectiveOrder orders) {
|
||||
// System.out.println("护理单元:" + orders.getNuId() + ",服务时间" + orders.getStartTime());
|
||||
if (orders.getIzPackage().equals("N")) {
|
||||
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) {
|
||||
orders.setEmployeeId(employee.getEmployeeId());
|
||||
orders.setEmployeeName(employee.getEmployeeName());
|
||||
orders.setOptIds(employee.getEmployeeId());
|
||||
orders.setOptNames(employee.getEmployeeName());
|
||||
this.save(orders);//生成工单主表
|
||||
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());
|
||||
ordersSub.setNuName(orders.getNuName());
|
||||
ordersSub.setElderId(orders.getElderId());
|
||||
ordersSub.setElderName(orders.getElderName());
|
||||
ordersSub.setEmployeeId(employee.getEmployeeId());
|
||||
ordersSub.setEmployeeName(employee.getEmployeeName());
|
||||
ordersSub.setCycleTypeId(orders.getCycleTypeId());
|
||||
ordersSub.setCycleType(orders.getCycleType());
|
||||
ordersSub.setCycleValue(orders.getCycleValue());
|
||||
ordersSub.setIzPackage(orders.getIzPackage());
|
||||
ordersSub.setStartTime(orders.getStartTime());
|
||||
ordersSub.setEndTime(orders.getEndTime());
|
||||
ordersSub.setOptType("1");
|
||||
ordersSub.setIzStart("N");
|
||||
ordersSub.setIzFinish("N");
|
||||
ordersSub.setOptIds(employee.getEmployeeId());
|
||||
ordersSub.setOptNames(employee.getEmployeeName());
|
||||
ordersInfoService.save(ordersSub);//生成工单子表
|
||||
}
|
||||
baseMapper.updatePoolIzOrder(orders.getPoolId());
|
||||
// System.out.println("护理单元:" + orders.getNuId() + ",服务时间:" + orders.getStartTime() + ",服务员工:" + employee.getEmployeeName() + ",获得积分:" + employee.getLevel());
|
||||
// System.out.println("");
|
||||
// System.out.println("");
|
||||
// System.out.println("");
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
|
||||
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() < ordersInfoList.size());//删除没有权限的数据
|
||||
String employeeIds = emps.stream().map(DirectiveOrder::getEmployeeId).collect(Collectors.joining(","));
|
||||
DirectiveOrder employee = employeeScreening(directiveIds, orders.getElderId(), employeeIds, orders.getStartTime());
|
||||
if (employee != null) {
|
||||
orders.setEmployeeId(employee.getEmployeeId());
|
||||
orders.setEmployeeName(employee.getEmployeeName());
|
||||
orders.setOptIds(employee.getEmployeeId());
|
||||
orders.setOptNames(employee.getEmployeeName());
|
||||
this.save(orders);//生成工单主表
|
||||
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());
|
||||
ordersSub.setNuName(orders.getNuName());
|
||||
ordersSub.setElderId(orders.getElderId());
|
||||
ordersSub.setElderName(orders.getElderName());
|
||||
ordersSub.setEmployeeId(employee.getEmployeeId());
|
||||
ordersSub.setEmployeeName(employee.getEmployeeName());
|
||||
ordersSub.setCycleTypeId(orders.getCycleTypeId());
|
||||
ordersSub.setCycleType(orders.getCycleType());
|
||||
ordersSub.setCycleValue(orders.getCycleValue());
|
||||
ordersSub.setIzPackage(orders.getIzPackage());
|
||||
if (!orders.getIzPackage().equals("N")) {
|
||||
ordersSub.setPackageId(orders.getDirectiveId());
|
||||
ordersSub.setPackageName(orders.getDirectiveName());
|
||||
}
|
||||
ordersSub.setStartTime(orders.getStartTime());
|
||||
ordersSub.setEndTime(orders.getEndTime());
|
||||
ordersSub.setOptType("1");
|
||||
ordersSub.setIzStart("N");
|
||||
ordersSub.setIzFinish("N");
|
||||
ordersSub.setOptIds(employee.getEmployeeId());
|
||||
ordersSub.setOptNames(employee.getEmployeeName());
|
||||
ordersInfoService.save(ordersSub);//生成工单子表
|
||||
}
|
||||
baseMapper.updatePoolIzOrder(orders.getPoolId());
|
||||
// System.out.println("护理单元:" + orders.getNuId() + ",服务时间:" + orders.getStartTime() + ",服务员工:" + employee.getEmployeeName() + ",获得积分:" + employee.getLevel());
|
||||
// System.out.println("");
|
||||
// System.out.println("");
|
||||
// System.out.println("");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取满足条件的员工
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private DirectiveOrder employeeScreening(String directiveIds, String elderId, String employeeIds, Date startTime) {
|
||||
if (sendOrderRule.getRuleCode().equals("1")) {
|
||||
//按优先级
|
||||
return getByPriority(directiveIds, elderId, startTime, employeeIds);
|
||||
}
|
||||
if (sendOrderRule.getRuleCode().equals("2")) {
|
||||
//专项按人头,可1v1,可NvN,全看长者配置专项护理员的设置
|
||||
return getByHeadCount(directiveIds, elderId, startTime, employeeIds);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 优先级派单
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private DirectiveOrder getByPriority(String directiveIds, String elderId, Date startTime, String employeeIds) {
|
||||
List<DirectiveOrder> empList = getEmpPermissionAndOnline(directiveIds, employeeIds, startTime);
|
||||
if (empList.size() > 0) {
|
||||
// for (int i = 0; i < empList.size(); i++) {
|
||||
// DirectiveOrder emp = empList.get(i);
|
||||
// System.out.println("员工信息:" + emp.getEmployeeName() + "," + emp.getOrderCap() + "," + emp.getOrderNum() + "," + emp.getTotalDuration() + "," + emp.getTotalComPrice() + "," + emp.getMaxTime() + "," + emp.getOwnCn() + "," + emp.getIzFree());
|
||||
// }
|
||||
if (ruleSubList.size() > 0) {
|
||||
for (SendOrderRuleInfo ruleSub : ruleSubList) {
|
||||
switch (ruleSub.getRuleCode()) {
|
||||
case 1:
|
||||
//空闲积分
|
||||
sortByIzFree(empList, ruleSub.getCoefficient());
|
||||
break;
|
||||
case 2:
|
||||
//专员积分
|
||||
sortByOrderly(empList, ruleSub.getCoefficient(), elderId);
|
||||
break;
|
||||
case 3:
|
||||
//单次积分
|
||||
sortByNumAndSetLevel(empList, ruleSub.getCoefficient());
|
||||
break;
|
||||
case 4:
|
||||
//收益积分
|
||||
sortByPriceAndSetLevel(empList, ruleSub.getCoefficient());
|
||||
break;
|
||||
case 5:
|
||||
//服务时长积分
|
||||
sortByDurationAndSetLevel(empList, ruleSub.getCoefficient());
|
||||
break;
|
||||
case 6:
|
||||
//最后接单时间积分
|
||||
sortByMaxTimeAndSetLevel(empList, ruleSub.getCoefficient());
|
||||
break;
|
||||
case 7:
|
||||
//超出上限积分
|
||||
sortByLimit(empList, ruleSub.getCoefficient());
|
||||
break;
|
||||
}
|
||||
}
|
||||
//获取员工信息
|
||||
sortEmpList(empList);
|
||||
return empList.get(0);
|
||||
} else {
|
||||
//随机获取一个员工
|
||||
Random random = new Random();
|
||||
return empList.get(random.nextInt(empList.size()));
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 按人头派单
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private DirectiveOrder getByHeadCount(String directiveIds, String elderId, Date startTime, String employeeIds) {
|
||||
List<DirectiveOrder> empList = getEmpPermissionAndOnline(directiveIds, employeeIds, startTime);
|
||||
if (empList.size() > 0) {
|
||||
List<DirectiveOrder> newList = new ArrayList();
|
||||
newList.addAll(empList);
|
||||
// for (int i = 0; i < empList.size(); i++) {
|
||||
// DirectiveOrder emp = empList.get(i);
|
||||
// System.out.println("员工信息:" + emp.getEmployeeName() + "," + emp.getOrderCap() + "," + emp.getOrderNum() + "," + emp.getTotalDuration() + "," + emp.getTotalComPrice() + "," + emp.getMaxTime() + "," + emp.getOwnCn() + "," + emp.getIzFree());
|
||||
// }
|
||||
|
||||
//****************获取指定护理员工列表,不指定的排除掉=============================>
|
||||
getByOrderly(empList, elderId);
|
||||
if (empList.size() > 0) {
|
||||
if (ruleSubList.size() > 0) {
|
||||
for (SendOrderRuleInfo ruleSub : ruleSubList) {
|
||||
switch (ruleSub.getRuleCode()) {
|
||||
case 1:
|
||||
//空闲积分
|
||||
sortByIzFree(empList, ruleSub.getCoefficient());
|
||||
break;
|
||||
case 2:
|
||||
//单次积分
|
||||
sortByNumAndSetLevel(empList, ruleSub.getCoefficient());
|
||||
break;
|
||||
case 3:
|
||||
//收益积分
|
||||
sortByPriceAndSetLevel(empList, ruleSub.getCoefficient());
|
||||
break;
|
||||
case 4:
|
||||
//服务时长积分
|
||||
sortByDurationAndSetLevel(empList, ruleSub.getCoefficient());
|
||||
break;
|
||||
case 5:
|
||||
//最后接单时间积分
|
||||
sortByMaxTimeAndSetLevel(empList, ruleSub.getCoefficient());
|
||||
break;
|
||||
case 6:
|
||||
//超出上限积分
|
||||
sortByLimit(empList, ruleSub.getCoefficient());
|
||||
break;
|
||||
}
|
||||
}
|
||||
//获取员工信息
|
||||
sortEmpList(empList);
|
||||
return empList.get(0);
|
||||
} else {
|
||||
//随机获取一个员工
|
||||
Random random = new Random();
|
||||
return empList.get(random.nextInt(empList.size()));
|
||||
}
|
||||
} else {
|
||||
//随机获取一个员工
|
||||
Random random = new Random();
|
||||
return newList.get(random.nextInt(newList.size()));
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过员工空闲状态来设置优先级
|
||||
*
|
||||
* @param empList
|
||||
*/
|
||||
public void sortByIzFree(List<DirectiveOrder> empList, Integer coefficient) {
|
||||
for (int i = 0; i < empList.size(); i++) {
|
||||
DirectiveOrder emp = empList.get(i);
|
||||
if (emp.getIzFree().equals(1)) {
|
||||
Integer empLevel = emp.getLevel();
|
||||
empLevel = empLevel + empList.size() * coefficient; //提高N等级
|
||||
emp.setLevel(empLevel);
|
||||
}
|
||||
// System.out.println("员工获取空闲积分信息:" + emp.getEmployeeId() + "-" + emp.getEmployeeName() + "[" + emp.getLevel() + "]");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过员工专项指定状态来设置优先级
|
||||
*
|
||||
* @param empList
|
||||
*/
|
||||
public void sortByOrderly(List<DirectiveOrder> empList, Integer coefficient, String elderId) {
|
||||
for (int i = 0; i < empList.size(); i++) {
|
||||
DirectiveOrder emp = empList.get(i);
|
||||
String employeeId = emp.getEmployeeId();
|
||||
Map<String, String> orderlyMap = getEmpOrderly(elderId);
|
||||
if (orderlyMap != null) {
|
||||
String orderlyId = orderlyMap.get(employeeId);
|
||||
if (orderlyId != null && !orderlyId.equals("")) {
|
||||
Integer empLevel = emp.getLevel();
|
||||
empLevel = empLevel + empList.size() * coefficient; //提高N等级
|
||||
emp.setLevel(empLevel);
|
||||
}
|
||||
}
|
||||
// System.out.println("员工获取指定护理积分信息:" + emp.getEmployeeId() + "-" + emp.getEmployeeName() + "[" + emp.getLevel() + "]");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过工单次数排序数据来设置优先级
|
||||
*
|
||||
* @param empList
|
||||
*/
|
||||
public void sortByNumAndSetLevel(List<DirectiveOrder> empList, Integer coefficient) {
|
||||
// 根据orderNum倒序排序,并为level顺序赋值
|
||||
List<DirectiveOrder> sortedEmployees = empList.stream()
|
||||
.sorted(Comparator.comparing(DirectiveOrder::getOrderNum).reversed())
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 为level字段顺序赋值1,2,3...
|
||||
for (int i = 0; i < sortedEmployees.size(); i++) {
|
||||
DirectiveOrder emp = sortedEmployees.get(i);
|
||||
Integer levle = emp.getLevel() * coefficient + i + 1;
|
||||
emp.setLevel(levle);
|
||||
|
||||
// System.out.println("员工获取工单数积分信息:" + emp.getEmployeeId() + "-" + emp.getEmployeeName() + "[" + emp.getLevel() + "]");
|
||||
}
|
||||
// 如果需要返回新列表,可以返回sortedEmployees
|
||||
// 如果要在原列表上修改,可以清空原列表并添加所有元素
|
||||
empList.clear();
|
||||
empList.addAll(sortedEmployees);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过总收益排序数据来设置优先级
|
||||
*
|
||||
* @param empList
|
||||
*/
|
||||
public void sortByPriceAndSetLevel(List<DirectiveOrder> empList, Integer coefficient) {
|
||||
// 根据totalComPrice倒序排序,并为level顺序赋值
|
||||
List<DirectiveOrder> sortedEmployees = empList.stream()
|
||||
.sorted(Comparator.comparing(DirectiveOrder::getTotalComPrice).reversed())
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 为level字段顺序赋值1,2,3...
|
||||
for (int i = 0; i < sortedEmployees.size(); i++) {
|
||||
DirectiveOrder emp = sortedEmployees.get(i);
|
||||
Integer levle = emp.getLevel() * coefficient + i + 1;
|
||||
emp.setLevel(levle);
|
||||
|
||||
// System.out.println("员工获取工单收益积分信息:" + emp.getEmployeeId() + "-" + emp.getEmployeeName() + "[" + emp.getLevel() + "]");
|
||||
}
|
||||
|
||||
// 如果需要返回新列表,可以返回sortedEmployees
|
||||
// 如果要在原列表上修改,可以清空原列表并添加所有元素
|
||||
empList.clear();
|
||||
empList.addAll(sortedEmployees);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过服务时长排序数据来设置优先级
|
||||
*
|
||||
* @param empList
|
||||
*/
|
||||
public void sortByDurationAndSetLevel(List<DirectiveOrder> empList, Integer coefficient) {
|
||||
// 根据totalDuration倒序排序,并为level顺序赋值
|
||||
List<DirectiveOrder> sortedEmployees = empList.stream()
|
||||
.sorted(Comparator.comparing(DirectiveOrder::getTotalDuration).reversed())
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 为level字段顺序赋值1,2,3...
|
||||
for (int i = 0; i < sortedEmployees.size(); i++) {
|
||||
DirectiveOrder emp = sortedEmployees.get(i);
|
||||
Integer levle = emp.getLevel() * coefficient + i + 1;
|
||||
emp.setLevel(levle);
|
||||
|
||||
// System.out.println("员工获取服务时长积分信息:" + emp.getEmployeeId() + "-" + emp.getEmployeeName() + "[" + emp.getLevel() + "]");
|
||||
}
|
||||
|
||||
// 如果需要返回新列表,可以返回sortedEmployees
|
||||
// 如果要在原列表上修改,可以清空原列表并添加所有元素
|
||||
empList.clear();
|
||||
empList.addAll(sortedEmployees);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过最后一次接收派单时间排序数据来设置优先级
|
||||
*
|
||||
* @param empList
|
||||
*/
|
||||
public void sortByMaxTimeAndSetLevel(List<DirectiveOrder> empList, Integer coefficient) {
|
||||
// 根据maxTime倒序排序,并为level顺序赋值
|
||||
List<DirectiveOrder> sortedEmployees = empList.stream()
|
||||
.sorted(Comparator.comparing(
|
||||
DirectiveOrder::getMaxTime,
|
||||
Comparator.nullsLast(Comparator.reverseOrder())
|
||||
))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 为level字段顺序赋值1,2,3...
|
||||
for (int i = 0; i < sortedEmployees.size(); i++) {
|
||||
DirectiveOrder emp = sortedEmployees.get(i);
|
||||
Integer levle = emp.getLevel() * coefficient + i + 1;
|
||||
emp.setLevel(levle);
|
||||
|
||||
// System.out.println("员工获取派单时间积分信息:" + emp.getEmployeeId() + "-" + emp.getEmployeeName() + "[" + emp.getLevel() + "]");
|
||||
}
|
||||
|
||||
// 如果需要返回新列表,可以返回sortedEmployees
|
||||
// 如果要在原列表上修改,可以清空原列表并添加所有元素
|
||||
empList.clear();
|
||||
empList.addAll(sortedEmployees);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过接单上限来排序数据来设置优先级
|
||||
*
|
||||
* @param empList
|
||||
*/
|
||||
public void sortByLimit(List<DirectiveOrder> empList, Integer coefficient) {
|
||||
for (int i = 0; i < empList.size(); i++) {
|
||||
DirectiveOrder emp = empList.get(i);
|
||||
//工单超出接单上限,降N级
|
||||
if (emp.getOwnCn() >= emp.getOrderCap()) {
|
||||
Integer levle = emp.getLevel() + empList.size() * coefficient;
|
||||
emp.setLevel(levle);
|
||||
|
||||
// System.out.println("员工获取单上限积分信息:" + emp.getEmployeeId() + "-" + emp.getEmployeeName() + "[" + emp.getLevel() + "]");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 按优先级排序数据
|
||||
*
|
||||
* @param empList
|
||||
*/
|
||||
public void sortEmpList(List<DirectiveOrder> empList) {
|
||||
//为level顺序
|
||||
List<DirectiveOrder> sortedEmployees = empList.stream()
|
||||
.sorted(Comparator.comparing(DirectiveOrder::getLevel).reversed())
|
||||
.collect(Collectors.toList());
|
||||
// 如果需要返回新列表,可以返回sortedEmployees
|
||||
// 如果要在原列表上修改,可以清空原列表并添加所有元素
|
||||
empList.clear();
|
||||
empList.addAll(sortedEmployees);
|
||||
// for (int i = 0; i < empList.size(); i++) {
|
||||
// DirectiveOrder emp = empList.get(i);
|
||||
// System.out.println("员工获取总积分信息:" + emp.getEmployeeId() + "-" + emp.getEmployeeName() + "[" + emp.getLevel() + "]");
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定护理员工列表
|
||||
*
|
||||
* @param empList
|
||||
*/
|
||||
public void getByOrderly(List<DirectiveOrder> empList, String elderId) {
|
||||
List<DirectiveOrder> newList = new ArrayList();
|
||||
for (int i = 0; i < empList.size(); i++) {
|
||||
DirectiveOrder emp = empList.get(i);
|
||||
String employeeId = emp.getEmployeeId();
|
||||
Map<String, String> orderlyMap = getEmpOrderly(elderId);
|
||||
if (orderlyMap != null) {
|
||||
String orderlyId = orderlyMap.get(employeeId);
|
||||
if (orderlyId != null && !orderlyId.equals("")) {
|
||||
newList.add(emp);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
empList.clear();
|
||||
empList.addAll(newList);
|
||||
// for (int i = 0; i < empList.size(); i++) {
|
||||
// DirectiveOrder emp = empList.get(i);
|
||||
// System.out.println("获取指定护理员工信息:" + emp.getEmployeeId() + "-" + emp.getEmployeeName());
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取单号
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private String getOrderNo(String orderType) {
|
||||
JSONObject deptInfo = sysBaseAPI.getDeptInfo();
|
||||
String deptCode = deptInfo.getString("code");
|
||||
String today = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd"));
|
||||
// 构建今天的前缀模式
|
||||
String todayPrefix = "";
|
||||
if (orderType.equals("1")) {
|
||||
todayPrefix = "HL";
|
||||
}
|
||||
if (orderType.equals("2")) {
|
||||
todayPrefix = "YL";
|
||||
}
|
||||
if (orderType.equals("3")) {
|
||||
todayPrefix = "CK";
|
||||
}
|
||||
if (orderType.equals("4")) {
|
||||
todayPrefix = "HQ";
|
||||
}
|
||||
todayPrefix = todayPrefix + deptCode + today;
|
||||
QueryWrapper<DirectiveOrder> qw = new QueryWrapper<>();
|
||||
qw.likeRight("order_no", todayPrefix);
|
||||
qw.select("order_no");
|
||||
qw.orderByDesc("order_no");
|
||||
qw.last("limit 1");
|
||||
DirectiveOrder entity = this.getOne(qw);
|
||||
int todayNo = 0;
|
||||
if (entity != null) {
|
||||
String orderNo = entity.getOrderNo();
|
||||
if (orderNo != null && !orderNo.equals("")) {
|
||||
String todayNoStr = orderNo.substring(todayPrefix.length());
|
||||
todayNo = Integer.parseInt(todayNoStr);
|
||||
}
|
||||
}
|
||||
todayNo = todayNo + 1;
|
||||
String frontNo = String.format("%04d", todayNo);
|
||||
return todayPrefix + frontNo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取子单号
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
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");
|
||||
DirectiveOrderInfo entity = ordersInfoService.getOne(qw);
|
||||
int todayNo = 0;
|
||||
if (entity != null) {
|
||||
String orderNo = entity.getOrderNo();
|
||||
if (orderNo != null && !orderNo.equals("")) {
|
||||
String todayNoStr = orderNo.substring(mainOrderNo.length());
|
||||
todayNo = Integer.parseInt(todayNoStr);
|
||||
}
|
||||
}
|
||||
todayNo = todayNo + 1;
|
||||
String frontNo = String.format("%03d", todayNo);
|
||||
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_directive_plan");
|
||||
}
|
||||
if (orderType.equals("2")) {
|
||||
//医疗即时
|
||||
directiveOrder.setTableName("nu_biz_nu_medical_directive_plan");
|
||||
}
|
||||
if (orderType.equals("3")) {
|
||||
//库房即时
|
||||
directiveOrder.setTableName("nu_biz_nu_invoicing_directive_plan");
|
||||
}
|
||||
if (orderType.equals("4")) {
|
||||
//后勤即时
|
||||
directiveOrder.setTableName("nu_biz_nu_logistics_directive_plan");
|
||||
}
|
||||
|
||||
DirectiveOrder orders = baseMapper.getInstantById(directiveOrder);
|
||||
List<DirectiveOrderInfo> infoList = null;
|
||||
String employeeId = "";
|
||||
String employeeName = "";
|
||||
Calendar c = Calendar.getInstance();
|
||||
Date startTime = c.getTime();
|
||||
if (orders.getIzPackage().equals("N")) {
|
||||
//获取服务指令
|
||||
DirectiveOrder directiveEntity = baseMapper.getDirectiveById(orders);
|
||||
if (directiveEntity == null) {
|
||||
map.put("success", false);
|
||||
map.put("message", "服务指令无效");
|
||||
return map;
|
||||
}
|
||||
orders.setDirectiveName(directiveEntity.getDirectiveName());
|
||||
orders.setPreviewFile(directiveEntity.getPreviewFile());
|
||||
orders.setPreviewFileSmall(directiveEntity.getPreviewFileSmall());
|
||||
orders.setMp3File(directiveEntity.getMp3File());
|
||||
orders.setMp4File(directiveEntity.getMp4File());
|
||||
orders.setServiceContent(directiveEntity.getServiceContent());
|
||||
orders.setServiceDuration(directiveEntity.getServiceDuration());
|
||||
orders.setTimeoutDuration(directiveEntity.getTimeoutDuration());
|
||||
} else {
|
||||
//获取服务指令包
|
||||
DirectiveOrder packageEntity = baseMapper.getPackageById(orders);
|
||||
if (packageEntity == null) {
|
||||
map.put("success", false);
|
||||
map.put("message", "服务指令包无效");
|
||||
return map;
|
||||
}
|
||||
orders.setDirectiveName(packageEntity.getDirectiveName());
|
||||
orders.setServiceContent(packageEntity.getServiceContent());
|
||||
orders.setServiceDuration(packageEntity.getServiceDuration());
|
||||
orders.setTimeoutDuration(packageEntity.getTimeoutDuration());
|
||||
}
|
||||
|
||||
//生成结束时间
|
||||
String duration = orders.getServiceDuration();
|
||||
if (duration.equals("") || duration.equals("0")) {
|
||||
c.set(Calendar.YEAR, 3000);
|
||||
c.set(Calendar.MONTH, Calendar.DECEMBER);
|
||||
c.set(Calendar.DAY_OF_MONTH, 31);
|
||||
c.set(Calendar.HOUR_OF_DAY, 0);
|
||||
c.set(Calendar.MINUTE, 0);
|
||||
c.set(Calendar.SECOND, 0);
|
||||
c.set(Calendar.MILLISECOND, 0);
|
||||
} else {
|
||||
c.add(Calendar.MINUTE, Integer.valueOf(duration));
|
||||
}
|
||||
Date endTime = c.getTime();
|
||||
orders.setStartTime(startTime);
|
||||
orders.setEndTime(endTime);
|
||||
if (orders.getIzPackage().equals("N")) {
|
||||
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());
|
||||
employeeId = employee.getEmployeeId();
|
||||
employeeName = employee.getEmployeeName();
|
||||
}
|
||||
} else {
|
||||
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 (infoList != null) {
|
||||
int size = infoList.size();
|
||||
emps.removeIf(data -> data.getOwnCn() < size);//删除没有权限的数据
|
||||
}
|
||||
String employeeIds = emps.stream().map(DirectiveOrder::getEmployeeId).collect(Collectors.joining(","));
|
||||
DirectiveOrder employee = employeeScreening(directiveIds, orders.getElderId(), employeeIds, orders.getStartTime());
|
||||
employeeId = employee.getEmployeeId();
|
||||
employeeName = employee.getEmployeeName();
|
||||
}
|
||||
}
|
||||
|
||||
if (directiveOrder.getTriggerMode().equals("1")) {
|
||||
//直接派单给发起人
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
employeeId = sysUser.getEmployeesId();
|
||||
employeeName = getEmployeeName(employeeId);
|
||||
}
|
||||
|
||||
String orderNo = getOrderNo(orderType);
|
||||
orders.setOrderNo(orderNo);
|
||||
orders.setOrderType(orderType);
|
||||
orders.setOptType("1");
|
||||
orders.setEmployeeId(employeeId);
|
||||
orders.setEmployeeName(employeeName);
|
||||
orders.setIzStart("N");
|
||||
orders.setIzFinish("N");
|
||||
orders.setIzTimeout("N");
|
||||
orders.setOptIds(employeeId);
|
||||
orders.setOptNames(employeeName);
|
||||
orders.setDelFlag("0");
|
||||
this.save(orders);//生成工单主表
|
||||
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")) {
|
||||
ordersInfo.setPackageId(orders.getDirectiveId());
|
||||
ordersInfo.setPackageName(orders.getDirectiveName());
|
||||
}
|
||||
ordersInfo.setStartTime(startTime);
|
||||
ordersInfo.setEndTime(endTime);
|
||||
ordersInfo.setIzStart("N");
|
||||
ordersInfo.setIzFinish("N");
|
||||
ordersInfo.setOptType("1");
|
||||
ordersInfo.setOptIds(employeeId);
|
||||
ordersInfo.setOptNames(employeeName);
|
||||
ordersInfoService.save(ordersInfo);//生成工单子表
|
||||
}
|
||||
}
|
||||
//todo
|
||||
|
||||
//发送websocket消息
|
||||
try {
|
||||
// 发送数据
|
||||
JSONObject message = new JSONObject();
|
||||
message.put("type", "directiveOrder");//消息类型
|
||||
message.put("timestamp", System.currentTimeMillis());
|
||||
message.put("from", "system");//发送者
|
||||
message.put("to", orders.getEmployeeId());//接收用户
|
||||
message.put("data", orders);//业务数据
|
||||
String messageJson = message.toJSONString();
|
||||
//发送给单个用户
|
||||
sdWebsocket.sendMessage(orders.getEmployeeId(), messageJson);
|
||||
log.info("【ws消息推送】发送给用户 {}: {}", orders.getEmployeeId(), messageJson);
|
||||
} catch (Exception e) {
|
||||
log.error("ws发送消息失败", e);
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取员工姓名
|
||||
|
|
|
|||
|
|
@ -1,14 +1,8 @@
|
|||
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.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;
|
||||
import com.nu.modules.biz.plan.invoicing.service.IInvoicingDirectivePlanService;
|
||||
import com.nu.modules.biz.plan.logistics.entity.LogisticsDirectivePlan;
|
||||
import com.nu.modules.biz.plan.logistics.service.LogisticsDirectivePlanService;
|
||||
import com.nu.modules.order.api.IDirectiveOrderApi;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
|
@ -21,7 +15,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
|
@ -39,10 +32,6 @@ public class DirectivePlanController extends JeecgController<CareDirectivePlan,
|
|||
@Autowired
|
||||
private ICareDirectivePlanService careDirectivePlanService;
|
||||
@Autowired
|
||||
private IInvoicingDirectivePlanService invoicingDirectivePlanService;
|
||||
@Autowired
|
||||
private LogisticsDirectivePlanService logisticsDirectivePlanService;
|
||||
@Autowired
|
||||
private IDirectiveOrderApi directiveOrderApi;
|
||||
|
||||
/**
|
||||
|
|
@ -57,39 +46,14 @@ public class DirectivePlanController extends JeecgController<CareDirectivePlan,
|
|||
|
||||
//护理类即时指令
|
||||
{
|
||||
//当天已完成总数
|
||||
int hllFinishedTotal = directiveOrderApi.queryTodayFinishedTotal("1", nuId, elderId);
|
||||
//todo 当天已完成总数 待完成
|
||||
int hllFinishedTotal = 0;
|
||||
result.put("hllFinishedTotal", hllFinishedTotal);
|
||||
//当天编排好的非即时指令总数量
|
||||
int hllTotal = careDirectivePlanService.queryTotal(nuId, elderId);
|
||||
result.put("hllTotal", hllTotal);
|
||||
}
|
||||
|
||||
//TODO 医疗类即时指令
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//库房类即时指令
|
||||
{
|
||||
//当天已完成总数
|
||||
int hllFinishedTotal = directiveOrderApi.queryTodayFinishedTotal("3", nuId, null);
|
||||
result.put("cklFinishedTotal", hllFinishedTotal);
|
||||
//当天编排好的非即时指令总数量
|
||||
int hllTotal = invoicingDirectivePlanService.queryTotal(nuId);
|
||||
result.put("cklTotal", hllTotal);
|
||||
}
|
||||
|
||||
//后勤类即时指令
|
||||
{
|
||||
//当天已完成总数
|
||||
int hllFinishedTotal = directiveOrderApi.queryTodayFinishedTotal("4", nuId, elderId);
|
||||
result.put("hqlFinishedTotal", hllFinishedTotal);
|
||||
//当天编排好的非即时指令总数量
|
||||
int hllTotal = logisticsDirectivePlanService.queryTotal(nuId, elderId);
|
||||
result.put("hqlTotal", hllTotal);
|
||||
}
|
||||
|
||||
return Result.OK(result);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,8 +24,6 @@ public interface CareDirectivePlanMapper extends BaseMapper<CareDirectivePlan> {
|
|||
|
||||
List<CareDirectivePlan> jzList(@Param("dto") CareDirectiveEntity careDirectiveEntity);
|
||||
|
||||
List<DirectiveOrderEntity> queryFuture( @Param("dto") CareDirectiveEntity dto);
|
||||
|
||||
List<DirectiveOrderEntity> queryListByDateTime( @Param("dto") CareDirectiveEntity dto);
|
||||
|
||||
int deleteDirectiveSet(@Param("dto") CareDirectiveEntity careDirectiveEntity);
|
||||
|
|
|
|||
|
|
@ -316,107 +316,6 @@
|
|||
</select>
|
||||
|
||||
|
||||
<select id="queryFuture" resultMap="DirectiveOrderMap">
|
||||
SELECT
|
||||
p.id,
|
||||
p.nu_id,
|
||||
base.nu_name,
|
||||
CASE WHEN p.iz_package = 'N' THEN directive.category_id ELSE NULL END as category_id,
|
||||
CASE WHEN p.iz_package = 'N' THEN category.category_name ELSE NULL END as category_name,
|
||||
CASE WHEN p.iz_package = 'N' THEN directive.type_id ELSE NULL END as type_id,
|
||||
CASE WHEN p.iz_package = 'N' THEN stype.type_name ELSE NULL END as type_name,
|
||||
p.directive_id,
|
||||
CASE
|
||||
WHEN p.iz_package = 'N' THEN directive.directive_name
|
||||
WHEN p.iz_package = 'Y' THEN package.package_name
|
||||
END as directive_name,
|
||||
p.cycle_type_id,
|
||||
p.cycle_value,
|
||||
CASE WHEN p.iz_package = 'N' THEN directive.immediate_file ELSE NULL END as immediate_file,
|
||||
CASE WHEN p.iz_package = 'N' THEN directive.immediate_file_focus ELSE NULL END as immediate_file_focus,
|
||||
CASE WHEN p.iz_package = 'N' THEN directive.preview_file ELSE NULL END as preview_file,
|
||||
CASE WHEN p.iz_package = 'N' THEN directive.preview_file_small ELSE NULL END as preview_file_small,
|
||||
CASE WHEN p.iz_package = 'N' THEN directive.mp3_file ELSE NULL END as mp3_file,
|
||||
CASE WHEN p.iz_package = 'N' THEN directive.mp4_file ELSE NULL END as mp4_file,
|
||||
CASE
|
||||
WHEN p.iz_package = 'N' THEN directive.service_duration
|
||||
WHEN p.iz_package = 'Y' THEN CAST(package.total_duration AS CHAR)
|
||||
END as service_duration,
|
||||
CASE
|
||||
WHEN p.iz_package = 'N' THEN directive.service_content
|
||||
WHEN p.iz_package = 'Y' THEN package.description
|
||||
END as service_content,
|
||||
p.positioning,
|
||||
p.positioning_long,
|
||||
p.tag_name,
|
||||
CONCAT(
|
||||
DATE_FORMAT(#{dto.queryDate}, '%Y-%m-%d'), ' ',
|
||||
LPAD(p.start_time, 5, '0'), ':00'
|
||||
) as start_time,
|
||||
CASE
|
||||
WHEN p.iz_package = 'N' AND directive.service_duration IS NOT NULL
|
||||
THEN CONCAT(
|
||||
DATE_FORMAT(#{dto.queryDate}, '%Y-%m-%d'), ' ',
|
||||
DATE_FORMAT(ADDTIME(STR_TO_DATE(CONCAT(LPAD(p.start_time, 5, '0'), ':00'), '%H:%i:%s'),
|
||||
SEC_TO_TIME(directive.service_duration * 60)), '%H:%i:%s')
|
||||
)
|
||||
WHEN p.iz_package = 'Y' AND package.total_duration IS NOT NULL
|
||||
THEN CONCAT(
|
||||
DATE_FORMAT(#{dto.queryDate}, '%Y-%m-%d'), ' ',
|
||||
DATE_FORMAT(ADDTIME(STR_TO_DATE(CONCAT(LPAD(p.start_time, 5, '0'), ':00'), '%H:%i:%s'),
|
||||
SEC_TO_TIME(package.total_duration * 60)), '%H:%i:%s')
|
||||
)
|
||||
ELSE NULL
|
||||
END as end_time,
|
||||
p.create_by,
|
||||
p.create_time,
|
||||
p.update_by,
|
||||
p.update_time,
|
||||
p.sys_org_code,
|
||||
p.iz_package,
|
||||
pd.directive_id AS sub_id,
|
||||
pd.directive_id AS sub_directive_id
|
||||
FROM nu_biz_directive_plan p
|
||||
LEFT JOIN nu_base_info base ON p.nu_id = base.nu_id
|
||||
LEFT JOIN nu_config_service_directive directive ON p.iz_package = 'N' AND p.directive_id = directive.id
|
||||
LEFT JOIN nu_config_directive_package_main package ON p.iz_package = 'Y' AND p.directive_id = package.id
|
||||
LEFT JOIN nu_config_service_category category ON directive.category_id = category.id
|
||||
LEFT JOIN nu_config_service_type stype ON directive.type_id = stype.id
|
||||
LEFT JOIN nu_config_directive_package_item pd ON p.iz_package = 'Y' AND p.directive_id = pd.package_id
|
||||
WHERE p.nu_id = #{dto.nuId}
|
||||
AND (
|
||||
-- 1: 每天执行
|
||||
p.cycle_type_id = '1'
|
||||
|
||||
-- 3: 按星期执行
|
||||
OR (p.cycle_type_id = '3' AND p.cycle_value = WEEKDAY(now()))
|
||||
|
||||
-- 4: 按日期执行
|
||||
OR (p.cycle_type_id = '4' AND p.cycle_value = DATE_FORMAT(#{dto.queryDate}, '%d'))
|
||||
|
||||
-- 5: 频次执行
|
||||
OR (p.cycle_type_id = '5' AND (
|
||||
-- 不限次数
|
||||
(p.opt_count = 0
|
||||
AND DATEDIFF(#{dto.queryDate}, DATE(p.opt_time)) >= 0
|
||||
AND MOD(DATEDIFF(#{dto.queryDate}, DATE(p.opt_time)), (CAST(p.cycle_value AS UNSIGNED) + 1)) = 0)
|
||||
|
||||
-- 有限次数
|
||||
OR (p.opt_count > 0
|
||||
AND DATEDIFF(#{dto.queryDate}, DATE(p.opt_time)) >= 0
|
||||
AND MOD(DATEDIFF(#{dto.queryDate}, DATE(p.opt_time)), (CAST(p.cycle_value AS UNSIGNED) + 1)) = 0
|
||||
AND (DATEDIFF(#{dto.queryDate}, DATE(p.opt_time)) / (CAST(p.cycle_value AS UNSIGNED) + 1)) < p.opt_count)
|
||||
))
|
||||
)
|
||||
|
||||
-- 是否查询未来指令
|
||||
<if test="dto.queryFuture != null and dto.queryFuture">
|
||||
AND #{dto.queryDate} = CURDATE() AND p.start_time > DATE_FORMAT(NOW(), '%H:%i')
|
||||
</if>
|
||||
|
||||
ORDER BY p.start_time ASC
|
||||
</select>
|
||||
|
||||
<select id="queryListByDateTime" resultMap="DirectiveOrderMap">
|
||||
SELECT p.id,
|
||||
p.nu_id,
|
||||
|
|
|
|||
|
|
@ -1,37 +1,31 @@
|
|||
package com.nu.modules.biz.plan.care.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.nu.entity.*;
|
||||
import com.nu.modules.biz.datapool.service.ICareDataPoolService;
|
||||
import com.nu.modules.biz.order.entity.DirectiveOrder;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nu.entity.CareDirectiveEntity;
|
||||
import com.nu.entity.DirectiveOrderEntity;
|
||||
import com.nu.entity.DirectivePlanDateEntity;
|
||||
import com.nu.entity.ElderTagEntity;
|
||||
import com.nu.modules.biz.plan.care.entity.CareDirectivePlan;
|
||||
import com.nu.modules.biz.plan.care.entity.DirectivePlanChangeStatus;
|
||||
import com.nu.modules.biz.plan.care.entity.ElderTagPlan;
|
||||
import com.nu.modules.biz.plan.care.mapper.CareDirectivePlanMapper;
|
||||
import com.nu.modules.biz.plan.care.service.ICareDirectivePlanService;
|
||||
import com.nu.modules.biz.plan.care.service.IDirectivePlanChangeStatusService;
|
||||
import com.nu.modules.biz.plan.care.service.IDirectivePlanLogService;
|
||||
import com.nu.modules.config.directivepackage.service.IDirectivePackageService;
|
||||
import com.nu.modules.config.directivepackage.service.impl.DirectivePackageServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.compress.utils.Lists;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.nu.modules.biz.plan.care.entity.ElderTagPlan;
|
||||
import com.nu.modules.biz.plan.care.entity.CareDirectivePlan;
|
||||
import com.nu.modules.biz.plan.care.mapper.CareDirectivePlanMapper;
|
||||
import com.nu.modules.biz.plan.care.service.IElderTagPlanService;
|
||||
import com.nu.modules.biz.plan.care.service.ICareDirectivePlanService;
|
||||
import com.nu.modules.care.api.ICareDirectivePlanApi;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 护理单元客户配置服务指令
|
||||
|
|
@ -46,10 +40,6 @@ public class CareDirectivePlanServiceImpl extends ServiceImpl<CareDirectivePlanM
|
|||
@Autowired
|
||||
private IElderTagPlanService bizNuElderTagPlanService;
|
||||
@Autowired
|
||||
private ICareDataPoolService dataPoolServiceImpl;
|
||||
@Autowired
|
||||
private DirectivePackageServiceImpl directivePackageService;
|
||||
@Autowired
|
||||
private IDirectivePlanLogService directivePlanLogService;
|
||||
@Autowired
|
||||
private IDirectivePlanChangeStatusService directivePlanChangeStatusService;
|
||||
|
|
@ -60,36 +50,6 @@ public class CareDirectivePlanServiceImpl extends ServiceImpl<CareDirectivePlanM
|
|||
//服务指令计划
|
||||
careDirectiveEntity.setQueryType("service");
|
||||
List<CareDirectivePlan> planList = baseMapper.jzList(careDirectiveEntity);
|
||||
// if (!CollectionUtils.isEmpty(groupList)) {
|
||||
// //将包的指令塞进去(写一个sql效率低)
|
||||
// CareDirectivePackageEntity queryParams = new CareDirectivePackageEntity();
|
||||
// List<CareDirectivePackageEntity> ids = Lists.newArrayList();
|
||||
// groupList.stream().forEach(item -> {
|
||||
// CareDirectivePackageEntity d_ = new CareDirectivePackageEntity();
|
||||
// if ("Y".equals(item.getIzPackage())) {
|
||||
// d_.setId(item.getDirectiveId());
|
||||
// ids.add(d_);
|
||||
// }
|
||||
// });
|
||||
// List<CareDirectivePackageEntity> packagelist = directivePackageService.getNcPackagelist(queryParams, ids);
|
||||
// if (!CollectionUtils.isEmpty(groupList)) {
|
||||
// Map<String, CareDirectivePackageEntity> packageMap = packagelist.stream()
|
||||
// .collect(Collectors.toMap(
|
||||
// CareDirectivePackageEntity::getId,
|
||||
// entity -> entity,
|
||||
// (existing, replacement) -> existing
|
||||
// ));
|
||||
// groupList.stream().forEach(item -> {
|
||||
// if ("Y".equals(item.getIzPackage())) {
|
||||
// List<DirectiveEntity> directives = packageMap.get(item.getDirectiveId()).getDirectives();
|
||||
// if (CollectionUtils.isEmpty(directives)) {
|
||||
// directives = List.of();
|
||||
// }
|
||||
// item.setDirectivesList(BeanUtil.copyToList(directives, CareDirectivePlan.class));
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
|
||||
resMap.put("serviceList", planList);//服务指令计划
|
||||
//即时指令
|
||||
|
|
@ -233,22 +193,8 @@ public class CareDirectivePlanServiceImpl extends ServiceImpl<CareDirectivePlanM
|
|||
uw.eq("instruction_tag_id", careDirectiveEntity.getInstructionTagId());
|
||||
directivePlanChangeStatusService.saveOrUpdate(directivePlanChangeStatus, uw);
|
||||
|
||||
//查询护理单元+对应分类下全部数据进行存储(保存是异步 线程里查询的由于事务原因会少数据)
|
||||
// QueryWrapper<CareDirectivePlan> qw = new QueryWrapper<>();
|
||||
// qw.eq("nu_id", careDirectiveEntity.getNuId());
|
||||
// qw.eq("instruction_tag_id", careDirectiveEntity.getInstructionTagId());
|
||||
// List<CareDirectivePlan> list = baseMapper.selectList(qw);
|
||||
//
|
||||
// if (!CollectionUtils.isEmpty(list)) {
|
||||
// LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
// directivePlanLogService.batchInsert(new Date(), sysUser, list);
|
||||
// }
|
||||
|
||||
return Result.ok();
|
||||
|
||||
//单一指令生成到数据池
|
||||
// dataPoolServiceImpl.generateDataPool(careDirectivePlan);
|
||||
// BeanUtils.copyProperties(careDirectivePlan, careDirectiveEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -324,28 +270,6 @@ public class CareDirectivePlanServiceImpl extends ServiceImpl<CareDirectivePlanM
|
|||
|
||||
//如果nuId+分类标签+单元格坐标下是否已有数据 需要将所有数据改为指令集 否则设置为非指令集
|
||||
if (cycleTypeChanged) {
|
||||
//处理旧的单元格 ( 指令集不存在只挪动其中一个服务 只会整个都挪走)
|
||||
// {
|
||||
// QueryWrapper<CareDirectivePlan> qw = new QueryWrapper<>();
|
||||
// qw.eq("nu_id", careDirectivePlan.getNuId());
|
||||
// qw.eq("instruction_tag_id", careDirectivePlan.getInstructionTagId());
|
||||
// qw.eq("positioning", entity.getPositioning());
|
||||
// qw.eq("positioning_long", entity.getPositioningLong());
|
||||
// List<CareDirectivePlan> list = baseMapper.selectList(qw);
|
||||
// UpdateWrapper<CareDirectivePlan> uw = new UpdateWrapper<>();
|
||||
// uw.eq("nu_id", careDirectivePlan.getNuId());
|
||||
// uw.eq("instruction_tag_id", careDirectivePlan.getInstructionTagId());
|
||||
// uw.eq("positioning", entity.getPositioning());
|
||||
// uw.eq("positioning_long", entity.getPositioningLong());
|
||||
// CareDirectivePlan upData = new CareDirectivePlan();
|
||||
// if (CollectionUtils.isEmpty(list) || list.size() == 1) {
|
||||
// upData.setIzMulti("N");
|
||||
// baseMapper.update(upData, uw);
|
||||
// } else {
|
||||
// upData.setIzMulti("Y");
|
||||
// baseMapper.update(upData, uw);
|
||||
// }
|
||||
// }
|
||||
//处理新的单元格
|
||||
{
|
||||
QueryWrapper<CareDirectivePlan> qw = new QueryWrapper<>();
|
||||
|
|
@ -381,16 +305,6 @@ public class CareDirectivePlanServiceImpl extends ServiceImpl<CareDirectivePlanM
|
|||
uw.eq("instruction_tag_id", careDirectiveEntity.getInstructionTagId());
|
||||
directivePlanChangeStatusService.saveOrUpdate(directivePlanChangeStatus, uw);
|
||||
|
||||
//查询护理单元+对应分类下全部数据进行存储(保存是异步 线程里查询的由于事务原因会少数据)
|
||||
// QueryWrapper<CareDirectivePlan> qw = new QueryWrapper<>();
|
||||
// qw.eq("nu_id", careDirectiveEntity.getNuId());
|
||||
// qw.eq("instruction_tag_id", careDirectiveEntity.getInstructionTagId());
|
||||
// List<CareDirectivePlan> list = baseMapper.selectList(qw);
|
||||
//
|
||||
// if (!CollectionUtils.isEmpty(list)) {
|
||||
// LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
// directivePlanLogService.batchInsert(new Date(), sysUser, list);
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -421,10 +335,6 @@ public class CareDirectivePlanServiceImpl extends ServiceImpl<CareDirectivePlanM
|
|||
baseMapper.update(upData, uw);
|
||||
}
|
||||
}
|
||||
//调用方法删除数据池中的数据
|
||||
// CareDirectivePlan careDirectivePlan = new CareDirectivePlan();
|
||||
// BeanUtils.copyProperties(careDirectiveEntity, careDirectivePlan);
|
||||
// dataPoolServiceImpl.deleteDataPool(careDirectivePlan);
|
||||
|
||||
//记录变化 用于定时任务调整日期快照
|
||||
DirectivePlanChangeStatus directivePlanChangeStatus = new DirectivePlanChangeStatus();
|
||||
|
|
@ -434,22 +344,6 @@ public class CareDirectivePlanServiceImpl extends ServiceImpl<CareDirectivePlanM
|
|||
uw.eq("nu_id", careDirectiveEntity.getNuId());
|
||||
uw.eq("instruction_tag_id", careDirectiveEntity.getInstructionTagId());
|
||||
directivePlanChangeStatusService.saveOrUpdate(directivePlanChangeStatus, uw);
|
||||
|
||||
//查询护理单元+对应分类下全部数据进行存储(保存是异步 线程里查询的由于事务原因会少数据)
|
||||
// QueryWrapper<CareDirectivePlan> qw = new QueryWrapper<>();
|
||||
// qw.eq("nu_id", careDirectiveEntity.getNuId());
|
||||
// qw.eq("instruction_tag_id", careDirectiveEntity.getInstructionTagId());
|
||||
// List<CareDirectivePlan> list = baseMapper.selectList(qw);
|
||||
//
|
||||
// if (!CollectionUtils.isEmpty(list)) {
|
||||
// LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
// directivePlanLogService.batchInsert(new Date(), sysUser, list);
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DirectiveOrderEntity> queryFuture(CareDirectiveEntity dto) {
|
||||
return baseMapper.queryFuture(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -481,16 +375,6 @@ public class CareDirectivePlanServiceImpl extends ServiceImpl<CareDirectivePlanM
|
|||
uw.eq("instruction_tag_id", careDirectiveEntity.getInstructionTagId());
|
||||
directivePlanChangeStatusService.saveOrUpdate(directivePlanChangeStatus, uw);
|
||||
|
||||
//查询护理单元+对应分类下全部数据进行存储(保存是异步 线程里查询的由于事务原因会少数据)
|
||||
// QueryWrapper<CareDirectivePlan> qw = new QueryWrapper<>();
|
||||
// qw.eq("nu_id", careDirectiveEntity.getNuId());
|
||||
// qw.eq("instruction_tag_id", careDirectiveEntity.getInstructionTagId());
|
||||
// List<CareDirectivePlan> list = baseMapper.selectList(qw);
|
||||
//
|
||||
// if (!CollectionUtils.isEmpty(list)) {
|
||||
// LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
// directivePlanLogService.batchInsert(new Date(), sysUser, list);
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -1,152 +0,0 @@
|
|||
package com.nu.modules.biz.plan.invoicing.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.nu.modules.biz.plan.care.entity.ElderTagPlan;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 库房类服务指令计划
|
||||
* @Author: caolei
|
||||
* @Date: 2026-1-6
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("nu_biz_nu_invoicing_directive_plan")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="nu_biz_nu_invoicing_directive_plan对象", description="库房类服务指令计划")
|
||||
public class InvoicingDirectivePlan implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
/**护理单元id*/
|
||||
private String nuId;
|
||||
/**服务指令id*/
|
||||
private String directiveId;
|
||||
/**指令类型ID 1日常 2即时 3星期 4日期 5频率*/
|
||||
private String cycleTypeId;
|
||||
/**周期值*/
|
||||
private String cycleValue;
|
||||
/**定位*/
|
||||
private String positioning;
|
||||
/**纵向定位*/
|
||||
private String positioningLong;
|
||||
/**PAD端无线循环使用*/
|
||||
private String tagName;
|
||||
/**开始时间*/
|
||||
private String startTime;
|
||||
/**创建人*/
|
||||
private String createBy;
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
/**更新人*/
|
||||
private String updateBy;
|
||||
/**更新日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
/**所属部门*/
|
||||
private String sysOrgCode;
|
||||
/**是否是服务指令包 N否 Y是*/
|
||||
private String izPackage;
|
||||
/**
|
||||
* 操作日志,用于频次类型的计算
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date optTime;
|
||||
/**
|
||||
* 执行次数,0不限次数 非0具体次数,用于频次类型计算
|
||||
*/
|
||||
private Integer optCount;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String packageId;
|
||||
|
||||
/**服务指令列表**/
|
||||
@TableField(exist = false)
|
||||
private List<InvoicingDirectivePlan> serverList;
|
||||
/**长者标签列表**/
|
||||
@TableField(exist = false)
|
||||
private List<ElderTagPlan> tagList;
|
||||
/**服务包中的服务列表**/
|
||||
@TableField(exist = false)
|
||||
private List<InvoicingDirectivePlan> directivesList;
|
||||
|
||||
/**护理单元名称*/
|
||||
@TableField(exist = false)
|
||||
private String nuName;
|
||||
|
||||
/**服务类别ID*/
|
||||
@TableField(exist = false)
|
||||
private String categoryId;
|
||||
|
||||
/**服务类别名称*/
|
||||
@TableField(exist = false)
|
||||
private String categoryName;
|
||||
|
||||
/**服务类型ID*/
|
||||
@TableField(exist = false)
|
||||
private String typeId;
|
||||
|
||||
/**服务类型名称*/
|
||||
@TableField(exist = false)
|
||||
private String typeName;
|
||||
|
||||
/**指令名称*/
|
||||
@TableField(exist = false)
|
||||
private String directiveName;
|
||||
|
||||
/**即时文件*/
|
||||
@TableField(exist = false)
|
||||
private String immediateFile;
|
||||
|
||||
/**即时文件焦点*/
|
||||
@TableField(exist = false)
|
||||
private String immediateFileFocus;
|
||||
|
||||
/**预览文件*/
|
||||
@TableField(exist = false)
|
||||
private String previewFile;
|
||||
|
||||
/**小预览文件*/
|
||||
@TableField(exist = false)
|
||||
private String previewFileSmall;
|
||||
|
||||
/**MP3文件*/
|
||||
@TableField(exist = false)
|
||||
private String mp3File;
|
||||
|
||||
/**MP4文件*/
|
||||
@TableField(exist = false)
|
||||
private String mp4File;
|
||||
|
||||
/**服务时长*/
|
||||
@TableField(exist = false)
|
||||
private String serviceDuration;
|
||||
|
||||
/**服务内容*/
|
||||
@TableField(exist = false)
|
||||
private String serviceContent;
|
||||
|
||||
/**结束时间*/
|
||||
@TableField(exist = false)
|
||||
private String endTime;
|
||||
|
||||
}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
package com.nu.modules.biz.plan.invoicing.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.nu.entity.InvoicingDirectiveEntity;
|
||||
import com.nu.modules.biz.plan.invoicing.entity.InvoicingDirectivePlan;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 户库房类服务指令计划
|
||||
* @Author: caolei
|
||||
* @Date: 2025-11-28
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface InvoicingDirectivePlanMapper extends BaseMapper<InvoicingDirectivePlan> {
|
||||
int deleteByIdPhysic(@Param("id") String id);
|
||||
|
||||
int queryTotal(@Param("nuId") String nuId);
|
||||
|
||||
List<InvoicingDirectivePlan> list(@Param("dto") InvoicingDirectiveEntity invoicingDirectiveEntity);
|
||||
}
|
||||
|
|
@ -1,123 +0,0 @@
|
|||
<?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.plan.invoicing.mapper.InvoicingDirectivePlanMapper">
|
||||
<delete id="deleteByIdPhysic">
|
||||
delete
|
||||
from nu_biz_nu_invoicing_directive_plan
|
||||
where id = #{id}
|
||||
</delete>
|
||||
<select id="queryTotal" resultType="java.lang.Integer">
|
||||
SELECT COUNT(p.id) as total_count
|
||||
FROM nu_biz_nu_invoicing_directive_plan p
|
||||
WHERE p.nu_id = #{nuId}
|
||||
AND (
|
||||
-- 1: 每天执行
|
||||
p.cycle_type_id = '1'
|
||||
|
||||
-- 3: 按星期执行
|
||||
OR (p.cycle_type_id = '3' AND p.cycle_value = (
|
||||
CASE DAYOFWEEK(now())
|
||||
WHEN 1 THEN '6'
|
||||
WHEN 2 THEN '0'
|
||||
WHEN 3 THEN '1'
|
||||
WHEN 4 THEN '2'
|
||||
WHEN 5 THEN '3'
|
||||
WHEN 6 THEN '4'
|
||||
WHEN 7 THEN '5'
|
||||
END
|
||||
))
|
||||
|
||||
-- 4: 按日期执行
|
||||
OR (p.cycle_type_id = '4' AND p.cycle_value = DATE_FORMAT(now(), '%d'))
|
||||
|
||||
-- 5: 频次执行
|
||||
OR (p.cycle_type_id = '5' AND (
|
||||
-- 不限次数
|
||||
(p.opt_count = 0
|
||||
AND DATEDIFF(now(), DATE(p.opt_time)) >= 0
|
||||
AND MOD(DATEDIFF(now(), DATE(p.opt_time)), (CAST(p.cycle_value AS UNSIGNED) + 1)) = 0)
|
||||
|
||||
-- 有限次数
|
||||
OR (p.opt_count > 0
|
||||
AND DATEDIFF(now(), DATE(p.opt_time)) >= 0
|
||||
AND MOD(DATEDIFF(now(), DATE(p.opt_time)), (CAST(p.cycle_value AS UNSIGNED) + 1)) = 0
|
||||
AND (DATEDIFF(now(), DATE(p.opt_time)) / (CAST(p.cycle_value AS UNSIGNED) + 1)) < p.opt_count)
|
||||
))
|
||||
)
|
||||
</select>
|
||||
<select id="list" resultType="com.nu.modules.biz.plan.invoicing.entity.InvoicingDirectivePlan">
|
||||
SELECT
|
||||
plan.id,
|
||||
plan.nu_id,
|
||||
base.nu_name,
|
||||
CASE WHEN plan.iz_package = 'N' THEN directive.category_id ELSE NULL END as category_id,
|
||||
CASE WHEN plan.iz_package = 'N' THEN category.category_name ELSE NULL END as category_name,
|
||||
CASE WHEN plan.iz_package = 'N' THEN directive.type_id ELSE NULL END as type_id,
|
||||
CASE WHEN plan.iz_package = 'N' THEN stype.type_name ELSE NULL END as type_name,
|
||||
plan.directive_id,
|
||||
CASE
|
||||
WHEN plan.iz_package = 'N' THEN directive.directive_name
|
||||
WHEN plan.iz_package = 'Y' THEN package.package_name
|
||||
END as directive_name,
|
||||
plan.cycle_type_id,
|
||||
plan.cycle_value,
|
||||
CASE WHEN plan.iz_package = 'N' THEN directive.immediate_file ELSE NULL END as immediate_file,
|
||||
CASE WHEN plan.iz_package = 'N' THEN directive.immediate_file_focus ELSE NULL END as immediate_file_focus,
|
||||
CASE WHEN plan.iz_package = 'N' THEN directive.preview_file ELSE NULL END as preview_file,
|
||||
CASE WHEN plan.iz_package = 'N' THEN directive.preview_file_small ELSE NULL END as preview_file_small,
|
||||
CASE WHEN plan.iz_package = 'N' THEN directive.mp3_file ELSE NULL END as mp3_file,
|
||||
CASE WHEN plan.iz_package = 'N' THEN directive.mp4_file ELSE NULL END as mp4_file,
|
||||
CASE
|
||||
WHEN plan.iz_package = 'N' THEN directive.service_duration
|
||||
WHEN plan.iz_package = 'Y' THEN CAST(package.total_duration AS CHAR)
|
||||
END as service_duration,
|
||||
CASE
|
||||
WHEN plan.iz_package = 'N' THEN directive.service_content
|
||||
WHEN plan.iz_package = 'Y' THEN package.description
|
||||
END as service_content,
|
||||
plan.positioning,
|
||||
plan.positioning_long,
|
||||
plan.tag_name,
|
||||
plan.start_time,
|
||||
CASE
|
||||
WHEN plan.iz_package = 'N' AND directive.service_duration IS NOT NULL AND directive.service_duration = 0
|
||||
THEN '23:59'
|
||||
WHEN plan.iz_package = 'Y' AND package.total_duration IS NOT NULL AND package.total_duration = 0
|
||||
THEN '23:59'
|
||||
WHEN plan.iz_package = 'N' AND directive.service_duration IS NOT NULL AND directive.service_duration > 0
|
||||
THEN DATE_FORMAT(ADDTIME(STR_TO_DATE(plan.start_time, '%H:%i'),SEC_TO_TIME(directive.service_duration * 60)), '%H:%i')
|
||||
WHEN plan.iz_package = 'Y' AND package.total_duration IS NOT NULL AND package.total_duration > 0
|
||||
THEN DATE_FORMAT(ADDTIME(STR_TO_DATE(plan.start_time, '%H:%i'),SEC_TO_TIME(package.total_duration * 60)), '%H:%i')
|
||||
ELSE NULL
|
||||
END as end_time,
|
||||
plan.create_by,
|
||||
plan.create_time,
|
||||
plan.update_by,
|
||||
plan.update_time,
|
||||
plan.sys_org_code,
|
||||
plan.iz_package
|
||||
FROM nu_biz_nu_invoicing_directive_plan plan
|
||||
LEFT JOIN nu_base_info base ON plan.nu_id = base.nu_id
|
||||
LEFT JOIN nu_config_service_directive directive ON plan.iz_package = 'N' AND plan.directive_id = directive.id
|
||||
LEFT JOIN nu_config_directive_package_main package ON plan.iz_package = 'Y' AND plan.directive_id = package.id
|
||||
LEFT JOIN nu_config_service_category category ON directive.category_id = category.id
|
||||
LEFT JOIN nu_config_service_type stype ON directive.type_id = stype.id
|
||||
WHERE 1=1
|
||||
<if test="dto != null and dto.nuId != null and dto.nuId != ''">
|
||||
AND plan.nu_id = #{dto.nuId}
|
||||
</if>
|
||||
<if test="dto != null and dto.queryType != null and dto.queryType != ''">
|
||||
<choose>
|
||||
<when test="dto.queryType == 'service'">
|
||||
AND plan.cycle_type_id != '2'
|
||||
</when>
|
||||
<when test="dto.queryType == 'instant'">
|
||||
AND plan.cycle_type_id = '2'
|
||||
</when>
|
||||
</choose>
|
||||
</if>
|
||||
ORDER BY plan.create_time DESC
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
package com.nu.modules.biz.plan.invoicing.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.nu.modules.biz.plan.invoicing.entity.InvoicingDirectivePlan;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 护理单元客户库房类服务指令计划
|
||||
* @Author: caolei
|
||||
* @Date: 2025-11-28
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IInvoicingDirectivePlanService extends IService<InvoicingDirectivePlan> {
|
||||
|
||||
int queryTotal(String nuId);
|
||||
|
||||
}
|
||||
|
|
@ -1,141 +0,0 @@
|
|||
package com.nu.modules.biz.plan.invoicing.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nu.entity.*;
|
||||
import com.nu.modules.biz.datapool.service.IInvoicingDataPoolService;
|
||||
import com.nu.modules.biz.plan.care.entity.CareDirectivePlan;
|
||||
import com.nu.modules.biz.plan.invoicing.entity.InvoicingDirectivePlan;
|
||||
import com.nu.modules.biz.plan.invoicing.mapper.InvoicingDirectivePlanMapper;
|
||||
import com.nu.modules.biz.plan.invoicing.service.IInvoicingDirectivePlanService;
|
||||
import com.nu.modules.config.directivepackage.service.impl.DirectivePackageServiceImpl;
|
||||
import com.nu.modules.invoicing.api.IInvoicingDirectivePlanApi;
|
||||
import org.apache.commons.compress.utils.Lists;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 护理单元客户库房类服务指令计划
|
||||
* @Author: caolei
|
||||
* @Date: 2026-1-6
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class InvoicingDirectivePlanServiceImpl extends ServiceImpl<InvoicingDirectivePlanMapper, InvoicingDirectivePlan> implements IInvoicingDirectivePlanService, IInvoicingDirectivePlanApi {
|
||||
|
||||
@Autowired
|
||||
private IInvoicingDataPoolService dataPoolServiceImpl;
|
||||
@Autowired
|
||||
private DirectivePackageServiceImpl directivePackageService;
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getPlanList(InvoicingDirectiveEntity invoicingDirectiveEntity) {
|
||||
Map<String, Object> resMap = new HashMap<>();
|
||||
//服务指令计划
|
||||
invoicingDirectiveEntity.setQueryType("service");
|
||||
List<InvoicingDirectivePlan> groupList = baseMapper.list(invoicingDirectiveEntity);
|
||||
if (!CollectionUtils.isEmpty(groupList)) {
|
||||
//将包的指令塞进去(写一个sql效率低)
|
||||
CareDirectivePackageEntity queryParams = new CareDirectivePackageEntity();
|
||||
List<CareDirectivePackageEntity> ids = Lists.newArrayList();
|
||||
groupList.stream().forEach(item -> {
|
||||
CareDirectivePackageEntity d_ = new CareDirectivePackageEntity();
|
||||
if ("Y".equals(item.getIzPackage())) {
|
||||
d_.setId(item.getDirectiveId());
|
||||
ids.add(d_);
|
||||
}
|
||||
});
|
||||
List<CareDirectivePackageEntity> packagelist = directivePackageService.getNcPackagelist(queryParams, ids);
|
||||
if (!CollectionUtils.isEmpty(groupList)) {
|
||||
Map<String, CareDirectivePackageEntity> packageMap = packagelist.stream()
|
||||
.collect(Collectors.toMap(
|
||||
CareDirectivePackageEntity::getId,
|
||||
entity -> entity,
|
||||
(existing, replacement) -> existing
|
||||
));
|
||||
groupList.stream().forEach(item -> {
|
||||
if ("Y".equals(item.getIzPackage())) {
|
||||
List<DirectiveEntity> directives = packageMap.get(item.getDirectiveId()).getDirectives();
|
||||
if (CollectionUtils.isEmpty(directives)) {
|
||||
directives = List.of();
|
||||
}
|
||||
item.setDirectivesList(BeanUtil.copyToList(directives, InvoicingDirectivePlan.class));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
resMap.put("serviceList", groupList);//服务指令计划
|
||||
|
||||
//即时指令
|
||||
invoicingDirectiveEntity.setQueryType("instant");
|
||||
List<InvoicingDirectivePlan> instantList = baseMapper.list(invoicingDirectiveEntity);
|
||||
resMap.put("instantList", instantList);//即时指令
|
||||
return resMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public InvoicingDirectiveEntity addDirective(InvoicingDirectiveEntity invoicingDirectiveEntity) {
|
||||
InvoicingDirectivePlan invoicingDirectivePlan = new InvoicingDirectivePlan();
|
||||
BeanUtils.copyProperties(invoicingDirectiveEntity, invoicingDirectivePlan);
|
||||
baseMapper.insert(invoicingDirectivePlan);
|
||||
//TODO 增加日志
|
||||
|
||||
//单一指令生成到数据池
|
||||
dataPoolServiceImpl.generateDataPool(invoicingDirectivePlan);
|
||||
BeanUtils.copyProperties(invoicingDirectivePlan, invoicingDirectiveEntity);
|
||||
return invoicingDirectiveEntity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void editDirective(InvoicingDirectiveEntity invoicingDirectiveEntity) {
|
||||
InvoicingDirectivePlan invoicingDirectivePlan = new InvoicingDirectivePlan();
|
||||
BeanUtils.copyProperties(invoicingDirectiveEntity, invoicingDirectivePlan);
|
||||
InvoicingDirectivePlan entity = baseMapper.selectById(invoicingDirectiveEntity.getId());
|
||||
//先删除再新增
|
||||
baseMapper.deleteByIdPhysic(invoicingDirectiveEntity.getId());
|
||||
baseMapper.insert(invoicingDirectivePlan);
|
||||
// baseMapper.updateById(invoicingDirectivePlan);
|
||||
//TODO 增加日志
|
||||
//调用方法先删除数据池中的数据,再生成数据池中的数据
|
||||
//todo 需要解开
|
||||
dataPoolServiceImpl.editDataPool(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteDirective(InvoicingDirectiveEntity invoicingDirectiveEntity) {
|
||||
InvoicingDirectivePlan invoicingDirectivePlan = new InvoicingDirectivePlan();
|
||||
BeanUtils.copyProperties(invoicingDirectiveEntity, invoicingDirectivePlan);
|
||||
String id = invoicingDirectivePlan.getId();
|
||||
//调用方法删除数据池中的数据
|
||||
//todo 需要解开
|
||||
dataPoolServiceImpl.deleteDataPool(invoicingDirectivePlan);
|
||||
baseMapper.deleteByIdPhysic(id);
|
||||
//TODO 增加日志
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DirectiveOrderEntity> queryImmediatelyOrderList(CareDirectiveEntity dto_) {
|
||||
InvoicingDirectiveEntity dto = new InvoicingDirectiveEntity();
|
||||
dto.setNuId(dto_.getNuId());
|
||||
dto.setQueryType("instant");
|
||||
List<InvoicingDirectivePlan> list = baseMapper.list(dto);
|
||||
if(!CollectionUtils.isEmpty(list)){
|
||||
return BeanUtil.copyToList(list,DirectiveOrderEntity.class);
|
||||
}else{
|
||||
return List.of();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int queryTotal(String nuId) {
|
||||
return baseMapper.queryTotal(nuId);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,147 +0,0 @@
|
|||
package com.nu.modules.biz.plan.logistics.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.nu.modules.biz.plan.care.entity.ElderTagPlan;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 后勤服务指令计划
|
||||
* @Author: caolei
|
||||
* @Date: 2026-1-6
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("nu_biz_nu_logistics_directive_plan")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="nu_biz_nu_logistics_directive_plan对象", description="后勤服务指令计划")
|
||||
public class LogisticsDirectivePlan implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
/**护理单元id*/
|
||||
private String nuId;
|
||||
/**服务指令id*/
|
||||
private String directiveId;
|
||||
/**指令类型ID*/
|
||||
private String cycleTypeId;
|
||||
/**周期值*/
|
||||
private String cycleValue;
|
||||
/**定位*/
|
||||
private String positioning;
|
||||
/**纵向定位*/
|
||||
private String positioningLong;
|
||||
/**PAD端无线循环使用*/
|
||||
private String tagName;
|
||||
/**开始时间*/
|
||||
private String startTime;
|
||||
/**创建人*/
|
||||
private String createBy;
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
/**更新人*/
|
||||
private String updateBy;
|
||||
/**更新日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
/**所属部门*/
|
||||
private String sysOrgCode;
|
||||
/**是否是服务指令包 N否 Y是*/
|
||||
private String izPackage;
|
||||
/**
|
||||
* 操作日志,用于频次类型的计算
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date optTime;
|
||||
/**
|
||||
* 执行次数,0不限次数 非0具体次数,用于频次类型计算
|
||||
*/
|
||||
private Integer optCount;
|
||||
|
||||
|
||||
|
||||
/**护理单元名称*/
|
||||
@TableField(exist = false)
|
||||
private String nuName;
|
||||
/**长者id*/
|
||||
@TableField(exist = false)
|
||||
private String elderId;
|
||||
/**长者姓名*/
|
||||
@TableField(exist = false)
|
||||
private String elderName;
|
||||
/**服务类别id*/
|
||||
@TableField(exist = false)
|
||||
private String categoryId;
|
||||
/**服务类别名称*/
|
||||
@TableField(exist = false)
|
||||
private String categoryName;
|
||||
/**服务类型id*/
|
||||
@TableField(exist = false)
|
||||
private String typeId;
|
||||
/**服务类型名称*/
|
||||
@TableField(exist = false)
|
||||
private String typeName;
|
||||
/**服务指令名称*/
|
||||
@TableField(exist = false)
|
||||
private String directiveName;
|
||||
/**指令类型*/
|
||||
@TableField(exist = false)
|
||||
private String cycleType;
|
||||
/**即时指令图标*/
|
||||
@TableField(exist = false)
|
||||
private String immediateFile;
|
||||
/**即时指令焦点图标*/
|
||||
@TableField(exist = false)
|
||||
private String immediateFileFocus;
|
||||
/**服务指令图片大图*/
|
||||
@TableField(exist = false)
|
||||
private String previewFile;
|
||||
/**服务指令图片小图*/
|
||||
@TableField(exist = false)
|
||||
private String previewFileSmall;
|
||||
/**指令音频文件*/
|
||||
@TableField(exist = false)
|
||||
private String mp3File;
|
||||
/**指令视频文件*/
|
||||
@TableField(exist = false)
|
||||
private String mp4File;
|
||||
/**服务指令时长*/
|
||||
@TableField(exist = false)
|
||||
private String serviceDuration;
|
||||
/**服务描述*/
|
||||
@TableField(exist = false)
|
||||
private String serviceContent;
|
||||
/**结束时间*/
|
||||
@TableField(exist = false)
|
||||
private String endTime;
|
||||
@TableField(exist = false)
|
||||
private String packageId;
|
||||
/**服务指令列表**/
|
||||
@TableField(exist = false)
|
||||
private List<LogisticsDirectivePlan> serverList;
|
||||
/**长者标签列表**/
|
||||
@TableField(exist = false)
|
||||
private List<ElderTagPlan> tagList;
|
||||
/**服务包中的服务列表**/
|
||||
@TableField(exist = false)
|
||||
private List<LogisticsDirectivePlan> directivesList;
|
||||
|
||||
}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
package com.nu.modules.biz.plan.logistics.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.nu.entity.LogisticsDirectiveEntity;
|
||||
import com.nu.modules.biz.plan.logistics.entity.LogisticsDirectivePlan;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 后勤服务指令计划
|
||||
* @Author: caolei
|
||||
* @Date: 2026-1-6
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface LogisticsDirectivePlanMapper extends BaseMapper<LogisticsDirectivePlan> {
|
||||
int deleteByIdPhysic(@Param("id") String id);
|
||||
|
||||
int queryTotal(@Param("nuId") String nuId, @Param("elderId") String elderId);
|
||||
|
||||
List<LogisticsDirectivePlan> list(@Param("dto") LogisticsDirectiveEntity logisticsDirectiveEntity);
|
||||
|
||||
}
|
||||
|
|
@ -1,124 +0,0 @@
|
|||
<?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.plan.logistics.mapper.LogisticsDirectivePlanMapper">
|
||||
<delete id="deleteByIdPhysic">
|
||||
delete
|
||||
from nu_biz_nu_logistics_directive_plan
|
||||
where id = #{id}
|
||||
</delete>
|
||||
<select id="queryTotal" resultType="java.lang.Integer">
|
||||
SELECT COUNT(p.id) as total_count
|
||||
FROM nu_biz_nu_logistics_directive_plan p
|
||||
WHERE p.nu_id = #{nuId}
|
||||
AND (
|
||||
-- 1: 每天执行
|
||||
p.cycle_type_id = '1'
|
||||
|
||||
-- 3: 按星期执行
|
||||
OR (p.cycle_type_id = '3' AND p.cycle_value = (
|
||||
CASE DAYOFWEEK(now())
|
||||
WHEN 1 THEN '6'
|
||||
WHEN 2 THEN '0'
|
||||
WHEN 3 THEN '1'
|
||||
WHEN 4 THEN '2'
|
||||
WHEN 5 THEN '3'
|
||||
WHEN 6 THEN '4'
|
||||
WHEN 7 THEN '5'
|
||||
END
|
||||
))
|
||||
|
||||
-- 4: 按日期执行
|
||||
OR (p.cycle_type_id = '4' AND p.cycle_value = DATE_FORMAT(now(), '%d'))
|
||||
|
||||
-- 5: 频次执行
|
||||
OR (p.cycle_type_id = '5' AND (
|
||||
-- 不限次数
|
||||
(p.opt_count = 0
|
||||
AND DATEDIFF(now(), DATE(p.opt_time)) >= 0
|
||||
AND MOD(DATEDIFF(now(), DATE(p.opt_time)), (CAST(p.cycle_value AS UNSIGNED) + 1)) = 0)
|
||||
|
||||
-- 有限次数
|
||||
OR (p.opt_count > 0
|
||||
AND DATEDIFF(now(), DATE(p.opt_time)) >= 0
|
||||
AND MOD(DATEDIFF(now(), DATE(p.opt_time)), (CAST(p.cycle_value AS UNSIGNED) + 1)) = 0
|
||||
AND (DATEDIFF(now(), DATE(p.opt_time)) / (CAST(p.cycle_value AS UNSIGNED) + 1)) < p.opt_count)
|
||||
))
|
||||
)
|
||||
</select>
|
||||
|
||||
<select id="list" resultType="com.nu.modules.biz.plan.logistics.entity.LogisticsDirectivePlan">
|
||||
SELECT
|
||||
plan.id,
|
||||
plan.nu_id,
|
||||
base.nu_name,
|
||||
CASE WHEN plan.iz_package = 'N' THEN directive.category_id ELSE NULL END as category_id,
|
||||
CASE WHEN plan.iz_package = 'N' THEN category.category_name ELSE NULL END as category_name,
|
||||
CASE WHEN plan.iz_package = 'N' THEN directive.type_id ELSE NULL END as type_id,
|
||||
CASE WHEN plan.iz_package = 'N' THEN stype.type_name ELSE NULL END as type_name,
|
||||
plan.directive_id,
|
||||
CASE
|
||||
WHEN plan.iz_package = 'N' THEN directive.directive_name
|
||||
WHEN plan.iz_package = 'Y' THEN package.package_name
|
||||
END as directive_name,
|
||||
plan.cycle_type_id,
|
||||
plan.cycle_value,
|
||||
CASE WHEN plan.iz_package = 'N' THEN directive.immediate_file ELSE NULL END as immediate_file,
|
||||
CASE WHEN plan.iz_package = 'N' THEN directive.immediate_file_focus ELSE NULL END as immediate_file_focus,
|
||||
CASE WHEN plan.iz_package = 'N' THEN directive.preview_file ELSE NULL END as preview_file,
|
||||
CASE WHEN plan.iz_package = 'N' THEN directive.preview_file_small ELSE NULL END as preview_file_small,
|
||||
CASE WHEN plan.iz_package = 'N' THEN directive.mp3_file ELSE NULL END as mp3_file,
|
||||
CASE WHEN plan.iz_package = 'N' THEN directive.mp4_file ELSE NULL END as mp4_file,
|
||||
CASE
|
||||
WHEN plan.iz_package = 'N' THEN directive.service_duration
|
||||
WHEN plan.iz_package = 'Y' THEN CAST(package.total_duration AS CHAR)
|
||||
END as service_duration,
|
||||
CASE
|
||||
WHEN plan.iz_package = 'N' THEN directive.service_content
|
||||
WHEN plan.iz_package = 'Y' THEN package.description
|
||||
END as service_content,
|
||||
plan.positioning,
|
||||
plan.positioning_long,
|
||||
plan.tag_name,
|
||||
plan.start_time,
|
||||
CASE
|
||||
WHEN plan.iz_package = 'N' AND directive.service_duration IS NOT NULL AND directive.service_duration = 0
|
||||
THEN '23:59'
|
||||
WHEN plan.iz_package = 'Y' AND package.total_duration IS NOT NULL AND package.total_duration = 0
|
||||
THEN '23:59'
|
||||
WHEN plan.iz_package = 'N' AND directive.service_duration IS NOT NULL AND directive.service_duration > 0
|
||||
THEN DATE_FORMAT(ADDTIME(STR_TO_DATE(plan.start_time, '%H:%i'),SEC_TO_TIME(directive.service_duration * 60)),
|
||||
'%H:%i')
|
||||
WHEN plan.iz_package = 'Y' AND package.total_duration IS NOT NULL AND package.total_duration > 0
|
||||
THEN DATE_FORMAT(ADDTIME(STR_TO_DATE(plan.start_time, '%H:%i'),SEC_TO_TIME(package.total_duration * 60)),
|
||||
'%H:%i')
|
||||
ELSE NULL
|
||||
END as end_time,
|
||||
plan.create_by,
|
||||
plan.create_time,
|
||||
plan.update_by,
|
||||
plan.update_time,
|
||||
plan.sys_org_code,
|
||||
plan.iz_package
|
||||
FROM nu_biz_nu_logistics_directive_plan plan
|
||||
LEFT JOIN nu_base_info base ON plan.nu_id = base.nu_id
|
||||
LEFT JOIN nu_config_service_directive directive ON plan.iz_package = 'N' AND plan.directive_id = directive.id
|
||||
LEFT JOIN nu_config_directive_package_main package ON plan.iz_package = 'Y' AND plan.directive_id = package.id
|
||||
LEFT JOIN nu_config_service_category category ON directive.category_id = category.id
|
||||
LEFT JOIN nu_config_service_type stype ON directive.type_id = stype.id
|
||||
WHERE 1=1
|
||||
<if test="dto != null and dto.nuId != null and dto.nuId != ''">
|
||||
AND plan.nu_id = #{dto.nuId}
|
||||
</if>
|
||||
<if test="dto != null and dto.queryType != null and dto.queryType != ''">
|
||||
<choose>
|
||||
<when test="dto.queryType == 'service'">
|
||||
AND plan.cycle_type_id != '2'
|
||||
</when>
|
||||
<when test="dto.queryType == 'instant'">
|
||||
AND plan.cycle_type_id = '2'
|
||||
</when>
|
||||
</choose>
|
||||
</if>
|
||||
ORDER BY plan.create_time DESC
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
package com.nu.modules.biz.plan.logistics.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.nu.modules.biz.plan.logistics.entity.LogisticsDirectivePlan;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 后勤服务指令计划
|
||||
* @Author: caolei
|
||||
* @Date: 2026-1-6
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface LogisticsDirectivePlanService extends IService<LogisticsDirectivePlan> {
|
||||
|
||||
int queryTotal(String nuId, String elderId);
|
||||
}
|
||||
|
|
@ -1,142 +0,0 @@
|
|||
package com.nu.modules.biz.plan.logistics.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nu.entity.*;
|
||||
import com.nu.modules.biz.datapool.service.ILogisticsDataPoolService;
|
||||
import com.nu.modules.biz.plan.invoicing.entity.InvoicingDirectivePlan;
|
||||
import com.nu.modules.biz.plan.logistics.entity.LogisticsDirectivePlan;
|
||||
import com.nu.modules.biz.plan.logistics.mapper.LogisticsDirectivePlanMapper;
|
||||
import com.nu.modules.biz.plan.logistics.service.LogisticsDirectivePlanService;
|
||||
import com.nu.modules.config.directivepackage.service.impl.DirectivePackageServiceImpl;
|
||||
import com.nu.modules.logistics.api.ILogisticsDirectivePlanApi;
|
||||
import org.apache.commons.compress.utils.Lists;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 后勤服务指令计划
|
||||
* @Author: caolei
|
||||
* @Date: 2026-1-6
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class LogisticsDirectivePlanServiceImpl extends ServiceImpl<LogisticsDirectivePlanMapper, LogisticsDirectivePlan> implements LogisticsDirectivePlanService, ILogisticsDirectivePlanApi {
|
||||
|
||||
@Autowired
|
||||
private ILogisticsDataPoolService dataPoolServiceImpl;
|
||||
@Autowired
|
||||
private DirectivePackageServiceImpl directivePackageService;
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getPlanList(LogisticsDirectiveEntity logisticsDirectiveEntity) {
|
||||
Map<String, Object> resMap = new HashMap<>();
|
||||
//服务指令计划
|
||||
logisticsDirectiveEntity.setQueryType("service");
|
||||
List<LogisticsDirectivePlan> groupList = baseMapper.list(logisticsDirectiveEntity);
|
||||
if (!CollectionUtils.isEmpty(groupList)) {
|
||||
//将包的指令塞进去(写一个sql效率低)
|
||||
CareDirectivePackageEntity queryParams = new CareDirectivePackageEntity();
|
||||
List<CareDirectivePackageEntity> ids = Lists.newArrayList();
|
||||
groupList.stream().forEach(item -> {
|
||||
CareDirectivePackageEntity d_ = new CareDirectivePackageEntity();
|
||||
if ("Y".equals(item.getIzPackage())) {
|
||||
d_.setId(item.getDirectiveId());
|
||||
ids.add(d_);
|
||||
}
|
||||
});
|
||||
List<CareDirectivePackageEntity> packagelist = directivePackageService.getNcPackagelist(queryParams, ids);
|
||||
if (!CollectionUtils.isEmpty(groupList)) {
|
||||
Map<String, CareDirectivePackageEntity> packageMap = packagelist.stream()
|
||||
.collect(Collectors.toMap(
|
||||
CareDirectivePackageEntity::getId,
|
||||
entity -> entity,
|
||||
(existing, replacement) -> existing
|
||||
));
|
||||
groupList.stream().forEach(item -> {
|
||||
if ("Y".equals(item.getIzPackage())) {
|
||||
CareDirectivePackageEntity packageEntity = packageMap.get(item.getDirectiveId());
|
||||
if (packageEntity != null) {
|
||||
List<DirectiveEntity> directives = packageEntity.getDirectives();
|
||||
// 处理 directives
|
||||
if (CollectionUtils.isEmpty(directives)) {
|
||||
directives = List.of();
|
||||
}
|
||||
item.setDirectivesList(BeanUtil.copyToList(directives, LogisticsDirectivePlan.class));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
resMap.put("serviceList", groupList);//服务指令计划
|
||||
|
||||
//即时指令
|
||||
logisticsDirectiveEntity.setQueryType("instant");
|
||||
List<LogisticsDirectivePlan> instantList = baseMapper.list(logisticsDirectiveEntity);
|
||||
resMap.put("instantList", instantList);//即时指令
|
||||
return resMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LogisticsDirectiveEntity addDirective(LogisticsDirectiveEntity logisticsDirectiveEntity) {
|
||||
LogisticsDirectivePlan logisticsDirectivePlan = new LogisticsDirectivePlan();
|
||||
BeanUtils.copyProperties(logisticsDirectiveEntity, logisticsDirectivePlan);
|
||||
baseMapper.insert(logisticsDirectivePlan);
|
||||
//TODO 增加日志
|
||||
|
||||
//单一指令生成到数据池
|
||||
dataPoolServiceImpl.generateDataPool(logisticsDirectivePlan);
|
||||
BeanUtils.copyProperties(logisticsDirectivePlan, logisticsDirectiveEntity);
|
||||
return logisticsDirectiveEntity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void editDirective(LogisticsDirectiveEntity logisticsDirectiveEntity) {
|
||||
LogisticsDirectivePlan logisticsDirectivePlan = new LogisticsDirectivePlan();
|
||||
BeanUtils.copyProperties(logisticsDirectiveEntity, logisticsDirectivePlan);
|
||||
LogisticsDirectivePlan entity = baseMapper.selectById(logisticsDirectiveEntity.getId());
|
||||
// baseMapper.updateById(logisticsDirectivePlan);
|
||||
baseMapper.deleteByIdPhysic(logisticsDirectiveEntity.getId());
|
||||
baseMapper.insert(logisticsDirectivePlan);
|
||||
//TODO 增加日志
|
||||
//调用方法先删除数据池中的数据,再生成数据池中的数据
|
||||
dataPoolServiceImpl.editDataPool(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteDirective(LogisticsDirectiveEntity logisticsDirectiveEntity) {
|
||||
LogisticsDirectivePlan logisticsDirectivePlan = new LogisticsDirectivePlan();
|
||||
BeanUtils.copyProperties(logisticsDirectiveEntity, logisticsDirectivePlan);
|
||||
String id = logisticsDirectivePlan.getId();
|
||||
//调用方法删除数据池中的数据
|
||||
dataPoolServiceImpl.deleteDataPool(logisticsDirectivePlan);
|
||||
baseMapper.deleteByIdPhysic(id);
|
||||
//TODO 增加日志
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DirectiveOrderEntity> queryImmediatelyOrderList(CareDirectiveEntity dto_) {
|
||||
LogisticsDirectiveEntity dto = new LogisticsDirectiveEntity();
|
||||
dto.setNuId(dto_.getNuId());
|
||||
dto.setQueryType("instant");
|
||||
List<LogisticsDirectivePlan> list = baseMapper.list(dto);
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
return BeanUtil.copyToList(list, DirectiveOrderEntity.class);
|
||||
} else {
|
||||
return List.of();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int queryTotal(String nuId, String elderId) {
|
||||
return baseMapper.queryTotal(nuId, elderId);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,136 +0,0 @@
|
|||
package com.nu.modules.config.canadddirective.controller;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.nu.modules.sysconfig.ISysConfigApi;
|
||||
import com.nu.utils.HttpRequestUtil;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import com.nu.modules.config.canadddirective.entity.CanAddDirective;
|
||||
import com.nu.modules.config.canadddirective.service.ICanAddDirectiveService;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.jeecg.config.JeecgBaseConfig;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
/**
|
||||
* @Description: 可新增指令
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-08-01
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags = "可新增指令")
|
||||
@RestController
|
||||
@RequestMapping("/canadddirective/canAddDirective")
|
||||
@Slf4j
|
||||
public class CanAddDirectiveController extends JeecgController<CanAddDirective, ICanAddDirectiveService> {
|
||||
@Autowired
|
||||
private ICanAddDirectiveService canAddDirectiveService;
|
||||
@Resource
|
||||
private JeecgBaseConfig jeecgBaseConfig;
|
||||
@Autowired
|
||||
private ISysConfigApi sysConfigApi;
|
||||
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param canAddDirective
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "可新增指令-分页列表查询")
|
||||
@ApiOperation(value = "可新增指令-分页列表查询", notes = "可新增指令-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
@DS("ope")
|
||||
public Result<IPage<CanAddDirective>> queryPageList(CanAddDirective canAddDirective,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
// 自定义查询规则
|
||||
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
|
||||
// 自定义多选的查询规则为:LIKE_WITH_OR
|
||||
customeRuleMap.put("orgCode", QueryRuleEnum.LIKE_WITH_OR);
|
||||
QueryWrapper<CanAddDirective> queryWrapper = QueryGenerator.initQueryWrapper(canAddDirective, req.getParameterMap(), customeRuleMap);
|
||||
if (StringUtils.isNotBlank(canAddDirective.getExistDirectiveIds())) {
|
||||
queryWrapper.notIn("directive_id", canAddDirective.getExistDirectiveIds().split(","));
|
||||
}
|
||||
Page<CanAddDirective> page = new Page<CanAddDirective>(pageNo, pageSize);
|
||||
IPage<CanAddDirective> pageList = canAddDirectiveService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param canAddDirective
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
@DS("ope")
|
||||
public ModelAndView exportXls(HttpServletRequest request, CanAddDirective canAddDirective) {
|
||||
String title = "差异指令";
|
||||
QueryWrapper<CanAddDirective> queryWrapper = new QueryWrapper<CanAddDirective>();
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
if (StringUtils.isNotBlank(canAddDirective.getOrgCode())) {
|
||||
queryWrapper.eq("org_code", canAddDirective.getOrgCode());
|
||||
}
|
||||
if (StringUtils.isNotBlank(canAddDirective.getExistDirectiveIds())) {
|
||||
queryWrapper.notIn("directive_id", canAddDirective.getExistDirectiveIds().split(","));
|
||||
}
|
||||
List<CanAddDirective> exportList = service.list(queryWrapper);
|
||||
//获取机构编码及名称
|
||||
JSONObject opeOpenUrl = sysConfigApi.getByKeyByDS("master", "ope_open_url");
|
||||
String opeApiAddress = opeOpenUrl.getString("configValue");
|
||||
if (opeApiAddress.endsWith("/")) {
|
||||
opeApiAddress = opeApiAddress.substring(0, opeApiAddress.length() - 1);
|
||||
}
|
||||
String allOrgCodeAndName = opeApiAddress + "/api/baseInfo/getOrgCodeAndName";
|
||||
JSONObject result = null;
|
||||
try {
|
||||
String res = HttpRequestUtil.doGet(allOrgCodeAndName, HttpRequestUtil.createDefaultHeaders());
|
||||
JSONObject jsonResponse = JSON.parseObject(res);
|
||||
result = jsonResponse.getJSONObject("result");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (result != null) {
|
||||
for (int i = 0; i < exportList.size(); i++) {
|
||||
exportList.get(i).setOrgCode(result.getString(exportList.get(i).getOrgCode()));
|
||||
}
|
||||
}
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||
mv.addObject(NormalExcelConstants.FILE_NAME, title);
|
||||
mv.addObject(NormalExcelConstants.CLASS, CanAddDirective.class);
|
||||
ExportParams exportParams = new ExportParams(title + "报表", "导出人:" + sysUser.getRealname(), title);
|
||||
exportParams.setImageBasePath(jeecgBaseConfig.getPath().getUpload());
|
||||
mv.addObject(NormalExcelConstants.PARAMS, exportParams);
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, exportList);
|
||||
return mv;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,149 +0,0 @@
|
|||
package com.nu.modules.config.canadddirective.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @Description: 可新增指令
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-08-01
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("nu_can_add_directive")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "nu_can_add_directive对象", description = "可新增指令")
|
||||
public class CanAddDirective implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private java.lang.String id;
|
||||
/**
|
||||
* 指令ID
|
||||
*/
|
||||
// @Excel(name = "指令ID", width = 15)
|
||||
@ApiModelProperty(value = "指令ID")
|
||||
private java.lang.String directiveId;
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
@Excel(name = "所属机构", width = 50)
|
||||
@Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "org_code")
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private java.lang.String orgCode;
|
||||
/**
|
||||
* 分类标签
|
||||
*/
|
||||
@Excel(name = "分类标签", width = 20)
|
||||
@ApiModelProperty(value = "分类标签")
|
||||
private java.lang.String instructionTag;
|
||||
/**
|
||||
* 服务类别
|
||||
*/
|
||||
@Excel(name = "服务类别", width = 20)
|
||||
@ApiModelProperty(value = "服务类别")
|
||||
private java.lang.String category;
|
||||
/**
|
||||
* 服务类型
|
||||
*/
|
||||
@Excel(name = "服务类型", width = 20)
|
||||
@ApiModelProperty(value = "服务类型")
|
||||
private java.lang.String type;
|
||||
/**
|
||||
* 服务指令
|
||||
*/
|
||||
@Excel(name = "服务指令", width = 40)
|
||||
@ApiModelProperty(value = "服务指令")
|
||||
private java.lang.String directiveName;
|
||||
/**
|
||||
* 指令类型 1日常护理 2周期护理 3即时护理
|
||||
*/
|
||||
@Excel(name = "指令类型", width = 20)
|
||||
@ApiModelProperty(value = "指令类型")
|
||||
private java.lang.String cycleType;
|
||||
/**
|
||||
* 基础价格
|
||||
*/
|
||||
@Excel(name = "基础价格(元)", width = 20)
|
||||
@ApiModelProperty(value = "基础价格")
|
||||
private java.math.BigDecimal tollPrice;
|
||||
/**
|
||||
* 提成价格
|
||||
*/
|
||||
@Excel(name = "提成价格(元)", width = 20)
|
||||
@ApiModelProperty(value = "提成价格")
|
||||
private java.math.BigDecimal comPrice;
|
||||
/**
|
||||
* 服务描述
|
||||
*/
|
||||
@Excel(name = "服务描述", width = 50)
|
||||
@ApiModelProperty(value = "服务描述")
|
||||
private java.lang.String serviceContent;
|
||||
/**
|
||||
* 服务时长(分钟)
|
||||
*/
|
||||
@Excel(name = "服务时长(分钟)", width = 18)
|
||||
@ApiModelProperty(value = "服务时长(分钟)")
|
||||
private java.lang.String serviceDuration;
|
||||
/**
|
||||
* 体型标签
|
||||
*/
|
||||
@ApiModelProperty(value = "体型标签")
|
||||
private java.lang.String bodyTags;
|
||||
/**
|
||||
* 情绪标签
|
||||
*/
|
||||
@ApiModelProperty(value = "情绪标签")
|
||||
private java.lang.String emotionTags;
|
||||
/**
|
||||
* 是否删除 0未删除 1删除
|
||||
*/
|
||||
@ApiModelProperty(value = "是否删除 0未删除 1删除")
|
||||
@TableLogic
|
||||
private java.lang.String delFlag;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private java.lang.String createBy;
|
||||
/**
|
||||
* 创建日期
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private java.util.Date createTime;
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private java.lang.String updateBy;
|
||||
/**
|
||||
* 更新日期
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新日期")
|
||||
private java.util.Date updateTime;
|
||||
|
||||
/**
|
||||
* 已存在服务指令ids 逗号拼接
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String existDirectiveIds;
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
package com.nu.modules.config.canadddirective.mapper;
|
||||
|
||||
import com.nu.modules.config.canadddirective.entity.CanAddDirective;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 可新增指令
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-08-01
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface CanAddDirectiveMapper extends BaseMapper<CanAddDirective> {
|
||||
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
<?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.config.canadddirective.mapper.CanAddDirectiveMapper">
|
||||
|
||||
</mapper>
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
package com.nu.modules.config.canadddirective.service;
|
||||
|
||||
import com.nu.modules.config.canadddirective.entity.CanAddDirective;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: 可新增指令
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-08-01
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ICanAddDirectiveService extends IService<CanAddDirective> {
|
||||
|
||||
}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
package com.nu.modules.config.canadddirective.service.impl;
|
||||
|
||||
import com.nu.modules.config.canadddirective.entity.CanAddDirective;
|
||||
import com.nu.modules.config.canadddirective.mapper.CanAddDirectiveMapper;
|
||||
import com.nu.modules.config.canadddirective.service.ICanAddDirectiveService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: 可新增指令
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-08-01
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class CanAddDirectiveServiceImpl extends ServiceImpl<CanAddDirectiveMapper, CanAddDirective> implements ICanAddDirectiveService {
|
||||
|
||||
}
|
||||
|
|
@ -1,172 +0,0 @@
|
|||
package com.nu.modules.config.customercaretemp.controller;
|
||||
|
||||
import java.util.Map;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.nu.modules.config.customercaretemp.service.INuBizCustomerCareTempInfoService;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import com.nu.modules.config.customercaretemp.entity.NuBizCustomerCareTempMain;
|
||||
import com.nu.modules.config.customercaretemp.service.INuBizCustomerCareTempMainService;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令模版主表
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-11-12
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags = "服务指令模版主表")
|
||||
@RestController
|
||||
@RequestMapping("/services/nuBizCustomerCareTempMain")
|
||||
@Slf4j
|
||||
public class NuBizCustomerCareTempMainController extends JeecgController<NuBizCustomerCareTempMain, INuBizCustomerCareTempMainService> {
|
||||
@Autowired
|
||||
private INuBizCustomerCareTempMainService nuBizCustomerCareTempMainService;
|
||||
@Autowired
|
||||
private INuBizCustomerCareTempInfoService nuBizCustomerCareTempInfoService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param nuBizCustomerCareTempMain
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "服务指令模版主表-分页列表查询")
|
||||
@ApiOperation(value = "服务指令模版主表-分页列表查询", notes = "服务指令模版主表-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<NuBizCustomerCareTempMain>> queryPageList(NuBizCustomerCareTempMain nuBizCustomerCareTempMain,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<NuBizCustomerCareTempMain> queryWrapper = QueryGenerator.initQueryWrapper(nuBizCustomerCareTempMain, req.getParameterMap());
|
||||
Page<NuBizCustomerCareTempMain> page = new Page<NuBizCustomerCareTempMain>(pageNo, pageSize);
|
||||
IPage<NuBizCustomerCareTempMain> pageList = nuBizCustomerCareTempMainService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param nuBizCustomerCareTempMain
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "服务指令模版主表-添加")
|
||||
@ApiOperation(value = "服务指令模版主表-添加", notes = "服务指令模版主表-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody NuBizCustomerCareTempMain nuBizCustomerCareTempMain) {
|
||||
nuBizCustomerCareTempMainService.save(nuBizCustomerCareTempMain);
|
||||
//全量新增
|
||||
if (nuBizCustomerCareTempMain.getCustomerCareTempInfoList() != null && nuBizCustomerCareTempMain.getCustomerCareTempInfoList().size() > 0) {
|
||||
nuBizCustomerCareTempMain.getCustomerCareTempInfoList().forEach(item -> {
|
||||
item.setPkId(nuBizCustomerCareTempMain.getId());
|
||||
});
|
||||
nuBizCustomerCareTempInfoService.saveBatch(nuBizCustomerCareTempMain.getCustomerCareTempInfoList());
|
||||
}
|
||||
return Result.OK("保存成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param nuBizCustomerCareTempMain
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "服务指令模版主表-编辑")
|
||||
@ApiOperation(value = "服务指令模版主表-编辑", notes = "服务指令模版主表-编辑")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody NuBizCustomerCareTempMain nuBizCustomerCareTempMain) {
|
||||
nuBizCustomerCareTempMainService.updateById(nuBizCustomerCareTempMain);
|
||||
//删除历史数据
|
||||
nuBizCustomerCareTempInfoService.deletePhysics(nuBizCustomerCareTempMain.getId());
|
||||
//全量新增
|
||||
nuBizCustomerCareTempInfoService.saveBatch(nuBizCustomerCareTempMain.getCustomerCareTempInfoList());
|
||||
return Result.OK("保存成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "服务指令模版主表-通过id删除")
|
||||
@ApiOperation(value = "服务指令模版主表-通过id删除", notes = "服务指令模版主表-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
nuBizCustomerCareTempMainService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "服务指令模版主表-通过id查询")
|
||||
@ApiOperation(value = "服务指令模版主表-通过id查询", notes = "服务指令模版主表-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<NuBizCustomerCareTempMain> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
NuBizCustomerCareTempMain nuBizCustomerCareTempMain = nuBizCustomerCareTempMainService.getById(id);
|
||||
if (nuBizCustomerCareTempMain == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(nuBizCustomerCareTempMain);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param nuBizCustomerCareTempMain
|
||||
*/
|
||||
@RequiresPermissions("customercaretemp:nu_biz_customer_care_temp_main:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, NuBizCustomerCareTempMain nuBizCustomerCareTempMain) {
|
||||
return super.exportXls(request, nuBizCustomerCareTempMain, NuBizCustomerCareTempMain.class, "服务指令模版主表");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("customercaretemp:nu_biz_customer_care_temp_main:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, NuBizCustomerCareTempMain.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取服务指令计划表格数据
|
||||
*
|
||||
* @param pkId
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "护理单元客户配置服务指令-分页列表查询", notes = "护理单元客户配置服务指令-分页列表查询")
|
||||
@GetMapping(value = "/getNclist")
|
||||
public Result<Map<String, Object>> getNclist(@RequestParam("pkId") String pkId) {
|
||||
Map<String, Object> pageList = nuBizCustomerCareTempInfoService.getNclist(pkId);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,164 +0,0 @@
|
|||
package com.nu.modules.config.customercaretemp.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令模版子表
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-11-12
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("nu_biz_customer_care_temp_info")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="nu_biz_customer_care_temp_info对象", description="服务指令模版子表")
|
||||
public class NuBizCustomerCareTempInfo implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private java.lang.String id;
|
||||
/**主表id nu_biz_customer_care_temp_main.id*/
|
||||
@Excel(name = "主表id nu_biz_customer_care_temp_main.id", width = 15)
|
||||
@ApiModelProperty(value = "主表id nu_biz_customer_care_temp_main.id")
|
||||
private java.lang.String pkId;
|
||||
/**服务类别id*/
|
||||
@Excel(name = "服务类别id", width = 15)
|
||||
@ApiModelProperty(value = "服务类别id")
|
||||
private java.lang.String categoryId;
|
||||
/**服务类别名称*/
|
||||
@Excel(name = "服务类别名称", width = 15)
|
||||
@ApiModelProperty(value = "服务类别名称")
|
||||
private java.lang.String categoryName;
|
||||
/**服务类型id*/
|
||||
@Excel(name = "服务类型id", width = 15)
|
||||
@ApiModelProperty(value = "服务类型id")
|
||||
private java.lang.String typeId;
|
||||
/**服务类型名称*/
|
||||
@Excel(name = "服务类型名称", width = 15)
|
||||
@ApiModelProperty(value = "服务类型名称")
|
||||
private java.lang.String typeName;
|
||||
/**服务指令id*/
|
||||
@Excel(name = "服务指令id", width = 15)
|
||||
@ApiModelProperty(value = "服务指令id")
|
||||
private java.lang.String directiveId;
|
||||
/**服务指令名称*/
|
||||
@Excel(name = "服务指令名称", width = 15)
|
||||
@ApiModelProperty(value = "服务指令名称")
|
||||
private java.lang.String directiveName;
|
||||
/**服务指令图片大图*/
|
||||
@Excel(name = "服务指令图片大图", width = 15)
|
||||
@ApiModelProperty(value = "服务指令图片大图")
|
||||
private java.lang.String previewFile;
|
||||
/**服务指令图片小图*/
|
||||
@Excel(name = "服务指令图片小图", width = 15)
|
||||
@ApiModelProperty(value = "服务指令图片小图")
|
||||
private java.lang.String previewFileSmall;
|
||||
/**即时指令图片*/
|
||||
@Excel(name = "即时指令图片", width = 15)
|
||||
@ApiModelProperty(value = "即时指令图片")
|
||||
private java.lang.String immediateFile;
|
||||
/**即时指令焦点图片*/
|
||||
@Excel(name = "即时指令焦点图片", width = 15)
|
||||
@ApiModelProperty(value = "即时指令焦点图片")
|
||||
private java.lang.String immediateFileFocus;
|
||||
/**指令类型ID*/
|
||||
@Excel(name = "指令类型ID", width = 15)
|
||||
@ApiModelProperty(value = "指令类型ID")
|
||||
private java.lang.String cycleTypeId;
|
||||
/**指令类型*/
|
||||
@Excel(name = "指令类型", width = 15)
|
||||
@ApiModelProperty(value = "指令类型")
|
||||
private java.lang.String cycleType;
|
||||
/**周期值*/
|
||||
@Excel(name = "周期值", width = 15)
|
||||
@ApiModelProperty(value = "周期值")
|
||||
private java.lang.String cycleValue;
|
||||
/**服务时长(分钟)*/
|
||||
@Excel(name = "服务时长(分钟)", width = 15)
|
||||
@ApiModelProperty(value = "服务时长(分钟)")
|
||||
private java.lang.String serviceDuration;
|
||||
/**横向定位*/
|
||||
@Excel(name = "横向定位", width = 15)
|
||||
@ApiModelProperty(value = "横向定位")
|
||||
private java.lang.String positioning;
|
||||
/**纵向定位*/
|
||||
@Excel(name = "纵向定位", width = 15)
|
||||
@ApiModelProperty(value = "纵向定位")
|
||||
private java.lang.String positioningLong;
|
||||
/**服务标签名称*/
|
||||
@Excel(name = "服务标签名称", width = 15)
|
||||
@ApiModelProperty(value = "服务标签名称")
|
||||
private java.lang.String tagName;
|
||||
/**开始时间*/
|
||||
@Excel(name = "开始时间", width = 15)
|
||||
@ApiModelProperty(value = "开始时间")
|
||||
private java.lang.String startTime;
|
||||
/**结束时间*/
|
||||
@Excel(name = "结束时间", width = 15)
|
||||
@ApiModelProperty(value = "结束时间")
|
||||
private java.lang.String endTime;
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private java.lang.String createBy;
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private java.util.Date createTime;
|
||||
/**更新人*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private java.lang.String updateBy;
|
||||
/**更新日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新日期")
|
||||
private java.util.Date updateTime;
|
||||
/**所属部门*/
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private java.lang.String sysOrgCode;
|
||||
/**是否是服务指令包 0否 1是*/
|
||||
@Excel(name = "是否是服务指令包 0否 1是", width = 15)
|
||||
@ApiModelProperty(value = "是否是服务指令包 0否 1是")
|
||||
private java.lang.String izPackage;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "指令包ID")
|
||||
private java.lang.String packageId;
|
||||
|
||||
/**服务指令列表**/
|
||||
@TableField(exist = false)
|
||||
private List<NuBizCustomerCareTempInfo> serverList;
|
||||
/**服务包中的服务列表**/
|
||||
@TableField(exist = false)
|
||||
private List<NuBizCustomerCareTempInfo> directivesList;
|
||||
/**即时指令图标*/
|
||||
@ApiModelProperty(value = "即时指令图标")
|
||||
@TableField(exist = false)
|
||||
private java.lang.String netImmediateFile;
|
||||
/**即时指令焦点图标*/
|
||||
@ApiModelProperty(value = "即时指令图标")
|
||||
@TableField(exist = false)
|
||||
private java.lang.String netImmediateFileFocus;
|
||||
/**服务指令图片大图*/
|
||||
@ApiModelProperty(value = "服务指令图片大图")
|
||||
@TableField(exist = false)
|
||||
private java.lang.String netPreviewFile;
|
||||
/**服务指令图片小图*/
|
||||
@ApiModelProperty(value = "服务指令图片小图")
|
||||
@TableField(exist = false)
|
||||
private java.lang.String netPreviewFileSmall;
|
||||
}
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
package com.nu.modules.config.customercaretemp.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令模版主表
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-11-12
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("nu_biz_customer_care_temp_main")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="nu_biz_customer_care_temp_main对象", description="服务指令模版主表")
|
||||
public class NuBizCustomerCareTempMain implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private java.lang.String id;
|
||||
/**名称*/
|
||||
@Excel(name = "名称", width = 15)
|
||||
@ApiModelProperty(value = "名称")
|
||||
private java.lang.String name;
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
@Dict(dictTable = "sys_user",dicCode = "username",dicText = "realname")
|
||||
private java.lang.String createBy;
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private java.util.Date createTime;
|
||||
/**更新人*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private java.lang.String updateBy;
|
||||
/**更新日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新日期")
|
||||
private java.util.Date updateTime;
|
||||
/**是否删除 0未删除 1删除*/
|
||||
@Excel(name = "是否删除 0未删除 1删除", width = 15)
|
||||
@ApiModelProperty(value = "是否删除 0未删除 1删除")
|
||||
@TableLogic
|
||||
private java.lang.String delFlag;
|
||||
|
||||
//服务指令编排模板子表数据
|
||||
@TableField(exist = false)
|
||||
private List<NuBizCustomerCareTempInfo> customerCareTempInfoList;
|
||||
}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
package com.nu.modules.config.customercaretemp.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.nu.modules.config.customercaretemp.entity.NuBizCustomerCareTempInfo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令模版子表
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-11-12
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface NuBizCustomerCareTempInfoMapper extends BaseMapper<NuBizCustomerCareTempInfo> {
|
||||
|
||||
List<NuBizCustomerCareTempInfo> getNcDirectiveList(@Param("params") NuBizCustomerCareTempInfo packageDirective);
|
||||
|
||||
void deletePhysics(@Param("pkId") String pkId);
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
package com.nu.modules.config.customercaretemp.mapper;
|
||||
|
||||
import com.nu.modules.config.customercaretemp.entity.NuBizCustomerCareTempMain;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令模版主表
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-11-12
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface NuBizCustomerCareTempMainMapper extends BaseMapper<NuBizCustomerCareTempMain> {
|
||||
|
||||
}
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
<?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.config.customercaretemp.mapper.NuBizCustomerCareTempInfoMapper">
|
||||
<delete id="deletePhysics">
|
||||
delete from nu_biz_customer_care_temp_info where pk_id = #{pkId}
|
||||
</delete>
|
||||
|
||||
<select id="getNcDirectiveList" resultType="com.nu.modules.config.customercaretemp.entity.NuBizCustomerCareTempInfo">
|
||||
select a.package_id,b.*,
|
||||
c.category_name AS category_name,
|
||||
d.type_name AS type_name,
|
||||
e.instruction_name AS instruction_name
|
||||
from nu_config_directive_package_item a
|
||||
left join nu_config_service_directive b on a.directive_id = b.id
|
||||
left join nu_config_service_category c on b.category_id = c.id
|
||||
left join nu_config_service_type d on b.type_id = d.id
|
||||
left join nu_config_service_instruction_tag e on b.instruction_tag_id = e.id
|
||||
<where>
|
||||
<if test="params.packageId != null and params.packageId != ''">
|
||||
AND a.package_id = #{params.packageId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
<?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.config.customercaretemp.mapper.NuBizCustomerCareTempMainMapper">
|
||||
|
||||
</mapper>
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
package com.nu.modules.config.customercaretemp.service;
|
||||
|
||||
import com.nu.modules.config.customercaretemp.entity.NuBizCustomerCareTempInfo;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令模版子表
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-11-12
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface INuBizCustomerCareTempInfoService extends IService<NuBizCustomerCareTempInfo> {
|
||||
Map<String, Object> getNclist(String pkId);
|
||||
|
||||
void deletePhysics(String pkId);
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
package com.nu.modules.config.customercaretemp.service;
|
||||
|
||||
import com.nu.modules.config.customercaretemp.entity.NuBizCustomerCareTempMain;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令模版主表
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-11-12
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface INuBizCustomerCareTempMainService extends IService<NuBizCustomerCareTempMain> {
|
||||
|
||||
}
|
||||
|
|
@ -1,120 +0,0 @@
|
|||
package com.nu.modules.config.customercaretemp.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.nu.modules.config.customercaretemp.entity.NuBizCustomerCareTempInfo;
|
||||
import com.nu.modules.config.customercaretemp.mapper.NuBizCustomerCareTempInfoMapper;
|
||||
import com.nu.modules.config.customercaretemp.service.INuBizCustomerCareTempInfoService;
|
||||
import com.nu.modules.sysconfig.ISysConfigApi;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令模版子表
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-11-12
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class NuBizCustomerCareTempInfoServiceImpl extends ServiceImpl<NuBizCustomerCareTempInfoMapper, NuBizCustomerCareTempInfo> implements INuBizCustomerCareTempInfoService {
|
||||
|
||||
@Autowired
|
||||
private ISysConfigApi sysConfigApi;
|
||||
//图片网络地址
|
||||
private String serverNetUrl;
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getNclist(String pkId) {
|
||||
Map<String, Object> resMap = new HashMap<>();
|
||||
//服务指令计划
|
||||
QueryWrapper<NuBizCustomerCareTempInfo> qw = new QueryWrapper<>();
|
||||
qw.eq( "pk_id", pkId);
|
||||
List<NuBizCustomerCareTempInfo> groupList = baseMapper.selectList(qw);
|
||||
|
||||
for (NuBizCustomerCareTempInfo par : groupList) {
|
||||
if (par.getIzPackage().equals("1")) {
|
||||
String directiveId = par.getDirectiveId();
|
||||
if (directiveId != null && !directiveId.equals("")) {
|
||||
NuBizCustomerCareTempInfo packageDirective = new NuBizCustomerCareTempInfo();
|
||||
packageDirective.setPackageId(directiveId);
|
||||
List<NuBizCustomerCareTempInfo> pdList = baseMapper.getNcDirectiveList(packageDirective);
|
||||
for (NuBizCustomerCareTempInfo pd : pdList) {
|
||||
getNetImages(pd);
|
||||
}
|
||||
par.setDirectivesList(pdList);
|
||||
}
|
||||
} else {
|
||||
getNetImages(par);
|
||||
}
|
||||
}
|
||||
|
||||
resMap.put("serviceList", groupList);//服务指令计划
|
||||
return resMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deletePhysics(String pkId) {
|
||||
baseMapper.deletePhysics(pkId);
|
||||
}
|
||||
|
||||
private NuBizCustomerCareTempInfo getNetImages(NuBizCustomerCareTempInfo par) {
|
||||
if (par.getImmediateFile() != null && !par.getImmediateFile().equals("")) {
|
||||
String immediateFile = getImageNetUrl(par.getImmediateFile());
|
||||
par.setNetImmediateFile(immediateFile);
|
||||
} else {
|
||||
par.setImmediateFile("");
|
||||
par.setNetImmediateFile("");
|
||||
}
|
||||
if (par.getImmediateFileFocus() != null && !par.getImmediateFileFocus().equals("")) {
|
||||
String immediateFileFocus = getImageNetUrl(par.getImmediateFileFocus());
|
||||
par.setNetImmediateFileFocus(immediateFileFocus);
|
||||
} else {
|
||||
par.setImmediateFileFocus("");
|
||||
par.setNetImmediateFileFocus("");
|
||||
}
|
||||
if (par.getPreviewFile() != null && !par.getPreviewFile().equals("")) {
|
||||
String previewFile = getImageNetUrl(par.getPreviewFile());
|
||||
par.setNetPreviewFile(previewFile);
|
||||
} else {
|
||||
par.setPreviewFile("");
|
||||
par.setNetPreviewFile("");
|
||||
}
|
||||
if (par.getPreviewFileSmall() != null && !par.getPreviewFileSmall().equals("")) {
|
||||
String previewFileSmall = getImageNetUrl(par.getPreviewFileSmall());
|
||||
par.setNetPreviewFileSmall(previewFileSmall);
|
||||
} else {
|
||||
par.setPreviewFileSmall("");
|
||||
par.setNetPreviewFileSmall("");
|
||||
}
|
||||
return par;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取管理平台静态资源路径
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private void getOpeMediaAddress() {
|
||||
if (serverNetUrl == null || serverNetUrl.equals("")) {
|
||||
JSONObject json = sysConfigApi.getByKey("ope_media_address");
|
||||
if (json != null) {
|
||||
String configValue = json.getString("configValue");
|
||||
if (!configValue.endsWith("/")) {
|
||||
configValue += "/";
|
||||
}
|
||||
serverNetUrl = configValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private String getImageNetUrl(String imageUrl) {
|
||||
getOpeMediaAddress();
|
||||
return serverNetUrl + imageUrl;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
package com.nu.modules.config.customercaretemp.service.impl;
|
||||
|
||||
import com.nu.modules.config.customercaretemp.entity.NuBizCustomerCareTempMain;
|
||||
import com.nu.modules.config.customercaretemp.mapper.NuBizCustomerCareTempMainMapper;
|
||||
import com.nu.modules.config.customercaretemp.service.INuBizCustomerCareTempMainService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令模版主表
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-11-12
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class NuBizCustomerCareTempMainServiceImpl extends ServiceImpl<NuBizCustomerCareTempMainMapper, NuBizCustomerCareTempMain> implements INuBizCustomerCareTempMainService {
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue