代码更新
This commit is contained in:
@@ -34,8 +34,11 @@ import org.nl.modules.logging.service.LogService;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Parameter;
|
||||
import java.util.ArrayList;
|
||||
@@ -75,11 +78,19 @@ public class LogAspect {
|
||||
*/
|
||||
@Around("logPointcut()")
|
||||
public Object logAround(ProceedingJoinPoint joinPoint) throws Throwable {
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
HttpServletRequest request = attributes.getRequest();
|
||||
HttpServletResponse response = attributes.getResponse();
|
||||
// HttpServletRequest request = RequestHolder.getHttpServletRequest();
|
||||
|
||||
|
||||
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
|
||||
Method method = signature.getMethod();
|
||||
// 方法路径
|
||||
String methodName = joinPoint.getTarget().getClass().getName() + "." + signature.getName() + "()";
|
||||
String params=getParameter(method, joinPoint.getArgs());
|
||||
|
||||
log.info("请求uri:{}", request.getRequestURI());
|
||||
log.info("请求方法:{}",methodName);
|
||||
log.info("请求方法参数:{}",params);
|
||||
|
||||
@@ -88,7 +99,7 @@ public class LogAspect {
|
||||
result = joinPoint.proceed();
|
||||
Log log = new Log("INFO",System.currentTimeMillis() - currentTime.get());
|
||||
currentTime.remove();
|
||||
HttpServletRequest request = RequestHolder.getHttpServletRequest();
|
||||
|
||||
logService.save(getUsername(), StringUtils.getBrowser(request), StringUtils.getIp(request),joinPoint, log);
|
||||
return result;
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -1,77 +0,0 @@
|
||||
|
||||
package org.nl.wms.st.vehiclebill.rest;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.nl.wms.st.vehiclebill.service.InEmptyvehiclerecordService;
|
||||
import org.nl.wms.st.vehiclebill.service.dto.EmptyvehiclerecordDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Liuxy
|
||||
* @date 2022-08-12
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "空载具入库管理")
|
||||
@RequestMapping("/api/inemptyvehicle")
|
||||
@Slf4j
|
||||
public class InEmptyvehiclerecordController {
|
||||
|
||||
private final InEmptyvehiclerecordService inEmptyvehiclerecordService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询空载具入库")
|
||||
@ApiOperation("查询空载具入库")
|
||||
//@SaCheckPermission("emptyvehiclerecord:list")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page) {
|
||||
return new ResponseEntity<>(inEmptyvehiclerecordService.queryAll(whereJson, page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增空载具入库")
|
||||
@ApiOperation("新增空载具入库")
|
||||
//@SaCheckPermission("emptyvehiclerecord:add")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody EmptyvehiclerecordDto dto) {
|
||||
inEmptyvehiclerecordService.create(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改空载具入库")
|
||||
@ApiOperation("修改空载具入库")
|
||||
//@SaCheckPermission("emptyvehiclerecord:edit")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody EmptyvehiclerecordDto dto) {
|
||||
inEmptyvehiclerecordService.update(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除空载具入库")
|
||||
@ApiOperation("删除空载具入库")
|
||||
//@SaCheckPermission("emptyvehiclerecord:del")
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||
inEmptyvehiclerecordService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("生成任务")
|
||||
@ApiOperation("生成任务")
|
||||
@PostMapping("/createTask")
|
||||
public ResponseEntity<Object> createTask(@RequestBody JSONObject whereJson) {
|
||||
inEmptyvehiclerecordService.createTask(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
|
||||
package org.nl.wms.st.vehiclebill.rest;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.nl.wms.st.vehiclebill.service.OutEmptyvehiclerecordService;
|
||||
import org.nl.wms.st.vehiclebill.service.dto.EmptyvehiclerecordDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Liuxy
|
||||
* @date 2022-08-12
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "空载具出库管理")
|
||||
@RequestMapping("/api/outemptyvehicle")
|
||||
@Slf4j
|
||||
public class OutEmptyvehiclerecordController {
|
||||
|
||||
private final OutEmptyvehiclerecordService outEmptyvehiclerecordService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询空载具出库")
|
||||
@ApiOperation("查询空载具出库")
|
||||
//@SaCheckPermission("emptyvehiclerecord:list")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page) {
|
||||
return new ResponseEntity<>(outEmptyvehiclerecordService.queryAll(whereJson, page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增空载具出库")
|
||||
@ApiOperation("新增空载具出库")
|
||||
//@SaCheckPermission("emptyvehiclerecord:add")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody EmptyvehiclerecordDto dto) {
|
||||
outEmptyvehiclerecordService.create(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改空载具出库")
|
||||
@ApiOperation("修改空载具出库")
|
||||
//@SaCheckPermission("emptyvehiclerecord:edit")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody EmptyvehiclerecordDto dto) {
|
||||
outEmptyvehiclerecordService.update(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除空载具出库")
|
||||
@ApiOperation("删除空载具出库")
|
||||
//@SaCheckPermission("emptyvehiclerecord:del")
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||
outEmptyvehiclerecordService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("生成任务")
|
||||
@ApiOperation("生成任务")
|
||||
@PostMapping("/createTask")
|
||||
public ResponseEntity<Object> createTask(@RequestBody JSONObject whereJson) {
|
||||
outEmptyvehiclerecordService.createTask(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
|
||||
package org.nl.wms.st.vehiclebill.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.st.vehiclebill.service.dto.EmptyvehiclerecordDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Liuxy
|
||||
* @description 服务接口
|
||||
* @date 2022-08-12
|
||||
**/
|
||||
public interface InEmptyvehiclerecordService {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
*
|
||||
* @param whereJson 条件
|
||||
* @param page 分页参数
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
Map<String, Object> queryAll(Map whereJson, Pageable page);
|
||||
|
||||
/**
|
||||
* 查询所有数据不分页
|
||||
*
|
||||
* @param whereJson 条件参数
|
||||
* @return List<EmptyvehiclerecordDto>
|
||||
*/
|
||||
List<EmptyvehiclerecordDto> queryAll(Map whereJson);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
*
|
||||
* @param record_uuid ID
|
||||
* @return Emptyvehiclerecord
|
||||
*/
|
||||
EmptyvehiclerecordDto findById(Long record_uuid);
|
||||
|
||||
/**
|
||||
* 根据编码查询
|
||||
*
|
||||
* @param code code
|
||||
* @return Emptyvehiclerecord
|
||||
*/
|
||||
EmptyvehiclerecordDto findByCode(String code);
|
||||
|
||||
|
||||
/**
|
||||
* 创建
|
||||
*
|
||||
* @param dto /
|
||||
*/
|
||||
void create(EmptyvehiclerecordDto dto);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param dto /
|
||||
*/
|
||||
void update(EmptyvehiclerecordDto dto);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
*
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(Long[] ids);
|
||||
|
||||
/**
|
||||
* 生成任务
|
||||
*
|
||||
* @param whereJson /
|
||||
*/
|
||||
void createTask(JSONObject whereJson);
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
|
||||
package org.nl.wms.st.vehiclebill.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.st.vehiclebill.service.dto.EmptyvehiclerecordDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Liuxy
|
||||
* @description 服务接口
|
||||
* @date 2022-08-12
|
||||
**/
|
||||
public interface OutEmptyvehiclerecordService {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
*
|
||||
* @param whereJson 条件
|
||||
* @param page 分页参数
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
Map<String, Object> queryAll(Map whereJson, Pageable page);
|
||||
|
||||
/**
|
||||
* 查询所有数据不分页
|
||||
*
|
||||
* @param whereJson 条件参数
|
||||
* @return List<EmptyvehiclerecordDto>
|
||||
*/
|
||||
List<EmptyvehiclerecordDto> queryAll(Map whereJson);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
*
|
||||
* @param record_uuid ID
|
||||
* @return Emptyvehiclerecord
|
||||
*/
|
||||
EmptyvehiclerecordDto findById(Long record_uuid);
|
||||
|
||||
/**
|
||||
* 根据编码查询
|
||||
*
|
||||
* @param code code
|
||||
* @return Emptyvehiclerecord
|
||||
*/
|
||||
EmptyvehiclerecordDto findByCode(String code);
|
||||
|
||||
|
||||
/**
|
||||
* 创建
|
||||
*
|
||||
* @param dto /
|
||||
*/
|
||||
void create(EmptyvehiclerecordDto dto);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param dto /
|
||||
*/
|
||||
void update(EmptyvehiclerecordDto dto);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
*
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(Long[] ids);
|
||||
|
||||
/**
|
||||
* 生成任务
|
||||
*
|
||||
* @param whereJson /
|
||||
*/
|
||||
void createTask(JSONObject whereJson);
|
||||
}
|
||||
@@ -1,110 +0,0 @@
|
||||
package org.nl.wms.st.vehiclebill.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
||||
/**
|
||||
* @author Liuxy
|
||||
* @description /
|
||||
* @date 2022-08-12
|
||||
**/
|
||||
@Data
|
||||
public class EmptyvehiclerecordDto implements Serializable {
|
||||
|
||||
/** 记录标识 */
|
||||
/**
|
||||
* 防止精度丢失
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long record_uuid;
|
||||
|
||||
/**
|
||||
* 单据编号
|
||||
*/
|
||||
private String bill_code;
|
||||
|
||||
/**
|
||||
* 单据类型
|
||||
*/
|
||||
private String io_type;
|
||||
|
||||
/**
|
||||
* 单据状态
|
||||
*/
|
||||
private String bill_status;
|
||||
|
||||
/**
|
||||
* 载具数量
|
||||
*/
|
||||
private BigDecimal vehicle_qty;
|
||||
|
||||
/**
|
||||
* 起始点位
|
||||
*/
|
||||
private String start_point_code;
|
||||
|
||||
/**
|
||||
* 下一点位
|
||||
*/
|
||||
private String next_point_code;
|
||||
|
||||
/**
|
||||
* 起始区域
|
||||
*/
|
||||
private Long start_region_id;
|
||||
|
||||
/**
|
||||
* 终点区域
|
||||
*/
|
||||
private Long end_region_id;
|
||||
|
||||
/**
|
||||
* 任务标识
|
||||
*/
|
||||
private Long task_uuid;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private Long create_id;
|
||||
|
||||
/**
|
||||
* 创建人姓名
|
||||
*/
|
||||
private String create_name;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String create_time;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private Long update_optid;
|
||||
|
||||
/**
|
||||
* 修改人姓名
|
||||
*/
|
||||
private String update_optname;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private String update_time;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private String is_delete;
|
||||
}
|
||||
@@ -1,211 +0,0 @@
|
||||
|
||||
package org.nl.wms.st.vehiclebill.service.impl;
|
||||
|
||||
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.common.utils.SecurityUtils;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.nl.modules.wql.util.WqlUtil;
|
||||
import org.nl.wms.sch.service.PointService;
|
||||
import org.nl.wms.sch.tasks.SendEmpVehicleTask;
|
||||
import org.nl.wms.st.vehiclebill.service.InEmptyvehiclerecordService;
|
||||
import org.nl.wms.st.vehiclebill.service.dto.EmptyvehiclerecordDto;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
|
||||
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
|
||||
/**
|
||||
* @author Liuxy
|
||||
* @description 服务实现
|
||||
* @date 2022-08-12
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class InEmptyvehiclerecordServiceImpl implements InEmptyvehiclerecordService {
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||
String bill_code = MapUtil.getStr(whereJson, "bill_code");
|
||||
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("flag", "1");
|
||||
|
||||
if (ObjectUtil.isNotEmpty(bill_code)) map.put("bill_code",bill_code + "%");
|
||||
|
||||
JSONObject json = WQL.getWO("ST_VEHICLE_IN_01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "st.create_time DESC");
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EmptyvehiclerecordDto> queryAll(Map whereJson) {
|
||||
WQLObject wo = WQLObject.getWQLObject("st_ivt_emptyvehiclerecord");
|
||||
JSONArray arr = wo.query().getResultJSONArray(0);
|
||||
if (ObjectUtil.isNotEmpty(arr)) return arr.toJavaList(EmptyvehiclerecordDto.class);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EmptyvehiclerecordDto findById(Long record_uuid) {
|
||||
WQLObject wo = WQLObject.getWQLObject("st_ivt_emptyvehiclerecord");
|
||||
JSONObject json = wo.query("record_uuid = '" + record_uuid + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(json)) {
|
||||
return json.toJavaObject(EmptyvehiclerecordDto.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EmptyvehiclerecordDto findByCode(String code) {
|
||||
WQLObject wo = WQLObject.getWQLObject("st_ivt_emptyvehiclerecord");
|
||||
JSONObject json = wo.query("code ='" + code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(json)) {
|
||||
return json.toJavaObject(EmptyvehiclerecordDto.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(EmptyvehiclerecordDto dto) {
|
||||
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point");
|
||||
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
String start_point_code = dto.getStart_point_code();
|
||||
String next_point_code = dto.getNext_point_code();
|
||||
// 判断起点是否为空! 入库起点不能为空
|
||||
if (ObjectUtil.isEmpty(start_point_code)) throw new BadRequestException("起点不能为空");
|
||||
// 根据点位编码找到对应的所属区域
|
||||
Long start_region_id = pointTab.query("point_code = '" + start_point_code + "'").uniqueResult(0).getLongValue("region_id");
|
||||
if (ObjectUtil.isNotEmpty(next_point_code)) {
|
||||
Long end_region_id = pointTab.query("point_code = '" + next_point_code + "'").uniqueResult(0).getLongValue("region_id");
|
||||
dto.setEnd_region_id(end_region_id);
|
||||
}
|
||||
|
||||
dto.setRecord_uuid(IdUtil.getSnowflake(1, 1).nextId());
|
||||
dto.setCreate_id(currentUserId);
|
||||
dto.setCreate_name(nickName);
|
||||
dto.setUpdate_optid(currentUserId);
|
||||
dto.setUpdate_optname(nickName);
|
||||
dto.setUpdate_time(now);
|
||||
dto.setCreate_time(now);
|
||||
dto.setBill_code(CodeUtil.getNewCode("KZJ_BILL_CODE"));
|
||||
dto.setIo_type("0");
|
||||
dto.setBill_status("10");
|
||||
dto.setStart_region_id(start_region_id);
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("st_ivt_emptyvehiclerecord");
|
||||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||
wo.insert(json);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(EmptyvehiclerecordDto dto) {
|
||||
EmptyvehiclerecordDto entity = this.findById(dto.getRecord_uuid());
|
||||
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
|
||||
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point");
|
||||
|
||||
String start_point_code = dto.getStart_point_code();
|
||||
String next_point_code = dto.getNext_point_code();
|
||||
// 判断起点是否为空! 入库起点不能为空
|
||||
if (ObjectUtil.isEmpty(start_point_code)) throw new BadRequestException("起点不能为空");
|
||||
// 根据点位编码找到对应的所属区域
|
||||
Long start_region_id = pointTab.query("point_code = '" + start_point_code + "'").uniqueResult(0).getLongValue("region_id");
|
||||
if (ObjectUtil.isNotEmpty(next_point_code)) {
|
||||
Long end_region_id = pointTab.query("point_code = '" + next_point_code + "'").uniqueResult(0).getLongValue("region_id");
|
||||
dto.setEnd_region_id(end_region_id);
|
||||
}
|
||||
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
|
||||
String now = DateUtil.now();
|
||||
dto.setUpdate_time(now);
|
||||
dto.setStart_region_id(start_region_id);
|
||||
dto.setUpdate_optid(currentUserId);
|
||||
dto.setUpdate_optname(nickName);
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("st_ivt_emptyvehiclerecord");
|
||||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||
wo.update(json);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteAll(Long[] ids) {
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("st_ivt_emptyvehiclerecord");
|
||||
for (Long record_uuid : ids) {
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("record_uuid", String.valueOf(record_uuid));
|
||||
param.put("is_delete", "1");
|
||||
param.put("update_optid", currentUserId);
|
||||
param.put("update_optname", nickName);
|
||||
param.put("update_time", now);
|
||||
wo.update(param);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void createTask(JSONObject whereJson) {
|
||||
WQLObject empTab = WQLObject.getWQLObject("st_ivt_EmptyVehicleRecord");
|
||||
WQLObject taskTab = WQLObject.getWQLObject("sch_base_task");
|
||||
|
||||
JSONObject jsonEmp = empTab.query("record_uuid = '" + whereJson.getString("record_uuid") + "'").uniqueResult(0);
|
||||
// 准备参数 调用空载具处理类中的 创建任务的方法
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("start_point_code", jsonEmp.getString("start_point_code"));
|
||||
param.put("next_point_code", jsonEmp.getString("next_point_code"));
|
||||
param.put("qty", jsonEmp.getString("vehicle_qty"));
|
||||
param.put("record_uuid", jsonEmp.getString("record_uuid"));
|
||||
|
||||
String task_id = new SendEmpVehicleTask().createTask(param);
|
||||
// 更新空载具表中的任务id和单据状态
|
||||
PointService pointDto = SpringContextHolder.getBean(PointService.class);
|
||||
JSONObject jsonTask = taskTab.query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
|
||||
jsonEmp.put("task_uuid", Long.valueOf(task_id));
|
||||
jsonEmp.put("bill_status","20");
|
||||
jsonEmp.put("next_point_code",jsonTask.getString("next_point_code"));
|
||||
jsonEmp.put("end_region_id",pointDto.findByCode(jsonTask.getString("next_point_code")).getRegion_id());
|
||||
jsonEmp.put("update_optid", SecurityUtils.getCurrentUserId());
|
||||
jsonEmp.put("update_optname", SecurityUtils.getCurrentNickName());
|
||||
jsonEmp.put("update_time", DateUtil.now());
|
||||
empTab.update(jsonEmp);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,206 +0,0 @@
|
||||
|
||||
package org.nl.wms.st.vehiclebill.service.impl;
|
||||
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.common.utils.SecurityUtils;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
|
||||
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.nl.modules.wql.util.WqlUtil;
|
||||
import org.nl.wms.sch.service.PointService;
|
||||
import org.nl.wms.sch.tasks.CallEmpVehicleTask;
|
||||
import org.nl.wms.st.vehiclebill.service.OutEmptyvehiclerecordService;
|
||||
import org.nl.wms.st.vehiclebill.service.dto.EmptyvehiclerecordDto;
|
||||
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Liuxy
|
||||
* @description 服务实现
|
||||
* @date 2022-08-12
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class OutEmptyvehiclerecordServiceImpl implements OutEmptyvehiclerecordService {
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||
String bill_code = MapUtil.getStr(whereJson, "bill_code");
|
||||
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("flag", "1");
|
||||
|
||||
if (ObjectUtil.isNotEmpty(bill_code)) map.put("bill_code",bill_code + "%");
|
||||
|
||||
JSONObject json = WQL.getWO("ST_VEHICLE_OUT_01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "st.create_time DESC");
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EmptyvehiclerecordDto> queryAll(Map whereJson) {
|
||||
WQLObject wo = WQLObject.getWQLObject("st_ivt_emptyvehiclerecord");
|
||||
JSONArray arr = wo.query().getResultJSONArray(0);
|
||||
if (ObjectUtil.isNotEmpty(arr)) return arr.toJavaList(EmptyvehiclerecordDto.class);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EmptyvehiclerecordDto findById(Long record_uuid) {
|
||||
WQLObject wo = WQLObject.getWQLObject("st_ivt_emptyvehiclerecord");
|
||||
JSONObject json = wo.query("record_uuid = '" + record_uuid + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(json)) {
|
||||
return json.toJavaObject(EmptyvehiclerecordDto.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EmptyvehiclerecordDto findByCode(String code) {
|
||||
WQLObject wo = WQLObject.getWQLObject("st_ivt_emptyvehiclerecord");
|
||||
JSONObject json = wo.query("code ='" + code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(json)) {
|
||||
return json.toJavaObject(EmptyvehiclerecordDto.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(EmptyvehiclerecordDto dto) {
|
||||
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point");
|
||||
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
String start_point_code = dto.getStart_point_code();
|
||||
String next_point_code = dto.getNext_point_code();
|
||||
// 判断终点是否为空! 出库终点不能为空
|
||||
if (ObjectUtil.isEmpty(next_point_code)) throw new BadRequestException("终点不能为空");
|
||||
// 根据点位编码找到对应的所属区域
|
||||
Long end_region_id = pointTab.query("point_code = '" + next_point_code + "'").uniqueResult(0).getLongValue("region_id");
|
||||
if (ObjectUtil.isNotEmpty(start_point_code)) {
|
||||
Long start_region_id = pointTab.query("point_code = '" + start_point_code + "'").uniqueResult(0).getLongValue("region_id");
|
||||
dto.setStart_region_id(start_region_id);
|
||||
}
|
||||
|
||||
dto.setRecord_uuid(IdUtil.getSnowflake(1, 1).nextId());
|
||||
dto.setCreate_id(currentUserId);
|
||||
dto.setCreate_name(nickName);
|
||||
dto.setUpdate_optid(currentUserId);
|
||||
dto.setUpdate_optname(nickName);
|
||||
dto.setUpdate_time(now);
|
||||
dto.setCreate_time(now);
|
||||
dto.setBill_code(CodeUtil.getNewCode("KZJ_BILL_CODE"));
|
||||
dto.setIo_type("1");
|
||||
dto.setBill_status("10");
|
||||
dto.setEnd_region_id(end_region_id);
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("st_ivt_emptyvehiclerecord");
|
||||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||
wo.insert(json);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(EmptyvehiclerecordDto dto) {
|
||||
EmptyvehiclerecordDto entity = this.findById(dto.getRecord_uuid());
|
||||
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
|
||||
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point");
|
||||
|
||||
String start_point_code = dto.getStart_point_code();
|
||||
String next_point_code = dto.getNext_point_code();
|
||||
// 判断起点是否为空! 入库起点不能为空
|
||||
if (ObjectUtil.isEmpty(next_point_code)) throw new BadRequestException("终点不能为空");
|
||||
// 根据点位编码找到对应的所属区域
|
||||
Long end_region_id = pointTab.query("point_code = '" + next_point_code + "'").uniqueResult(0).getLongValue("region_id");
|
||||
if (ObjectUtil.isNotEmpty(start_point_code)) {
|
||||
Long start_region_id = pointTab.query("point_code = '" + start_point_code + "'").uniqueResult(0).getLongValue("region_id");
|
||||
dto.setStart_region_id(start_region_id);
|
||||
}
|
||||
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
|
||||
String now = DateUtil.now();
|
||||
dto.setUpdate_time(now);
|
||||
dto.setStart_region_id(end_region_id);
|
||||
dto.setUpdate_optid(currentUserId);
|
||||
dto.setUpdate_optname(nickName);
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("st_ivt_emptyvehiclerecord");
|
||||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||
wo.update(json);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteAll(Long[] ids) {
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("st_ivt_emptyvehiclerecord");
|
||||
for (Long record_uuid : ids) {
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("record_uuid", String.valueOf(record_uuid));
|
||||
param.put("is_delete", "1");
|
||||
param.put("update_optid", currentUserId);
|
||||
param.put("update_optname", nickName);
|
||||
param.put("update_time", now);
|
||||
wo.update(param);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void createTask(JSONObject whereJson) {
|
||||
WQLObject empTab = WQLObject.getWQLObject("st_ivt_EmptyVehicleRecord");
|
||||
WQLObject taskTab = WQLObject.getWQLObject("sch_base_task");
|
||||
|
||||
JSONObject jsonEmp = empTab.query("record_uuid = '" + whereJson.getString("record_uuid") + "'").uniqueResult(0);
|
||||
// 准备参数 调用空载具处理类中的 创建任务的方法
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("start_point_code", jsonEmp.getString("start_point_code"));
|
||||
param.put("next_point_code", jsonEmp.getString("next_point_code"));
|
||||
param.put("qty", jsonEmp.getString("vehicle_qty"));
|
||||
param.put("record_uuid", jsonEmp.getString("record_uuid"));
|
||||
|
||||
String task_id = new CallEmpVehicleTask().createTask(param);
|
||||
// 更新空载具表中的任务id和单据状态
|
||||
PointService pointDto = SpringContextHolder.getBean(PointService.class);
|
||||
JSONObject jsonTask = taskTab.query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
|
||||
jsonEmp.put("task_uuid", Long.valueOf(task_id));
|
||||
jsonEmp.put("bill_status","20");
|
||||
jsonEmp.put("start_point_code",jsonTask.getString("start_point_code"));
|
||||
jsonEmp.put("start_region_id",pointDto.findByCode(jsonTask.getString("start_point_code")).getRegion_id());
|
||||
jsonEmp.put("update_optid", SecurityUtils.getCurrentUserId());
|
||||
jsonEmp.put("update_optname", SecurityUtils.getCurrentNickName());
|
||||
jsonEmp.put("update_time", DateUtil.now());
|
||||
empTab.update(jsonEmp);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
[交易说明]
|
||||
交易名: 空载具入库分页查询
|
||||
所属模块:
|
||||
功能简述:
|
||||
版权所有:
|
||||
表引用:
|
||||
版本经历:
|
||||
|
||||
[数据库]
|
||||
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
||||
|
||||
[IO定义]
|
||||
#################################################
|
||||
## 表字段对应输入参数
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.bill_code TYPEAS s_string
|
||||
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
|
||||
[临时变量]
|
||||
--所有中间过程变量均可在此处定义
|
||||
|
||||
[业务过程]
|
||||
|
||||
##########################################
|
||||
# 1、输入输出检查 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 2、主过程前处理 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 3、业务主过程 #
|
||||
##########################################
|
||||
|
||||
IF 输入.flag = "1"
|
||||
PAGEQUERY
|
||||
SELECT
|
||||
st.*,
|
||||
region1.region_name AS start_region_name,
|
||||
region2.region_name AS endt_region_name
|
||||
FROM
|
||||
st_ivt_EmptyVehicleRecord st
|
||||
LEFT JOIN sch_base_region region1 ON st.start_region_id = region1.region_id
|
||||
LEFT JOIN sch_base_region region2 ON st.end_region_id = region2.region_id
|
||||
WHERE
|
||||
st.is_delete = '0'
|
||||
AND st.io_type = '0'
|
||||
|
||||
OPTION 输入.bill_code <> ""
|
||||
st.bill_code like 输入.bill_code
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
@@ -1,108 +0,0 @@
|
||||
[交易说明]
|
||||
交易名: 空载具入库业务
|
||||
所属模块:
|
||||
功能简述:
|
||||
版权所有:
|
||||
表引用:
|
||||
版本经历:
|
||||
|
||||
[数据库]
|
||||
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
||||
|
||||
[IO定义]
|
||||
#################################################
|
||||
## 表字段对应输入参数
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.vehicle_qty TYPEAS s_string
|
||||
输入.region_code TYPEAS s_string
|
||||
输入.vehicle_type TYPEAS s_string
|
||||
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
|
||||
[临时变量]
|
||||
--所有中间过程变量均可在此处定义
|
||||
|
||||
[业务过程]
|
||||
|
||||
##########################################
|
||||
# 1、输入输出检查 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 2、主过程前处理 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 3、业务主过程 #
|
||||
##########################################
|
||||
|
||||
IF 输入.flag = "1"
|
||||
QUERY
|
||||
SELECT
|
||||
point.*
|
||||
FROM
|
||||
sch_base_point point
|
||||
LEFT JOIN SCH_BASE_Region region ON point.region_id = region.region_id
|
||||
WHERE
|
||||
point.lock_type = '00'
|
||||
AND (12 - IFNULL(point.vehicle_qty,0)) >= 输入.vehicle_qty
|
||||
|
||||
OPTION 输入.region_code <> ""
|
||||
region.region_code = 输入.region_code
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.vehicle_type <> ""
|
||||
point.vehicle_type = 输入.vehicle_type
|
||||
ENDOPTION
|
||||
|
||||
order by point.vehicle_qty DESC
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "2"
|
||||
QUERY
|
||||
SELECT
|
||||
point.*
|
||||
FROM
|
||||
sch_base_point point
|
||||
LEFT JOIN SCH_BASE_Region region ON point.region_id = region.region_id
|
||||
WHERE
|
||||
point.lock_type = '00'
|
||||
AND IFNULL(point.vehicle_qty,0) = '0'
|
||||
|
||||
OPTION 输入.region_code <> ""
|
||||
region.region_code = 输入.region_code
|
||||
ENDOPTION
|
||||
|
||||
order by point.vehicle_qty DESC
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "3"
|
||||
QUERY
|
||||
SELECT
|
||||
point.*
|
||||
FROM
|
||||
sch_base_point point
|
||||
LEFT JOIN SCH_BASE_Region region ON point.region_id = region.region_id
|
||||
WHERE
|
||||
point.lock_type = '00'
|
||||
AND point.point_status = '00'
|
||||
|
||||
OPTION 输入.region_code <> ""
|
||||
region.region_code = 输入.region_code
|
||||
ENDOPTION
|
||||
|
||||
order by point.point_code DESC
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
@@ -1,61 +0,0 @@
|
||||
[交易说明]
|
||||
交易名: 空载具出库分页查询
|
||||
所属模块:
|
||||
功能简述:
|
||||
版权所有:
|
||||
表引用:
|
||||
版本经历:
|
||||
|
||||
[数据库]
|
||||
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
||||
|
||||
[IO定义]
|
||||
#################################################
|
||||
## 表字段对应输入参数
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.bill_code TYPEAS s_string
|
||||
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
|
||||
[临时变量]
|
||||
--所有中间过程变量均可在此处定义
|
||||
|
||||
[业务过程]
|
||||
|
||||
##########################################
|
||||
# 1、输入输出检查 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 2、主过程前处理 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 3、业务主过程 #
|
||||
##########################################
|
||||
|
||||
IF 输入.flag = "1"
|
||||
PAGEQUERY
|
||||
SELECT
|
||||
st.*,
|
||||
region1.region_name AS start_region_name,
|
||||
region2.region_name AS endt_region_name
|
||||
FROM
|
||||
st_ivt_EmptyVehicleRecord st
|
||||
LEFT JOIN sch_base_region region1 ON st.start_region_id = region1.region_id
|
||||
LEFT JOIN sch_base_region region2 ON st.end_region_id = region2.region_id
|
||||
WHERE
|
||||
st.is_delete = '0'
|
||||
AND st.io_type = '1'
|
||||
|
||||
OPTION 输入.bill_code <> ""
|
||||
st.bill_code like 输入.bill_code
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
@@ -1,114 +0,0 @@
|
||||
[交易说明]
|
||||
交易名: 空载具出库业务
|
||||
所属模块:
|
||||
功能简述:
|
||||
版权所有:
|
||||
表引用:
|
||||
版本经历:
|
||||
|
||||
[数据库]
|
||||
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
||||
|
||||
[IO定义]
|
||||
#################################################
|
||||
## 表字段对应输入参数
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.vehicle_qty TYPEAS s_string
|
||||
输入.vehicle_type TYPEAS s_string
|
||||
输入.region_code TYPEAS s_string
|
||||
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
|
||||
[临时变量]
|
||||
--所有中间过程变量均可在此处定义
|
||||
|
||||
[业务过程]
|
||||
|
||||
##########################################
|
||||
# 1、输入输出检查 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 2、主过程前处理 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 3、业务主过程 #
|
||||
##########################################
|
||||
|
||||
IF 输入.flag = "1"
|
||||
QUERY
|
||||
SELECT
|
||||
point.*
|
||||
FROM
|
||||
sch_base_point point
|
||||
LEFT JOIN SCH_BASE_Region region ON point.region_id = region.region_id
|
||||
WHERE
|
||||
point.lock_type = '00'
|
||||
AND point.point_status = '01'
|
||||
AND IFNULL(point.vehicle_qty,0) >= 输入.vehicle_qty
|
||||
|
||||
OPTION 输入.region_code <> ""
|
||||
region.region_code = 输入.region_code
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.vehicle_type <> ""
|
||||
point.vehicle_type = 输入.vehicle_type
|
||||
ENDOPTION
|
||||
|
||||
order by point.vehicle_qty ASC
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "3"
|
||||
QUERY
|
||||
SELECT
|
||||
point.*
|
||||
FROM
|
||||
sch_base_point point
|
||||
LEFT JOIN SCH_BASE_Region region ON point.region_id = region.region_id
|
||||
WHERE
|
||||
point.lock_type = '00'
|
||||
AND point.point_status = '01'
|
||||
AND IFNULL(point.vehicle_qty,0) = 输入.vehicle_qty
|
||||
|
||||
OPTION 输入.region_code <> ""
|
||||
region.region_code = 输入.region_code
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.vehicle_type <> ""
|
||||
point.vehicle_type = 输入.vehicle_type
|
||||
ENDOPTION
|
||||
|
||||
order by point.point_code DESC
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "2"
|
||||
QUERY
|
||||
SELECT
|
||||
point.*
|
||||
FROM
|
||||
sch_base_point point
|
||||
LEFT JOIN SCH_BASE_Region region ON point.region_id = region.region_id
|
||||
WHERE
|
||||
point.lock_type = '00'
|
||||
AND point.point_status = '00'
|
||||
|
||||
OPTION 输入.region_code <> ""
|
||||
region.region_code = 输入.region_code
|
||||
ENDOPTION
|
||||
|
||||
order by point.point_code DESC
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
@@ -6,7 +6,7 @@ spring:
|
||||
druid:
|
||||
db-type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:47.111.78.178}:${DB_PORT:3306}/${DB_NAME:lzhl_one_lms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:47.111.78.178}:${DB_PORT:3306}/${DB_NAME:yongyu_lms2}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||
# url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:nladmin}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||
username: ${DB_USER:root}
|
||||
password: ${DB_PWD:P@ssw0rd}
|
||||
@@ -134,7 +134,7 @@ logging:
|
||||
# Sa-Token配置
|
||||
sa-token:
|
||||
# token 名称 (同时也是cookie名称)
|
||||
token-name: satoken
|
||||
token-name: Authorization
|
||||
# token 有效期,单位s 默认30天, -1代表永不过期
|
||||
timeout: 2592000
|
||||
# token 临时有效期 (指定时间内无操作就视为token过期) 单位: 秒
|
||||
@@ -149,7 +149,7 @@ sa-token:
|
||||
is-log: false
|
||||
jwt-secret-key: opsjajisdnnca0sdkksdfaaasdfwwq
|
||||
# token 前缀
|
||||
# token-prefix: Bearer
|
||||
token-prefix: Bearer
|
||||
|
||||
loki:
|
||||
url: http://localhost:3100/loki/api/v1
|
||||
|
||||
@@ -1,202 +0,0 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="请选择点位"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
width="1000px"
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<el-row style="margin-bottom: 10px;">
|
||||
<el-col :span="22">
|
||||
<el-form :inline="true" class="demo-form-inline">
|
||||
<el-form-item :inline="true" label="模糊搜索:">
|
||||
<el-input v-model="query.search" placeholder="请输入点位编码或名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="所属区域" prop="region_id">
|
||||
<el-select
|
||||
v-model="query.region_id"
|
||||
placeholder="请选择"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in reginoList"
|
||||
:label="item.region_name"
|
||||
:value="item.region_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
style="width: 100%;"
|
||||
size="mini"
|
||||
border
|
||||
:cell-style="{'text-align':'center'}"
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266','text-align':'center'}"
|
||||
@select="handleSelectionChange"
|
||||
@select-all="onSelectAll"
|
||||
@current-change="clickChange"
|
||||
>
|
||||
<el-table-column v-if="!isSingle" type="selection" width="55" />
|
||||
<el-table-column v-if="isSingle" label="选择" width="55">
|
||||
<template slot-scope="scope">
|
||||
<el-radio v-model="tableRadio" :label="scope.row"><i /></el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="point_code" label="终点点位编码" show-overflow-tooltip />
|
||||
<el-table-column prop="point_name" label="终点点位名称" show-overflow-tooltip />
|
||||
<el-table-column prop="region_name" label="所属区域" show-overflow-tooltip />
|
||||
<el-table-column prop="vehicle_qty" label="载具数量" show-overflow-tooltip :formatter="formatQty" />
|
||||
<el-table-column prop="point_type" label="点位类型">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.sch_point_type[scope.row.point_type] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import CRUD, { header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import crudPoint from '@/api/wms/sch/point'
|
||||
|
||||
export default {
|
||||
name: 'EndPointDialog',
|
||||
components: { rrOperation, pagination },
|
||||
dicts: ['sch_area_type', 'sch_point_type'],
|
||||
cruds() {
|
||||
return CRUD({ title: '点位', url: 'api/point/selectPoint', crudMethod: { ...crudPoint }, optShow: {}})
|
||||
},
|
||||
mixins: [presenter(), header()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
isSingle: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
openParam: {
|
||||
type: Object,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formInline: {
|
||||
search: ''
|
||||
},
|
||||
tableRadio: '',
|
||||
tableData: [],
|
||||
reginoList: [],
|
||||
dialogVisible: false,
|
||||
material: {}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudPoint.getRegion().then(res => {
|
||||
this.reginoList = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
handleClose(done) {
|
||||
this.$confirm('确认关闭?')
|
||||
.then(_ => {
|
||||
done()
|
||||
})
|
||||
.catch(_ => {
|
||||
})
|
||||
},
|
||||
open() {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
close() {
|
||||
this.crud.resetQuery(false)
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
submit() {
|
||||
// 处理单选
|
||||
if (this.isSingle && this.tableRadio) {
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('tableChanged2', this.tableRadio)
|
||||
return
|
||||
}
|
||||
this.rows = this.$refs.table.selection
|
||||
if (this.rows.length <= 0) {
|
||||
this.$message('请先选择终点点位')
|
||||
return
|
||||
}
|
||||
this.crud.resetQuery(false)
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('tableChanged2', this.rows)
|
||||
},
|
||||
handleSelectionChange(val, row) {
|
||||
if (val.length > 1) {
|
||||
this.$refs.table.clearSelection()
|
||||
this.$refs.table.toggleRowSelection(val.pop())
|
||||
} else {
|
||||
this.checkrow = row
|
||||
}
|
||||
},
|
||||
onSelectAll() {
|
||||
this.$refs.table.clearSelection()
|
||||
},
|
||||
clickChange(item) {
|
||||
this.tableRadio = item
|
||||
},
|
||||
hand(value) {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
formatQty(row) {
|
||||
debugger
|
||||
if (row.vehicle_qty === '') {
|
||||
return '0'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.crud-opts2 {
|
||||
padding: 4px 0;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.crud-opts2 .crud-opts-right2 {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.el-table_body tr.current-row>td {
|
||||
background-color: #e9e500;
|
||||
}
|
||||
</style>
|
||||
@@ -1,217 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="90px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="单据编号">
|
||||
<el-input
|
||||
v-model="query.bill_code"
|
||||
clearable
|
||||
placeholder="单据编号"
|
||||
style="width: 185px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation :crud="crud" />
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
:loading="loading"
|
||||
:disabled="crud.selections.length !== 1"
|
||||
@click="createTask"
|
||||
>
|
||||
生成任务
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="550px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="100px">
|
||||
<el-form-item label="数量:" prop="vehicle_qty">
|
||||
<el-input v-model="form.vehicle_qty" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="起始点位:" prop="start_point_code">
|
||||
<el-input v-model="form.start_point_name" style="width: 370px;" @focus="openStartPonit" />
|
||||
</el-form-item>
|
||||
<el-form-item label="下一点位:">
|
||||
<el-input v-model="form.next_point_name" style="width: 370px;" @focus="openEndPonit" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注:">
|
||||
<el-input v-model="form.remark" type="textarea" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column v-if="false" prop="record_uuid" label="记录标识" />
|
||||
<el-table-column prop="bill_code" label="单据编号" show-overflow-tooltip />
|
||||
<el-table-column prop="bill_status" label="单据状态">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.st_bill_status[scope.row.bill_status] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="start_point_code" label="起始点位" />
|
||||
<el-table-column prop="next_point_code" label="下一点位" />
|
||||
<el-table-column prop="start_region_name" label="起始区域" />
|
||||
<el-table-column prop="endt_region_name" label="终点区域" />
|
||||
<el-table-column prop="vehicle_qty" label="数量" />
|
||||
<el-table-column prop="task_uuid" label="任务标识" show-overflow-tooltip/>
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
<el-table-column prop="create_name" label="创建人" />
|
||||
<el-table-column prop="create_time" label="创建时间" width="150px" />
|
||||
<el-table-column prop="update_optname" label="修改人" />
|
||||
<el-table-column prop="update_time" label="修改时间" width="150px" />
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<PointDialog :dialog-show.sync="pointDialog" @tableChanged2="tableChanged2" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudInemptyvehicl from '@/api/wms/st/vehiclebill/inemptyvehicl'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import PointDialog from '@/views/wms/st/vehiclebill/PointDialog'
|
||||
|
||||
const defaultForm = {
|
||||
record_uuid: null,
|
||||
bill_code: null,
|
||||
io_type: null,
|
||||
bill_status: null,
|
||||
vehicle_qty: null,
|
||||
start_point_code: null,
|
||||
next_point_code: null,
|
||||
start_point_name: null,
|
||||
next_point_name: null,
|
||||
start_region_id: null,
|
||||
end_region_id: null,
|
||||
task_uuid: null,
|
||||
remark: null,
|
||||
create_id: null,
|
||||
create_name: null,
|
||||
create_time: null,
|
||||
update_optid: null,
|
||||
update_optname: null,
|
||||
update_time: null,
|
||||
is_delete: null
|
||||
}
|
||||
export default {
|
||||
name: 'Inemptyvehicle',
|
||||
dicts: ['st_bill_status'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation, PointDialog },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '空载具入库',
|
||||
url: 'api/inemptyvehicle',
|
||||
idField: 'record_uuid',
|
||||
sort: 'record_uuid,desc',
|
||||
crudMethod: { ...crudInemptyvehicl },
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false,
|
||||
reset: true
|
||||
}
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pointDialog: false,
|
||||
is_startAndEnd: null,
|
||||
loading: false,
|
||||
permission: {},
|
||||
rules: {
|
||||
vehicle_qty: [
|
||||
{ required: true, message: '数量不能为空', trigger: 'blur' }
|
||||
],
|
||||
start_point_code: [
|
||||
{ required: true, message: '起始点位不能为空', trigger: 'blur' }
|
||||
],
|
||||
next_point_code: [
|
||||
{ required: true, message: '终点点位不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
openStartPonit() {
|
||||
// 1代表起始点位 2代表终点点位
|
||||
this.is_startAndEnd = '1'
|
||||
this.pointDialog = true
|
||||
},
|
||||
openEndPonit() {
|
||||
// 1代表起始点位 2代表终点点位
|
||||
this.is_startAndEnd = '2'
|
||||
this.pointDialog = true
|
||||
},
|
||||
tableChanged2(row) {
|
||||
if (this.is_startAndEnd === '1') {
|
||||
this.form.start_point_code = row.point_code
|
||||
this.form.start_point_name = row.point_name
|
||||
}
|
||||
if (this.is_startAndEnd === '2') {
|
||||
this.form.next_point_code = row.point_code
|
||||
this.form.next_point_name = row.point_name
|
||||
}
|
||||
},
|
||||
createTask() {
|
||||
const _selectData = this.$refs.table.selection
|
||||
if (_selectData[0].bill_status !== '10') {
|
||||
return this.crud.notify('只能对生成状态的单据生成任务', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
}
|
||||
const data = _selectData[0]
|
||||
this.loading = true
|
||||
crudInemptyvehicl.createTask(data).then(res => {
|
||||
this.crud.toQuery()
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.loading = false
|
||||
}).cache(() => {
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -1,217 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="90px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="单据编号">
|
||||
<el-input
|
||||
v-model="query.bill_code"
|
||||
clearable
|
||||
placeholder="单据编号"
|
||||
style="width: 185px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation :crud="crud" />
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
:loading="loading"
|
||||
:disabled="crud.selections.length !== 1"
|
||||
@click="createTask"
|
||||
>
|
||||
生成任务
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="550px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="100px">
|
||||
<el-form-item label="数量:" prop="vehicle_qty">
|
||||
<el-input v-model="form.vehicle_qty" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="起始点位:">
|
||||
<el-input v-model="form.start_point_name" style="width: 370px;" @focus="openStartPonit" />
|
||||
</el-form-item>
|
||||
<el-form-item label="下一点位:" prop="next_point_code">
|
||||
<el-input v-model="form.next_point_name" style="width: 370px;" @focus="openEndPonit" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注:">
|
||||
<el-input v-model="form.remark" type="textarea" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column v-if="false" prop="record_uuid" label="记录标识" />
|
||||
<el-table-column prop="bill_code" label="单据编号" show-overflow-tooltip />
|
||||
<el-table-column prop="bill_status" label="单据状态">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.st_bill_status[scope.row.bill_status] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="start_point_code" label="起始点位" />
|
||||
<el-table-column prop="next_point_code" label="下一点位" />
|
||||
<el-table-column prop="start_region_name" label="起始区域" />
|
||||
<el-table-column prop="endt_region_name" label="终点区域" />
|
||||
<el-table-column prop="vehicle_qty" label="数量" />
|
||||
<el-table-column prop="task_uuid" label="任务标识" show-overflow-tooltip/>
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
<el-table-column prop="create_name" label="创建人" />
|
||||
<el-table-column prop="create_time" label="创建时间" width="150px" />
|
||||
<el-table-column prop="update_optname" label="修改人" />
|
||||
<el-table-column prop="update_time" label="修改时间" width="150px" />
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<PointDialog :dialog-show.sync="pointDialog" @tableChanged2="tableChanged2" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudOutemptyvehicl from '@/api/wms/st/vehiclebill/outemptyvehicl'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import PointDialog from '@/views/wms/st/vehiclebill/PointDialog'
|
||||
|
||||
const defaultForm = {
|
||||
record_uuid: null,
|
||||
bill_code: null,
|
||||
io_type: null,
|
||||
bill_status: null,
|
||||
vehicle_qty: null,
|
||||
start_point_code: null,
|
||||
next_point_code: null,
|
||||
start_point_name: null,
|
||||
next_point_name: null,
|
||||
start_region_id: null,
|
||||
end_region_id: null,
|
||||
task_uuid: null,
|
||||
remark: null,
|
||||
create_id: null,
|
||||
create_name: null,
|
||||
create_time: null,
|
||||
update_optid: null,
|
||||
update_optname: null,
|
||||
update_time: null,
|
||||
is_delete: null
|
||||
}
|
||||
export default {
|
||||
name: 'Outemptyvehicle',
|
||||
dicts: ['st_bill_status'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation, PointDialog },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '空载具出库',
|
||||
url: 'api/outemptyvehicle',
|
||||
idField: 'record_uuid',
|
||||
sort: 'record_uuid,desc',
|
||||
crudMethod: { ...crudOutemptyvehicl },
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false,
|
||||
reset: true
|
||||
}
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pointDialog: false,
|
||||
is_startAndEnd: null,
|
||||
loading: false,
|
||||
permission: {},
|
||||
rules: {
|
||||
vehicle_qty: [
|
||||
{ required: true, message: '数量不能为空', trigger: 'blur' }
|
||||
],
|
||||
start_point_code: [
|
||||
{ required: true, message: '起始点位不能为空', trigger: 'blur' }
|
||||
],
|
||||
next_point_code: [
|
||||
{ required: true, message: '终点点位不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
openStartPonit() {
|
||||
// 1代表起始点位 2代表终点点位
|
||||
this.is_startAndEnd = '1'
|
||||
this.pointDialog = true
|
||||
},
|
||||
openEndPonit() {
|
||||
// 1代表起始点位 2代表终点点位
|
||||
this.is_startAndEnd = '2'
|
||||
this.pointDialog = true
|
||||
},
|
||||
tableChanged2(row) {
|
||||
if (this.is_startAndEnd === '1') {
|
||||
this.form.start_point_code = row.point_code
|
||||
this.form.start_point_name = row.point_name
|
||||
}
|
||||
if (this.is_startAndEnd === '2') {
|
||||
this.form.next_point_code = row.point_code
|
||||
this.form.next_point_name = row.point_name
|
||||
}
|
||||
},
|
||||
createTask() {
|
||||
const _selectData = this.$refs.table.selection
|
||||
if (_selectData[0].bill_status !== '10') {
|
||||
return this.crud.notify('只能对生成状态的单据生成任务', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
}
|
||||
const data = _selectData[0]
|
||||
this.loading = true
|
||||
crudOutemptyvehicl.createTask(data).then(res => {
|
||||
this.crud.toQuery()
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.loading = false
|
||||
}).cache(() => {
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user