rev:基础数据维护
This commit is contained in:
@@ -74,7 +74,11 @@
|
||||
<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
|
||||
<version>2.7.5</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.yomahub</groupId>
|
||||
<artifactId>liteflow-spring-boot-starter</artifactId>
|
||||
<version>2.10.3</version>
|
||||
</dependency>
|
||||
|
||||
<!-- logback appender日志-->
|
||||
<dependency>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
<el-select
|
||||
v-model="query.isUsed"
|
||||
v-model="query.is_used"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="状态"
|
||||
@@ -43,9 +43,9 @@
|
||||
<el-form-item label="部门名称" prop="name">
|
||||
<el-input v-model="form.name" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="部门排序" prop="deptSort">
|
||||
<el-form-item label="部门排序" prop="dept_sort">
|
||||
<el-input-number
|
||||
v-model.number="form.deptSort"
|
||||
v-model.number="form.dept_sort"
|
||||
:min="0"
|
||||
:max="999"
|
||||
controls-position="right"
|
||||
@@ -53,7 +53,7 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="外部标识" prop="extId">
|
||||
<el-input v-model="form.extId" style="width: 370px;" />
|
||||
<el-input v-model="form.ext_id" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="顶级部门">
|
||||
<el-radio-group v-model="form.isTop" style="width: 140px">
|
||||
@@ -63,11 +63,11 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="isUesd">
|
||||
<el-switch
|
||||
v-model="form.isUsed"
|
||||
v-model="form.is_used"
|
||||
active-color="#409EFF"
|
||||
inactive-color="#F56C6C"
|
||||
active-value = 'true'
|
||||
inactive-valu='false'
|
||||
active-value="true"
|
||||
inactive-valu="false"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.isTop === '0'" style="margin-bottom: 0;" label="上级部门" prop="pid">
|
||||
@@ -94,7 +94,7 @@
|
||||
:load="getDeptDatas"
|
||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
||||
:data="crud.data"
|
||||
row-key="deptId"
|
||||
row-key="dept_id"
|
||||
@select="crud.selectChange"
|
||||
@select-all="crud.selectAllChange"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
@@ -102,19 +102,19 @@
|
||||
<el-table-column :selectable="checkboxT" type="selection" width="55" />
|
||||
<!-- <el-table-column label="编码" prop="code" />-->
|
||||
<el-table-column label="名称" prop="name" />
|
||||
<el-table-column label="排序" prop="deptSort" />
|
||||
<el-table-column label="状态" align="center" prop="isUsed">
|
||||
<el-table-column label="排序" prop="dept_sort" />
|
||||
<el-table-column label="状态" align="center" prop="is_used">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.isUsed"
|
||||
v-model="scope.row.is_used"
|
||||
:disabled="scope.row.id === 1"
|
||||
active-color="#409EFF"
|
||||
inactive-color="#F56C6C"
|
||||
@change="changeEnabled(scope.row, scope.row.isUsed,)"
|
||||
@change="changeEnabled(scope.row, scope.row.is_used,)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime" label="创建日期" />
|
||||
<el-table-column prop="create_time" label="创建日期" />
|
||||
<el-table-column
|
||||
v-permission="['admin','dept:edit','dept:del']"
|
||||
label="操作"
|
||||
@@ -150,15 +150,15 @@ const defaultForm = {
|
||||
isTop: '1',
|
||||
sub_count: 0,
|
||||
pid: null,
|
||||
deptSort: 999,
|
||||
isUsed: true,
|
||||
dept_sort: 999,
|
||||
is_used: true,
|
||||
extId: null
|
||||
}
|
||||
export default {
|
||||
name: 'Dept',
|
||||
components: { Treeselect, crudOperation, rrOperation, udOperation },
|
||||
cruds() {
|
||||
return CRUD({ title: '部门', idField: 'deptId', url: 'api/dept/vo', crudMethod: { ...crudDept }})
|
||||
return CRUD({ title: '部门', idField: 'dept_id', url: 'api/dept/vo', crudMethod: { ...crudDept }})
|
||||
},
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
// 设置数据字典
|
||||
@@ -170,7 +170,7 @@ export default {
|
||||
name: [
|
||||
{ required: true, message: '请输入名称', trigger: 'blur' }
|
||||
],
|
||||
deptSort: [
|
||||
dept_sort: [
|
||||
{ required: true, message: '请输入序号', trigger: 'blur', type: 'number' }
|
||||
]
|
||||
},
|
||||
@@ -187,7 +187,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
getDeptDatas(tree, treeNode, resolve) {
|
||||
const params = { pid: tree.deptId }
|
||||
const params = { pid: tree.dept_id }
|
||||
setTimeout(() => {
|
||||
crudDept.getDeptvo(params).then(res => {
|
||||
resolve(res.content)
|
||||
@@ -201,7 +201,7 @@ export default {
|
||||
} else {
|
||||
form.isTop = '1'
|
||||
}
|
||||
form.isUsed = `${form.isUsed}`
|
||||
form.is_used = `${form.is_used}`
|
||||
if (form.pid != null) {
|
||||
this.getSupDepts(form.pid)
|
||||
} else {
|
||||
@@ -226,7 +226,7 @@ export default {
|
||||
})
|
||||
},
|
||||
getDepts() {
|
||||
crudDept.getDeptvo({ isUsed: true }).then(res => {
|
||||
crudDept.getDeptvo({ is_used: true }).then(res => {
|
||||
this.depts = res.content.map(function(obj) {
|
||||
if (obj.hasChildren) {
|
||||
obj.children = null
|
||||
@@ -238,7 +238,7 @@ export default {
|
||||
// 获取弹窗内部门数据
|
||||
loadDepts({ action, parentNode, callback }) {
|
||||
if (action === LOAD_CHILDREN_OPTIONS) {
|
||||
crudDept.getDeptvo({ isUsed: true, pid: parentNode.deptId }).then(res => {
|
||||
crudDept.getDeptvo({ is_used: true, pid: parentNode.dept_id }).then(res => {
|
||||
parentNode.children = res.content.map(function(obj) {
|
||||
obj.children = null
|
||||
return obj
|
||||
@@ -265,7 +265,7 @@ export default {
|
||||
},
|
||||
// 改变状态
|
||||
changeEnabled(data, val) {
|
||||
const satus = this.enabledTypeOptions.find(item => { return item.key == data.isUsed })
|
||||
const satus = this.enabledTypeOptions.find(item => { return item.key == data.is_used })
|
||||
|
||||
this.$confirm('此操作将 "' + satus.display_name + '" ' + data.name + '部门, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
@@ -276,7 +276,7 @@ export default {
|
||||
this.crud.notify(satus.display_name + '成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
}).catch(() => {
|
||||
data.isUsed = !data.isUsed
|
||||
data.is_used = !data.is_used
|
||||
})
|
||||
},
|
||||
checkboxT(row, rowIndex) {
|
||||
@@ -284,7 +284,7 @@ export default {
|
||||
},
|
||||
normalizer(node) {
|
||||
return {
|
||||
id: node.deptId,
|
||||
id: node.dept_id,
|
||||
label: node.name,
|
||||
children: node.children
|
||||
}
|
||||
|
||||
@@ -80,8 +80,8 @@
|
||||
placeholder="菜单标题"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.type.toString() === '2'" label="按钮名称" prop="title">
|
||||
<el-input v-model="form.title" placeholder="按钮名称" style="width: 190px;" />
|
||||
<el-form-item v-if="form.type.toString() === '2'" label="目录名称" prop="title">
|
||||
<el-input v-model="form.title" placeholder="目录名称" style="width: 190px;" />
|
||||
</el-form-item>
|
||||
<el-form-item v-show="form.type.toString() !== '1' " label="权限标识" prop="permission">
|
||||
<el-input v-model="form.permission" :disabled="form.iframe=='1'" placeholder="权限标识" style="width: 190px;" />
|
||||
|
||||
@@ -92,8 +92,8 @@
|
||||
placeholder="菜单标题"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.type.toString() === '2'" label="按钮名称" prop="title">
|
||||
<el-input v-model="form.title" placeholder="按钮名称" style="width: 190px;" />
|
||||
<el-form-item v-if="form.type.toString() === '2'" label="目录名称" prop="title">
|
||||
<el-input v-model="form.title" placeholder="目录名称" style="width: 190px;" />
|
||||
</el-form-item>
|
||||
<el-form-item v-show="form.type.toString() !== '1' " label="权限标识" prop="permission">
|
||||
<el-input v-model="form.permission" :disabled="form.iframe" placeholder="权限标识" style="width: 190px;" />
|
||||
|
||||
@@ -131,12 +131,12 @@ import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
|
||||
const defaultForm = { roleId: null, name: null, remark: null }
|
||||
const defaultForm = { role_id: null, name: null, remark: null }
|
||||
export default {
|
||||
name: 'Role',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation, crudMenu },
|
||||
cruds() {
|
||||
return CRUD({ idField: 'roleId', title: '角色', url: 'api/sysRole', crudMethod: { ...crudRoles }})
|
||||
return CRUD({ idField: 'role_id', title: '角色', url: 'api/sysRole', crudMethod: { ...crudRoles }})
|
||||
},
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
data() {
|
||||
@@ -203,7 +203,7 @@ export default {
|
||||
// 清空菜单的选中
|
||||
this.$refs.menu.setCheckedKeys([])
|
||||
// 保存当前的角色id
|
||||
this.currentId = val.roleId
|
||||
this.currentId = val.role_id
|
||||
// 初始化默认选中的key
|
||||
this.menu_ids = []
|
||||
val.menus.forEach(function(data) {
|
||||
@@ -237,7 +237,7 @@ export default {
|
||||
// 保存菜单
|
||||
saveMenu() {
|
||||
this.menuLoading = true
|
||||
const role = { roleId: this.currentId, menus: [] }
|
||||
const role = { role_id: this.currentId, menus: [] }
|
||||
// 得到已选中的 key 值
|
||||
this.menu_ids.forEach(function(menu_id) {
|
||||
const menu = { menu_id: menu_id }
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-input v-model="query.jobName" clearable size="mini" placeholder="输入任务名称搜索" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery" />
|
||||
<el-input v-model="query.job_name" clearable size="mini" placeholder="输入任务名称搜索" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery" />
|
||||
<rrOperation />
|
||||
</div>
|
||||
<crudOperation :permission="permission">
|
||||
@@ -23,21 +23,21 @@
|
||||
<!--Form表单-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" append-to-body width="730px">
|
||||
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="mini" label-width="100px">
|
||||
<el-form-item label="任务名称" prop="jobName">
|
||||
<el-input v-model="form.jobName" style="width: 220px;" />
|
||||
<el-form-item label="任务名称" prop="job_name">
|
||||
<el-input v-model="form.job_name" style="width: 220px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="任务描述" prop="description">
|
||||
<el-input v-model="form.description" style="width: 220px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="Bean名称" prop="beanName">
|
||||
<el-input v-model="form.beanName" style="width: 220px;" />
|
||||
<el-form-item label="Bean名称" prop="bean_name">
|
||||
<el-input v-model="form.bean_name" style="width: 220px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="执行方法" prop="methodName">
|
||||
<el-input v-model="form.methodName" style="width: 220px;" />
|
||||
<el-form-item label="执行方法" prop="method_name">
|
||||
<el-input v-model="form.method_name" style="width: 220px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="Cron表达式" prop="cronExpression">
|
||||
<!-- <el-input v-model="form.cronExpression" style="width: 220px;" />-->
|
||||
<el-input v-model="form.cronExpression" placeholder="请输入CRON 表达式" style="width: 220px;">
|
||||
<el-form-item label="Cron表达式" prop="cron_expression">
|
||||
<!-- <el-input v-model="form.cron_expression" style="width: 220px;" />-->
|
||||
<el-input v-model="form.cron_expression" placeholder="请输入CRON 表达式" style="width: 220px;">
|
||||
<template slot="append">
|
||||
<el-button type="primary" @click="handleShowCron">
|
||||
生成表达式
|
||||
@@ -47,22 +47,22 @@
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="子任务ID">
|
||||
<el-input v-model="form.subTask" placeholder="多个用逗号隔开,按顺序执行" style="width: 220px;" />
|
||||
<el-input v-model="form.sub_task" placeholder="多个用逗号隔开,按顺序执行" style="width: 220px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="任务负责人" prop="person_in_charge">
|
||||
<el-input v-model="form.personInCharge" style="width: 220px;" />
|
||||
<el-input v-model="form.person_in_charge" style="width: 220px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="告警邮箱" prop="email">
|
||||
<el-input v-model="form.email" placeholder="多个邮箱用逗号隔开" style="width: 220px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="失败后暂停">
|
||||
<el-radio-group v-model="form.pauseAfterFailure" style="width: 220px">
|
||||
<el-radio-group v-model="form.pause_after_failure" style="width: 220px">
|
||||
<el-radio :label="true">是</el-radio>
|
||||
<el-radio :label="false">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="任务状态">
|
||||
<el-radio-group v-model="form.isPause" style="width: 220px">
|
||||
<el-radio-group v-model="form.is_pause" style="width: 220px">
|
||||
<el-radio :label="false">启用</el-radio>
|
||||
<el-radio :label="true">暂停</el-radio>
|
||||
</el-radio-group>
|
||||
@@ -79,40 +79,40 @@
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column :selectable="checkboxT" type="selection" width="55" />
|
||||
<el-table-column show-overflow-tooltip prop="jobId" label="任务ID" />
|
||||
<el-table-column show-overflow-tooltip prop="jobName" label="任务名称" min-width="120" />
|
||||
<el-table-column show-overflow-tooltip prop="beanName" label="Bean名称" />
|
||||
<el-table-column show-overflow-tooltip prop="methodName" label="执行方法" />
|
||||
<el-table-column show-overflow-tooltip prop="job_id" label="任务ID" />
|
||||
<el-table-column show-overflow-tooltip prop="job_name" label="任务名称" min-width="120" />
|
||||
<el-table-column show-overflow-tooltip prop="bean_name" label="Bean名称" />
|
||||
<el-table-column show-overflow-tooltip prop="method_name" label="执行方法" />
|
||||
<el-table-column show-overflow-tooltip prop="params" label="参数" />
|
||||
<el-table-column show-overflow-tooltip prop="cronExpression" label="cron表达式" min-width="100" show-tooltip-when-overflow />
|
||||
<el-table-column show-overflow-tooltip prop="isPause" width="90px" label="状态">
|
||||
<el-table-column show-overflow-tooltip prop="cron_expression" label="cron表达式" min-width="100" show-tooltip-when-overflow />
|
||||
<el-table-column show-overflow-tooltip prop="is_pause" width="90px" label="状态">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.isPause ? 'warning' : 'success'">{{ scope.row.isPause ? '已暂停' : '运行中' }}</el-tag>
|
||||
<el-tag :type="scope.row.is_pause ? 'warning' : 'success'">{{ scope.row.is_pause ? '已暂停' : '运行中' }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="description" width="150px" label="描述" />
|
||||
<el-table-column show-overflow-tooltip prop="createTime" width="136px" label="创建日期">
|
||||
<el-table-column show-overflow-tooltip prop="create_time" width="136px" label="创建日期">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
<span>{{ parseTime(scope.row.create_time) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-permission="['admin','timing:edit','timing:del']" label="操作" width="170px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-permission="['admin','timing:edit']" size="mini" style="margin-right: 3px;" type="text" @click="crud.toEdit(scope.row)">编辑</el-button>
|
||||
<el-button v-permission="['admin','timing:edit']" style="margin-left: -2px" type="text" size="mini" @click="execute(scope.row.jobId)">执行</el-button>
|
||||
<el-button v-permission="['admin','timing:edit']" style="margin-left: 3px" type="text" size="mini" @click="updateStatus(scope.row.jobId,scope.row.isPause ? '恢复' : '暂停')">
|
||||
{{ scope.row.isPause ? '恢复' : '暂停' }}
|
||||
<el-button v-permission="['admin','timing:edit']" style="margin-left: -2px" type="text" size="mini" @click="execute(scope.row.job_id)">执行</el-button>
|
||||
<el-button v-permission="['admin','timing:edit']" style="margin-left: 3px" type="text" size="mini" @click="updateStatus(scope.row.job_id,scope.row.is_pause ? '恢复' : '暂停')">
|
||||
{{ scope.row.is_pause ? '恢复' : '暂停' }}
|
||||
</el-button>
|
||||
<el-popover
|
||||
:ref="scope.row.jobId"
|
||||
:ref="scope.row.job_id"
|
||||
v-permission="['admin','timing:del']"
|
||||
placement="top"
|
||||
width="200"
|
||||
>
|
||||
<p>确定停止并删除该任务吗?</p>
|
||||
<div style="text-align: right; margin: 0">
|
||||
<el-button size="mini" type="text" @click="$refs[scope.row.jobId].doClose()">取消</el-button>
|
||||
<el-button :loading="delLoading" type="primary" size="mini" @click="delMethod(scope.row.jobId)">确定</el-button>
|
||||
<el-button size="mini" type="text" @click="$refs[scope.row.job_id].doClose()">取消</el-button>
|
||||
<el-button :loading="delLoading" type="primary" size="mini" @click="delMethod(scope.row.job_id)">确定</el-button>
|
||||
</div>
|
||||
<el-button slot="reference" type="text" size="mini">删除</el-button>
|
||||
</el-popover>
|
||||
@@ -136,12 +136,12 @@ import crudOperation from '@crud/CRUD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import Crontab from './components/crontab'
|
||||
|
||||
const defaultForm = { jobId: null, beanName: null, cronExpression: null, isPause: false, jobName: null, methodName: null, params: null, description: null, personInCharge: null, email: null, subTask: null, pauseAfterFailure: true, createId: null, createName: null, createTime: null, updateId: null, updateName: null, updateTime: null }
|
||||
const defaultForm = { job_id: null, bean_name: null, cron_expression: null, is_pause: false, job_name: null, method_name: null, params: null, description: null, person_in_charge: null, email: null, sub_task: null, pause_after_failure: true, create_id: null, create_name: null, create_time: null, update_id: null, update_name: null, update_time: null }
|
||||
export default {
|
||||
name: 'Timing',
|
||||
components: { Log, pagination, crudOperation, rrOperation, Crontab },
|
||||
cruds() {
|
||||
return CRUD({ title: '定时任务', idField: 'jobId', url: 'api/jobs', crudMethod: { ...crudJob }})
|
||||
return CRUD({ title: '定时任务', idField: 'job_id', url: 'api/jobs', crudMethod: { ...crudJob }})
|
||||
},
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
data() {
|
||||
@@ -153,22 +153,22 @@ export default {
|
||||
del: ['admin', 'timing:del']
|
||||
},
|
||||
rules: {
|
||||
jobName: [
|
||||
job_name: [
|
||||
{ required: true, message: '请输入任务名称', trigger: 'blur' }
|
||||
],
|
||||
description: [
|
||||
{ required: true, message: '请输入任务描述', trigger: 'blur' }
|
||||
],
|
||||
beanName: [
|
||||
bean_name: [
|
||||
{ required: true, message: '请输入Bean名称', trigger: 'blur' }
|
||||
],
|
||||
methodName: [
|
||||
method_name: [
|
||||
{ required: true, message: '请输入方法名称', trigger: 'blur' }
|
||||
],
|
||||
cronExpression: [
|
||||
cron_expression: [
|
||||
{ required: true, message: '请输入Cron表达式', trigger: 'blur' }
|
||||
],
|
||||
personInCharge: [
|
||||
person_in_charge: [
|
||||
{ required: true, message: '请输入负责人名称', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
@@ -225,12 +225,12 @@ export default {
|
||||
},
|
||||
/** cron表达式按钮操作 */
|
||||
handleShowCron() {
|
||||
this.expression = this.form.cronExpression
|
||||
this.expression = this.form.cron_expression
|
||||
this.openCron = true
|
||||
},
|
||||
/** 确定后回传值 */
|
||||
crontabFill(value) {
|
||||
this.form.cronExpression = value
|
||||
this.form.cron_expression = value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
<el-select
|
||||
v-model="query.isUsed"
|
||||
v-model="query.is_used"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="状态"
|
||||
@@ -72,7 +72,7 @@
|
||||
<el-input v-model.number="form.phone" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="姓名" prop="preson_name">
|
||||
<el-input v-model="form.personName" style="width: 200px;" />
|
||||
<el-input v-model="form.person_name" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="邮箱" prop="email">
|
||||
<el-input v-model="form.email" style="width: 200px;" />
|
||||
@@ -100,9 +100,9 @@
|
||||
<el-radio label="女">女</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="isUesd">
|
||||
<el-form-item label="状态" prop="is_uesd">
|
||||
<el-switch
|
||||
v-model="form.isUsed"
|
||||
v-model="form.is_used"
|
||||
active-color="#409EFF"
|
||||
inactive-color="#F56C6C"
|
||||
/>
|
||||
@@ -145,11 +145,11 @@
|
||||
<el-table-column :selectable="checkboxT" type="selection" width="55" />
|
||||
<el-table-column prop="username" label="用户名" :min-width="flexWidth('username',crud.data,'用户名')" />
|
||||
<el-table-column
|
||||
prop="personName"
|
||||
prop="person_name"
|
||||
label="姓名"
|
||||
:min-width="flexWidth('personName',crud.data,'姓名')"
|
||||
:min-width="flexWidth('person_name',crud.data,'姓名')"
|
||||
/>
|
||||
<el-table-column prop="gender" label="性别" :min-width="flexWidth('personName',crud.data,'性别')" />
|
||||
<el-table-column prop="gender" label="性别" :min-width="flexWidth('person_name',crud.data,'性别')" />
|
||||
<el-table-column prop="phone" label="电话" :min-width="flexWidth('phone',crud.data,'电话')" />
|
||||
<el-table-column prop="email" label="邮箱" :min-width="flexWidth('email',crud.data,'邮箱')" />
|
||||
<el-table-column show-overflow-tooltip prop="depts" label="部门">
|
||||
@@ -159,10 +159,10 @@
|
||||
</el-table-column>>
|
||||
<el-table-column label="状态" align="center" prop="enabled">
|
||||
<template slot-scope="scope">
|
||||
<span :style="{'color': caseStatusColorFilter(scope.row.isUsed)}">{{ enabledTypeOptions.find(item => {return item.key == scope.row.isUsed}).display_name }}</span>
|
||||
<span :style="{'color': caseStatusColorFilter(scope.row.is_used)}">{{ enabledTypeOptions.find(item => {return item.key == scope.row.is_used}).display_name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime" label="创建日期" :min-width="flexWidth('createTime',crud.data,'创建日期')" />
|
||||
<el-table-column prop="create_time" label="创建日期" :min-width="flexWidth('create_time',crud.data,'创建日期')" />
|
||||
<el-table-column
|
||||
label="操作"
|
||||
fixed="right"
|
||||
@@ -182,7 +182,7 @@
|
||||
<el-dropdown-item icon="el-icon-key">
|
||||
<span @click="openDataDialog(scope.row)">数据权限</span>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item icon="el-icon-lock"><span @click="changeEnabled(scope.row)">{{ enabledTypeOptions.find(item => {return item.key !== scope.row.isUsed}).display_name }}账号</span></el-dropdown-item>
|
||||
<el-dropdown-item icon="el-icon-lock"><span @click="changeEnabled(scope.row)">{{ enabledTypeOptions.find(item => {return item.key !== scope.row.is_used}).display_name }}账号</span></el-dropdown-item>
|
||||
<el-dropdown-item icon="el-icon-circle-check">
|
||||
<span @click="openRoleDrawer(scope.row)">分配角色</span>
|
||||
</el-dropdown-item>
|
||||
@@ -214,7 +214,7 @@
|
||||
:data="deptsDatas"
|
||||
:default-checked-keys="depChecked"
|
||||
:props="deptProps"
|
||||
node-key="deptId"
|
||||
node-key="dept_ud"
|
||||
highlight-current
|
||||
check-strictly
|
||||
@check="handCheck"
|
||||
@@ -250,7 +250,7 @@
|
||||
<el-input v-model="dataDialog.username" disabled style="width: 200px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="姓名" prop="presonName">
|
||||
<el-input v-model="dataDialog.personName" disabled style="width: 200px;" />
|
||||
<el-input v-model="dataDialog.person_name" disabled style="width: 200px;" />
|
||||
</el-form-item>
|
||||
<el-table
|
||||
ref="dialogTable"
|
||||
@@ -307,7 +307,7 @@
|
||||
<el-table-column prop="permissionScopeType" label="权限类型" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="permissionName" label="权限范围" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="deptName" label="部门名称" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="personName" label="用户名称" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="person_name" label="用户名称" min-width="100" show-overflow-tooltip />
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
<relevance-user-dialog :dialog-show.sync="relevanceUser" :is-single="false" :users="userIds" @selectUsers="selectUsers" />
|
||||
@@ -333,13 +333,13 @@ import RelevanceDeptDialog from '@/views/system/user/dialog/relevanceDeptDialog'
|
||||
|
||||
let userRoles = []
|
||||
const defaultForm = {
|
||||
deptId: null,
|
||||
dept_id: null,
|
||||
depts: [],
|
||||
username: null,
|
||||
personName: null,
|
||||
person_name: null,
|
||||
gender: '男',
|
||||
email: null,
|
||||
isUsed: true,
|
||||
is_used: true,
|
||||
roles: [],
|
||||
phone: null,
|
||||
password: null
|
||||
@@ -374,7 +374,7 @@ export default {
|
||||
{ required: true, message: '请输入用户名', trigger: 'blur' },
|
||||
{ min: 2, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur' }
|
||||
],
|
||||
personName: [
|
||||
person_name: [
|
||||
{ required: true, message: '请输入用户姓名', trigger: 'blur' },
|
||||
{ min: 2, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur' }
|
||||
]
|
||||
@@ -433,8 +433,8 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
caseStatusColorFilter(isUsed) {
|
||||
if (isUsed === true) {
|
||||
caseStatusColorFilter(is_used) {
|
||||
if (is_used === true) {
|
||||
return '#378be2'
|
||||
}
|
||||
return '#F56C6C'
|
||||
@@ -453,13 +453,13 @@ export default {
|
||||
// 新增与编辑前做的操作
|
||||
[CRUD.HOOK.afterToCU](crud, form) {
|
||||
this.getRoles()
|
||||
if (form.deptId == null) {
|
||||
if (form.dept_ud == null) {
|
||||
crudDept.getDepts()
|
||||
} else {
|
||||
this.getSupDepts(form.deptId)
|
||||
this.getSupDepts(form.dept_ud)
|
||||
}
|
||||
// this.getRoleLevel() 暂时不用
|
||||
form.isUsed = form.enabled.toString()
|
||||
form.is_used = form.enabled.toString()
|
||||
},
|
||||
// 新增前将多选的值设置为空
|
||||
[CRUD.HOOK.beforeToAdd]() {
|
||||
@@ -530,7 +530,7 @@ export default {
|
||||
},
|
||||
getDepts() {
|
||||
console.log('获取部门')
|
||||
crudDept.getDepts({ isUsed: true }).then(res => {
|
||||
crudDept.getDepts({ is_used: true }).then(res => {
|
||||
console.log('获取的部门信息', res)
|
||||
|
||||
this.depts = res.content.map(function(obj) {
|
||||
@@ -541,8 +541,8 @@ export default {
|
||||
})
|
||||
})
|
||||
},
|
||||
getSupDepts(deptId) {
|
||||
crudDept.getDeptSuperior(deptId).then(res => {
|
||||
getSupDepts(dept_ud) {
|
||||
crudDept.getDeptSuperior(dept_ud).then(res => {
|
||||
console.log('父部门', res)
|
||||
const date = res.content
|
||||
this.buildDepts(date)
|
||||
@@ -562,7 +562,7 @@ export default {
|
||||
// 获取弹窗内部门数据
|
||||
loadDepts({ action, parentNode, callback }) {
|
||||
if (action === LOAD_CHILDREN_OPTIONS) {
|
||||
crudDept.getDeptvo({ isUsed: true, pid: parentNode.dept_id }).then(res => {
|
||||
crudDept.getDeptvo({ is_used: true, pid: parentNode.dept_id }).then(res => {
|
||||
parentNode.children = res.content.map(function(obj) {
|
||||
obj.children = null
|
||||
return obj
|
||||
@@ -575,27 +575,27 @@ export default {
|
||||
},
|
||||
normalizer(node) {
|
||||
return {
|
||||
id: node.deptId,
|
||||
id: node.dept_ud,
|
||||
label: node.name,
|
||||
children: node.children
|
||||
}
|
||||
},
|
||||
// 切换部门
|
||||
handleNodeClick(data) {
|
||||
this.query.deptId = data.deptId
|
||||
this.query.dept_ud = data.dept_ud
|
||||
this.query.needAll = true
|
||||
this.crud.toQuery()
|
||||
this.query.deptId = null
|
||||
this.query.dept_ud = null
|
||||
},
|
||||
// 改变状态
|
||||
changeEnabled(row) {
|
||||
const satus = this.enabledTypeOptions.find(item => { return item.key !== row.isUsed })
|
||||
const satus = this.enabledTypeOptions.find(item => { return item.key !== row.is_used })
|
||||
this.$confirm('此操作将' + satus.display_name + '账号:' + row.username + ', 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
row.isUsed = satus.key
|
||||
row.is_used = satus.key
|
||||
crudUser.edit(row).then(res => {
|
||||
this.crud.toQuery()
|
||||
this.crud.notify('账号' + row.username + '已' + satus.display_name)
|
||||
@@ -644,7 +644,7 @@ export default {
|
||||
// 默认选中
|
||||
const deptIds = []
|
||||
for (var index in row.depts) {
|
||||
deptIds.push(row.depts[index].deptId)
|
||||
deptIds.push(row.depts[index].dept_ud)
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.$refs.deptUser.setCheckedKeys(deptIds)
|
||||
@@ -684,10 +684,10 @@ export default {
|
||||
crudDataPermission.getDataPermissionOption().then(res => {
|
||||
// console.log(res)
|
||||
this.permissions = res
|
||||
this.dataDialog.personName = row.personName
|
||||
this.dataDialog.person_name = row.person_name
|
||||
this.dataDialog.username = row.username
|
||||
this.dataDialog.userId = row.userId
|
||||
this.dataPermissionTitle = '[' + row.personName + '] 数据权限'
|
||||
this.dataPermissionTitle = '[' + row.person_name + '] 数据权限'
|
||||
this.dataPerm = true
|
||||
// 回显数据
|
||||
crudDataPermission.getDataShow(row.userId).then(res => {
|
||||
|
||||
Reference in New Issue
Block a user