Compare commits
No commits in common. "eaad08e8afdafc326c586a12b1e4d203be71712b" and "357dc98f8cbc44e0deedd7a4e5e2c2da904f520c" have entirely different histories.
eaad08e8af
...
357dc98f8c
|
|
@ -256,7 +256,7 @@
|
||||||
start_time,
|
start_time,
|
||||||
end_time,
|
end_time,
|
||||||
iz_start
|
iz_start
|
||||||
from nu_biz_nu_logistics_directive_order
|
from nu_biz_nu_care_directive_order
|
||||||
where pool_id = #{id}
|
where pool_id = #{id}
|
||||||
AND iz_start = #{izStart}
|
AND iz_start = #{izStart}
|
||||||
</select>
|
</select>
|
||||||
|
|
@ -264,12 +264,12 @@
|
||||||
<update id="addOrdersLog">
|
<update id="addOrdersLog">
|
||||||
insert into ${tableName}
|
insert into ${tableName}
|
||||||
select a.*,#{remarks}
|
select a.*,#{remarks}
|
||||||
from nu_biz_nu_logistics_directive_order a
|
from nu_biz_nu_care_directive_order a
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<update id="deleteOrders">
|
<update id="deleteOrders">
|
||||||
delete from nu_biz_nu_logistics_directive_order
|
delete from nu_biz_nu_care_directive_order
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,10 @@ import java.util.List;
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class LogisticsDataPoolServiceImpl extends ServiceImpl<LogisticsDataPoolMapper, LogisticsDataPool> implements ILogisticsDataPoolService {
|
public class LogisticsDataPoolServiceImpl extends ServiceImpl<LogisticsDataPoolMapper, LogisticsDataPool> implements ILogisticsDataPoolService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysConfigApi sysConfigApi;
|
||||||
|
private String serverNetUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量生成数据池
|
* 批量生成数据池
|
||||||
*/
|
*/
|
||||||
|
|
@ -83,8 +87,7 @@ public class LogisticsDataPoolServiceImpl extends ServiceImpl<LogisticsDataPoolM
|
||||||
if(typeId.equals("2")){
|
if(typeId.equals("2")){
|
||||||
//周期,先判断是星期还是月份,再判断当前时间是否命中周期
|
//周期,先判断是星期还是月份,再判断当前时间是否命中周期
|
||||||
String cycleValue = dataPool.getCycleValue();
|
String cycleValue = dataPool.getCycleValue();
|
||||||
String[] values = cycleValue.split(",");
|
if(cycleValue.length()>1){
|
||||||
if(values[0].length()>1){
|
|
||||||
//月周期
|
//月周期
|
||||||
addMonthDay(dataPool);
|
addMonthDay(dataPool);
|
||||||
}else{
|
}else{
|
||||||
|
|
@ -110,13 +113,10 @@ public class LogisticsDataPoolServiceImpl extends ServiceImpl<LogisticsDataPoolM
|
||||||
*/
|
*/
|
||||||
private void addWeekDay(LogisticsDataPool dataPool){
|
private void addWeekDay(LogisticsDataPool dataPool){
|
||||||
String cycleValue = dataPool.getCycleValue();
|
String cycleValue = dataPool.getCycleValue();
|
||||||
String[] values = cycleValue.split(",");
|
|
||||||
for(int i=0;i<values.length;i++){
|
|
||||||
String value = values[i];
|
|
||||||
Calendar calendar = Calendar.getInstance();
|
Calendar calendar = Calendar.getInstance();
|
||||||
int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK); //1周日 2周一 3周二 4周三 5周四 6周五 7周六
|
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 %
|
// cycleValue 存js的星期 0周一 1周二 2周三 3周四 4周五 5周六 6周日 js +2 2 3 4 5 6 7 8 /7 %
|
||||||
Integer cv = Integer.valueOf(value);
|
Integer cv = Integer.valueOf(cycleValue);
|
||||||
//处理js星期,使其能和java的星期进行比较
|
//处理js星期,使其能和java的星期进行比较
|
||||||
cv = cv + 2;
|
cv = cv + 2;
|
||||||
if(cv-7>0){
|
if(cv-7>0){
|
||||||
|
|
@ -129,26 +129,22 @@ public class LogisticsDataPoolServiceImpl extends ServiceImpl<LogisticsDataPoolM
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 月周期指令生成数据池子表(非包)
|
* 月周期指令生成数据池子表(非包)
|
||||||
*/
|
*/
|
||||||
private void addMonthDay(LogisticsDataPool dataPool){
|
private void addMonthDay(LogisticsDataPool dataPool){
|
||||||
String cycleValue = dataPool.getCycleValue();
|
String cycleValue = dataPool.getCycleValue();
|
||||||
String[] values = cycleValue.split(",");
|
|
||||||
for(int i=0;i<values.length;i++){
|
|
||||||
String value = values[i];
|
|
||||||
Calendar calendar = Calendar.getInstance();
|
Calendar calendar = Calendar.getInstance();
|
||||||
int dayOfMonth = calendar.get(Calendar.DAY_OF_MONTH);
|
int dayOfMonth = calendar.get(Calendar.DAY_OF_MONTH);
|
||||||
Integer cv = Integer.valueOf(value);
|
Integer cv = Integer.valueOf(cycleValue);
|
||||||
//计划执行月中的几号是当天,则入指令池
|
//计划执行月中的几号是当天,则入指令池
|
||||||
if(dayOfMonth == cv){
|
if(dayOfMonth == cv){
|
||||||
//入指令池主表
|
//入指令池主表
|
||||||
this.save(dataPool);
|
this.save(dataPool);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 单一指令生成到数据池
|
* 单一指令生成到数据池
|
||||||
|
|
@ -249,7 +245,7 @@ public class LogisticsDataPoolServiceImpl extends ServiceImpl<LogisticsDataPoolM
|
||||||
* 创建工单日志表
|
* 创建工单日志表
|
||||||
*/
|
*/
|
||||||
private void addOrdersLog(String dateStr, LogisticsDataPool dataPool){
|
private void addOrdersLog(String dateStr, LogisticsDataPool dataPool){
|
||||||
String tableName = "nu_biz_nu_logistics_directive_order_log_"+dateStr.substring(2, 4)+dateStr.substring(5, 7);
|
String tableName = "nu_biz_nu_care_directive_order_log_"+dateStr.substring(2, 4)+dateStr.substring(5, 7);
|
||||||
dataPool.setTableName(tableName);
|
dataPool.setTableName(tableName);
|
||||||
baseMapper.createOrdersLog(dataPool);//创建日志主表
|
baseMapper.createOrdersLog(dataPool);//创建日志主表
|
||||||
dataPool.setRemarks("计划删除,删除未开始工单");
|
dataPool.setRemarks("计划删除,删除未开始工单");
|
||||||
|
|
@ -275,7 +271,7 @@ public class LogisticsDataPoolServiceImpl extends ServiceImpl<LogisticsDataPoolM
|
||||||
* 创建日志表
|
* 创建日志表
|
||||||
*/
|
*/
|
||||||
private void addDataPoolLog(String dateStr,String id){
|
private void addDataPoolLog(String dateStr,String id){
|
||||||
String tableName = "nu_biz_nu_logistics_directive_data_pool_log_"+dateStr.substring(2, 4)+dateStr.substring(5, 7);
|
String tableName = "nu_biz_nu_care_directive_data_pool_log_"+dateStr.substring(2, 4)+dateStr.substring(5, 7);
|
||||||
LogisticsDataPool dataPool = new LogisticsDataPool();
|
LogisticsDataPool dataPool = new LogisticsDataPool();
|
||||||
dataPool.setTableName(tableName);
|
dataPool.setTableName(tableName);
|
||||||
baseMapper.createDataPoolLog(dataPool);//创建日志主表
|
baseMapper.createDataPoolLog(dataPool);//创建日志主表
|
||||||
|
|
@ -303,7 +299,7 @@ public class LogisticsDataPoolServiceImpl extends ServiceImpl<LogisticsDataPoolM
|
||||||
* 创建日志表
|
* 创建日志表
|
||||||
*/
|
*/
|
||||||
private void addDataPoolLogByClean(String dateStr){
|
private void addDataPoolLogByClean(String dateStr){
|
||||||
String tableName = "nu_biz_nu_logistics_directive_data_pool_log_"+dateStr.substring(2, 4)+dateStr.substring(5, 7);
|
String tableName = "nu_biz_nu_care_directive_data_pool_log_"+dateStr.substring(2, 4)+dateStr.substring(5, 7);
|
||||||
LogisticsDataPool dataPool = new LogisticsDataPool();
|
LogisticsDataPool dataPool = new LogisticsDataPool();
|
||||||
dataPool.setTableName(tableName);
|
dataPool.setTableName(tableName);
|
||||||
baseMapper.createDataPoolLog(dataPool);//创建日志主表
|
baseMapper.createDataPoolLog(dataPool);//创建日志主表
|
||||||
|
|
@ -341,4 +337,26 @@ public class LogisticsDataPoolServiceImpl extends ServiceImpl<LogisticsDataPoolM
|
||||||
return Result.OK();
|
return Result.OK();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取管理平台静态资源路径
|
||||||
|
*
|
||||||
|
* @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,155 +0,0 @@
|
||||||
package com.nu.modules.biz.logistics.order.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 lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 后勤类服务指令工单表
|
|
||||||
* @Author: caolei
|
|
||||||
* @Date: 2025-12-1
|
|
||||||
* @Version: V1.0
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@TableName("nu_biz_nu_logistics_directive_order")
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
|
||||||
@ApiModel(value="nu_biz_nu_logistics_directive_order对象", description="后勤类服务指令工单表")
|
|
||||||
public class LogisticsOrders implements Serializable {
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
/**id*/
|
|
||||||
@TableId(type = IdType.ASSIGN_ID)
|
|
||||||
private String id;
|
|
||||||
/**数据池子表ID*/
|
|
||||||
private String poolId;
|
|
||||||
/**主表id*/
|
|
||||||
private String bizId;
|
|
||||||
/**护理单元id*/
|
|
||||||
private String nuId;
|
|
||||||
/**护理单元名称*/
|
|
||||||
private String nuName;
|
|
||||||
/**客户id*/
|
|
||||||
private String customerId;
|
|
||||||
/**客户姓名*/
|
|
||||||
private String customerName;
|
|
||||||
/**员工ID*/
|
|
||||||
private String employeeId;
|
|
||||||
/**员工姓名*/
|
|
||||||
private String employeeName;
|
|
||||||
/**服务指令id*/
|
|
||||||
private String directiveId;
|
|
||||||
/**服务指令名称*/
|
|
||||||
private String directiveName;
|
|
||||||
/**周期类型ID*/
|
|
||||||
private String cycleTypeId;
|
|
||||||
/**周期类型*/
|
|
||||||
private String cycleType;
|
|
||||||
/**周期值*/
|
|
||||||
private String cycleValue;
|
|
||||||
/**服务指令图片大图*/
|
|
||||||
private String previewFile;
|
|
||||||
/**服务指令图片大图-网络地址*/
|
|
||||||
private String netPreviewFile;
|
|
||||||
/**服务指令图片小图*/
|
|
||||||
private String previewFileSmall;
|
|
||||||
/**服务指令图片小图-网络地址*/
|
|
||||||
private String netPreviewFileSmall;
|
|
||||||
/**指令音频文件*/
|
|
||||||
private String mp3File;
|
|
||||||
/**指令音频文件-网络地址*/
|
|
||||||
private String netMp3File;
|
|
||||||
/**指令视频文件*/
|
|
||||||
private String mp4File;
|
|
||||||
/**指令视频文件-网络地址*/
|
|
||||||
private String netMp4File;
|
|
||||||
/**服务时长(分钟)*/
|
|
||||||
private String serviceDuration;
|
|
||||||
/**服务描述*/
|
|
||||||
private String serviceContent;
|
|
||||||
/**开始时间*/
|
|
||||||
@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")
|
|
||||||
private Date endTime;
|
|
||||||
/**实际开始时间*/
|
|
||||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
|
||||||
private Date beginTime;
|
|
||||||
/**实际结束时间*/
|
|
||||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
|
||||||
private Date finishTime;
|
|
||||||
/**是否开始 Y是 N否*/
|
|
||||||
private String izStart;
|
|
||||||
/**是否完成 Y是 N否*/
|
|
||||||
private String izFinish;
|
|
||||||
/**创建人*/
|
|
||||||
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;
|
|
||||||
|
|
||||||
/**接单上限*/
|
|
||||||
@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,27 +0,0 @@
|
||||||
package com.nu.modules.biz.logistics.order.job;
|
|
||||||
|
|
||||||
import com.nu.modules.biz.logistics.order.service.ILogisticsOrdersService;
|
|
||||||
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 LogisticsOrdersJob implements Job {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
ILogisticsOrdersService 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,21 +0,0 @@
|
||||||
package com.nu.modules.biz.logistics.order.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.nu.modules.biz.logistics.order.entity.LogisticsOrders;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 后勤类服务指令工单主表
|
|
||||||
* @Author: caolei
|
|
||||||
* @Date: 2025-11-18
|
|
||||||
* @Version: V1.0
|
|
||||||
*/
|
|
||||||
public interface LogisticsOrdersMapper extends BaseMapper<LogisticsOrders> {
|
|
||||||
List<LogisticsOrders> queryDataPoolList(LogisticsOrders orders);
|
|
||||||
List<LogisticsOrders> getEmpPermissionAndOnline(@Param("directiveId") String directiveId, @Param("startTime") Date startTime);
|
|
||||||
LogisticsOrders getEmpOrderly(@Param("customerId") String customerId);
|
|
||||||
List<LogisticsOrders> getPermissionEmps(@Param("directiveIds") String directiveIds);
|
|
||||||
}
|
|
||||||
|
|
@ -1,104 +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.logistics.order.mapper.LogisticsOrdersMapper">
|
|
||||||
|
|
||||||
<select id="queryDataPoolList" resultType="com.nu.modules.biz.logistics.order.entity.LogisticsOrders">
|
|
||||||
select
|
|
||||||
a.id as poolId,
|
|
||||||
a.biz_id as bizId,
|
|
||||||
a.nu_id as nuId,
|
|
||||||
a.nu_name as nuName,
|
|
||||||
a.customer_id as customerId,
|
|
||||||
a.customer_name as customerName,
|
|
||||||
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_logistics_directive_data_pool a
|
|
||||||
left join nu_biz_elder_info b on a.customer_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.logistics.order.entity.LogisticsOrders">
|
|
||||||
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_servcie_tags b on a.id = b.employees_id
|
|
||||||
inner join nu_service_tag c on c.id = b.tags_id
|
|
||||||
inner join nu_servtag_directive d on d.tag_id = c.id
|
|
||||||
left join (
|
|
||||||
select employee_id,count(*) as orderNum,
|
|
||||||
sum(service_duration) as totalDuration,
|
|
||||||
round(sum(ifnull(com_price,0)),4) as totalComPrice,
|
|
||||||
max(start_time) as maxTime,
|
|
||||||
sum(case when iz_finish='N' then 1 else 0 end) as ownCn
|
|
||||||
from nu_biz_nu_logistics_directive_order
|
|
||||||
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_logistics_directive_order
|
|
||||||
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="directiveId != null and directiveId != ''">
|
|
||||||
AND d.directive_id = #{directiveId}
|
|
||||||
</if>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="getEmpOrderly" resultType="com.nu.modules.biz.logistics.order.entity.LogisticsOrders">
|
|
||||||
select orderly as employeeIds
|
|
||||||
from nu_biz_elder_info
|
|
||||||
where id = #{customerId}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="getPermissionEmps" resultType="com.nu.modules.biz.logistics.order.entity.LogisticsOrders">
|
|
||||||
select a.id as employeeId,count(*) as ownCn
|
|
||||||
from nu_biz_employees_info a
|
|
||||||
inner join nu_biz_employees_servcie_tags b on a.id = b.employees_id
|
|
||||||
inner join nu_service_tag c on c.id = b.tags_id
|
|
||||||
inner join nu_servtag_directive d on d.tags_id = c.id
|
|
||||||
where d.directive_id in
|
|
||||||
<foreach collection="directiveIds" item="directiveId" open="(" separator="," close=")">
|
|
||||||
#{directiveId}
|
|
||||||
</foreach>
|
|
||||||
group by a.id
|
|
||||||
</select>
|
|
||||||
|
|
||||||
</mapper>
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
package com.nu.modules.biz.logistics.order.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.nu.modules.biz.logistics.order.entity.LogisticsOrders;
|
|
||||||
import org.jeecg.common.api.vo.Result;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 后勤类服务指令工单主表
|
|
||||||
* @Author: caolei
|
|
||||||
* @Date: 2025-12-1
|
|
||||||
* @Version: V1.0
|
|
||||||
*/
|
|
||||||
public interface ILogisticsOrdersService extends IService<LogisticsOrders> {
|
|
||||||
Result<?> generateOrdersBatch();
|
|
||||||
}
|
|
||||||
|
|
@ -1,319 +0,0 @@
|
||||||
package com.nu.modules.biz.logistics.order.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
|
|
||||||
import com.nu.modules.biz.logistics.order.entity.LogisticsOrders;
|
|
||||||
import com.nu.modules.biz.logistics.order.mapper.LogisticsOrdersMapper;
|
|
||||||
import com.nu.modules.biz.logistics.order.service.ILogisticsOrdersService;
|
|
||||||
import com.nu.modules.config.sendorderpriority.entity.SendOrderRule;
|
|
||||||
import com.nu.modules.config.sendorderpriority.service.ISendOrderRuleService;
|
|
||||||
import com.nu.modules.mediamanage.entity.MediaManage;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.jeecg.common.api.vo.Result;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 后勤类服务指令工单主表
|
|
||||||
* @Author: caolei
|
|
||||||
* @Date: 2025-12-1
|
|
||||||
* @Version: V1.0
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
@Slf4j
|
|
||||||
public class LogisticsOrdersServiceImpl extends ServiceImpl<LogisticsOrdersMapper, LogisticsOrders> implements ILogisticsOrdersService {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
ISendOrderRuleService sendOrderRuleService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取在线,有指令权限的员工,并获取员工的接单上限、收益、服务时长、单次
|
|
||||||
* @param directiveId
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
private List<LogisticsOrders> getEmpPermissionAndOnline(String directiveId, Date startTime){
|
|
||||||
return baseMapper.getEmpPermissionAndOnline(directiveId,startTime);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取长者指定所有护理员
|
|
||||||
* @param customerId
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
private Map<String,String> getEmpOrderly(String customerId){
|
|
||||||
Map<String, String> map = null;
|
|
||||||
LogisticsOrders orders = baseMapper.getEmpOrderly(customerId);
|
|
||||||
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(){
|
|
||||||
List<LogisticsOrders> ordersList = baseMapper.queryDataPoolList(null);
|
|
||||||
for(int i=0;i<ordersList.size();i++){
|
|
||||||
LogisticsOrders orders = ordersList.get(i);
|
|
||||||
generateOrders(orders);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取工单子表数据,并进行处理
|
|
||||||
* @param orders
|
|
||||||
*/
|
|
||||||
private void generateOrders(LogisticsOrders orders){
|
|
||||||
System.out.println("护理单元:"+orders.getNuId()+",服务时间"+orders.getStartTime());
|
|
||||||
//获取满足条件的员工
|
|
||||||
LogisticsOrders employee = employeeScreening(orders.getDirectiveId(),orders.getCustomerId(),orders.getStartTime());
|
|
||||||
if(employee!=null){
|
|
||||||
orders.setEmployeeId(employee.getEmployeeId());
|
|
||||||
orders.setEmployeeName(employee.getEmployeeName());
|
|
||||||
orders.setIzStart("N");
|
|
||||||
orders.setIzFinish("N");
|
|
||||||
this.save(orders);//生成工单主表
|
|
||||||
System.out.println("护理单元:"+orders.getNuId()+",服务时间:"+orders.getStartTime()+",服务员工:"+employee.getEmployeeName()+",获得积分:"+employee.getLevel());
|
|
||||||
System.out.println("");
|
|
||||||
System.out.println("");
|
|
||||||
System.out.println("");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取满足条件的员工
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
private LogisticsOrders employeeScreening(String directiveId, String customerId, Date startTime){
|
|
||||||
|
|
||||||
//获取派单规则
|
|
||||||
QueryWrapper<SendOrderRule> qw = new QueryWrapper<>();
|
|
||||||
qw.eq("izEnabled", "Y");
|
|
||||||
SendOrderRule one = sendOrderRuleService.getOne(qw);
|
|
||||||
if(one.getPriorityCode().equals("1")){
|
|
||||||
return getByPriority();
|
|
||||||
}
|
|
||||||
if(one.getPriorityCode().equals("2")){
|
|
||||||
return getByHeadCount();
|
|
||||||
}
|
|
||||||
if(one.getPriorityCode().equals("3")){
|
|
||||||
return getBySpecial();
|
|
||||||
}
|
|
||||||
|
|
||||||
List<LogisticsOrders> empList = getEmpPermissionAndOnline(directiveId,startTime);
|
|
||||||
Map<String,String> orderlyMap = getEmpOrderly(customerId);
|
|
||||||
if(empList.size()>0){
|
|
||||||
for(int i=0;i<empList.size();i++){
|
|
||||||
LogisticsOrders emp = empList.get(i);
|
|
||||||
System.out.println("员工信息:"+emp.getEmployeeName()+","+emp.getOrderCap()+","+emp.getOrderNum()+","+emp.getTotalDuration()+","+emp.getTotalComPrice()+","+emp.getMaxTime()+","+emp.getOwnCn()+","+emp.getIzFree());
|
|
||||||
String employeeId = emp.getEmployeeId();
|
|
||||||
if(emp.getIzFree().equals(1)){
|
|
||||||
Integer empLevel = emp.getLevel();
|
|
||||||
empLevel = empLevel + empList.size()*5; //提高5N等级
|
|
||||||
emp.setLevel(empLevel);
|
|
||||||
}
|
|
||||||
System.out.println("员工获取空闲积分信息:"+emp.getEmployeeId()+"-"+emp.getEmployeeName()+"["+emp.getLevel()+"]");
|
|
||||||
if(orderlyMap!=null){
|
|
||||||
String orderlyId = orderlyMap.get(employeeId);
|
|
||||||
if(orderlyId!=null&&!orderlyId.equals("")){
|
|
||||||
Integer empLevel = emp.getLevel();
|
|
||||||
empLevel = empLevel + empList.size()*3; //提高4N等级
|
|
||||||
emp.setLevel(empLevel);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
System.out.println("员工获取指定护理积分信息:"+emp.getEmployeeId()+"-"+emp.getEmployeeName()+"["+emp.getLevel()+"]");
|
|
||||||
}
|
|
||||||
//通过工单次数排序数据来设置优先级
|
|
||||||
sortByNumAndSetLevel(empList);
|
|
||||||
for(int i=0;i<empList.size();i++){
|
|
||||||
LogisticsOrders emp = empList.get(i);
|
|
||||||
System.out.println("员工获取工单数积分信息:"+emp.getEmployeeId()+"-"+emp.getEmployeeName()+"["+emp.getLevel()+"]");
|
|
||||||
}
|
|
||||||
//通过总收益排序数据来设置优先级
|
|
||||||
sortByPriceAndSetLevel(empList);
|
|
||||||
for(int i=0;i<empList.size();i++){
|
|
||||||
LogisticsOrders emp = empList.get(i);
|
|
||||||
System.out.println("员工获取工单收益积分信息:"+emp.getEmployeeId()+"-"+emp.getEmployeeName()+"["+emp.getLevel()+"]");
|
|
||||||
}
|
|
||||||
//通过服务时长排序数据来设置优先级
|
|
||||||
sortByDurationAndSetLevel(empList);
|
|
||||||
for(int i=0;i<empList.size();i++){
|
|
||||||
LogisticsOrders emp = empList.get(i);
|
|
||||||
System.out.println("员工获取服务时长积分信息:"+emp.getEmployeeId()+"-"+emp.getEmployeeName()+"["+emp.getLevel()+"]");
|
|
||||||
}
|
|
||||||
//通过最后一次接收派单时间排序数据来设置优先级
|
|
||||||
sortByMaxTimeAndSetLevel(empList);
|
|
||||||
for(int i=0;i<empList.size();i++){
|
|
||||||
LogisticsOrders emp = empList.get(i);
|
|
||||||
System.out.println("员工获取派单时间积分信息:"+emp.getEmployeeId()+"-"+emp.getEmployeeName()+"["+emp.getLevel()+"]");
|
|
||||||
}
|
|
||||||
//按优先级排序数据
|
|
||||||
sortByLevel(empList);
|
|
||||||
for(int i=0;i<empList.size();i++){
|
|
||||||
LogisticsOrders emp = empList.get(i);
|
|
||||||
System.out.println("员工获取总积分信息:"+emp.getEmployeeId()+"-"+emp.getEmployeeName()+"["+emp.getLevel()+"]");
|
|
||||||
}
|
|
||||||
//获取员工信息
|
|
||||||
return empList.get(0);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 优先级派单
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
private LogisticsOrders getByPriority(){
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 按人头派单
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
private LogisticsOrders getByHeadCount(){
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 1V1派单
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
private LogisticsOrders getBySpecial(){
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过工单次数排序数据来设置优先级
|
|
||||||
* @param empList
|
|
||||||
*/
|
|
||||||
public void sortByNumAndSetLevel(List<LogisticsOrders> empList) {
|
|
||||||
// 根据orderNum倒序排序,并为level顺序赋值
|
|
||||||
List<LogisticsOrders> sortedEmployees = empList.stream()
|
|
||||||
.sorted(Comparator.comparing(LogisticsOrders::getOrderNum).reversed())
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
|
|
||||||
// 为level字段顺序赋值1,2,3...
|
|
||||||
for (int i = 0; i < sortedEmployees.size(); i++) {
|
|
||||||
Integer levle = sortedEmployees.get(i).getLevel()+i+1;
|
|
||||||
sortedEmployees.get(i).setLevel(levle);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 如果需要返回新列表,可以返回sortedEmployees
|
|
||||||
// 如果要在原列表上修改,可以清空原列表并添加所有元素
|
|
||||||
empList.clear();
|
|
||||||
empList.addAll(sortedEmployees);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过总收益排序数据来设置优先级
|
|
||||||
* @param empList
|
|
||||||
*/
|
|
||||||
public void sortByPriceAndSetLevel(List<LogisticsOrders> empList) {
|
|
||||||
// 根据totalComPrice倒序排序,并为level顺序赋值
|
|
||||||
List<LogisticsOrders> sortedEmployees = empList.stream()
|
|
||||||
.sorted(Comparator.comparing(LogisticsOrders::getTotalComPrice).reversed())
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
|
|
||||||
// 为level字段顺序赋值1,2,3...
|
|
||||||
for (int i = 0; i < sortedEmployees.size(); i++) {
|
|
||||||
Integer levle = sortedEmployees.get(i).getLevel()+i+1;
|
|
||||||
sortedEmployees.get(i).setLevel(levle);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 如果需要返回新列表,可以返回sortedEmployees
|
|
||||||
// 如果要在原列表上修改,可以清空原列表并添加所有元素
|
|
||||||
empList.clear();
|
|
||||||
empList.addAll(sortedEmployees);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过服务时长排序数据来设置优先级
|
|
||||||
* @param empList
|
|
||||||
*/
|
|
||||||
public void sortByDurationAndSetLevel(List<LogisticsOrders> empList) {
|
|
||||||
// 根据totalDuration倒序排序,并为level顺序赋值
|
|
||||||
List<LogisticsOrders> sortedEmployees = empList.stream()
|
|
||||||
.sorted(Comparator.comparing(LogisticsOrders::getTotalDuration).reversed())
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
|
|
||||||
// 为level字段顺序赋值1,2,3...
|
|
||||||
for (int i = 0; i < sortedEmployees.size(); i++) {
|
|
||||||
Integer levle = sortedEmployees.get(i).getLevel()+i+1;
|
|
||||||
sortedEmployees.get(i).setLevel(levle);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 如果需要返回新列表,可以返回sortedEmployees
|
|
||||||
// 如果要在原列表上修改,可以清空原列表并添加所有元素
|
|
||||||
empList.clear();
|
|
||||||
empList.addAll(sortedEmployees);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过最后一次接收派单时间排序数据来设置优先级
|
|
||||||
* @param empList
|
|
||||||
*/
|
|
||||||
public void sortByMaxTimeAndSetLevel(List<LogisticsOrders> empList) {
|
|
||||||
// 根据maxTime倒序排序,并为level顺序赋值
|
|
||||||
List<LogisticsOrders> sortedEmployees = empList.stream()
|
|
||||||
.sorted(Comparator.comparing(
|
|
||||||
LogisticsOrders::getMaxTime,
|
|
||||||
Comparator.nullsLast(Comparator.reverseOrder())
|
|
||||||
))
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
|
|
||||||
// 为level字段顺序赋值1,2,3...
|
|
||||||
for (int i = 0; i < sortedEmployees.size(); i++) {
|
|
||||||
Integer levle = sortedEmployees.get(i).getLevel()+i+1;
|
|
||||||
sortedEmployees.get(i).setLevel(levle);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 如果需要返回新列表,可以返回sortedEmployees
|
|
||||||
// 如果要在原列表上修改,可以清空原列表并添加所有元素
|
|
||||||
empList.clear();
|
|
||||||
empList.addAll(sortedEmployees);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 按优先级排序数据
|
|
||||||
* @param empList
|
|
||||||
*/
|
|
||||||
public void sortByLevel(List<LogisticsOrders> empList) {
|
|
||||||
for (int i = 0; i < empList.size(); i++) {
|
|
||||||
//工单超出接单上限,降4N级
|
|
||||||
if(empList.get(i).getOwnCn()>=empList.get(i).getOrderCap()){
|
|
||||||
Integer levle = empList.get(i).getLevel()-empList.size()*4;
|
|
||||||
empList.get(i).setLevel(levle);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//为level顺序
|
|
||||||
List<LogisticsOrders> sortedEmployees = empList.stream()
|
|
||||||
.sorted(Comparator.comparing(LogisticsOrders::getLevel).reversed())
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
|
|
||||||
// 如果需要返回新列表,可以返回sortedEmployees
|
|
||||||
// 如果要在原列表上修改,可以清空原列表并添加所有元素
|
|
||||||
empList.clear();
|
|
||||||
empList.addAll(sortedEmployees);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.nu.entity.LogisticsDirectiveEntity;
|
import com.nu.entity.LogisticsDirectiveEntity;
|
||||||
import com.nu.modules.biz.logistics.datapool.service.ILogisticsDataPoolService;
|
|
||||||
import com.nu.modules.biz.logistics.plan.entity.PlanBizNuCustomerLogisticsServer;
|
import com.nu.modules.biz.logistics.plan.entity.PlanBizNuCustomerLogisticsServer;
|
||||||
import com.nu.modules.biz.logistics.plan.mapper.PlanBizNuCustomerLogisticsServerMapper;
|
import com.nu.modules.biz.logistics.plan.mapper.PlanBizNuCustomerLogisticsServerMapper;
|
||||||
import com.nu.modules.biz.logistics.plan.service.IPlanBizNuCustomerLogisticsServerService;
|
import com.nu.modules.biz.logistics.plan.service.IPlanBizNuCustomerLogisticsServerService;
|
||||||
|
|
@ -28,8 +27,8 @@ public class PlanBizNuCustomerLogisticsServerServiceImpl extends ServiceImpl<Pla
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysConfigApi sysConfigApi;
|
private ISysConfigApi sysConfigApi;
|
||||||
@Autowired
|
// @Autowired
|
||||||
private ILogisticsDataPoolService dataPoolServiceImpl;
|
// private CareDataPoolServiceImpl dataPoolServiceImpl;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> getPlanList(LogisticsDirectiveEntity logisticsDirectiveEntity) {
|
public Map<String, Object> getPlanList(LogisticsDirectiveEntity logisticsDirectiveEntity) {
|
||||||
|
|
@ -51,7 +50,7 @@ public class PlanBizNuCustomerLogisticsServerServiceImpl extends ServiceImpl<Pla
|
||||||
//TODO 增加日志
|
//TODO 增加日志
|
||||||
|
|
||||||
//单一指令生成到数据池
|
//单一指令生成到数据池
|
||||||
dataPoolServiceImpl.generateDataPool(planBizNuCustomerServer);
|
// dataPoolServiceImpl.generateDataPool(planBizNuCustomerServer);
|
||||||
BeanUtils.copyProperties(planBizNuCustomerServer, logisticsDirectiveEntity);
|
BeanUtils.copyProperties(planBizNuCustomerServer, logisticsDirectiveEntity);
|
||||||
return logisticsDirectiveEntity;
|
return logisticsDirectiveEntity;
|
||||||
}
|
}
|
||||||
|
|
@ -64,7 +63,7 @@ public class PlanBizNuCustomerLogisticsServerServiceImpl extends ServiceImpl<Pla
|
||||||
baseMapper.updateById(planBizNuCustomerServer);
|
baseMapper.updateById(planBizNuCustomerServer);
|
||||||
//TODO 增加日志
|
//TODO 增加日志
|
||||||
//调用方法先删除数据池中的数据,再生成数据池中的数据
|
//调用方法先删除数据池中的数据,再生成数据池中的数据
|
||||||
dataPoolServiceImpl.editDataPool(entity);
|
// dataPoolServiceImpl.editDataPool(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -73,7 +72,7 @@ public class PlanBizNuCustomerLogisticsServerServiceImpl extends ServiceImpl<Pla
|
||||||
BeanUtils.copyProperties(logisticsDirectiveEntity,planBizNuCustomerServer);
|
BeanUtils.copyProperties(logisticsDirectiveEntity,planBizNuCustomerServer);
|
||||||
String id = planBizNuCustomerServer.getId();
|
String id = planBizNuCustomerServer.getId();
|
||||||
//调用方法删除数据池中的数据
|
//调用方法删除数据池中的数据
|
||||||
dataPoolServiceImpl.deleteDataPool(planBizNuCustomerServer);
|
// dataPoolServiceImpl.deleteDataPool(planBizNuCustomerServer);
|
||||||
baseMapper.deleteByIdPhysic(id);
|
baseMapper.deleteByIdPhysic(id);
|
||||||
//TODO 增加日志
|
//TODO 增加日志
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,127 +0,0 @@
|
||||||
package com.nu.modules.config.sendorderpriority.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.config.sendorderpriority.entity.SendOrderRule;
|
|
||||||
import com.nu.modules.config.sendorderpriority.service.ISendOrderRuleService;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.jeecg.common.api.vo.Result;
|
|
||||||
import org.jeecg.common.system.base.controller.JeecgController;
|
|
||||||
import org.jeecg.common.system.query.QueryGenerator;
|
|
||||||
import org.jeecg.common.system.query.QueryRuleEnum;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 服务指令-派单优先级配置主表
|
|
||||||
* @Author: caolei
|
|
||||||
* @Date: 2025-12-1
|
|
||||||
* @Version: V1.0
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/services/sendorderpriority")
|
|
||||||
@Slf4j
|
|
||||||
public class SendOrderRuleController extends JeecgController<SendOrderRule, ISendOrderRuleService> {
|
|
||||||
@Autowired
|
|
||||||
private ISendOrderRuleService service;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页列表查询
|
|
||||||
*
|
|
||||||
* @param sendOrderPriority
|
|
||||||
* @param pageNo
|
|
||||||
* @param pageSize
|
|
||||||
* @param req
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "派单优先级配置主表-分页列表查询", notes = "派单优先级配置主表-分页列表查询")
|
|
||||||
@GetMapping(value = "/list")
|
|
||||||
public Result<IPage<SendOrderRule>> queryPageList(SendOrderRule sendOrderPriority,
|
|
||||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
|
||||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
|
||||||
HttpServletRequest req) {
|
|
||||||
// 自定义查询规则
|
|
||||||
Map<String, QueryRuleEnum> ruleMap = new HashMap<>();
|
|
||||||
// 自定义多选的查询规则为:LIKE_WITH_OR
|
|
||||||
ruleMap.put("izEnabled", QueryRuleEnum.LIKE_WITH_OR);
|
|
||||||
QueryWrapper<SendOrderRule> queryWrapper = QueryGenerator.initQueryWrapper(sendOrderPriority, req.getParameterMap(), ruleMap);
|
|
||||||
Page<SendOrderRule> page = new Page<SendOrderRule>(pageNo, pageSize);
|
|
||||||
IPage<SendOrderRule> pageList = service.page(page, queryWrapper);
|
|
||||||
return Result.OK(pageList);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加
|
|
||||||
*
|
|
||||||
* @param sendOrderPriority
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "派单优先级配置主表-添加", notes = "派单优先级配置主表-添加")
|
|
||||||
@PostMapping(value = "/add")
|
|
||||||
public Result<String> add(@RequestBody SendOrderRule sendOrderPriority) {
|
|
||||||
service.save(sendOrderPriority);
|
|
||||||
return Result.OK("添加成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 编辑
|
|
||||||
*
|
|
||||||
* @param directiveTag
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "派单优先级配置主表-编辑", notes = "派单优先级配置主表-编辑")
|
|
||||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
|
||||||
public Result<String> edit(@RequestBody SendOrderRule directiveTag) {
|
|
||||||
service.updateById(directiveTag);
|
|
||||||
return Result.OK("编辑成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过id删除
|
|
||||||
*
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "派单优先级配置主表-通过id删除", notes = "派单优先级配置主表-通过id删除")
|
|
||||||
@DeleteMapping(value = "/delete")
|
|
||||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
|
||||||
service.removeById(id);
|
|
||||||
return Result.OK("删除成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除
|
|
||||||
*
|
|
||||||
* @param ids
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "派单优先级配置主表-批量删除", notes = "派单优先级配置主表-批量删除")
|
|
||||||
@DeleteMapping(value = "/deleteBatch")
|
|
||||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
|
||||||
this.service.removeByIds(Arrays.asList(ids.split(",")));
|
|
||||||
return Result.OK("批量删除成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过id查询
|
|
||||||
*
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "派单优先级配置主表-通过id查询", notes = "派单优先级配置主表-通过id查询")
|
|
||||||
@GetMapping(value = "/queryById")
|
|
||||||
public Result<SendOrderRule> queryById(@RequestParam(name = "id", required = true) String id) {
|
|
||||||
SendOrderRule directiveTag = service.getById(id);
|
|
||||||
if (directiveTag == null) {
|
|
||||||
return Result.error("未找到对应数据");
|
|
||||||
}
|
|
||||||
return Result.OK(directiveTag);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,56 +0,0 @@
|
||||||
package com.nu.modules.config.sendorderpriority.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.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 服务指令-派单优先级配置主表
|
|
||||||
* @Author: caolei
|
|
||||||
* @Date: 2025-12-1
|
|
||||||
* @Version: V1.0
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@TableName("nu_config_send_order_priority")
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
|
||||||
@ApiModel(value="nu_config_send_order_priority对象", description="服务指令-派单优先级配置主表")
|
|
||||||
public class SendOrderRule implements Serializable {
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
/**id*/
|
|
||||||
@TableId(type = IdType.ASSIGN_ID)
|
|
||||||
private String id;
|
|
||||||
|
|
||||||
private String priorityCode;
|
|
||||||
|
|
||||||
private String priorityName;
|
|
||||||
|
|
||||||
/**是否启用 Y启用 N未启用*/
|
|
||||||
private String izEnabled;
|
|
||||||
|
|
||||||
/**创建人*/
|
|
||||||
private String createBy;
|
|
||||||
/**创建日期*/
|
|
||||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
|
||||||
private java.util.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 java.util.Date updateTime;
|
|
||||||
/**是否删除 0未删除 1删除*/
|
|
||||||
private String delFlag;
|
|
||||||
|
|
||||||
private List<SendOrderRuleSub> sendOrderPrioritySubList;
|
|
||||||
}
|
|
||||||
|
|
@ -1,55 +0,0 @@
|
||||||
package com.nu.modules.config.sendorderpriority.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;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 服务指令-派单优先级配置子表
|
|
||||||
* @Author: caolei
|
|
||||||
* @Date: 2025-12-1
|
|
||||||
* @Version: V1.0
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@TableName("nu_config_send_order_priority_sub")
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
|
||||||
@ApiModel(value="nu_config_send_order_priority_sub对象", description="服务指令-派单优先级配置子表")
|
|
||||||
public class SendOrderRuleSub implements Serializable {
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
/**id*/
|
|
||||||
@TableId(type = IdType.ASSIGN_ID)
|
|
||||||
private String id;
|
|
||||||
|
|
||||||
private String mainId;
|
|
||||||
|
|
||||||
private String priorityCode;
|
|
||||||
|
|
||||||
private String priorityName;
|
|
||||||
|
|
||||||
/**是否启用 Y启用 N未启用*/
|
|
||||||
private String izEnabled;
|
|
||||||
|
|
||||||
/**创建人*/
|
|
||||||
private String createBy;
|
|
||||||
/**创建日期*/
|
|
||||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
|
||||||
private java.util.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 java.util.Date updateTime;
|
|
||||||
/**是否删除 0未删除 1删除*/
|
|
||||||
private String delFlag;
|
|
||||||
}
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
package com.nu.modules.config.sendorderpriority.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.nu.modules.config.sendorderpriority.entity.SendOrderRule;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 派单优先级配置主表
|
|
||||||
* @Author: caolei
|
|
||||||
* @Date: 2025-12-1
|
|
||||||
* @Version: V1.0
|
|
||||||
*/
|
|
||||||
public interface SendOrderRuleMapper extends BaseMapper<SendOrderRule> {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
package com.nu.modules.config.sendorderpriority.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.nu.modules.config.sendorderpriority.entity.SendOrderRuleSub;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 派单优先级配置子表
|
|
||||||
* @Author: caolei
|
|
||||||
* @Date: 2025-12-1
|
|
||||||
* @Version: V1.0
|
|
||||||
*/
|
|
||||||
public interface SendOrderRuleSubMapper extends BaseMapper<SendOrderRuleSub> {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -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.sendorderpriority.mapper.SendOrderRuleMapper">
|
|
||||||
|
|
||||||
</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.sendorderpriority.mapper.SendOrderRuleSubMapper">
|
|
||||||
|
|
||||||
</mapper>
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
package com.nu.modules.config.sendorderpriority.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.nu.modules.config.sendorderpriority.entity.SendOrderRule;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 服务指令-派单优先级配置主表
|
|
||||||
* @Author: caolei
|
|
||||||
* @Date: 2025-12-1
|
|
||||||
* @Version: V1.0
|
|
||||||
*/
|
|
||||||
public interface ISendOrderRuleService extends IService<SendOrderRule> {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
package com.nu.modules.config.sendorderpriority.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.nu.modules.config.sendorderpriority.entity.SendOrderRuleSub;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 服务指令-派单优先级配置子表
|
|
||||||
* @Author: caolei
|
|
||||||
* @Date: 2025-12-1
|
|
||||||
* @Version: V1.0
|
|
||||||
*/
|
|
||||||
public interface ISendOrderRuleSubService extends IService<SendOrderRuleSub> {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
package com.nu.modules.config.sendorderpriority.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.nu.modules.config.sendorderpriority.entity.SendOrderRule;
|
|
||||||
import com.nu.modules.config.sendorderpriority.mapper.SendOrderRuleMapper;
|
|
||||||
import com.nu.modules.config.sendorderpriority.service.ISendOrderRuleService;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 服务指令-派单优先级配置主表
|
|
||||||
* @Author: caolei
|
|
||||||
* @Date: 2025-12-1
|
|
||||||
* @Version: V1.0
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class SendOrderRuleServiceImpl extends ServiceImpl<SendOrderRuleMapper, SendOrderRule> implements ISendOrderRuleService {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
package com.nu.modules.config.sendorderpriority.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.nu.modules.config.sendorderpriority.entity.SendOrderRuleSub;
|
|
||||||
import com.nu.modules.config.sendorderpriority.mapper.SendOrderRuleSubMapper;
|
|
||||||
import com.nu.modules.config.sendorderpriority.service.ISendOrderRuleSubService;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 服务指令-派单优先级配置主表
|
|
||||||
* @Author: caolei
|
|
||||||
* @Date: 2025-12-1
|
|
||||||
* @Version: V1.0
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class SendOrderRuleSubServiceImpl extends ServiceImpl<SendOrderRuleSubMapper, SendOrderRuleSub> implements ISendOrderRuleSubService {
|
|
||||||
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue