rev:基础数据维护
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
package org.nl.common.publish.event;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import org.nl.common.publish.PublishEvent;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2023/4/28 13:50
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public class VechlieEvent implements PublishEvent {
|
||||
|
||||
String VechlieCode;
|
||||
//meterilaCode ,qty
|
||||
List<Map> meterilas;
|
||||
//出还是入
|
||||
|
||||
}
|
||||
@@ -71,7 +71,7 @@ public class CodeGenerator {
|
||||
pc.setService("service." + moduleName);
|
||||
pc.setServiceImpl("service." + moduleName + ".impl");
|
||||
pc.setEntity("service." + moduleName + ".dao");
|
||||
pc.setXml("service." + moduleName + ".dao.mapper");
|
||||
pc.setXml("service." + moduleName + ".dao.mapper.xml");
|
||||
mpg.setPackageInfo(pc);
|
||||
// // 自定义配置
|
||||
InjectionConfig cfg = new InjectionConfig() {
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
package org.nl.wms.product_manage.controller.cacheline.region.rest;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.anno.Log;
|
||||
import org.nl.wms.product_manage.controller.cacheline.region.service.CachelineRegionRelationService;
|
||||
import org.nl.wms.product_manage.controller.cacheline.region.service.dto.CachelineRegionRelationDto;
|
||||
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 lyd
|
||||
* @date 2023-03-24
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "个缓存线区域关系管理")
|
||||
@RequestMapping("/api/cachelineRegionRelation")
|
||||
@Slf4j
|
||||
public class CachelineRegionRelationController {
|
||||
|
||||
private final CachelineRegionRelationService cachelineRegionRelationService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询个缓存线区域关系")
|
||||
@ApiOperation("查询个缓存线区域关系")
|
||||
//@PreAuthorize("@el.check('cachelineRegionRelation:list')")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page){
|
||||
return new ResponseEntity<>(cachelineRegionRelationService.queryAll(whereJson,page),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增个缓存线区域关系")
|
||||
@ApiOperation("新增个缓存线区域关系")
|
||||
//@PreAuthorize("@el.check('cachelineRegionRelation:add')")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody CachelineRegionRelationDto dto){
|
||||
cachelineRegionRelationService.create(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改个缓存线区域关系")
|
||||
@ApiOperation("修改个缓存线区域关系")
|
||||
//@PreAuthorize("@el.check('cachelineRegionRelation:edit')")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody CachelineRegionRelationDto dto){
|
||||
cachelineRegionRelationService.update(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除个缓存线区域关系")
|
||||
@ApiOperation("删除个缓存线区域关系")
|
||||
//@PreAuthorize("@el.check('cachelineRegionRelation:del')")
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody String[] ids) {
|
||||
cachelineRegionRelationService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
package org.nl.wms.product_manage.controller.cacheline.region.service;
|
||||
|
||||
import org.nl.wms.product_manage.controller.cacheline.region.service.dto.CachelineRegionRelationDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 服务接口
|
||||
* @author lyd
|
||||
* @date 2023-03-24
|
||||
**/
|
||||
public interface CachelineRegionRelationService {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param whereJson 条件
|
||||
* @param page 分页参数
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
Map<String,Object> queryAll(Map whereJson, Pageable page);
|
||||
|
||||
/**
|
||||
* 查询所有数据不分页
|
||||
* @param whereJson 条件参数
|
||||
* @return List<CachelineRegionRelationDto>
|
||||
*/
|
||||
List<CachelineRegionRelationDto> queryAll(Map whereJson);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
* @param relation_id ID
|
||||
* @return CachelineRegionRelation
|
||||
*/
|
||||
CachelineRegionRelationDto findById(String relation_id);
|
||||
|
||||
/**
|
||||
* 根据编码查询
|
||||
* @param code code
|
||||
* @return CachelineRegionRelation
|
||||
*/
|
||||
CachelineRegionRelationDto findByCode(String code);
|
||||
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param dto /
|
||||
*/
|
||||
void create(CachelineRegionRelationDto dto);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param dto /
|
||||
*/
|
||||
void update(CachelineRegionRelationDto dto);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(String[] ids);
|
||||
|
||||
}
|
||||
@@ -1,112 +0,0 @@
|
||||
package org.nl.wms.product_manage.controller.cacheline.region.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.wql.core.bean.ResultBean;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.WqlUtil;
|
||||
import org.nl.wms.product_manage.controller.cacheline.region.service.CachelineRegionRelationService;
|
||||
import org.nl.wms.product_manage.controller.cacheline.region.service.dto.CachelineRegionRelationDto;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import org.springframework.data.domain.Pageable;
|
||||
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;
|
||||
|
||||
/**
|
||||
* @description 服务实现
|
||||
* @author lyd
|
||||
* @date 2023-03-24
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class CachelineRegionRelationServiceImpl implements CachelineRegionRelationService {
|
||||
|
||||
@Override
|
||||
public Map<String,Object> queryAll(Map whereJson, Pageable page){
|
||||
WQLObject wo = WQLObject.getWQLObject("sch_cacheline_region_relation");
|
||||
String where = "1 = 1";
|
||||
if (ObjectUtil.isNotEmpty(whereJson.get("search"))){
|
||||
String search = whereJson.get("search").toString();
|
||||
where = "region_code like '%" + search + "%' " +
|
||||
"OR cacheline_code like '%" + search + "%'";
|
||||
}
|
||||
ResultBean rb = wo.pagequery(WqlUtil.getHttpContext(page), where, "region_code, cacheline_code");
|
||||
final JSONObject json = rb.pageResult();
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CachelineRegionRelationDto> queryAll(Map whereJson){
|
||||
WQLObject wo = WQLObject.getWQLObject("sch_cacheline_region_relation");
|
||||
JSONArray arr = wo.query().getResultJSONArray(0);
|
||||
if (ObjectUtil.isNotEmpty(arr)) return arr.toJavaList(CachelineRegionRelationDto.class);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CachelineRegionRelationDto findById(String relation_id) {
|
||||
WQLObject wo = WQLObject.getWQLObject("sch_cacheline_region_relation");
|
||||
JSONObject json = wo.query("relation_id = '" + relation_id + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(json)){
|
||||
return json.toJavaObject( CachelineRegionRelationDto.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CachelineRegionRelationDto findByCode(String code) {
|
||||
WQLObject wo = WQLObject.getWQLObject("sch_cacheline_region_relation");
|
||||
JSONObject json = wo.query("code ='" + code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(json)){
|
||||
return json.toJavaObject( CachelineRegionRelationDto.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(CachelineRegionRelationDto dto) {
|
||||
dto.setRelation_id(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||
dto.setUpdate_time(DateUtil.now());
|
||||
dto.setCreate_time(DateUtil.now());
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("sch_cacheline_region_relation");
|
||||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||
wo.insert(json);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(CachelineRegionRelationDto dto) {
|
||||
CachelineRegionRelationDto entity = this.findById(dto.getRelation_id());
|
||||
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
|
||||
dto.setUpdate_time(DateUtil.now());
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("sch_cacheline_region_relation");
|
||||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||
wo.update(json);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteAll(String[] ids) {
|
||||
WQLObject wo = WQLObject.getWQLObject("sch_cacheline_region_relation");
|
||||
for (String relation_id: ids) {
|
||||
wo.delete("relation_id = '" + relation_id + "'");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
package org.nl.wms.product_manage.controller.cacheline.vehicle.rest;
|
||||
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.anno.Log;
|
||||
import org.nl.wms.product_manage.controller.cacheline.vehicle.service.CachelineVehicleService;
|
||||
import org.nl.wms.product_manage.controller.cacheline.vehicle.service.dto.CachelineVehicleDto;
|
||||
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 lyd
|
||||
* @date 2023-03-17
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "缓存线载具管理")
|
||||
@RequestMapping("/api/cachelineVehicle")
|
||||
@Slf4j
|
||||
public class CachelineVehicleController {
|
||||
|
||||
private final CachelineVehicleService cachelineVehicleService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询缓存线载具")
|
||||
@ApiOperation("查询缓存线载具")
|
||||
//@PreAuthorize("@el.check('cachelineVehicle:list')")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page){
|
||||
return new ResponseEntity<>(cachelineVehicleService.queryAll(whereJson,page),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增缓存线载具")
|
||||
@ApiOperation("新增缓存线载具")
|
||||
//@PreAuthorize("@el.check('cachelineVehicle:add')")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody CachelineVehicleDto dto){
|
||||
cachelineVehicleService.create(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改缓存线载具")
|
||||
@ApiOperation("修改缓存线载具")
|
||||
//@PreAuthorize("@el.check('cachelineVehicle:edit')")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody CachelineVehicleDto dto){
|
||||
cachelineVehicleService.update(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除缓存线载具")
|
||||
@ApiOperation("删除缓存线载具")
|
||||
//@PreAuthorize("@el.check('cachelineVehicle:del')")
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody String[] ids) {
|
||||
cachelineVehicleService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
package org.nl.wms.product_manage.controller.cacheline.vehicle.service;
|
||||
|
||||
import org.nl.wms.product_manage.controller.cacheline.vehicle.service.dto.CachelineVehicleDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @description 服务接口
|
||||
* @author lyd
|
||||
* @date 2023-03-17
|
||||
**/
|
||||
public interface CachelineVehicleService {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param whereJson 条件
|
||||
* @param page 分页参数
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
Map<String,Object> queryAll(Map whereJson, Pageable page);
|
||||
|
||||
/**
|
||||
* 查询所有数据不分页
|
||||
* @param whereJson 条件参数
|
||||
* @return List<CachelineVehicleDto>
|
||||
*/
|
||||
List<CachelineVehicleDto> queryAll(Map whereJson);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
* @param vehicle_code ID
|
||||
* @return CachelineVehicle
|
||||
*/
|
||||
CachelineVehicleDto findById(String vehicle_code);
|
||||
|
||||
/**
|
||||
* 根据编码查询
|
||||
* @param code code
|
||||
* @return CachelineVehicle
|
||||
*/
|
||||
CachelineVehicleDto findByCode(String code);
|
||||
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param dto /
|
||||
*/
|
||||
void create(CachelineVehicleDto dto);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param dto /
|
||||
*/
|
||||
void update(CachelineVehicleDto dto);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(String[] ids);
|
||||
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
package org.nl.wms.product_manage.controller.cacheline.vehicle.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @description /
|
||||
* @author lyd
|
||||
* @date 2023-03-17
|
||||
**/
|
||||
@Data
|
||||
public class CachelineVehicleDto implements Serializable {
|
||||
|
||||
/** 载具编码 */
|
||||
private String vehicle_code;
|
||||
|
||||
/** 载具条码值 */
|
||||
private String vehicle_value;
|
||||
|
||||
/** 打印次数 */
|
||||
private BigDecimal print_num;
|
||||
|
||||
/** 是否打印 */
|
||||
private String is_print;
|
||||
|
||||
/** 打印时间 */
|
||||
private String print_time;
|
||||
|
||||
/** 生产区域 */
|
||||
private String product_area;
|
||||
|
||||
/** 是否可用 */
|
||||
private String is_active;
|
||||
|
||||
/** 是否删除 */
|
||||
private String is_delete;
|
||||
|
||||
/** 创建人 */
|
||||
private String create_id;
|
||||
|
||||
/** 创建人 */
|
||||
private String create_name;
|
||||
|
||||
/** 创建时间 */
|
||||
private String create_time;
|
||||
|
||||
/** 修改人 */
|
||||
private String update_id;
|
||||
|
||||
/** 修改人 */
|
||||
private String update_name;
|
||||
|
||||
/** 修改时间 */
|
||||
private String update_time;
|
||||
}
|
||||
@@ -1,135 +0,0 @@
|
||||
package org.nl.wms.product_manage.controller.cacheline.vehicle.service.impl;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.wql.core.bean.ResultBean;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.WqlUtil;
|
||||
import org.nl.wms.product_manage.controller.cacheline.vehicle.service.CachelineVehicleService;
|
||||
import org.nl.wms.product_manage.controller.cacheline.vehicle.service.dto.CachelineVehicleDto;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import org.springframework.data.domain.Pageable;
|
||||
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 org.nl.common.utils.SecurityUtils;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
|
||||
/**
|
||||
* @description 服务实现
|
||||
* @author lyd
|
||||
* @date 2023-03-17
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class CachelineVehicleServiceImpl implements CachelineVehicleService {
|
||||
|
||||
@Override
|
||||
public Map<String,Object> queryAll(Map whereJson, Pageable page){
|
||||
WQLObject wo = WQLObject.getWQLObject("SCH_CacheLine_VehileMaterial");
|
||||
String where = "1=1";
|
||||
Object search = whereJson.get("search");
|
||||
if (ObjectUtil.isNotEmpty(search))
|
||||
where = where + " AND vehicle_code like %" + search.toString() + "%";
|
||||
ResultBean rb = wo.pagequery(WqlUtil.getHttpContext(page), where, "vehicle_code");
|
||||
final JSONObject json = rb.pageResult();
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CachelineVehicleDto> queryAll(Map whereJson){
|
||||
WQLObject wo = WQLObject.getWQLObject("sch_cacheline_vehicle");
|
||||
JSONArray arr = wo.query().getResultJSONArray(0);
|
||||
if (ObjectUtil.isNotEmpty(arr)) return arr.toJavaList(CachelineVehicleDto.class);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CachelineVehicleDto findById(String vehicle_code) {
|
||||
WQLObject wo = WQLObject.getWQLObject("sch_cacheline_vehicle");
|
||||
JSONObject json = wo.query("vehicle_code = '" + vehicle_code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(json)){
|
||||
return json.toJavaObject( CachelineVehicleDto.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CachelineVehicleDto findByCode(String code) {
|
||||
WQLObject wo = WQLObject.getWQLObject("sch_cacheline_vehicle");
|
||||
JSONObject json = wo.query("code ='" + code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(json)){
|
||||
return json.toJavaObject( CachelineVehicleDto.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(CachelineVehicleDto dto) {
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
|
||||
dto.setVehicle_code(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||
dto.setCreate_id(currentUserId);
|
||||
dto.setCreate_name(nickName);
|
||||
dto.setUpdate_id(currentUserId);
|
||||
dto.setUpdate_name(nickName);
|
||||
dto.setUpdate_time(DateUtil.now());
|
||||
dto.setCreate_time(DateUtil.now());
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("sch_cacheline_vehicle");
|
||||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||
wo.insert(json);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(CachelineVehicleDto dto) {
|
||||
CachelineVehicleDto entity = this.findById(dto.getVehicle_code());
|
||||
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
|
||||
|
||||
dto.setUpdate_time(DateUtil.now());
|
||||
dto.setUpdate_id(currentUserId);
|
||||
dto.setUpdate_name(nickName);
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("sch_cacheline_vehicle");
|
||||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||
wo.update(json);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteAll(String[] ids) {
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("sch_cacheline_vehicle");
|
||||
for (String vehicle_code: ids) {
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("vehicle_code", String.valueOf(vehicle_code));
|
||||
param.put("is_delete", "1");
|
||||
param.put("update_optid", currentUserId);
|
||||
param.put("update_optname", nickName);
|
||||
param.put("update_time", DateUtil.now());
|
||||
wo.update(param);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Binary file not shown.
@@ -1,18 +1,17 @@
|
||||
package org.nl.wms.product_manage.controller.cacheline.position.rest;
|
||||
package org.nl.wms.scheduler_manage.controller.cacheline;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.anno.Log;
|
||||
import org.nl.wms.product_manage.controller.cacheline.position.service.CachelinePositionService;
|
||||
import org.nl.wms.product_manage.controller.cacheline.position.service.dto.CachelinePositionDto;
|
||||
import org.nl.wms.scheduler_manage.service.cacheline.CachelinePositionService;
|
||||
import org.nl.wms.scheduler_manage.service.cacheline.dto.CachelinePositionDto;
|
||||
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;
|
||||
|
||||
/**
|
||||
Binary file not shown.
@@ -1,10 +1,10 @@
|
||||
package org.nl.wms.product_manage.controller.cacheline.position.service;
|
||||
package org.nl.wms.scheduler_manage.service.cacheline;
|
||||
|
||||
import org.nl.wms.product_manage.controller.cacheline.position.service.dto.CachelinePositionDto;
|
||||
import org.nl.wms.scheduler_manage.service.cacheline.dto.CachelinePositionDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @description 服务接口
|
||||
@@ -0,0 +1,16 @@
|
||||
package org.nl.wms.scheduler_manage.service.cacheline;
|
||||
|
||||
import org.nl.wms.scheduler_manage.service.cacheline.dao.SchCachelinePosition;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 缓存线位置表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-06
|
||||
*/
|
||||
public interface ISchCachelinePositionService extends IService<SchCachelinePosition> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package org.nl.wms.scheduler_manage.service.cacheline;
|
||||
|
||||
import org.nl.wms.scheduler_manage.service.cacheline.dao.SchCachelineRegionRelation;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 区域及物料对应缓存线关系表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-06
|
||||
*/
|
||||
public interface ISchCachelineRegionRelationService extends IService<SchCachelineRegionRelation> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package org.nl.wms.scheduler_manage.service.cacheline;
|
||||
|
||||
import org.nl.wms.scheduler_manage.service.cacheline.dao.SchCachelineVehicle;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 缓存线载具条码表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-06
|
||||
*/
|
||||
public interface ISchCachelineVehicleService extends IService<SchCachelineVehicle> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package org.nl.wms.scheduler_manage.service.cacheline;
|
||||
|
||||
import org.nl.wms.scheduler_manage.service.cacheline.dao.SchCachelineVehilematerial;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 缓存线载具物料表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-06
|
||||
*/
|
||||
public interface ISchCachelineVehilematerialService extends IService<SchCachelineVehilematerial> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package org.nl.wms.scheduler_manage.service.cacheline.dao;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 缓存线位置表
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-06
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("sch_cacheline_position")
|
||||
public class SchCachelinePosition implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 缓存线位置表-位置编码
|
||||
*/
|
||||
private String position_code;
|
||||
|
||||
/**
|
||||
* 缓存线位置名字
|
||||
*/
|
||||
private String position_name;
|
||||
|
||||
/**
|
||||
* 位置顺序号
|
||||
*/
|
||||
private BigDecimal positionorder_no;
|
||||
|
||||
/**
|
||||
* 缓存线层数
|
||||
*/
|
||||
private BigDecimal layer_num;
|
||||
|
||||
/**
|
||||
* 缓存线编号
|
||||
*/
|
||||
private BigDecimal cache_line_no;
|
||||
|
||||
/**
|
||||
* 缓存线编码
|
||||
*/
|
||||
private String cacheLine_code;
|
||||
|
||||
/**
|
||||
* 实时任务id
|
||||
*/
|
||||
private String task_code;
|
||||
|
||||
/**
|
||||
* 优先层顺序
|
||||
*/
|
||||
private BigDecimal priority_layer_no;
|
||||
|
||||
/**
|
||||
* 料箱展示顺序号
|
||||
*/
|
||||
private BigDecimal order_no;
|
||||
|
||||
/**
|
||||
* 载具编码
|
||||
*/
|
||||
private String vehicle_code;
|
||||
|
||||
/**
|
||||
* 生产区域
|
||||
*/
|
||||
private String product_area;
|
||||
|
||||
/**
|
||||
* 是否空位
|
||||
*/
|
||||
private String is_empty;
|
||||
|
||||
/**
|
||||
* 是否展示
|
||||
*/
|
||||
private String is_show;
|
||||
|
||||
/**
|
||||
* 是否可用
|
||||
*/
|
||||
private String is_active;
|
||||
|
||||
/**
|
||||
* 点位锁0否1是
|
||||
*/
|
||||
private String lock_type;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private String is_delete;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,16 +1,24 @@
|
||||
package org.nl.wms.product_manage.controller.cacheline.region.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
package org.nl.wms.scheduler_manage.service.cacheline.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @author lyd
|
||||
* @description /
|
||||
* @date 2023-03-24
|
||||
**/
|
||||
* <p>
|
||||
* 区域及物料对应缓存线关系表
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-06
|
||||
*/
|
||||
@Data
|
||||
public class CachelineRegionRelationDto implements Serializable {
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("sch_cacheline_region_relation")
|
||||
public class SchCachelineRegionRelation implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键标识
|
||||
@@ -42,8 +50,5 @@ public class CachelineRegionRelationDto implements Serializable {
|
||||
*/
|
||||
private String is_active;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private String is_delete;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
package org.nl.wms.scheduler_manage.service.cacheline.dao;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 缓存线载具条码表
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-06
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("sch_cacheline_vehicle")
|
||||
public class SchCachelineVehicle implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 缓存线载具表-编码
|
||||
*/
|
||||
private String vehicle_code;
|
||||
|
||||
/**
|
||||
* 载具条码值
|
||||
*/
|
||||
private String vehicle_value;
|
||||
|
||||
/**
|
||||
* 打印次数
|
||||
*/
|
||||
private BigDecimal print_num;
|
||||
|
||||
/**
|
||||
* 是否打印
|
||||
*/
|
||||
private String is_print;
|
||||
|
||||
/**
|
||||
* 打印时间
|
||||
*/
|
||||
private String print_time;
|
||||
|
||||
/**
|
||||
* 生产区域
|
||||
*/
|
||||
private String product_area;
|
||||
|
||||
/**
|
||||
* 是否可用
|
||||
*/
|
||||
private String is_active;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private String is_delete;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private Long create_id;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String create_name;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String create_time;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private Long update_id;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private String update_name;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private String update_time;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package org.nl.wms.scheduler_manage.service.cacheline.dao;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 缓存线载具物料表
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-06
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("sch_cacheline_vehilematerial")
|
||||
public class SchCachelineVehilematerial implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 载具物料表-物料标识
|
||||
*/
|
||||
private String vehmaterial_id;
|
||||
|
||||
/**
|
||||
* 载具编码
|
||||
*/
|
||||
private String vehicle_code;
|
||||
|
||||
/**
|
||||
* 载具状态
|
||||
*/
|
||||
private String vehicle_status;
|
||||
|
||||
/**
|
||||
* 缓存线点位编码
|
||||
*/
|
||||
private String cacheLine_code;
|
||||
|
||||
/**
|
||||
* 异常类型
|
||||
*/
|
||||
private String err_type;
|
||||
|
||||
/**
|
||||
* 工单编码
|
||||
*/
|
||||
private String workorder_code;
|
||||
|
||||
/**
|
||||
* 工序编号
|
||||
*/
|
||||
private String workprocedure_code;
|
||||
|
||||
/**
|
||||
* 工序名称
|
||||
*/
|
||||
private String workprocedure_name;
|
||||
|
||||
/**
|
||||
* 物料标识
|
||||
*/
|
||||
private String material_id;
|
||||
|
||||
/**
|
||||
* 料箱物料数量
|
||||
*/
|
||||
private BigDecimal quantity;
|
||||
|
||||
/**
|
||||
* 料箱物料重量
|
||||
*/
|
||||
private BigDecimal weight;
|
||||
|
||||
/**
|
||||
* 生产区域
|
||||
*/
|
||||
private String product_area;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String create_time;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private String update_time;
|
||||
|
||||
/**
|
||||
* 是否可用
|
||||
*/
|
||||
private String is_active;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private String is_delete;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package org.nl.wms.scheduler_manage.service.cacheline.dao.mapper;
|
||||
|
||||
import org.nl.wms.scheduler_manage.service.cacheline.dao.SchCachelinePosition;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 缓存线位置表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-06
|
||||
*/
|
||||
public interface SchCachelinePositionMapper extends BaseMapper<SchCachelinePosition> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package org.nl.wms.scheduler_manage.service.cacheline.dao.mapper;
|
||||
|
||||
import org.nl.wms.scheduler_manage.service.cacheline.dao.SchCachelineRegionRelation;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 区域及物料对应缓存线关系表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-06
|
||||
*/
|
||||
public interface SchCachelineRegionRelationMapper extends BaseMapper<SchCachelineRegionRelation> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package org.nl.wms.scheduler_manage.service.cacheline.dao.mapper;
|
||||
|
||||
import org.nl.wms.scheduler_manage.service.cacheline.dao.SchCachelineVehicle;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 缓存线载具条码表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-06
|
||||
*/
|
||||
public interface SchCachelineVehicleMapper extends BaseMapper<SchCachelineVehicle> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package org.nl.wms.scheduler_manage.service.cacheline.dao.mapper;
|
||||
|
||||
import org.nl.wms.scheduler_manage.service.cacheline.dao.SchCachelineVehilematerial;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 缓存线载具物料表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-06
|
||||
*/
|
||||
public interface SchCachelineVehilematerialMapper extends BaseMapper<SchCachelineVehilematerial> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.wms.scheduler_manage.service.cacheline.dao.mapper.SchCachelinePositionMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.wms.scheduler_manage.service.cacheline.dao.mapper.SchCachelineRegionRelationMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.wms.scheduler_manage.service.cacheline.dao.mapper.SchCachelineVehicleMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.wms.scheduler_manage.service.cacheline.dao.mapper.SchCachelineVehilematerialMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.nl.wms.product_manage.controller.cacheline.position.service.dto;
|
||||
package org.nl.wms.scheduler_manage.service.cacheline.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.nl.wms.product_manage.controller.cacheline.position.service.impl;
|
||||
package org.nl.wms.scheduler_manage.service.cacheline.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -6,8 +6,8 @@ import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.WqlUtil;
|
||||
import org.nl.wms.product_manage.controller.cacheline.position.service.CachelinePositionService;
|
||||
import org.nl.wms.product_manage.controller.cacheline.position.service.dto.CachelinePositionDto;
|
||||
import org.nl.wms.scheduler_manage.service.cacheline.CachelinePositionService;
|
||||
import org.nl.wms.scheduler_manage.service.cacheline.dto.CachelinePositionDto;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package org.nl.wms.scheduler_manage.service.cacheline.impl;
|
||||
|
||||
import org.nl.wms.scheduler_manage.service.cacheline.dao.SchCachelinePosition;
|
||||
import org.nl.wms.scheduler_manage.service.cacheline.dao.mapper.SchCachelinePositionMapper;
|
||||
import org.nl.wms.scheduler_manage.service.cacheline.ISchCachelinePositionService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 缓存线位置表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-06
|
||||
*/
|
||||
@Service
|
||||
public class SchCachelinePositionServiceImpl extends ServiceImpl<SchCachelinePositionMapper, SchCachelinePosition> implements ISchCachelinePositionService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package org.nl.wms.scheduler_manage.service.cacheline.impl;
|
||||
|
||||
import org.nl.wms.scheduler_manage.service.cacheline.dao.SchCachelineRegionRelation;
|
||||
import org.nl.wms.scheduler_manage.service.cacheline.dao.mapper.SchCachelineRegionRelationMapper;
|
||||
import org.nl.wms.scheduler_manage.service.cacheline.ISchCachelineRegionRelationService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 区域及物料对应缓存线关系表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-06
|
||||
*/
|
||||
@Service
|
||||
public class SchCachelineRegionRelationServiceImpl extends ServiceImpl<SchCachelineRegionRelationMapper, SchCachelineRegionRelation> implements ISchCachelineRegionRelationService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package org.nl.wms.scheduler_manage.service.cacheline.impl;
|
||||
|
||||
import org.nl.wms.scheduler_manage.service.cacheline.dao.SchCachelineVehicle;
|
||||
import org.nl.wms.scheduler_manage.service.cacheline.dao.mapper.SchCachelineVehicleMapper;
|
||||
import org.nl.wms.scheduler_manage.service.cacheline.ISchCachelineVehicleService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 缓存线载具条码表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-06
|
||||
*/
|
||||
@Service
|
||||
public class SchCachelineVehicleServiceImpl extends ServiceImpl<SchCachelineVehicleMapper, SchCachelineVehicle> implements ISchCachelineVehicleService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package org.nl.wms.scheduler_manage.service.cacheline.impl;
|
||||
|
||||
import org.nl.wms.scheduler_manage.service.cacheline.dao.SchCachelineVehilematerial;
|
||||
import org.nl.wms.scheduler_manage.service.cacheline.dao.mapper.SchCachelineVehilematerialMapper;
|
||||
import org.nl.wms.scheduler_manage.service.cacheline.ISchCachelineVehilematerialService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 缓存线载具物料表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-06
|
||||
*/
|
||||
@Service
|
||||
public class SchCachelineVehilematerialServiceImpl extends ServiceImpl<SchCachelineVehilematerialMapper, SchCachelineVehilematerial> implements ISchCachelineVehilematerialService {
|
||||
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.google.common.collect.Lists;
|
||||
import io.jsonwebtoken.lang.Assert;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.TableDataInfo;
|
||||
@@ -16,6 +17,7 @@ import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.publish.BussEventMulticaster;
|
||||
import org.nl.common.publish.PublishEvent;
|
||||
import org.nl.common.publish.event.PointEvent;
|
||||
import org.nl.common.publish.event.VechlieEvent;
|
||||
import org.nl.common.publish.listener.PointListener;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
|
||||
Binary file not shown.
@@ -96,7 +96,7 @@ public class DeptController {
|
||||
@PutMapping
|
||||
// @SaCheckPermission("dept:edit")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody SysDept dept){
|
||||
if (dept.getPid() != null && dept.getDeptId().equals(dept.getPid())) {
|
||||
if (dept.getPid() != null && dept.getDept_id().equals(dept.getPid())) {
|
||||
throw new BadRequestException("上级不能为自己");
|
||||
}
|
||||
deptService.updateDept(dept);
|
||||
|
||||
@@ -58,7 +58,7 @@ public class SysQuartzJobController {
|
||||
@PostMapping
|
||||
@SaCheckPermission("timing:add")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody SysQuartzJob resources) {
|
||||
if (resources.getJobId() != null) {
|
||||
if (resources.getJob_id() != null) {
|
||||
throw new BadRequestException("A new " + ENTITY_NAME + " cannot already have an ID");
|
||||
}
|
||||
quartzJobService.createJob(resources);
|
||||
|
||||
@@ -30,7 +30,7 @@ public class SysDept implements Serializable {
|
||||
* ID
|
||||
*/
|
||||
@TableId(value = "dept_id", type = IdType.NONE)
|
||||
private String deptId;
|
||||
private String dept_id;
|
||||
|
||||
/**
|
||||
* 上级部门
|
||||
@@ -40,7 +40,7 @@ public class SysDept implements Serializable {
|
||||
/**
|
||||
* 子部门数目
|
||||
*/
|
||||
private Integer subCount;
|
||||
private Integer sub_count;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
@@ -50,45 +50,45 @@ public class SysDept implements Serializable {
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer deptSort;
|
||||
private Integer dept_sort;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Boolean isUsed;
|
||||
private Boolean is_used;
|
||||
|
||||
private String createId;
|
||||
private String create_id;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
private String createName;
|
||||
private String create_name;
|
||||
|
||||
private String updateId;
|
||||
private String update_id;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
private String updateName;
|
||||
private String update_name;
|
||||
|
||||
/**
|
||||
* 创建日期
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
private Date create_time;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
private Date update_time;
|
||||
|
||||
/**
|
||||
* 部门编号
|
||||
*/
|
||||
private String code;
|
||||
|
||||
private String extId;
|
||||
private String ext_id;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ public class DeptQuery extends BaseQuery<SysDept> {
|
||||
@Override
|
||||
public void paramMapping() {
|
||||
super.doP.put("pidIsNull", QParam.builder().k(new String[]{"pid"}).type(QueryTEnum.NO).build());
|
||||
super.doP.put("deptIds", QParam.builder().k(new String[]{"deptId"}).type(QueryTEnum.IN).build());
|
||||
super.doP.put("deptIds", QParam.builder().k(new String[]{"dept_id"}).type(QueryTEnum.IN).build());
|
||||
super.doP.put("name", QParam.builder().k(new String[]{"name"}).type(QueryTEnum.LK).build());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ import java.util.List;
|
||||
@Setter
|
||||
public class DeptTree implements Serializable {
|
||||
|
||||
private String deptId;
|
||||
private String dept_id;
|
||||
|
||||
private String pid;
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package org.nl.wms.system_manage.service.dept.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
@@ -23,6 +24,7 @@ import org.nl.modules.common.base.BaseDTO;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -31,18 +33,18 @@ import java.util.List;
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class DeptVo extends BaseDTO implements Serializable {
|
||||
public class DeptVo implements Serializable {
|
||||
|
||||
|
||||
private String deptId;
|
||||
private String dept_id;
|
||||
|
||||
private String code;
|
||||
|
||||
private String extId;
|
||||
private String ext_id;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "排序")
|
||||
private Integer deptSort;
|
||||
private Integer dept_sort;
|
||||
|
||||
|
||||
@NotBlank
|
||||
@@ -51,20 +53,31 @@ public class DeptVo extends BaseDTO implements Serializable {
|
||||
|
||||
@NotNull
|
||||
@ApiModelProperty(value = "是否启用")
|
||||
private Boolean isUsed;
|
||||
private Boolean is_used;
|
||||
|
||||
@ApiModelProperty(value = "上级部门")
|
||||
private Long pid;
|
||||
|
||||
@ApiModelProperty(value = "子节点数目", hidden = true)
|
||||
private Integer subCount = 0;
|
||||
private Integer sub_count = 0;
|
||||
//前端显示
|
||||
private Boolean hasChildren =Boolean.FALSE;
|
||||
|
||||
private List<DeptVo> children;
|
||||
|
||||
public void setSubCount(Integer subCount) {
|
||||
this.subCount = subCount;
|
||||
|
||||
private String create_name;
|
||||
|
||||
private String updated_name;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date create_time;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date update_Time;
|
||||
|
||||
public void setSub_count(Integer subCount) {
|
||||
this.sub_count = subCount;
|
||||
if (subCount>0){
|
||||
this.hasChildren=Boolean.TRUE;
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
|
||||
trees.add(deptDTO);
|
||||
}
|
||||
for (DeptTree it : deptDtos) {
|
||||
if (it.getPid() != null && deptDTO.getDeptId().equals(it.getPid())) {
|
||||
if (it.getPid() != null && deptDTO.getDept_id().equals(it.getPid())) {
|
||||
isChild = true;
|
||||
if (deptDTO.getChildren() == null) {
|
||||
deptDTO.setChildren(new ArrayList<>());
|
||||
@@ -123,12 +123,12 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateDept(SysDept dept) {
|
||||
if (dept == null ||StringUtils.isBlank(dept.getDeptId())){
|
||||
if (dept == null ||StringUtils.isBlank(dept.getDept_id())){
|
||||
return;
|
||||
}
|
||||
this.updateById(dept);
|
||||
//删除节点信息
|
||||
sysDeptMapper.updateSubCount(dept.getDeptId());
|
||||
sysDeptMapper.updateSubCount(dept.getDept_id());
|
||||
if (StringUtils.isNotBlank(dept.getPid())){
|
||||
sysDeptMapper.updateSubCount(dept.getPid());
|
||||
}
|
||||
@@ -171,11 +171,11 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void createDept(SysDept dept) {
|
||||
dept.setDeptId(IdUtil.getStringId());
|
||||
dept.setDept_id(IdUtil.getStringId());
|
||||
CurrentUser user = SecurityUtils.getCurrentUser();
|
||||
dept.setCreateId(user.getId());
|
||||
dept.setCreateName(user.getPresonName());
|
||||
dept.setCreateTime(new Date());
|
||||
dept.setCreate_id(user.getId());
|
||||
dept.setCreate_name(user.getPresonName());
|
||||
dept.setCreate_time(new Date());
|
||||
dept.setCode(UUID.randomUUID().toString());
|
||||
this.save(dept);
|
||||
// 清理缓存
|
||||
|
||||
@@ -15,16 +15,18 @@
|
||||
*/
|
||||
package org.nl.wms.system_manage.service.menu.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import org.nl.modules.common.base.BaseDTO;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@Data
|
||||
public class MenuDto extends BaseDTO implements Serializable {
|
||||
public class MenuDto implements Serializable {
|
||||
|
||||
private String menu_id;
|
||||
|
||||
@@ -78,6 +80,17 @@ public class MenuDto extends BaseDTO implements Serializable {
|
||||
return title;
|
||||
}
|
||||
|
||||
|
||||
private String create_name;
|
||||
|
||||
private String updated_name;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date create_time;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date update_time;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
|
||||
@@ -64,7 +64,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
||||
query.setPid(null);
|
||||
}
|
||||
Page<SysMenu> menuPage = this.page(page.build(SysMenu.class), query.build());
|
||||
List<MenuDto> collect = menuPage.getRecords().stream().map(menu -> this.doToDto(menu)).sorted(Comparator.comparingInt(MenuDto::getMenu_sort)).collect(Collectors.toList());
|
||||
List<MenuDto> collect = menuPage.getRecords().stream().map(menu -> this.doToDto(menu)).sorted(Comparator.comparingInt(a->a.getMenu_sort()==null?1:a.getMenu_sort())).collect(Collectors.toList());
|
||||
return collect;
|
||||
}
|
||||
|
||||
@@ -319,7 +319,8 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
||||
public List<MenuDto> buildTree(List<MenuDto> menuDtos) {
|
||||
List<MenuDto> trees = new ArrayList<>();
|
||||
Set<String> ids = new HashSet<>();
|
||||
for (MenuDto menuDTO : menuDtos) {
|
||||
List<MenuDto> collect = menuDtos.stream().filter(a -> a.getType().equals("2")).collect(Collectors.toList());
|
||||
for (MenuDto menuDTO : collect) {
|
||||
if (menuDTO.getPid() == null) {
|
||||
trees.add(menuDTO);
|
||||
}
|
||||
@@ -372,7 +373,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
||||
menuDto.setHidden(entity.getHidden());
|
||||
menuDto.setComponent_name(entity.getComponent_name());
|
||||
menuDto.setIcon(entity.getIcon());
|
||||
menuDto.setCreateTime(entity.getCreate_time());
|
||||
menuDto.setCreate_time(entity.getCreate_time());
|
||||
|
||||
//构建前端需要的数据结构树
|
||||
Integer sub_count = entity.getSub_count();
|
||||
|
||||
@@ -32,36 +32,36 @@ public class SysQuartzJob implements Serializable {
|
||||
* 标识
|
||||
*/
|
||||
@TableId(value = "job_id")
|
||||
private String jobId;
|
||||
private String job_id;
|
||||
|
||||
/**
|
||||
* bean名
|
||||
*/
|
||||
@NotBlank
|
||||
private String beanName;
|
||||
private String bean_name;
|
||||
|
||||
/**
|
||||
* corn表达式
|
||||
*/
|
||||
@NotBlank
|
||||
private String cronExpression;
|
||||
private String cron_expression;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Boolean isPause;
|
||||
private Boolean is_pause;
|
||||
|
||||
/**
|
||||
* 任务名称
|
||||
*/
|
||||
@NotBlank
|
||||
private String jobName;
|
||||
private String job_name;
|
||||
|
||||
/**
|
||||
* 方法名称
|
||||
*/
|
||||
@NotBlank
|
||||
private String methodName;
|
||||
private String method_name;
|
||||
|
||||
/**
|
||||
* 参数
|
||||
@@ -77,7 +77,7 @@ public class SysQuartzJob implements Serializable {
|
||||
/**
|
||||
* 负责人
|
||||
*/
|
||||
private String personInCharge;
|
||||
private String person_in_charge;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
@@ -87,42 +87,42 @@ public class SysQuartzJob implements Serializable {
|
||||
/**
|
||||
* 子任务ID
|
||||
*/
|
||||
private String subTask;
|
||||
private String sub_task;
|
||||
|
||||
/**
|
||||
* 失败状态
|
||||
*/
|
||||
private Boolean pauseAfterFailure;
|
||||
private Boolean pause_after_failure;
|
||||
|
||||
/**
|
||||
* 创建人标识
|
||||
*/
|
||||
private String createId;
|
||||
private String create_id;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createName;
|
||||
private String create_name;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
private Date create_time;
|
||||
|
||||
/**
|
||||
* 修改人标识
|
||||
*/
|
||||
private String updateId;
|
||||
private String update_id;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private String updateName;
|
||||
private String update_name;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
private Date update_time;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String uuid;
|
||||
|
||||
@@ -17,11 +17,11 @@ import java.util.List;
|
||||
*/
|
||||
@Data
|
||||
public class JobQuery extends BaseQuery<SysQuartzJob> {
|
||||
private String jobName;
|
||||
private String job_name;
|
||||
private Boolean isSuccess;
|
||||
private List<Timestamp> createTime;
|
||||
private List<Timestamp> create_time;
|
||||
@Override
|
||||
public void paramMapping() {
|
||||
this.doP.put("jobName", QParam.builder().k(new String[]{"job_name"}).type(QueryTEnum.LK).build());
|
||||
this.doP.put("job_name", QParam.builder().k(new String[]{"job_name"}).type(QueryTEnum.LK).build());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,11 +55,11 @@ public class SysQuartzJobServiceImpl extends ServiceImpl<SysQuartzJobMapper, Sys
|
||||
@Override
|
||||
public IPage<SysQuartzLog> queryAllLog(JobQuery criteria, PageQuery page) {
|
||||
LambdaQueryWrapper<SysQuartzLog> lam = new LambdaQueryWrapper<>();
|
||||
lam.like(ObjectUtil.isNotEmpty(criteria.getJobName()), SysQuartzLog::getJobName, criteria.getJobName())
|
||||
lam.like(ObjectUtil.isNotEmpty(criteria.getJob_name()), SysQuartzLog::getJobName, criteria.getJob_name())
|
||||
.eq(ObjectUtil.isNotEmpty(criteria.getIsSuccess()), SysQuartzLog::getIsSuccess, criteria.getIsSuccess())
|
||||
.nested(ObjectUtil.isNotEmpty(criteria.getCreateTime()), i -> {
|
||||
i.ge(SysQuartzLog::getCreateTime, criteria.getCreateTime().get(0))
|
||||
.le(SysQuartzLog::getCreateTime, criteria.getCreateTime().get(1));
|
||||
.nested(ObjectUtil.isNotEmpty(criteria.getCreate_time()), i -> {
|
||||
i.ge(SysQuartzLog::getCreateTime, criteria.getCreate_time().get(0))
|
||||
.le(SysQuartzLog::getCreateTime, criteria.getCreate_time().get(1));
|
||||
});
|
||||
IPage<SysQuartzLog> pages = new Page<>(page.getPage() + 1, page.getSize());
|
||||
quartzLogMapper.selectPage(pages, lam);
|
||||
@@ -69,19 +69,16 @@ public class SysQuartzJobServiceImpl extends ServiceImpl<SysQuartzJobMapper, Sys
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void createJob(SysQuartzJob resources) {
|
||||
if (!CronExpression.isValidExpression(resources.getCronExpression())) {
|
||||
if (!CronExpression.isValidExpression(resources.getCron_expression())) {
|
||||
throw new BadRequestException("cron表达式格式错误");
|
||||
}
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
|
||||
resources.setJobId(IdUtil.getSnowflake(1,1).nextIdStr());
|
||||
resources.setCreateId(currentUserId);
|
||||
resources.setCreateName(nickName);
|
||||
resources.setCreateTime(new Date());
|
||||
resources.setUpdateId(currentUserId);
|
||||
resources.setUpdateName(nickName);
|
||||
resources.setUpdateTime(new Date());
|
||||
resources.setJob_id(IdUtil.getSnowflake(1,1).nextIdStr());
|
||||
resources.setCreate_id(currentUserId);
|
||||
resources.setCreate_name(nickName);
|
||||
resources.setCreate_time(new Date());
|
||||
quartzJobMapper.insert(resources);
|
||||
// 添加到任务管理
|
||||
quartzManage.addJob(resources);
|
||||
@@ -90,18 +87,18 @@ public class SysQuartzJobServiceImpl extends ServiceImpl<SysQuartzJobMapper, Sys
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateJob(SysQuartzJob resources) {
|
||||
if (!CronExpression.isValidExpression(resources.getCronExpression())) {
|
||||
if (!CronExpression.isValidExpression(resources.getCron_expression())) {
|
||||
throw new BadRequestException("cron表达式格式错误");
|
||||
}
|
||||
if (StrUtil.isNotEmpty(resources.getSubTask())) {
|
||||
List<String> tasks = Arrays.asList(resources.getSubTask().split("[,,]"));
|
||||
if (tasks.contains(resources.getJobId())) {
|
||||
if (StrUtil.isNotEmpty(resources.getSub_task())) {
|
||||
List<String> tasks = Arrays.asList(resources.getSub_task().split("[,,]"));
|
||||
if (tasks.contains(resources.getJob_id())) {
|
||||
throw new BadRequestException("子任务中不能添加当前任务ID");
|
||||
}
|
||||
}
|
||||
resources.setUpdateId(SecurityUtils.getCurrentUserId());
|
||||
resources.setUpdateName(SecurityUtils.getCurrentNickName());
|
||||
resources.setUpdateTime(new Date());
|
||||
resources.setUpdate_id(SecurityUtils.getCurrentUserId());
|
||||
resources.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||
resources.setUpdate_time(new Date());
|
||||
quartzJobMapper.updateById(resources);
|
||||
quartzManage.updateJobCron(resources);
|
||||
}
|
||||
@@ -109,12 +106,12 @@ public class SysQuartzJobServiceImpl extends ServiceImpl<SysQuartzJobMapper, Sys
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateIsPause(SysQuartzJob quartzJob) {
|
||||
if (quartzJob.getIsPause()) {
|
||||
if (quartzJob.getIs_pause()) {
|
||||
quartzManage.resumeJob(quartzJob);
|
||||
quartzJob.setIsPause(false);
|
||||
quartzJob.setIs_pause(false);
|
||||
} else {
|
||||
quartzManage.pauseJob(quartzJob);
|
||||
quartzJob.setIsPause(true);
|
||||
quartzJob.setIs_pause(true);
|
||||
}
|
||||
quartzJobMapper.updateById(quartzJob);
|
||||
}
|
||||
@@ -158,6 +155,6 @@ public class SysQuartzJobServiceImpl extends ServiceImpl<SysQuartzJobMapper, Sys
|
||||
|
||||
@Override
|
||||
public List<SysQuartzJob> findByIsPauseIsFalse() {
|
||||
return quartzJobMapper.selectList(new LambdaQueryWrapper<SysQuartzJob>().eq(SysQuartzJob::getIsPause, false));
|
||||
return quartzJobMapper.selectList(new LambdaQueryWrapper<SysQuartzJob>().eq(SysQuartzJob::getIs_pause, false));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,15 +48,15 @@ public class ExecutionJob extends QuartzJobBean {
|
||||
|
||||
SysQuartzLog logDto = new SysQuartzLog();
|
||||
logDto.setLogId(IdUtil.getSnowflake(1,1).nextIdStr());
|
||||
logDto.setJobName(quartzJob.getJobName());
|
||||
logDto.setBeanName(quartzJob.getBeanName());
|
||||
logDto.setMethodName(quartzJob.getMethodName());
|
||||
logDto.setJobName(quartzJob.getJob_name());
|
||||
logDto.setBeanName(quartzJob.getBean_name());
|
||||
logDto.setMethodName(quartzJob.getMethod_name());
|
||||
logDto.setParams(quartzJob.getParams());
|
||||
long startTime = System.currentTimeMillis();
|
||||
logDto.setCronExpression(quartzJob.getCronExpression());
|
||||
logDto.setCronExpression(quartzJob.getCron_expression());
|
||||
try {
|
||||
// 执行任务
|
||||
QuartzRunnable task = new QuartzRunnable(quartzJob.getBeanName(), quartzJob.getMethodName(),
|
||||
QuartzRunnable task = new QuartzRunnable(quartzJob.getBean_name(), quartzJob.getMethod_name(),
|
||||
quartzJob.getParams());
|
||||
Future<?> future = EXECUTOR.submit(task);
|
||||
future.get();
|
||||
@@ -68,8 +68,8 @@ public class ExecutionJob extends QuartzJobBean {
|
||||
// 任务状态
|
||||
logDto.setIsSuccess(true);
|
||||
// 判断是否存在子任务
|
||||
if (StrUtil.isNotEmpty(quartzJob.getSubTask())) {
|
||||
String[] tasks = quartzJob.getSubTask().split("[,,]");
|
||||
if (StrUtil.isNotEmpty(quartzJob.getSub_task())) {
|
||||
String[] tasks = quartzJob.getSub_task().split("[,,]");
|
||||
// 执行子任务
|
||||
quartzJobService.executionSubJob(tasks);
|
||||
}
|
||||
@@ -83,8 +83,8 @@ public class ExecutionJob extends QuartzJobBean {
|
||||
logDto.setIsSuccess(false);
|
||||
logDto.setExceptionDetail(ThrowableUtil.getStackTrace(e));
|
||||
// 任务如果失败了则暂停
|
||||
if (quartzJob.getPauseAfterFailure() != null && quartzJob.getPauseAfterFailure()) {
|
||||
quartzJob.setIsPause(false);
|
||||
if (quartzJob.getPause_after_failure() != null && quartzJob.getPause_after_failure()) {
|
||||
quartzJob.setIs_pause(false);
|
||||
//更新状态
|
||||
quartzJobService.updateIsPause(quartzJob);
|
||||
}
|
||||
|
||||
@@ -28,13 +28,13 @@ public class QuartzManage {
|
||||
try {
|
||||
// 构建job信息
|
||||
JobDetail jobDetail = JobBuilder.newJob(ExecutionJob.class).
|
||||
withIdentity(JOB_NAME + quartzJob.getJobId()).build();
|
||||
withIdentity(JOB_NAME + quartzJob.getJob_id()).build();
|
||||
|
||||
//通过触发器名和cron 表达式创建 Trigger
|
||||
Trigger cronTrigger = newTrigger()
|
||||
.withIdentity(JOB_NAME + quartzJob.getJobId())
|
||||
.withIdentity(JOB_NAME + quartzJob.getJob_id())
|
||||
.startNow()
|
||||
.withSchedule(CronScheduleBuilder.cronSchedule(quartzJob.getCronExpression()))
|
||||
.withSchedule(CronScheduleBuilder.cronSchedule(quartzJob.getCron_expression()))
|
||||
.build();
|
||||
|
||||
cronTrigger.getJobDataMap().put(SysQuartzJob.JOB_KEY, quartzJob);
|
||||
@@ -46,7 +46,7 @@ public class QuartzManage {
|
||||
scheduler.scheduleJob(jobDetail,cronTrigger);
|
||||
|
||||
// 暂停任务
|
||||
if (quartzJob.getIsPause()) {
|
||||
if (quartzJob.getIs_pause()) {
|
||||
pauseJob(quartzJob);
|
||||
}
|
||||
} catch (Exception e){
|
||||
@@ -61,14 +61,14 @@ public class QuartzManage {
|
||||
*/
|
||||
public void updateJobCron(SysQuartzJob quartzJob) {
|
||||
try {
|
||||
TriggerKey triggerKey = TriggerKey.triggerKey(JOB_NAME + quartzJob.getJobId());
|
||||
TriggerKey triggerKey = TriggerKey.triggerKey(JOB_NAME + quartzJob.getJob_id());
|
||||
CronTrigger trigger = (CronTrigger) scheduler.getTrigger(triggerKey);
|
||||
// 如果不存在则创建一个定时任务
|
||||
if(trigger == null){
|
||||
addJob(quartzJob);
|
||||
trigger = (CronTrigger) scheduler.getTrigger(triggerKey);
|
||||
}
|
||||
CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(quartzJob.getCronExpression());
|
||||
CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(quartzJob.getCron_expression());
|
||||
trigger = trigger.getTriggerBuilder().withIdentity(triggerKey).withSchedule(scheduleBuilder).build();
|
||||
//重置启动时间
|
||||
((CronTriggerImpl)trigger).setStartTime(new Date());
|
||||
@@ -76,7 +76,7 @@ public class QuartzManage {
|
||||
|
||||
scheduler.rescheduleJob(triggerKey, trigger);
|
||||
// 暂停任务
|
||||
if (quartzJob.getIsPause()) {
|
||||
if (quartzJob.getIs_pause()) {
|
||||
pauseJob(quartzJob);
|
||||
}
|
||||
} catch (Exception e){
|
||||
@@ -91,13 +91,13 @@ public class QuartzManage {
|
||||
*/
|
||||
public void resumeJob(SysQuartzJob quartzJob) {
|
||||
try {
|
||||
TriggerKey triggerKey = TriggerKey.triggerKey(JOB_NAME + quartzJob.getJobId());
|
||||
TriggerKey triggerKey = TriggerKey.triggerKey(JOB_NAME + quartzJob.getJob_id());
|
||||
CronTrigger trigger = (CronTrigger) scheduler.getTrigger(triggerKey);
|
||||
// 如果不存在则创建一个定时任务
|
||||
if(trigger == null) {
|
||||
addJob(quartzJob);
|
||||
}
|
||||
JobKey jobKey = JobKey.jobKey(JOB_NAME + quartzJob.getJobId());
|
||||
JobKey jobKey = JobKey.jobKey(JOB_NAME + quartzJob.getJob_id());
|
||||
scheduler.resumeJob(jobKey);
|
||||
} catch (Exception e){
|
||||
log.error("恢复定时任务失败", e);
|
||||
@@ -111,7 +111,7 @@ public class QuartzManage {
|
||||
*/
|
||||
public void pauseJob(SysQuartzJob quartzJob) {
|
||||
try {
|
||||
JobKey jobKey = JobKey.jobKey(JOB_NAME + quartzJob.getJobId());
|
||||
JobKey jobKey = JobKey.jobKey(JOB_NAME + quartzJob.getJob_id());
|
||||
scheduler.pauseJob(jobKey);
|
||||
} catch (Exception e){
|
||||
log.error("定时任务暂停失败", e);
|
||||
@@ -125,7 +125,7 @@ public class QuartzManage {
|
||||
*/
|
||||
public void runJobNow(SysQuartzJob quartzJob) {
|
||||
try {
|
||||
TriggerKey triggerKey = TriggerKey.triggerKey(JOB_NAME + quartzJob.getJobId());
|
||||
TriggerKey triggerKey = TriggerKey.triggerKey(JOB_NAME + quartzJob.getJob_id());
|
||||
CronTrigger trigger = (CronTrigger) scheduler.getTrigger(triggerKey);
|
||||
// 如果不存在则创建一个定时任务
|
||||
if(trigger == null) {
|
||||
@@ -133,7 +133,7 @@ public class QuartzManage {
|
||||
}
|
||||
JobDataMap dataMap = new JobDataMap();
|
||||
dataMap.put(SysQuartzJob.JOB_KEY, quartzJob);
|
||||
JobKey jobKey = JobKey.jobKey(JOB_NAME + quartzJob.getJobId());
|
||||
JobKey jobKey = JobKey.jobKey(JOB_NAME + quartzJob.getJob_id());
|
||||
scheduler.triggerJob(jobKey,dataMap);
|
||||
} catch (Exception e){
|
||||
log.error("定时任务执行失败", e);
|
||||
@@ -147,7 +147,7 @@ public class QuartzManage {
|
||||
*/
|
||||
public void deleteJob(SysQuartzJob quartzJob) {
|
||||
try {
|
||||
JobKey jobKey = JobKey.jobKey(JOB_NAME + quartzJob.getJobId());
|
||||
JobKey jobKey = JobKey.jobKey(JOB_NAME + quartzJob.getJob_id());
|
||||
scheduler.pauseJob(jobKey);
|
||||
scheduler.deleteJob(jobKey);
|
||||
} catch (Exception e){
|
||||
|
||||
@@ -32,7 +32,7 @@ public class SysRole implements Serializable {
|
||||
* ID
|
||||
*/
|
||||
@TableId(value = "role_id")
|
||||
private String roleId;
|
||||
private String role_id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
|
||||
@@ -50,7 +50,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
|
||||
IPage<SysRole> pages = new Page<>(page.getPage() + 1, page.getSize());
|
||||
roleMapper.selectPage(pages, lam);
|
||||
// 需要吧menus反回去
|
||||
pages.getRecords().forEach(sysRole -> sysRole.setMenus(roleMapper.selectMenuIdsByRoles(sysRole.getRoleId())));
|
||||
pages.getRecords().forEach(sysRole -> sysRole.setMenus(roleMapper.selectMenuIdsByRoles(sysRole.getRole_id())));
|
||||
return pages;
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
|
||||
// 插入
|
||||
sysRole.setRoleId(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||
sysRole.setRole_id(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||
sysRole.setCreate_id(userId);
|
||||
sysRole.setCreate_name(nickName);
|
||||
sysRole.setCreate_time(new Date());
|
||||
@@ -89,7 +89,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
|
||||
|
||||
//判断角色名字是否存在
|
||||
SysRole role = roleMapper.selectOne(new LambdaQueryWrapper<SysRole>().eq(SysRole::getName, sysRole.getName())
|
||||
.ne(SysRole::getRoleId, sysRole.getRoleId()));
|
||||
.ne(SysRole::getRole_id, sysRole.getRole_id()));
|
||||
if (ObjectUtil.isNotEmpty(role)) throw new BadRequestException("角色【" + name + "】已存在!");
|
||||
String userId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
@@ -112,7 +112,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateMenu(JSONObject form) {
|
||||
String roleId = form.getString("roleId");
|
||||
String roleId = form.getString("role_id");
|
||||
JSONArray menus = form.getJSONArray("menus");
|
||||
Set<String> menuIds = new HashSet<>();
|
||||
for (int i = 0; i < menus.size(); i++) {
|
||||
|
||||
@@ -2,27 +2,27 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.wms.system_manage.service.user.dao.mapper.SysUserMapper">
|
||||
<sql id="Base_Column_List">
|
||||
sys_user.user_id as userId,
|
||||
sys_user.username as username,
|
||||
sys_user.person_name as personName,
|
||||
sys_user.user_id ,
|
||||
sys_user.username ,
|
||||
sys_user.person_name ,
|
||||
sys_user.gender,
|
||||
sys_user.phone,
|
||||
sys_user.email,
|
||||
sys_user.avatar_name as avatarName,
|
||||
sys_user.avatar_path as avatarPath,
|
||||
sys_user.avatar_name ,
|
||||
sys_user.avatar_path ,
|
||||
sys_user.password,
|
||||
sys_user.is_admin as isAdmin,
|
||||
sys_user.is_used as isUsed,
|
||||
sys_user.pwd_reset_user_id as pwdResetUserId,
|
||||
sys_user.pwd_reset_time as pwdResetTime,
|
||||
sys_user.create_id as createId,
|
||||
sys_user.create_name as createName,
|
||||
sys_user.create_time as createTime,
|
||||
sys_user.update_id as updateId,
|
||||
sys_user.update_name as updateName,
|
||||
sys_user.update_time as updateTime,
|
||||
sys_user.extperson_id as extpersonId,
|
||||
sys_user.extuser_id as extuserId
|
||||
sys_user.is_admin ,
|
||||
sys_user.is_used ,
|
||||
sys_user.pwd_reset_user_id ,
|
||||
sys_user.pwd_reset_time ,
|
||||
sys_user.create_id ,
|
||||
sys_user.create_name ,
|
||||
sys_user.create_time ,
|
||||
sys_user.update_id ,
|
||||
sys_user.update_name ,
|
||||
sys_user.update_time ,
|
||||
sys_user.extperson_id ,
|
||||
sys_user.extuser_id
|
||||
</sql>
|
||||
<insert id="insertDataPermission">
|
||||
INSERT INTO sys_user_data_permission(user_id, permission_scope_type, permission_id) VALUES (#{dataPermission.userId}, #{dataPermission.permissionScopeType}, #{dataPermission.permissionId})
|
||||
@@ -31,54 +31,54 @@
|
||||
DELETE FROM sys_user_data_permission WHERE user_id = #{userId}
|
||||
</delete>
|
||||
<resultMap id="UserDetail" type="org.nl.wms.system_manage.service.user.dto.SysUserDetail" >
|
||||
<id column="userId" property="userId" />
|
||||
<id column="user_id" property="user_id" />
|
||||
<result column="username" property="username" />
|
||||
<result column="personName" property="personName" />
|
||||
<result column="gender" property="gender" />
|
||||
<result column="phone" property="phone" />
|
||||
<result column="email" property="email" />
|
||||
<result column="avatarName" property="avatarName" />
|
||||
<result column="avatarPath" property="avatarPath" />
|
||||
<result column="password" property="password" />
|
||||
<result column="isAdmin" property="isAdmin" />
|
||||
<result column="isUsed" property="isUsed" />
|
||||
<result column="pwdResetUserId" property="pwdResetUserId" />
|
||||
<result column="pwdResetTime" property="pwdResetTime" />
|
||||
<result column="create_id" property="createId" />
|
||||
<result column="createName" property="createName" />
|
||||
<result column="createTime" property="createTime" />
|
||||
<result column="updateId" property="updateId" />
|
||||
<result column="updateName" property="updateName" />
|
||||
<result column="updateTime" property="updateTime" />
|
||||
<result column="extpersonId" property="extpersonId" />
|
||||
<result column="extuserId" property="extuserId" />
|
||||
<collection property="depts" ofType="org.nl.wms.system_manage.service.dept.dao.SysDept" column="userId" select="selectDept"></collection>
|
||||
<collection property="roles" ofType="org.nl.wms.system_manage.service.role.dao.SysRole" column="userId" select="selectRole"></collection>
|
||||
<result column="personName" />
|
||||
<result column="gender" />
|
||||
<result column="phone" />
|
||||
<result column="email" />
|
||||
<result column="avatarName" />
|
||||
<result column="avatarPath" />
|
||||
<result column="password" />
|
||||
<result column="isAdmin" />
|
||||
<result column="isUsed" />
|
||||
<result column="pwdResetUserId" />
|
||||
<result column="pwdResetTime" />
|
||||
<result column="create_id" />
|
||||
<result column="createName" />
|
||||
<result column="createTime" />
|
||||
<result column="updateId" />
|
||||
<result column="updateName" />
|
||||
<result column="updateTime" />
|
||||
<result column="extpersonId" />
|
||||
<result column="extuserId" />
|
||||
<collection property="depts" ofType="org.nl.wms.system_manage.service.dept.dao.SysDept" column="user_id" select="selectDept"></collection>
|
||||
<collection property="roles" ofType="org.nl.wms.system_manage.service.role.dao.SysRole" column="user_id" select="selectRole"></collection>
|
||||
</resultMap>
|
||||
<select id="getUserDetail" resultMap="UserDetail">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
,sys_dept.dept_id as deptId
|
||||
,sys_dept.name as deptName
|
||||
,sys_users_roles.role_id as roleId
|
||||
,sys_dept.dept_id
|
||||
,sys_dept.name
|
||||
,sys_users_roles.role_id
|
||||
FROM
|
||||
sys_user
|
||||
left join sys_user_dept on sys_user.user_id = sys_user_dept.user_id
|
||||
left join sys_users_roles on sys_users_roles.user_id = sys_user.user_id
|
||||
left join sys_dept on sys_user_dept.dept_id = sys_dept.dept_id
|
||||
<where>
|
||||
<if test="query.deptId != null">
|
||||
<if test="query.dept_id != null">
|
||||
and
|
||||
sys_user.user_id in (select user_id from sys_user_dept where dept_id = #{query.deptId})
|
||||
sys_user.user_id in (select user_id from sys_user_dept where dept_id = #{query.dept_id})
|
||||
</if>
|
||||
<if test="query.isUsed != null">
|
||||
and sys_user.is_used = #{query.isUsed}
|
||||
<if test="query.is_used != null">
|
||||
and sys_user.is_used = #{query.is_used}
|
||||
</if>
|
||||
<if test="query.startTime != null">
|
||||
and and sys_user.create_time >= #{query.startTime}
|
||||
<if test="query.start_time != null">
|
||||
and and sys_user.create_time >= #{query.start_time}
|
||||
</if>
|
||||
<if test="query.endTime != null">
|
||||
and #{query.endTime} >= sys_user.create_time
|
||||
<if test="query.end_time != null">
|
||||
and #{query.end_time} >= sys_user.create_time
|
||||
</if>
|
||||
<if test="query.blurry != null">
|
||||
and (email like "%"#{query.blurry}"%" or username like "%"#{query.blurry}"%" or person_name like "%"#{query.blurry}"%")
|
||||
@@ -92,12 +92,12 @@
|
||||
from sys_dept
|
||||
left join sys_user_dept
|
||||
on sys_user_dept.dept_id = sys_dept.dept_id
|
||||
where user_id = #{userId}
|
||||
where user_id = #{user_id}
|
||||
</select>
|
||||
<select id="selectRole" resultType="org.nl.wms.system_manage.service.role.dao.SysRole">
|
||||
select role_id as roleId
|
||||
from sys_users_roles
|
||||
where user_id = #{userId}
|
||||
where user_id = #{user_id}
|
||||
</select>
|
||||
<select id="getDetailForMap" resultType="java.util.Map">
|
||||
SELECT
|
||||
|
||||
@@ -14,10 +14,10 @@ import org.nl.wms.system_manage.service.user.dao.SysUser;
|
||||
@Data
|
||||
public class UserQuery extends BaseQuery<SysUser> {
|
||||
|
||||
private Long deptId;
|
||||
private Long dept_id;
|
||||
|
||||
@Override
|
||||
public void paramMapping() {
|
||||
this.doP.put("deptId", QParam.builder().k(new String[]{"deptId"}).type(QueryTEnum.LK).build());
|
||||
this.doP.put("dept_id", QParam.builder().k(new String[]{"dept_id"}).type(QueryTEnum.LK).build());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,11 +23,11 @@ spring:
|
||||
db-type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||
#url: jdbc:log4jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:hl_one_mes}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:hl_one_mes}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
# username: ${DB_USER:root}
|
||||
# password: ${DB_PWD:Root.123456}
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:hl_one_mes}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
username: ${DB_USER:root}
|
||||
password: ${DB_PWD:942464Yy}
|
||||
password: ${DB_PWD:Root.123456}
|
||||
# username: ${DB_USER:root}
|
||||
# password: ${DB_PWD:942464Yy}
|
||||
|
||||
# 初始连接数
|
||||
initial-size: 5
|
||||
|
||||
Reference in New Issue
Block a user