Merge branch 'master' of http://121.40.234.130:8899/root/stand_lms
This commit is contained in:
@@ -29,8 +29,7 @@ public class PdmBdWorkorder implements Serializable {
|
||||
@ApiModelProperty(value = "工单编号")
|
||||
private String workorder_code;
|
||||
|
||||
@ApiModelProperty(value = "生产日期")
|
||||
private String produce_date;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "计划数量")
|
||||
private BigDecimal plan_qty;
|
||||
|
||||
@@ -18,8 +18,6 @@ public class PdmBdWorkorderDto implements Serializable {
|
||||
/** 工单编号 */
|
||||
private String workorder_code;
|
||||
|
||||
/** 生产日期 */
|
||||
private String produce_date;
|
||||
|
||||
/** 计划数量 */
|
||||
private BigDecimal plan_qty;
|
||||
|
||||
@@ -10,10 +10,10 @@ import lombok.EqualsAndHashCode;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @description /
|
||||
* @author lyd
|
||||
* @date 2023-05-15
|
||||
**/
|
||||
* @description /
|
||||
* @author lyd
|
||||
* @date 2023-05-16
|
||||
**/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("sch_base_region")
|
||||
@@ -61,4 +61,7 @@ public class SchBaseRegion implements Serializable {
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private String update_time;
|
||||
|
||||
@ApiModelProperty(value = "顺和号")
|
||||
private Integer order_seq;
|
||||
|
||||
}
|
||||
|
||||
@@ -4,10 +4,10 @@ import lombok.Data;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @description /
|
||||
* @author lyd
|
||||
* @date 2023-05-15
|
||||
**/
|
||||
* @description /
|
||||
* @author lyd
|
||||
* @date 2023-05-16
|
||||
**/
|
||||
@Data
|
||||
public class SchBaseRegionDto implements Serializable {
|
||||
|
||||
@@ -24,7 +24,7 @@ public class SchBaseRegionDto implements Serializable {
|
||||
private String point_status_explain;
|
||||
|
||||
/** 是否创建工单 */
|
||||
private String is_has_workder;
|
||||
private Boolean is_has_workder;
|
||||
|
||||
/** 车间编码 */
|
||||
private String workshop_code;
|
||||
@@ -33,7 +33,7 @@ public class SchBaseRegionDto implements Serializable {
|
||||
private String remark;
|
||||
|
||||
/** 创建人 */
|
||||
private Long create_id;
|
||||
private String create_id;
|
||||
|
||||
/** 创建人 */
|
||||
private String create_name;
|
||||
@@ -42,11 +42,14 @@ public class SchBaseRegionDto implements Serializable {
|
||||
private String create_time;
|
||||
|
||||
/** 修改人 */
|
||||
private Long update_id;
|
||||
private String update_id;
|
||||
|
||||
/** 修改人 */
|
||||
private String update_name;
|
||||
|
||||
/** 修改时间 */
|
||||
private String update_time;
|
||||
|
||||
/** 顺和号 */
|
||||
private Integer order_seq;
|
||||
}
|
||||
|
||||
@@ -46,7 +46,8 @@ public class SchBaseRegionServiceImpl extends ServiceImpl<SchBaseRegionMapper, S
|
||||
lam.eq(ObjectUtil.isNotEmpty(workshop_code), SchBaseRegion::getWorkshop_code, workshop_code)
|
||||
.eq(ObjectUtil.isNotEmpty(is_has_workder), SchBaseRegion::getIs_has_workder, is_has_workder)
|
||||
.like(ObjectUtil.isNotEmpty(blurry), SchBaseRegion::getRegion_code, blurry)
|
||||
.or(ObjectUtil.isNotEmpty(blurry), la -> la.like(SchBaseRegion::getRegion_name, blurry));
|
||||
.or(ObjectUtil.isNotEmpty(blurry), la -> la.like(SchBaseRegion::getRegion_name, blurry))
|
||||
.orderByAsc(SchBaseRegion::getOrder_seq);
|
||||
IPage<SchBaseRegion> pages = new Page<>(page.getPage() + 1, page.getSize());
|
||||
schBaseRegionMapper.selectPage(pages, lam);
|
||||
return pages;
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package org.nl.wms.sch.task.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -13,6 +16,7 @@ import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import sun.security.krb5.internal.PAData;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
@@ -63,4 +67,15 @@ public class SchBaseTaskController {
|
||||
schBaseTaskService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/apply")
|
||||
@Log("新增任务管理")
|
||||
@ApiOperation("新增任务管理")
|
||||
//@SaCheckPermission("@el.check('schBaseTask:add')")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> apply(@RequestBody Map param){
|
||||
schBaseTaskService.apply(JSONObject.parseObject(JSON.toJSONString(param)));
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
package org.nl.wms.sch.task.core.task;
|
||||
@@ -1 +0,0 @@
|
||||
package org.nl.wms.sch.task.core.task.core;
|
||||
@@ -1 +0,0 @@
|
||||
package org.nl.wms.sch.task.core.task.core;
|
||||
@@ -1 +0,0 @@
|
||||
package org.nl.wms.sch.task.core.task.core;
|
||||
@@ -1 +0,0 @@
|
||||
package org.nl.wms.sch.task.core.task.core;
|
||||
@@ -1 +0,0 @@
|
||||
package org.nl.wms.sch.task.core.task.core;
|
||||
@@ -1 +0,0 @@
|
||||
package org.nl.wms.sch.task.core.task.tasks;
|
||||
@@ -1,43 +1,66 @@
|
||||
package org.nl.wms.sch.task.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.wms.sch.task.service.dao.SchBaseTask;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @description 服务接口
|
||||
* @author lyd
|
||||
* @date 2023-05-15
|
||||
**/
|
||||
* @author lyd
|
||||
* @description 服务接口
|
||||
* @date 2023-05-15
|
||||
**/
|
||||
public interface ISchBaseTaskService extends IService<SchBaseTask> {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param whereJson 条件
|
||||
* @param pageable 分页参数
|
||||
* @return IPage<SchBaseTask>
|
||||
*/
|
||||
* 查询数据分页
|
||||
*
|
||||
* @param whereJson 条件
|
||||
* @param pageable 分页参数
|
||||
* @return IPage<SchBaseTask>
|
||||
*/
|
||||
IPage<SchBaseTask> queryAll(Map whereJson, PageQuery pageable);
|
||||
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param entity /
|
||||
*/
|
||||
* 创建
|
||||
*
|
||||
* @param entity /
|
||||
*/
|
||||
void create(SchBaseTask entity);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param entity /
|
||||
*/
|
||||
* 编辑
|
||||
*
|
||||
* @param entity /
|
||||
*/
|
||||
void update(SchBaseTask entity);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
* @param ids /
|
||||
*/
|
||||
* 多选删除
|
||||
*
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(Set<String> ids);
|
||||
|
||||
|
||||
/**
|
||||
* 根据任务配置查询为完成的任务数
|
||||
*
|
||||
* @param config_code 任务配置编码
|
||||
* @return 未完成任务列表
|
||||
*/
|
||||
List<SchBaseTask> findUnFishedTasksByTaskConfig(String config_code);
|
||||
|
||||
/**
|
||||
* 任务申请
|
||||
*
|
||||
* @param param /
|
||||
*/
|
||||
void apply(JSONObject param);
|
||||
}
|
||||
|
||||
@@ -26,8 +26,6 @@ public class SchBaseTask implements Serializable {
|
||||
@ApiModelProperty(value = "任务编码")
|
||||
private String task_code;
|
||||
|
||||
@ApiModelProperty(value = "任务分类")
|
||||
private String task_class_id;
|
||||
|
||||
@ApiModelProperty(value = "任务状态")
|
||||
private String task_status;
|
||||
@@ -56,11 +54,6 @@ public class SchBaseTask implements Serializable {
|
||||
@ApiModelProperty(value = "载具编码")
|
||||
private String vehicle_code;
|
||||
|
||||
@ApiModelProperty(value = "优先级")
|
||||
private String priority;
|
||||
|
||||
@ApiModelProperty(value = "处理类")
|
||||
private String handle_class;
|
||||
|
||||
@ApiModelProperty(value = "处理状态")
|
||||
private String handle_status;
|
||||
@@ -68,8 +61,6 @@ public class SchBaseTask implements Serializable {
|
||||
@ApiModelProperty(value = "车号")
|
||||
private String car_no;
|
||||
|
||||
@ApiModelProperty(value = "是否自动下发")
|
||||
private Boolean is_auto_issue;
|
||||
|
||||
@ApiModelProperty(value = "任务组标识")
|
||||
private Long task_group_id;
|
||||
|
||||
@@ -47,10 +47,10 @@ public class SchBaseTaskconfig implements Serializable {
|
||||
private String priority;
|
||||
|
||||
@ApiModelProperty(value = "允许最大任务生成数")
|
||||
private BigDecimal task_create_num;
|
||||
private Integer task_create_max_num;
|
||||
|
||||
@ApiModelProperty(value = "允许最大任务下发数")
|
||||
private BigDecimal task_issue_num;
|
||||
private Integer task_issue_max_num;
|
||||
|
||||
@ApiModelProperty(value = "是否自动下发")
|
||||
private Boolean is_auto_issue;
|
||||
|
||||
@@ -15,8 +15,6 @@ public class SchBaseTaskDto implements Serializable {
|
||||
/** 任务编码 */
|
||||
private String task_code;
|
||||
|
||||
/** 任务分类 */
|
||||
private String task_class_id;
|
||||
|
||||
/** 任务状态 */
|
||||
private String task_status;
|
||||
@@ -45,20 +43,12 @@ public class SchBaseTaskDto implements Serializable {
|
||||
/** 载具编码 */
|
||||
private String vehicle_code;
|
||||
|
||||
/** 优先级 */
|
||||
private String priority;
|
||||
|
||||
/** 处理类 */
|
||||
private String handle_class;
|
||||
|
||||
/** 处理状态 */
|
||||
private String handle_status;
|
||||
|
||||
/** 车号 */
|
||||
private String car_no;
|
||||
|
||||
/** 是否自动下发 */
|
||||
private Boolean is_auto_issue;
|
||||
|
||||
/** 任务组标识 */
|
||||
private Long task_group_id;
|
||||
|
||||
@@ -34,10 +34,10 @@ public class SchBaseTaskconfigDto implements Serializable {
|
||||
private String priority;
|
||||
|
||||
/** 允许最大任务生成数 */
|
||||
private BigDecimal task_create_num;
|
||||
private Integer task_create_max_num;
|
||||
|
||||
/** 允许最大任务下发数 */
|
||||
private BigDecimal task_issue_num;
|
||||
private Integer task_issue_max_num;
|
||||
|
||||
/** 是否自动下发 */
|
||||
private Boolean is_auto_issue;
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
package org.nl.wms.sch.task.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
@@ -14,17 +16,20 @@ import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.sch.task.service.ISchBaseTaskService;
|
||||
import org.nl.wms.sch.task.service.dao.mapper.SchBaseTaskMapper;
|
||||
import org.nl.wms.sch.task.service.dao.SchBaseTask;
|
||||
import org.nl.wms.sch.task_manage.BaseTask;
|
||||
import org.nl.wms.sch.task_manage.task.TaskFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @description 服务实现
|
||||
* @author lyd
|
||||
* @date 2023-05-15
|
||||
**/
|
||||
* @author lyd
|
||||
* @description 服务实现
|
||||
* @date 2023-05-15
|
||||
**/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBaseTask> implements ISchBaseTaskService {
|
||||
@@ -33,28 +38,14 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
|
||||
private SchBaseTaskMapper schBaseTaskMapper;
|
||||
|
||||
@Override
|
||||
public IPage<SchBaseTask> queryAll(Map whereJson, PageQuery page){
|
||||
public IPage<SchBaseTask> queryAll(Map whereJson, PageQuery page) {
|
||||
LambdaQueryWrapper<SchBaseTask> lam = new LambdaQueryWrapper<>();
|
||||
IPage<SchBaseTask> pages = new Page<>(page.getPage() + 1, page.getSize());
|
||||
schBaseTaskMapper.selectPage(pages, lam);
|
||||
return pages;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void create(SchBaseTask entity) {
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
entity.setTask_code(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||
entity.setCreate_id(currentUserId);
|
||||
entity.setCreate_name(nickName);
|
||||
entity.setCreate_time(now);
|
||||
entity.setUpdate_id(currentUserId);
|
||||
entity.setUpdate_name(nickName);
|
||||
entity.setUpdate_time(now);
|
||||
schBaseTaskMapper.insert(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(SchBaseTask entity) {
|
||||
@@ -77,4 +68,43 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
|
||||
schBaseTaskMapper.deleteBatchIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SchBaseTask> findUnFishedTasksByTaskConfig(String config_code) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void create(SchBaseTask entity) {
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
// if (ObjectUtil.isEmpty(entity.getTask_status())) throw new BadRequestException("任务状态不能为空!");
|
||||
Assert.notNull(entity.getTask_status(),"任务状态不能为空!");
|
||||
|
||||
entity.setTask_code(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||
entity.setCreate_id(currentUserId);
|
||||
entity.setCreate_name(nickName);
|
||||
entity.setCreate_time(now);
|
||||
entity.setUpdate_id(currentUserId);
|
||||
entity.setUpdate_name(nickName);
|
||||
entity.setUpdate_time(now);
|
||||
schBaseTaskMapper.insert(entity);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply(JSONObject param) {
|
||||
String device_code = "123";
|
||||
String type = "123";
|
||||
String vehicle_code = "123";
|
||||
|
||||
//1、如果是送料,检测载具状态
|
||||
//2、送空载具
|
||||
//3、叫料
|
||||
//4、叫空载具
|
||||
TaskFactory taskFactory = new TaskFactory();
|
||||
BaseTask task = taskFactory.getTask("HNMLTask");
|
||||
task.apply(param);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
package org.nl.wms.sch.task_manage;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.config.SpringContextHolder;
|
||||
import org.nl.wms.sch.task.service.ISchBaseTaskService;
|
||||
import org.nl.wms.sch.task.service.dao.SchBaseTask;
|
||||
import org.nl.wms.sch.task.service.dao.SchBaseTaskconfig;
|
||||
import org.nl.wms.sch.task.service.impl.SchBaseTaskServiceImpl;
|
||||
import org.nl.wms.sch.task.service.impl.SchBaseTaskconfigServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
/**
|
||||
* @author ldjun
|
||||
* @version 1.0
|
||||
* @date 2023年05月16日 16:42
|
||||
* @desc desc
|
||||
*/
|
||||
|
||||
public abstract class BaseTask {
|
||||
@Autowired
|
||||
private ISchBaseTaskService taskService;
|
||||
|
||||
public void apply(JSONObject param) {
|
||||
//1、校验数据
|
||||
SchBaseTaskconfig taskConfig = SpringContextHolder.getBean(SchBaseTaskconfigServiceImpl.class).getById(null);
|
||||
Integer tcmn = taskConfig.getTask_create_max_num();
|
||||
|
||||
SpringContextHolder.getBean(SchBaseTaskServiceImpl.class);
|
||||
|
||||
|
||||
SchBaseTask task = new SchBaseTask();
|
||||
task.setAcs_trace_id("");
|
||||
task.setConfig_code("");
|
||||
task.setCreate_id("");
|
||||
task.setCreate_mode("");
|
||||
task.setPoint_code1("");
|
||||
task.setVehicle_code("");
|
||||
// task.setTask_status("01");
|
||||
SpringContextHolder.getBean(SchBaseTaskServiceImpl.class).create(task);
|
||||
//1、如果是送料,检测载具状态
|
||||
//2、送空载具
|
||||
//3、叫料
|
||||
//4、叫空载具
|
||||
|
||||
//校验
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package org.nl.wms.sch.task_manage.task;
|
||||
|
||||
import org.nl.wms.sch.task_manage.BaseTask;
|
||||
import org.nl.wms.sch.task_manage.task.tasks.HNMLTask;
|
||||
|
||||
/**
|
||||
* @author ldjun
|
||||
* @version 1.0
|
||||
* @date 2023年05月16日 16:42
|
||||
* @desc desc
|
||||
*/
|
||||
public class TaskFactory {
|
||||
//使用 getShape 方法获取形状类型的对象
|
||||
public BaseTask getTask(String taskType) {
|
||||
if (taskType == null) {
|
||||
return null;
|
||||
}
|
||||
if (taskType.equalsIgnoreCase("HNMLTask")) {
|
||||
return new HNMLTask();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
package org.nl.wms.sch.task_manage.task;
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.nl.wms.sch.task.core.task;
|
||||
package org.nl.wms.sch.task_manage.task;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -0,0 +1 @@
|
||||
package org.nl.wms.sch.task_manage.task.core;
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.nl.wms.sch.task.core.task.core;
|
||||
package org.nl.wms.sch.task_manage.task.core;
|
||||
|
||||
/**
|
||||
* @author ldjun
|
||||
@@ -0,0 +1 @@
|
||||
package org.nl.wms.sch.task_manage.task.core;
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.nl.wms.sch.task.core.task.core;
|
||||
package org.nl.wms.sch.task_manage.task.core;
|
||||
|
||||
/**
|
||||
* @author ldjun
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.nl.wms.sch.task.core.task.core;
|
||||
package org.nl.wms.sch.task_manage.task.core;
|
||||
|
||||
/**
|
||||
* @author ldjun
|
||||
@@ -0,0 +1 @@
|
||||
package org.nl.wms.sch.task_manage.task.core;
|
||||
@@ -0,0 +1 @@
|
||||
package org.nl.wms.sch.task_manage.task.core;
|
||||
@@ -0,0 +1 @@
|
||||
package org.nl.wms.sch.task_manage.task.core;
|
||||
@@ -0,0 +1,12 @@
|
||||
package org.nl.wms.sch.task_manage.task.tasks;
|
||||
|
||||
import org.nl.wms.sch.task_manage.BaseTask;
|
||||
|
||||
/**
|
||||
* @author ldjun
|
||||
* @version 1.0
|
||||
* @date 2023年05月16日 16:44
|
||||
* @desc desc
|
||||
*/
|
||||
public class HNMLTask extends BaseTask {
|
||||
}
|
||||
Reference in New Issue
Block a user