rev:手持组盘入库
This commit is contained in:
@@ -30,7 +30,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
@ServletComponentScan
|
@ServletComponentScan
|
||||||
@EnableTransactionManagement
|
@EnableTransactionManagement
|
||||||
@MapperScan("org.nl.**.mapper")
|
@MapperScan("org.nl.**.mapper")
|
||||||
@EnableDynamicTp
|
//@EnableDynamicTp
|
||||||
public class AppRun implements CommandLineRunner {
|
public class AppRun implements CommandLineRunner {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
SpringApplication.run(AppRun.class, args);
|
SpringApplication.run(AppRun.class, args);
|
||||||
|
|||||||
@@ -14,4 +14,7 @@ public class DictConstantPool {
|
|||||||
public static final String DICT_SYS_NAME = "所属系统";
|
public static final String DICT_SYS_NAME = "所属系统";
|
||||||
public static final int STRUCT_COUNT = 5;
|
public static final int STRUCT_COUNT = 5;
|
||||||
public static final Map<String,String> PRODUCT_OUT_POINT = MapOf.of("A1","1101","A2","2114","A3","3204");
|
public static final Map<String,String> PRODUCT_OUT_POINT = MapOf.of("A1","1101","A2","2114","A3","3204");
|
||||||
|
|
||||||
|
public static final Map<String,String> PRODUCT_OUT_POINT_TP = MapOf.of("A1","1131","A2","2127","A3","3110");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,20 +6,26 @@ import org.nl.common.domain.entity.QParam;
|
|||||||
import org.nl.common.enums.QueryTEnum;
|
import org.nl.common.enums.QueryTEnum;
|
||||||
import org.nl.wms.base_manage.material.service.dao.MdMeMaterialbase;
|
import org.nl.wms.base_manage.material.service.dao.MdMeMaterialbase;
|
||||||
|
|
||||||
/*
|
/* *
|
||||||
|
*物料查询对象
|
||||||
* @author ZZQ
|
* @author ZZQ
|
||||||
* @Date 2023/5/4 19:49
|
* @Date 2023/5/4 19:49
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class MaterialQuery extends BaseQuery<MdMeMaterialbase> {
|
public class MaterialQuery extends BaseQuery<MdMeMaterialbase> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料编码名称
|
||||||
|
*/
|
||||||
private String search;
|
private String search;
|
||||||
|
/**
|
||||||
|
* 物料类型
|
||||||
|
*/
|
||||||
private String material_type_id;
|
private String material_type_id;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void paramMapping() {
|
public void paramMapping() {
|
||||||
super.doP.put("search", QParam.builder().k(new String[]{"material_code","material_name"}).type(QueryTEnum.EQ).build());
|
super.doP.put("search", QParam.builder().k(new String[]{"material_code","material_name"}).type(QueryTEnum.ORLK).build());
|
||||||
super.doP.put("material_type_id", QParam.builder().k(new String[]{"material_type_id"}).type(QueryTEnum.EQ).build());
|
super.doP.put("material_type_id", QParam.builder().k(new String[]{"material_type_id"}).type(QueryTEnum.EQ).build());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import cn.hutool.core.date.DateUtil;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import org.nl.common.TableDataInfo;
|
import org.nl.common.TableDataInfo;
|
||||||
|
import org.nl.common.anno.Log;
|
||||||
import org.nl.common.domain.entity.PageQuery;
|
import org.nl.common.domain.entity.PageQuery;
|
||||||
import org.nl.common.domain.exception.BadRequestException;
|
import org.nl.common.domain.exception.BadRequestException;
|
||||||
import org.nl.common.utils.IdUtil;
|
import org.nl.common.utils.IdUtil;
|
||||||
@@ -62,6 +63,7 @@ public class BmFormStrucController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping
|
@PostMapping
|
||||||
|
@Log("创建单据结构")
|
||||||
public ResponseEntity<Object> save(@RequestBody JSONObject param){
|
public ResponseEntity<Object> save(@RequestBody JSONObject param){
|
||||||
//参数判读,参数解析,调用参数入库
|
//参数判读,参数解析,调用参数入库
|
||||||
BmFormStruc formStruc = param.toJavaObject(BmFormStruc.class);
|
BmFormStruc formStruc = param.toJavaObject(BmFormStruc.class);
|
||||||
@@ -72,6 +74,7 @@ public class BmFormStrucController {
|
|||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
|
@Log("修改单据结构")
|
||||||
public ResponseEntity<Object> update(@RequestBody JSONObject param){
|
public ResponseEntity<Object> update(@RequestBody JSONObject param){
|
||||||
//逻辑判断:如果有数据了则不允许修改
|
//逻辑判断:如果有数据了则不允许修改
|
||||||
BmFormStruc formStruc = param.toJavaObject(BmFormStruc.class);
|
BmFormStruc formStruc = param.toJavaObject(BmFormStruc.class);
|
||||||
@@ -86,6 +89,7 @@ public class BmFormStrucController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping
|
@DeleteMapping
|
||||||
|
@Log("删除单据结构")
|
||||||
public ResponseEntity<Object> delete(@RequestBody String[] ids){
|
public ResponseEntity<Object> delete(@RequestBody String[] ids){
|
||||||
//参数判读,参数解析,调用参数入库
|
//参数判读,参数解析,调用参数入库
|
||||||
if (ids.length>0){
|
if (ids.length>0){
|
||||||
@@ -129,6 +133,7 @@ public class BmFormStrucController {
|
|||||||
* 数据结构:{"type":xxx,"name":xxx,"desc":xxx,"item":{"desc":"描述"}}
|
* 数据结构:{"type":xxx,"name":xxx,"desc":xxx,"item":{"desc":"描述"}}
|
||||||
*/
|
*/
|
||||||
@GetMapping("/formColumns/{form_type}")
|
@GetMapping("/formColumns/{form_type}")
|
||||||
|
@Log("查询动态表头")
|
||||||
public ResponseEntity<Object> formColumns(@PathVariable String form_type){
|
public ResponseEntity<Object> formColumns(@PathVariable String form_type){
|
||||||
//参数判读,参数解析,调用参数入库
|
//参数判读,参数解析,调用参数入库
|
||||||
List<Map> items = new ArrayList<>();
|
List<Map> items = new ArrayList<>();
|
||||||
|
|||||||
@@ -5,16 +5,14 @@ import com.alibaba.fastjson.JSONObject;
|
|||||||
import org.nl.common.TableDataInfo;
|
import org.nl.common.TableDataInfo;
|
||||||
import org.nl.common.anno.Log;
|
import org.nl.common.anno.Log;
|
||||||
import org.nl.common.domain.entity.PageQuery;
|
import org.nl.common.domain.entity.PageQuery;
|
||||||
import org.nl.common.domain.exception.BadRequestException;
|
|
||||||
import org.nl.wms.dispatch_manage.task.service.ISchBaseTaskService;
|
import org.nl.wms.dispatch_manage.task.service.ISchBaseTaskService;
|
||||||
import org.nl.wms.dispatch_manage.task.service.TaskScheduleService;
|
|
||||||
import org.nl.wms.dispatch_manage.task.service.dao.SchBaseTask;
|
import org.nl.wms.dispatch_manage.task.service.dao.SchBaseTask;
|
||||||
|
import org.nl.wms.system_manage.service.quartz.task.TaskScheduleService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.redis.core.RedisTemplate;
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
import org.springframework.util.CollectionUtils;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
|||||||
@@ -54,7 +54,12 @@ public class OutStorageTask extends AbstractTask {
|
|||||||
//通过全局变量获取目标位置
|
//通过全局变量获取目标位置
|
||||||
String product_area = from.getString("product_area");
|
String product_area = from.getString("product_area");
|
||||||
if (StringUtils.isNotEmpty(product_area)){
|
if (StringUtils.isNotEmpty(product_area)){
|
||||||
String configTarget = DictConstantPool.PRODUCT_OUT_POINT.get(product_area);
|
String configTarget;
|
||||||
|
if (vehicle_code.contains("T")){
|
||||||
|
configTarget = DictConstantPool.PRODUCT_OUT_POINT_TP.get(product_area);
|
||||||
|
}else {
|
||||||
|
configTarget = DictConstantPool.PRODUCT_OUT_POINT.get(product_area);
|
||||||
|
}
|
||||||
if (StringUtils.isEmpty(configTarget)){
|
if (StringUtils.isEmpty(configTarget)){
|
||||||
throw new BadRequestException("创建任务失败:出库点车间点位对应关系配置异常");
|
throw new BadRequestException("创建任务失败:出库点车间点位对应关系配置异常");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,80 +0,0 @@
|
|||||||
package org.nl.wms.dispatch_manage.task.service;
|
|
||||||
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
|
||||||
import cn.hutool.http.HttpStatus;
|
|
||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.SneakyThrows;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.nl.common.TableDataInfo;
|
|
||||||
import org.nl.common.enums.StatusEnum;
|
|
||||||
import org.nl.wms.dispatch_manage.task.service.dao.SchBaseTask;
|
|
||||||
import org.nl.wms.external_system.acs.service.WmsToAcsService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springframework.util.CollectionUtils;
|
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
import java.util.concurrent.locks.ReentrantLock;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @author ZZQ
|
|
||||||
* @Date 2023/3/22 17:14
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
@Slf4j
|
|
||||||
public class TaskScheduleService {
|
|
||||||
|
|
||||||
private ReentrantLock lock = new ReentrantLock();
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ISchBaseTaskService iSchBaseTaskService;
|
|
||||||
@Autowired
|
|
||||||
private WmsToAcsService wmsToAcsService;
|
|
||||||
|
|
||||||
@SneakyThrows
|
|
||||||
// @Scheduled(cron = "0/30 * * * * ?")
|
|
||||||
public void taskPublish(){
|
|
||||||
boolean islock = lock.tryLock();
|
|
||||||
try {
|
|
||||||
if (islock){
|
|
||||||
//查询所有自动下发的任务
|
|
||||||
List<SchBaseTask> list = iSchBaseTaskService.list(new QueryWrapper<SchBaseTask>().eq("is_send", true)
|
|
||||||
.eq("status", StatusEnum.FORM_STATUS.code("生成")));
|
|
||||||
if (!CollectionUtils.isEmpty(list)){
|
|
||||||
List<String> taskCodes = list.stream().map(SchBaseTask::getTask_code).collect(Collectors.toList());
|
|
||||||
TableDataInfo response = wmsToAcsService.interationToExt(list, "createTask");
|
|
||||||
if (!response.getCode().equals(String.valueOf(HttpStatus.HTTP_OK))){
|
|
||||||
JSONArray results = (JSONArray)JSON.toJSON(response.getData());
|
|
||||||
if (!CollectionUtils.isEmpty(results)){
|
|
||||||
for (Object result : results) {
|
|
||||||
Map resultM = (Map) result;
|
|
||||||
taskCodes.remove(resultM.get("task_code"));
|
|
||||||
iSchBaseTaskService.update(new UpdateWrapper<SchBaseTask>()
|
|
||||||
.eq("task_code",resultM.get("task_code"))
|
|
||||||
.set("status",StatusEnum.FORM_STATUS.code("暂停"))
|
|
||||||
.set("update_time", DateUtil.now()).set("remark",resultM.get("msg")));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!CollectionUtils.isEmpty(taskCodes)){
|
|
||||||
iSchBaseTaskService.update(new UpdateWrapper<SchBaseTask>()
|
|
||||||
.set("status",StatusEnum.FORM_STATUS.code("下发"))
|
|
||||||
.in("task_code",taskCodes));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}finally {
|
|
||||||
if (lock.isLocked() && lock.isHeldByCurrentThread()){
|
|
||||||
lock.unlock();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -6,6 +6,7 @@ import cn.hutool.core.date.DateUtil;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.nl.common.TableDataInfo;
|
import org.nl.common.TableDataInfo;
|
||||||
|
import org.nl.common.anno.Log;
|
||||||
import org.nl.common.domain.entity.PageQuery;
|
import org.nl.common.domain.entity.PageQuery;
|
||||||
import org.nl.common.domain.exception.BadRequestException;
|
import org.nl.common.domain.exception.BadRequestException;
|
||||||
import org.nl.common.enums.StatusEnum;
|
import org.nl.common.enums.StatusEnum;
|
||||||
@@ -61,11 +62,13 @@ public class ActDeModelController {
|
|||||||
private BpmnJSONConverter bpmnJSONConverter;
|
private BpmnJSONConverter bpmnJSONConverter;
|
||||||
|
|
||||||
@GetMapping
|
@GetMapping
|
||||||
|
@Log("查询模型")
|
||||||
public ResponseEntity<Object> getAll(ModelQuery query, PageQuery page) {
|
public ResponseEntity<Object> getAll(ModelQuery query, PageQuery page) {
|
||||||
return new ResponseEntity<>(TableDataInfo.build(modelService.page(page.build(), query.build())), HttpStatus.OK);
|
return new ResponseEntity<>(TableDataInfo.build(modelService.page(page.build(), query.build())), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping
|
@PostMapping
|
||||||
|
@Log("新增模型")
|
||||||
public ResponseEntity<Object> add(@Validated @RequestBody JSONObject form) {
|
public ResponseEntity<Object> add(@Validated @RequestBody JSONObject form) {
|
||||||
ActDeModel actDeModel = form.toJavaObject(ActDeModel.class);
|
ActDeModel actDeModel = form.toJavaObject(ActDeModel.class);
|
||||||
|
|
||||||
@@ -86,6 +89,7 @@ public class ActDeModelController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping
|
@PutMapping
|
||||||
|
@Log("修改模型")
|
||||||
public ResponseEntity<Object> update(@Validated @RequestBody ActDeModel dto) {
|
public ResponseEntity<Object> update(@Validated @RequestBody ActDeModel dto) {
|
||||||
dto.setStatus(StatusEnum.MODEL_STATUS.code("未发布"));
|
dto.setStatus(StatusEnum.MODEL_STATUS.code("未发布"));
|
||||||
dto.setUpdated_id(SecurityUtils.getCurrentNickName());
|
dto.setUpdated_id(SecurityUtils.getCurrentNickName());
|
||||||
@@ -104,6 +108,7 @@ public class ActDeModelController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping
|
@DeleteMapping
|
||||||
|
@Log("删除模型")
|
||||||
public ResponseEntity<Object> delete(@RequestBody String[] ids) {
|
public ResponseEntity<Object> delete(@RequestBody String[] ids) {
|
||||||
throw new BadRequestException("模型配置无法直接删除");
|
throw new BadRequestException("模型配置无法直接删除");
|
||||||
// if (ids.length > 0) {
|
// if (ids.length > 0) {
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import org.nl.common.utils.SecurityUtils;
|
|||||||
import org.nl.wms.md_manage.group_dick.service.IMdGruopDickService;
|
import org.nl.wms.md_manage.group_dick.service.IMdGruopDickService;
|
||||||
import org.nl.wms.md_manage.group_dick.service.dao.MdGruopDick;
|
import org.nl.wms.md_manage.group_dick.service.dao.MdGruopDick;
|
||||||
import org.nl.wms.md_manage.group_dick.service.dto.GroupDickQuery;
|
import org.nl.wms.md_manage.group_dick.service.dto.GroupDickQuery;
|
||||||
|
import org.nl.wms.pda_manage.group.dto.MaterGroupDto;
|
||||||
import org.nl.wms.pm_manage.form_data.service.IPmFormDataService;
|
import org.nl.wms.pm_manage.form_data.service.IPmFormDataService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
@@ -83,8 +84,8 @@ public class MdGruopDickController {
|
|||||||
@PostMapping
|
@PostMapping
|
||||||
@Log("人工组盘入库")
|
@Log("人工组盘入库")
|
||||||
@SaIgnore
|
@SaIgnore
|
||||||
public ResponseEntity<Object> groupDick(@RequestBody JSONObject dicks) {
|
public ResponseEntity<Object> groupDick(@RequestBody MaterGroupDto dicks) {
|
||||||
iMdGruopDickService.groupDick(dicks);
|
iMdGruopDickService.groupDick((JSONObject) JSONObject.toJSON(dicks));
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ public class MdGruopDickServiceImpl extends ServiceImpl<MdGruopDickMapper, MdGru
|
|||||||
}
|
}
|
||||||
}, StatusEnum.STRATEGY_TYPE.code("入库")+forms.getString("stor_code"),5);
|
}, StatusEnum.STRATEGY_TYPE.code("入库")+forms.getString("stor_code"),5);
|
||||||
|
|
||||||
List<JSONObject> tableData = (ArrayList)forms.remove("item");
|
List<Map> tableData = (List)forms.remove("item");
|
||||||
String now = DateUtil.now();
|
String now = DateUtil.now();
|
||||||
forms.put("create_name",SecurityUtils.getCurrentNickName());
|
forms.put("create_name",SecurityUtils.getCurrentNickName());
|
||||||
forms.put("create_time", now);
|
forms.put("create_time", now);
|
||||||
|
|||||||
@@ -0,0 +1,59 @@
|
|||||||
|
package org.nl.wms.pda_manage.common;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.dev33.satoken.annotation.SaIgnore;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import org.nl.common.TableDataInfo;
|
||||||
|
import org.nl.common.anno.Log;
|
||||||
|
import org.nl.common.domain.exception.BadRequestException;
|
||||||
|
import org.nl.common.utils.ListOf;
|
||||||
|
import org.nl.common.utils.MapOf;
|
||||||
|
import org.nl.wms.dispatch_manage.point.service.ISchBasePointService;
|
||||||
|
import org.nl.wms.dispatch_manage.point.service.dao.SchBasePoint;
|
||||||
|
import org.nl.wms.external_system.acs.service.WmsToAcsService;
|
||||||
|
import org.nl.wms.pda_manage.devicemanage.dto.ComTp;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*公共接口
|
||||||
|
* @author generator
|
||||||
|
* @since 2024-03-28
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("api/pda/common")
|
||||||
|
public class PdaCommonController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private WmsToAcsService wmsToAcsService;
|
||||||
|
@Autowired
|
||||||
|
private ISchBasePointService iSchBasePointService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 仓库编码
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/storList")
|
||||||
|
@SaIgnore
|
||||||
|
@Log("仓库编码")
|
||||||
|
public ResponseEntity<TableDataInfo<List>> storList() {
|
||||||
|
HashMap of1 = MapOf.of("label", "托盘库编码", "value", "FStockPallet");
|
||||||
|
HashMap of2 = MapOf.of("label", "料箱库编码", "value", "FStockId");
|
||||||
|
HashMap of3 = MapOf.of("label", "虚拟库编码", "value", "FicStockId");
|
||||||
|
ArrayList list = ListOf.of(of1, of2, of3);
|
||||||
|
return new ResponseEntity<>(TableDataInfo.build(list),HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -13,6 +13,7 @@ import org.nl.wms.dispatch_manage.point.service.ISchBasePointService;
|
|||||||
import org.nl.wms.dispatch_manage.point.service.dao.SchBasePoint;
|
import org.nl.wms.dispatch_manage.point.service.dao.SchBasePoint;
|
||||||
import org.nl.wms.external_system.acs.service.AcsToWmsService;
|
import org.nl.wms.external_system.acs.service.AcsToWmsService;
|
||||||
import org.nl.wms.external_system.acs.service.WmsToAcsService;
|
import org.nl.wms.external_system.acs.service.WmsToAcsService;
|
||||||
|
import org.nl.wms.pda_manage.devicemanage.dto.ComTp;
|
||||||
import org.nl.wms.pda_manage.palletio.service.PalletIostorinvService;
|
import org.nl.wms.pda_manage.palletio.service.PalletIostorinvService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
@@ -25,10 +26,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
import java.text.Format;
|
import java.text.Format;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
*设备操控
|
||||||
* 出入库单主表 前端控制器
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @author generator
|
* @author generator
|
||||||
* @since 2024-03-28
|
* @since 2024-03-28
|
||||||
*/
|
*/
|
||||||
@@ -41,31 +39,47 @@ public class DeviceManageController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ISchBasePointService iSchBasePointService;
|
private ISchBasePointService iSchBasePointService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 切换出入库模式
|
||||||
|
* @param form
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@PostMapping("/changeMode/switchInOut")
|
@PostMapping("/changeMode/switchInOut")
|
||||||
@SaIgnore
|
@SaIgnore
|
||||||
@Log("切换出入库模式")
|
@Log("切换出入库模式")
|
||||||
public ResponseEntity<Object> changeModeIO(@RequestBody JSONObject form) {
|
public ResponseEntity<TableDataInfo> changeModeIO(@RequestBody ComTp form) {
|
||||||
wmsToAcsService.changeMode(form.getString("device_code"),"switchInOut",form.getString("mode"));
|
wmsToAcsService.changeMode(form.getDevice_code(),"switchInOut",form.getMode());
|
||||||
return new ResponseEntity<>(TableDataInfo.build(),HttpStatus.OK);
|
return new ResponseEntity<>(TableDataInfo.build(),HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拣选工位启停模式
|
||||||
|
* @param form
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@PostMapping("/changeMode/pinkStartStop")
|
@PostMapping("/changeMode/pinkStartStop")
|
||||||
@SaIgnore
|
@SaIgnore
|
||||||
@Log("切换拣选工位启停模式")
|
@Log("切换拣选工位启停模式")
|
||||||
public ResponseEntity<Object> changeModePick(@RequestBody JSONObject form) {
|
public ResponseEntity<TableDataInfo> changeModePick(@RequestBody ComTp form) {
|
||||||
wmsToAcsService.changeMode(form.getString("device_code"),"pinkStartStop",form.getString("mode"));
|
wmsToAcsService.changeMode(form.getDevice_code(),"pinkStartStop",form.getMode());
|
||||||
return new ResponseEntity<>(TableDataInfo.build(),HttpStatus.OK);
|
return new ResponseEntity<>(TableDataInfo.build(),HttpStatus.OK);
|
||||||
}
|
}
|
||||||
@PostMapping("/toCommandTP")
|
|
||||||
|
/**
|
||||||
|
* 下发输送线运动命令
|
||||||
|
* @param form
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/changeMode/toCommandTP")
|
||||||
@SaIgnore
|
@SaIgnore
|
||||||
@Log("下发输送线运动命令")
|
@Log("下发输送线运动命令")
|
||||||
public ResponseEntity<Object> toCommandTP(@RequestBody JSONObject form) {
|
public ResponseEntity<TableDataInfo> toCommandTP(@RequestBody ComTp form) {
|
||||||
String device_code = form.getString("device_code");
|
String device_code = form.getDevice_code();
|
||||||
SchBasePoint code = iSchBasePointService.getOne(new QueryWrapper<SchBasePoint>().eq("code", device_code));
|
SchBasePoint code = iSchBasePointService.getOne(new QueryWrapper<SchBasePoint>().eq("code", device_code));
|
||||||
if (code!=null && !code.getIs_used()){
|
if (code!=null && !code.getIs_used()){
|
||||||
return new ResponseEntity<>(ApiError.error(String.format("输送线%s模式不正确不允许下发运动",device_code)),HttpStatus.OK);
|
throw new BadRequestException(String.format("输送线%s模式不正确不允许下发运动",device_code));
|
||||||
}
|
}
|
||||||
wmsToAcsService.toCommand(device_code,form.getString("cmd"));
|
wmsToAcsService.toCommand(device_code,form.getMode());
|
||||||
return new ResponseEntity<>(TableDataInfo.build(),HttpStatus.OK);
|
return new ResponseEntity<>(TableDataInfo.build(),HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package org.nl.wms.pda_manage.devicemanage.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ComTp {
|
||||||
|
/**
|
||||||
|
* 扫码点位
|
||||||
|
*/
|
||||||
|
private String device_code;
|
||||||
|
/**
|
||||||
|
* 操作命令
|
||||||
|
*/
|
||||||
|
private String mode ;
|
||||||
|
/**
|
||||||
|
* 载具编码
|
||||||
|
*/
|
||||||
|
private String vehicle_code ;
|
||||||
|
}
|
||||||
@@ -2,10 +2,22 @@ package org.nl.wms.pda_manage.group;
|
|||||||
|
|
||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaIgnore;
|
import cn.dev33.satoken.annotation.SaIgnore;
|
||||||
|
import cn.hutool.core.lang.Assert;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.nl.common.TableDataInfo;
|
import org.nl.common.TableDataInfo;
|
||||||
import org.nl.common.anno.Log;
|
import org.nl.common.anno.Log;
|
||||||
|
import org.nl.common.domain.entity.PageQuery;
|
||||||
|
import org.nl.wms.base_manage.material.service.IMdMeMaterialbaseService;
|
||||||
|
import org.nl.wms.base_manage.material.service.dao.MdMeMaterialbase;
|
||||||
|
import org.nl.wms.base_manage.material.service.dto.MaterialQuery;
|
||||||
|
import org.nl.wms.early_manage.service.early_inv.dao.AlmEarlyInv;
|
||||||
import org.nl.wms.md_manage.group_dick.service.IMdGruopDickService;
|
import org.nl.wms.md_manage.group_dick.service.IMdGruopDickService;
|
||||||
|
import org.nl.wms.pda_manage.group.dto.GroupItemData;
|
||||||
|
import org.nl.wms.pda_manage.group.dto.MaterGroupDto;
|
||||||
|
import org.nl.wms.pda_manage.group.dto.MaterItem;
|
||||||
|
import org.nl.wms.pda_manage.group.dto.PdaMaterQuery;
|
||||||
import org.nl.wms.pda_manage.palletio.service.PalletIostorinvService;
|
import org.nl.wms.pda_manage.palletio.service.PalletIostorinvService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
@@ -15,28 +27,89 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* 物料组盘入库
|
||||||
* 出入库单主表 前端控制器
|
|
||||||
* </p>
|
|
||||||
*
|
*
|
||||||
* @author generator
|
* @author generator
|
||||||
* @since 2024-03-28
|
* @since 2024-03-28
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("api/group")
|
@RequestMapping("api/groupMater")
|
||||||
public class GroupController {
|
public class GroupController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IMdGruopDickService iMdGruopDickService;
|
private IMdGruopDickService iMdGruopDickService;
|
||||||
|
@Autowired
|
||||||
|
private IMdMeMaterialbaseService iMdMeMaterialbaseService;
|
||||||
|
|
||||||
|
@PostMapping("storCode")
|
||||||
@PostMapping("in")
|
|
||||||
@SaIgnore
|
@SaIgnore
|
||||||
@Log("手持组盘操作")
|
@Log("仓库信息")
|
||||||
public ResponseEntity<Object> inStorage(@RequestBody JSONObject form) {
|
public ResponseEntity<TableDataInfo> getStorCode(@RequestBody MaterGroupDto form) {
|
||||||
iMdGruopDickService.groupDick(form);
|
Assert.noNullElements(new Object[]{form,form.getItem(),form.getStor_code()},"请求参数不能为空");
|
||||||
|
for (MaterItem item : form.getItem()) {
|
||||||
|
GroupItemData itemData = new GroupItemData();
|
||||||
|
itemData.setSingle_weight(item.getSingle_weight());
|
||||||
|
item.setForm_data(itemData);
|
||||||
|
item.setUnit_id("16");
|
||||||
|
}
|
||||||
|
iMdGruopDickService.groupDick((JSONObject) JSONObject.toJSON(form));
|
||||||
return new ResponseEntity<>(TableDataInfo.build(),HttpStatus.OK);
|
return new ResponseEntity<>(TableDataInfo.build(),HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料列表
|
||||||
|
* @param query
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("maters")
|
||||||
|
@SaIgnore
|
||||||
|
@Log("物料列表")
|
||||||
|
public ResponseEntity<TableDataInfo<MdMeMaterialbase>> inStorage(@RequestBody PdaMaterQuery query) {
|
||||||
|
PageQuery pageQuery = new PageQuery();
|
||||||
|
pageQuery.setPage(query.getPage()-1);
|
||||||
|
pageQuery.setSize(query.getSize());
|
||||||
|
MaterialQuery materialQuery = new MaterialQuery();
|
||||||
|
if (!StringUtils.isEmpty(query.getSearch())){
|
||||||
|
materialQuery.setSearch(query.getSearch());
|
||||||
|
}
|
||||||
|
Page mapPage = iMdMeMaterialbaseService.pageMaps(pageQuery.build(), materialQuery.build());
|
||||||
|
List<Map<String, Object>> records = mapPage.getRecords();
|
||||||
|
ArrayList<MaterItem> items = new ArrayList<>();
|
||||||
|
for (Map record : records) {
|
||||||
|
JSONObject jsonM = new JSONObject(record);
|
||||||
|
MaterItem item = jsonM.toJavaObject(MaterItem.class);
|
||||||
|
item.setUnit_id("个/只");
|
||||||
|
items.add(item);
|
||||||
|
}
|
||||||
|
mapPage.setRecords(items);
|
||||||
|
return new ResponseEntity<>(TableDataInfo.build(mapPage),HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手持物料组盘操作
|
||||||
|
* @param form
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("in")
|
||||||
|
@SaIgnore
|
||||||
|
@Log("手持物料组盘操作")
|
||||||
|
public ResponseEntity<TableDataInfo> inStorage(@RequestBody JSONObject jform) {
|
||||||
|
MaterGroupDto form = jform.toJavaObject(MaterGroupDto.class);
|
||||||
|
Assert.noNullElements(new Object[]{form,form.getItem(),form.getStor_code()},"请求参数不能为空");
|
||||||
|
for (MaterItem item : form.getItem()) {
|
||||||
|
GroupItemData itemData = new GroupItemData();
|
||||||
|
itemData.setSingle_weight(item.getSingle_weight());
|
||||||
|
item.setForm_data(itemData);
|
||||||
|
item.setUnit_id("16");
|
||||||
|
}
|
||||||
|
iMdGruopDickService.groupDick((JSONObject) JSONObject.toJSON(form));
|
||||||
|
return new ResponseEntity<>(TableDataInfo.build(),HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,70 @@
|
|||||||
|
package org.nl.wms.pda_manage.group;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.dev33.satoken.annotation.SaIgnore;
|
||||||
|
import cn.hutool.core.lang.Assert;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import org.nl.common.TableDataInfo;
|
||||||
|
import org.nl.common.anno.Log;
|
||||||
|
import org.nl.common.domain.entity.PageQuery;
|
||||||
|
import org.nl.wms.base_manage.material.service.IMdMeMaterialbaseService;
|
||||||
|
import org.nl.wms.base_manage.material.service.dao.MdMeMaterialbase;
|
||||||
|
import org.nl.wms.base_manage.material.service.dto.MaterialQuery;
|
||||||
|
import org.nl.wms.md_manage.group_dick.service.IMdGruopDickService;
|
||||||
|
import org.nl.wms.pda_manage.group.dto.GroupItemData;
|
||||||
|
import org.nl.wms.pda_manage.group.dto.MaterGroupDto;
|
||||||
|
import org.nl.wms.pda_manage.group.dto.MaterItem;
|
||||||
|
import org.nl.wms.pda_manage.group.dto.PdaMaterQuery;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单据组盘入库
|
||||||
|
*
|
||||||
|
* @author generator
|
||||||
|
* @since 2024-03-28
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("api/group")
|
||||||
|
public class GroupOrderController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IMdGruopDickService iMdGruopDickService;
|
||||||
|
@Autowired
|
||||||
|
private IMdMeMaterialbaseService iMdMeMaterialbaseService;
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("maters")
|
||||||
|
@SaIgnore
|
||||||
|
@Log("物料列表")
|
||||||
|
public ResponseEntity<TableDataInfo<MdMeMaterialbase>> inStorage(@RequestBody PdaMaterQuery query) {
|
||||||
|
PageQuery pageQuery = new PageQuery();
|
||||||
|
pageQuery.setPage(query.getPage());
|
||||||
|
pageQuery.setSize(query.getSize());
|
||||||
|
MaterialQuery materialQuery = new MaterialQuery();
|
||||||
|
materialQuery.setSearch(query.getSearch());
|
||||||
|
Page<MdMeMaterialbase> page = iMdMeMaterialbaseService.page(pageQuery.build(), materialQuery.build());
|
||||||
|
return new ResponseEntity<>(TableDataInfo.build(page),HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("in")
|
||||||
|
@SaIgnore
|
||||||
|
@Log("手持物料组盘操作")
|
||||||
|
public ResponseEntity<Object> inStorage(@RequestBody MaterGroupDto form) {
|
||||||
|
Assert.noNullElements(new Object[]{form,form.getItem(),form.getStor_code()},"请求参数不能为空");
|
||||||
|
for (MaterItem item : form.getItem()) {
|
||||||
|
GroupItemData itemData = new GroupItemData();
|
||||||
|
itemData.setSingle_weight(item.getSingle_weight());
|
||||||
|
item.setForm_data(itemData);
|
||||||
|
}
|
||||||
|
iMdGruopDickService.groupDick((JSONObject) JSONObject.toJSON(form));
|
||||||
|
return new ResponseEntity<>(TableDataInfo.build(),HttpStatus.OK);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package org.nl.wms.pda_manage.group.dto;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.annotation.JSONField;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 描述单据及单重
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class GroupItemData {
|
||||||
|
/**
|
||||||
|
* 描述单据
|
||||||
|
*/
|
||||||
|
@JsonProperty("FMoBillNo")
|
||||||
|
@JSONField(name = "FMoBillNo")
|
||||||
|
private String FMoBillNo;
|
||||||
|
/**
|
||||||
|
* 输入的物料单重
|
||||||
|
*/
|
||||||
|
private String single_weight;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package org.nl.wms.pda_manage.group.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组盘入库数据
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class MaterGroupDto {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 仓库编码
|
||||||
|
*/
|
||||||
|
private String stor_code;
|
||||||
|
/**
|
||||||
|
* 主数据原单id
|
||||||
|
*/
|
||||||
|
private String source_form_id;
|
||||||
|
/**
|
||||||
|
* 主数据原单类型
|
||||||
|
*/
|
||||||
|
private String source_form_type;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
/**
|
||||||
|
* 组盘物料明细数据
|
||||||
|
*/
|
||||||
|
private List<MaterItem> item;
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
package org.nl.wms.pda_manage.group.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组盘入库物料明细数据
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class MaterItem {
|
||||||
|
/**
|
||||||
|
* 物料编码
|
||||||
|
*/
|
||||||
|
private String material_code;
|
||||||
|
/**
|
||||||
|
* 物料id
|
||||||
|
*/
|
||||||
|
private String material_id;
|
||||||
|
/**
|
||||||
|
* 物料名称
|
||||||
|
*/
|
||||||
|
private String material_name;
|
||||||
|
/**
|
||||||
|
* 物料规格
|
||||||
|
*/
|
||||||
|
private String material_spec;
|
||||||
|
/**
|
||||||
|
* 单位
|
||||||
|
*/
|
||||||
|
private String unit_id;
|
||||||
|
/**
|
||||||
|
* 物料单重
|
||||||
|
*/
|
||||||
|
private String single_weight;
|
||||||
|
/**
|
||||||
|
* 物料批次
|
||||||
|
*/
|
||||||
|
private String pcsn;
|
||||||
|
/**
|
||||||
|
* 物料数量
|
||||||
|
*/
|
||||||
|
private Integer qty;
|
||||||
|
/**
|
||||||
|
* 载具编码
|
||||||
|
*/
|
||||||
|
private String vehicle_code;
|
||||||
|
/**
|
||||||
|
* 仓库编码
|
||||||
|
*/
|
||||||
|
private String stor_code;
|
||||||
|
/**
|
||||||
|
* 原单id
|
||||||
|
*/
|
||||||
|
private String source_form_id;
|
||||||
|
/**
|
||||||
|
* 原单类型
|
||||||
|
*/
|
||||||
|
private String source_form_type;
|
||||||
|
/**
|
||||||
|
* 描述单据及单重
|
||||||
|
*/
|
||||||
|
private GroupItemData form_data;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package org.nl.wms.pda_manage.group.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import org.nl.common.domain.entity.BaseQuery;
|
||||||
|
import org.nl.wms.base_manage.material.service.dao.MdMeMaterialbase;
|
||||||
|
import org.nl.wms.md_manage.group_dick.service.dao.MdGruopDick;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组盘入库物料查询
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PdaMaterQuery {
|
||||||
|
/**
|
||||||
|
* 物料名称
|
||||||
|
*/
|
||||||
|
private String search;
|
||||||
|
/**
|
||||||
|
* 页码
|
||||||
|
*/
|
||||||
|
private Integer page;
|
||||||
|
/**
|
||||||
|
* 页数据
|
||||||
|
*/
|
||||||
|
private Integer size;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -3,6 +3,7 @@ package org.nl.wms.pm_manage.form_data.controller;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import org.nl.common.TableDataInfo;
|
import org.nl.common.TableDataInfo;
|
||||||
|
import org.nl.common.anno.Log;
|
||||||
import org.nl.common.domain.entity.PageQuery;
|
import org.nl.common.domain.entity.PageQuery;
|
||||||
import org.nl.wms.pm_manage.form_data.service.IPmFormDataService;
|
import org.nl.wms.pm_manage.form_data.service.IPmFormDataService;
|
||||||
import org.nl.wms.pm_manage.form_data.service.dao.PmFormData;
|
import org.nl.wms.pm_manage.form_data.service.dao.PmFormData;
|
||||||
@@ -38,6 +39,7 @@ public class PmFormDataController {
|
|||||||
|
|
||||||
@DeleteMapping
|
@DeleteMapping
|
||||||
@Transactional
|
@Transactional
|
||||||
|
@Log("删除单据")
|
||||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||||
if (ids.length > 0) {
|
if (ids.length > 0) {
|
||||||
iPmFormDataService.removeByIds(Arrays.asList(ids));
|
iPmFormDataService.removeByIds(Arrays.asList(ids));
|
||||||
@@ -55,6 +57,7 @@ public class PmFormDataController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/sync/{type}")
|
@GetMapping("/sync/{type}")
|
||||||
|
@Log("单据同步")
|
||||||
public ResponseEntity<Object> sync(@RequestParam String type, String formDtl) {
|
public ResponseEntity<Object> sync(@RequestParam String type, String formDtl) {
|
||||||
//参数判读,参数解析,调用参数入库
|
//参数判读,参数解析,调用参数入库
|
||||||
iPmFormDataService.syncFormData("type", formDtl);
|
iPmFormDataService.syncFormData("type", formDtl);
|
||||||
|
|||||||
@@ -43,11 +43,13 @@ public class CheckController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping()
|
@GetMapping()
|
||||||
|
@Log("盘点单查询")
|
||||||
public ResponseEntity<Object> queryAll(FormDataQuery query, PageQuery page) {
|
public ResponseEntity<Object> queryAll(FormDataQuery query, PageQuery page) {
|
||||||
return new ResponseEntity<>(TableDataInfo.build(iPmFormDataService.queryTree(query,page)), HttpStatus.OK);
|
return new ResponseEntity<>(TableDataInfo.build(iPmFormDataService.queryTree(query,page)), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/getSonFormData/{id}")
|
@GetMapping("/getSonFormData/{id}")
|
||||||
|
@Log("盘点单明细查询")
|
||||||
public ResponseEntity<Object> getSonDtlFormData(@PathVariable String id){
|
public ResponseEntity<Object> getSonDtlFormData(@PathVariable String id){
|
||||||
//参数判读,参数解析,调用参数入库
|
//参数判读,参数解析,调用参数入库
|
||||||
//Page<BmFormStruc> page = iBmFormStrucService.page(pageQuery.build(), query.build());
|
//Page<BmFormStruc> page = iBmFormStrucService.page(pageQuery.build(), query.build());
|
||||||
|
|||||||
@@ -44,17 +44,20 @@ public class StIvtIostorinvController {
|
|||||||
return new ResponseEntity<>(TableDataInfo.build(result), HttpStatus.OK);
|
return new ResponseEntity<>(TableDataInfo.build(result), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
@PostMapping("delete")
|
@PostMapping("delete")
|
||||||
|
@Log("删除入库单")
|
||||||
public ResponseEntity<Object> delete(@RequestBody List<String> ids) {
|
public ResponseEntity<Object> delete(@RequestBody List<String> ids) {
|
||||||
iStIvtIostorinvService.removeByIds(ids);
|
iStIvtIostorinvService.removeByIds(ids);
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
@PostMapping
|
@PostMapping
|
||||||
|
@Log("创建入库单")
|
||||||
public ResponseEntity<Object> save(@RequestBody JSONObject form) {
|
public ResponseEntity<Object> save(@RequestBody JSONObject form) {
|
||||||
iStIvtIostorinvService.save(form);
|
iStIvtIostorinvService.save(form);
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
|
@Log("更新入库单")
|
||||||
public ResponseEntity<Object> update(@RequestBody JSONObject form) {
|
public ResponseEntity<Object> update(@RequestBody JSONObject form) {
|
||||||
iStIvtIostorinvService.update(form);
|
iStIvtIostorinvService.update(form);
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
|||||||
@@ -256,7 +256,13 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvOutMapp
|
|||||||
List<StIvtIostorinvdtlVo> dtlVo = iStIvtIostorinvDtlService.getDtlVo(iostorinv.getId());
|
List<StIvtIostorinvdtlVo> dtlVo = iStIvtIostorinvDtlService.getDtlVo(iostorinv.getId());
|
||||||
List<String> vechiles = dtlVo.stream().map(StIvtIostorinvdtlVo::getVehicle_code).collect(Collectors.toList());
|
List<String> vechiles = dtlVo.stream().map(StIvtIostorinvdtlVo::getVehicle_code).collect(Collectors.toList());
|
||||||
//扔一个物料信息进去
|
//扔一个物料信息进去
|
||||||
BussEventMulticaster.Publish(new FlowStartEvent("st_ivt_iostorinv_" + (iostorinv.getIn_storage() ? "in" : "out")
|
String BaseModeKey;
|
||||||
|
if (dtlVo.get(0).getVehicle_code().contains("T")){
|
||||||
|
BaseModeKey="st_ivt_iostorinv_tp_";
|
||||||
|
}else {
|
||||||
|
BaseModeKey= "st_ivt_iostorinv_";
|
||||||
|
}
|
||||||
|
BussEventMulticaster.Publish(new FlowStartEvent(BaseModeKey + (iostorinv.getIn_storage() ? "in" : "out")
|
||||||
, (proc_inst_id, innerVehicle) -> iMdPbVehicleMaterService.update(new UpdateWrapper<MdPbVehicleMater>()
|
, (proc_inst_id, innerVehicle) -> iMdPbVehicleMaterService.update(new UpdateWrapper<MdPbVehicleMater>()
|
||||||
.set("proc_inst_id", proc_inst_id)
|
.set("proc_inst_id", proc_inst_id)
|
||||||
.eq("is_delete",false)
|
.eq("is_delete",false)
|
||||||
|
|||||||
@@ -35,11 +35,13 @@ public class MovingController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping()
|
@GetMapping()
|
||||||
|
@Log("查看移库单")
|
||||||
public ResponseEntity<Object> queryAll(FormDataQuery query, PageQuery page) {
|
public ResponseEntity<Object> queryAll(FormDataQuery query, PageQuery page) {
|
||||||
return new ResponseEntity<>(TableDataInfo.build(iPmFormDataService.queryTree(query,page)), HttpStatus.OK);
|
return new ResponseEntity<>(TableDataInfo.build(iPmFormDataService.queryTree(query,page)), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/getSonFormData/{id}")
|
@GetMapping("/getSonFormData/{id}")
|
||||||
|
@Log("查看移库单明细")
|
||||||
public ResponseEntity<Object> getSonDtlFormData(@PathVariable String id){
|
public ResponseEntity<Object> getSonDtlFormData(@PathVariable String id){
|
||||||
//参数判读,参数解析,调用参数入库
|
//参数判读,参数解析,调用参数入库
|
||||||
//Page<BmFormStruc> page = iBmFormStrucService.page(pageQuery.build(), query.build());
|
//Page<BmFormStruc> page = iBmFormStrucService.page(pageQuery.build(), query.build());
|
||||||
@@ -59,6 +61,7 @@ public class MovingController {
|
|||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
@PostMapping("/updateStatus")
|
@PostMapping("/updateStatus")
|
||||||
|
@Log("更新移库状态")
|
||||||
public ResponseEntity<Object> updateStatus(@RequestBody JSONObject param) {
|
public ResponseEntity<Object> updateStatus(@RequestBody JSONObject param) {
|
||||||
//TODO:明细校验
|
//TODO:明细校验
|
||||||
iPmFormDataService.update(new UpdateWrapper<PmFormData>()
|
iPmFormDataService.update(new UpdateWrapper<PmFormData>()
|
||||||
@@ -67,12 +70,14 @@ public class MovingController {
|
|||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
@PostMapping("/taskOpen")
|
@PostMapping("/taskOpen")
|
||||||
|
@Log("移动库作业下发")
|
||||||
public ResponseEntity<Object> taskOpen(@RequestBody JSONObject param) {
|
public ResponseEntity<Object> taskOpen(@RequestBody JSONObject param) {
|
||||||
movingService.taskOpen(param);
|
movingService.taskOpen(param);
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping()
|
@DeleteMapping()
|
||||||
|
@Log("删除移库单")
|
||||||
public ResponseEntity<Object> delete(@RequestBody String[] ids) {
|
public ResponseEntity<Object> delete(@RequestBody String[] ids) {
|
||||||
movingService.delete(ids);
|
movingService.delete(ids);
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
|||||||
@@ -35,17 +35,20 @@ public class PickingController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping()
|
@GetMapping()
|
||||||
|
@Log("拣选单查看")
|
||||||
public ResponseEntity<Object> queryAll(FormDataQuery query, PageQuery page) {
|
public ResponseEntity<Object> queryAll(FormDataQuery query, PageQuery page) {
|
||||||
return new ResponseEntity<>(TableDataInfo.build(iPmFormDataService.queryTree(query, page)), HttpStatus.OK);
|
return new ResponseEntity<>(TableDataInfo.build(iPmFormDataService.queryTree(query, page)), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/updateDtl")
|
@PostMapping("/updateDtl")
|
||||||
|
@Log("更新拣选明细")
|
||||||
public ResponseEntity<Object> updateDtl(@RequestBody JSONArray params) {
|
public ResponseEntity<Object> updateDtl(@RequestBody JSONArray params) {
|
||||||
pickingService.update(params);
|
pickingService.update(params);
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/getSonFormData/{id}")
|
@GetMapping("/getSonFormData/{id}")
|
||||||
|
@Log("查询子单据")
|
||||||
public ResponseEntity<Object> getSonDtlFormData(@PathVariable String id) {
|
public ResponseEntity<Object> getSonDtlFormData(@PathVariable String id) {
|
||||||
//参数判读,参数解析,调用参数入库
|
//参数判读,参数解析,调用参数入库
|
||||||
//Page<BmFormStruc> page = iBmFormStrucService.page(pageQuery.build(), query.build());
|
//Page<BmFormStruc> page = iBmFormStrucService.page(pageQuery.build(), query.build());
|
||||||
@@ -54,6 +57,7 @@ public class PickingController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/sync/{type}")
|
@GetMapping("/sync/{type}")
|
||||||
|
@Log("单据同步")
|
||||||
public ResponseEntity<Object> sync(@RequestParam String type, String formDtl) {
|
public ResponseEntity<Object> sync(@RequestParam String type, String formDtl) {
|
||||||
//参数判读,参数解析,调用参数入库
|
//参数判读,参数解析,调用参数入库
|
||||||
iPmFormDataService.syncFormData("type", formDtl);
|
iPmFormDataService.syncFormData("type", formDtl);
|
||||||
@@ -68,6 +72,7 @@ public class PickingController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/updateStatus")
|
@PostMapping("/updateStatus")
|
||||||
|
@Log("修改单据状态")
|
||||||
public ResponseEntity<Object> updateStatus(@RequestBody JSONObject param) {
|
public ResponseEntity<Object> updateStatus(@RequestBody JSONObject param) {
|
||||||
//TODO:明细校验
|
//TODO:明细校验
|
||||||
iPmFormDataService.update(new UpdateWrapper<PmFormData>()
|
iPmFormDataService.update(new UpdateWrapper<PmFormData>()
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import cn.hutool.core.date.DateUtil;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.nl.common.anno.Log;
|
||||||
import org.nl.common.domain.entity.PageQuery;
|
import org.nl.common.domain.entity.PageQuery;
|
||||||
import org.nl.common.utils.IdUtil;
|
import org.nl.common.utils.IdUtil;
|
||||||
import org.nl.common.utils.SecurityUtils;
|
import org.nl.common.utils.SecurityUtils;
|
||||||
@@ -35,11 +36,13 @@ public class StIvtStructattrController {
|
|||||||
private IStIvtStructattrService structattrService;
|
private IStIvtStructattrService structattrService;
|
||||||
|
|
||||||
@GetMapping
|
@GetMapping
|
||||||
|
@Log("仓位查询")
|
||||||
public ResponseEntity<Object> query(StructattrQuery query, PageQuery page) {
|
public ResponseEntity<Object> query(StructattrQuery query, PageQuery page) {
|
||||||
return new ResponseEntity<>(structattrService.pageQuery(query,page), HttpStatus.OK);
|
return new ResponseEntity<>(structattrService.pageQuery(query,page), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping
|
@PostMapping
|
||||||
|
@Log("仓位新增")
|
||||||
public ResponseEntity<Object> create(@Validated @RequestBody StIvtStructattr dto) {
|
public ResponseEntity<Object> create(@Validated @RequestBody StIvtStructattr dto) {
|
||||||
dto.setId(IdUtil.getStringId());
|
dto.setId(IdUtil.getStringId());
|
||||||
dto.setCreate_id(SecurityUtils.getCurrentUserId());
|
dto.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||||
@@ -50,6 +53,7 @@ public class StIvtStructattrController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping
|
@PutMapping
|
||||||
|
@Log("仓位修改")
|
||||||
public ResponseEntity<Object> update(@Validated @RequestBody StIvtStructattr dto) {
|
public ResponseEntity<Object> update(@Validated @RequestBody StIvtStructattr dto) {
|
||||||
String vehicle_code = dto.getVehicle_code();
|
String vehicle_code = dto.getVehicle_code();
|
||||||
if (StringUtils.isEmpty(vehicle_code)){
|
if (StringUtils.isEmpty(vehicle_code)){
|
||||||
@@ -60,12 +64,14 @@ public class StIvtStructattrController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping
|
@DeleteMapping
|
||||||
|
@Log("仓位删除")
|
||||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||||
structattrService.deleteAll(ids);
|
structattrService.deleteAll(ids);
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/changeActive")
|
@PutMapping("/changeActive")
|
||||||
|
@Log("仓位状态改变")
|
||||||
public ResponseEntity<Object> changeActive(@RequestBody StIvtStructattr dto) {
|
public ResponseEntity<Object> changeActive(@RequestBody StIvtStructattr dto) {
|
||||||
structattrService.changeActive(dto);
|
structattrService.changeActive(dto);
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
@@ -78,6 +84,7 @@ public class StIvtStructattrController {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping("/getStructIvt")
|
@GetMapping("/getStructIvt")
|
||||||
|
@Log("查询库存")
|
||||||
public ResponseEntity<Object> getStructIvt(StructattrQuery query, PageQuery page) {
|
public ResponseEntity<Object> getStructIvt(StructattrQuery query, PageQuery page) {
|
||||||
return new ResponseEntity<>(structattrService.getStructIvt(query,page), HttpStatus.OK);
|
return new ResponseEntity<>(structattrService.getStructIvt(query,page), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,6 +81,7 @@
|
|||||||
</if>
|
</if>
|
||||||
<if test="is_lock != null and is_lock != ''">
|
<if test="is_lock != null and is_lock != ''">
|
||||||
and md_pb_vehicleMater.is_lock = false
|
and md_pb_vehicleMater.is_lock = false
|
||||||
|
and md_pb_vehicleMater.frozen_qty = 0
|
||||||
</if>
|
</if>
|
||||||
<if test="order_by != null and order_by != ''">
|
<if test="order_by != null and order_by != ''">
|
||||||
order by ${order_by}
|
order by ${order_by}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import org.springframework.stereotype.Component;
|
|||||||
@Component
|
@Component
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@Order(100)
|
@Order(100)
|
||||||
@ConditionalOnProperty(name = "spring.profiles.active", havingValue = "prod")
|
@ConditionalOnProperty(name = "jobrun", havingValue = "true")
|
||||||
public class JobRunner implements ApplicationRunner {
|
public class JobRunner implements ApplicationRunner {
|
||||||
private static final Logger log = LoggerFactory.getLogger(JobRunner.class);
|
private static final Logger log = LoggerFactory.getLogger(JobRunner.class);
|
||||||
private final ISysQuartzJobService quartzJobService;
|
private final ISysQuartzJobService quartzJobService;
|
||||||
|
|||||||
@@ -32,37 +32,37 @@ public class SysQuartzLog implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* bean名
|
* bean名
|
||||||
*/
|
*/
|
||||||
private String beanName;
|
private String bean_name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建时间
|
* 创建时间
|
||||||
*/
|
*/
|
||||||
private String createTime;
|
private String create_time;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* corn表达式
|
* corn表达式
|
||||||
*/
|
*/
|
||||||
private String cronExpression;
|
private String cron_expression;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 异常信息
|
* 异常信息
|
||||||
*/
|
*/
|
||||||
private String exceptionDetail;
|
private String exception_detail;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否成功
|
* 是否成功
|
||||||
*/
|
*/
|
||||||
private Boolean isSuccess;
|
private Boolean is_success;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 任务名称
|
* 任务名称
|
||||||
*/
|
*/
|
||||||
private String jobName;
|
private String job_name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 方法名称
|
* 方法名称
|
||||||
*/
|
*/
|
||||||
private String methodName;
|
private String method_name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 参数
|
* 参数
|
||||||
|
|||||||
@@ -59,11 +59,11 @@ public class SysQuartzJobServiceImpl extends ServiceImpl<SysQuartzJobMapper, Sys
|
|||||||
@Override
|
@Override
|
||||||
public IPage<SysQuartzLog> queryAllLog(JobQuery criteria, PageQuery page) {
|
public IPage<SysQuartzLog> queryAllLog(JobQuery criteria, PageQuery page) {
|
||||||
LambdaQueryWrapper<SysQuartzLog> lam = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<SysQuartzLog> lam = new LambdaQueryWrapper<>();
|
||||||
lam.like(ObjectUtil.isNotEmpty(criteria.getJob_name()), SysQuartzLog::getJobName, criteria.getJob_name())
|
lam.like(ObjectUtil.isNotEmpty(criteria.getJob_name()), SysQuartzLog::getJob_name, criteria.getJob_name())
|
||||||
.eq(ObjectUtil.isNotEmpty(criteria.getIsSuccess()), SysQuartzLog::getIsSuccess, criteria.getIsSuccess())
|
.eq(ObjectUtil.isNotEmpty(criteria.getIsSuccess()), SysQuartzLog::getIs_success, criteria.getIsSuccess())
|
||||||
.nested(ObjectUtil.isNotEmpty(criteria.getCreate_time()), i -> {
|
.nested(ObjectUtil.isNotEmpty(criteria.getCreate_time()), i -> {
|
||||||
i.ge(SysQuartzLog::getCreateTime, criteria.getCreate_time().get(0))
|
i.ge(SysQuartzLog::getCreate_time, criteria.getCreate_time().get(0))
|
||||||
.le(SysQuartzLog::getCreateTime, criteria.getCreate_time().get(1));
|
.le(SysQuartzLog::getCreate_time, criteria.getCreate_time().get(1));
|
||||||
});
|
});
|
||||||
IPage<SysQuartzLog> pages = new Page<>(page.getPage() + 1, page.getSize());
|
IPage<SysQuartzLog> pages = new Page<>(page.getPage() + 1, page.getSize());
|
||||||
quartzLogMapper.selectPage(pages, lam);
|
quartzLogMapper.selectPage(pages, lam);
|
||||||
|
|||||||
@@ -1,26 +0,0 @@
|
|||||||
package org.nl.wms.system_manage.service.quartz.task;
|
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: lyd
|
|
||||||
* @Description: 测试例子
|
|
||||||
* @Date: 2022/12/19
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Component
|
|
||||||
public class TestTask {
|
|
||||||
|
|
||||||
public void run(){
|
|
||||||
log.info("run 执行成功");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void run1(String str){
|
|
||||||
log.info("run1 执行成功,参数为: {}" + str);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void run2(){
|
|
||||||
log.info("run2 执行成功");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -53,12 +53,12 @@ public class ExecutionJob extends QuartzJobBean {
|
|||||||
|
|
||||||
SysQuartzLog logDto = new SysQuartzLog();
|
SysQuartzLog logDto = new SysQuartzLog();
|
||||||
logDto.setLogId(IdUtil.getSnowflake(1,1).nextIdStr());
|
logDto.setLogId(IdUtil.getSnowflake(1,1).nextIdStr());
|
||||||
logDto.setJobName(quartzJob.getJob_name());
|
logDto.setJob_name(quartzJob.getJob_name());
|
||||||
logDto.setBeanName(quartzJob.getBean_name());
|
logDto.setBean_name(quartzJob.getBean_name());
|
||||||
logDto.setMethodName(quartzJob.getMethod_name());
|
logDto.setMethod_name(quartzJob.getMethod_name());
|
||||||
logDto.setParams(quartzJob.getParams());
|
logDto.setParams(quartzJob.getParams());
|
||||||
long startTime = System.currentTimeMillis();
|
long startTime = System.currentTimeMillis();
|
||||||
logDto.setCronExpression(quartzJob.getCron_expression());
|
logDto.setCron_expression(quartzJob.getCron_expression());
|
||||||
try {
|
try {
|
||||||
// 执行任务
|
// 执行任务
|
||||||
QuartzRunnable task = new QuartzRunnable(quartzJob.getBean_name(), quartzJob.getMethod_name(),
|
QuartzRunnable task = new QuartzRunnable(quartzJob.getBean_name(), quartzJob.getMethod_name(),
|
||||||
@@ -71,7 +71,7 @@ public class ExecutionJob extends QuartzJobBean {
|
|||||||
redisUtils.set(uuid, true);
|
redisUtils.set(uuid, true);
|
||||||
}
|
}
|
||||||
// 任务状态
|
// 任务状态
|
||||||
logDto.setIsSuccess(true);
|
logDto.setIs_success(true);
|
||||||
// 判断是否存在子任务
|
// 判断是否存在子任务
|
||||||
if (StrUtil.isNotEmpty(quartzJob.getSub_task())) {
|
if (StrUtil.isNotEmpty(quartzJob.getSub_task())) {
|
||||||
String[] tasks = quartzJob.getSub_task().split("[,,]");
|
String[] tasks = quartzJob.getSub_task().split("[,,]");
|
||||||
@@ -85,8 +85,8 @@ public class ExecutionJob extends QuartzJobBean {
|
|||||||
long times = System.currentTimeMillis() - startTime;
|
long times = System.currentTimeMillis() - startTime;
|
||||||
logDto.setTime(times);
|
logDto.setTime(times);
|
||||||
// 任务状态 0:成功 1:失败
|
// 任务状态 0:成功 1:失败
|
||||||
logDto.setIsSuccess(false);
|
logDto.setIs_success(false);
|
||||||
logDto.setExceptionDetail(e.getMessage());
|
logDto.setException_detail(e.getMessage());
|
||||||
// 任务如果失败了则暂停
|
// 任务如果失败了则暂停
|
||||||
if (quartzJob.getPause_after_failure() != null && quartzJob.getPause_after_failure()) {
|
if (quartzJob.getPause_after_failure() != null && quartzJob.getPause_after_failure()) {
|
||||||
quartzJob.setIs_pause(false);
|
quartzJob.setIs_pause(false);
|
||||||
|
|||||||
@@ -33,6 +33,14 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="接口">
|
||||||
|
<el-input
|
||||||
|
v-model="requestMethod"
|
||||||
|
size="mini"
|
||||||
|
placeholder="请输入接口"
|
||||||
|
clearable
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="关键字">
|
<el-form-item label="关键字">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="message"
|
v-model="message"
|
||||||
@@ -187,6 +195,7 @@ let queryParam = {
|
|||||||
startTime: null,
|
startTime: null,
|
||||||
endTime: null,
|
endTime: null,
|
||||||
traceId: null,
|
traceId: null,
|
||||||
|
requestMethod: null,
|
||||||
message: null,
|
message: null,
|
||||||
filterSql: true,
|
filterSql: true,
|
||||||
isRequest: true,
|
isRequest: true,
|
||||||
@@ -204,6 +213,7 @@ export default {
|
|||||||
system: '',
|
system: '',
|
||||||
timeRange: [],
|
timeRange: [],
|
||||||
message: '',
|
message: '',
|
||||||
|
requestMethod: '',
|
||||||
traceId: '',
|
traceId: '',
|
||||||
size: 20,
|
size: 20,
|
||||||
logData: [],
|
logData: [],
|
||||||
@@ -314,6 +324,7 @@ export default {
|
|||||||
queryParam.filterSql = this.filterSql === '1'
|
queryParam.filterSql = this.filterSql === '1'
|
||||||
queryParam.isRequest = this.filterSql === '1'
|
queryParam.isRequest = this.filterSql === '1'
|
||||||
queryParam.traceId = this.traceId
|
queryParam.traceId = this.traceId
|
||||||
|
queryParam.requestMethod = this.requestMethod
|
||||||
queryParam.size = this.size
|
queryParam.size = this.size
|
||||||
queryParam.page = this.page
|
queryParam.page = this.page
|
||||||
queryParam.system = this.system
|
queryParam.system = this.system
|
||||||
@@ -353,6 +364,7 @@ export default {
|
|||||||
}
|
}
|
||||||
queryParam.message = this.message.replace(/^\s*|\s*$/g, '')
|
queryParam.message = this.message.replace(/^\s*|\s*$/g, '')
|
||||||
queryParam.traceId = this.traceId
|
queryParam.traceId = this.traceId
|
||||||
|
queryParam.requestMethod = this.requestMethod
|
||||||
queryParam.system = this.system
|
queryParam.system = this.system
|
||||||
|
|
||||||
logOperation.clearLogs(queryParam).then(res => {
|
logOperation.clearLogs(queryParam).then(res => {
|
||||||
|
|||||||
Reference in New Issue
Block a user