opt:库区物料设置功能开发。基础分类功能优化
This commit is contained in:
@@ -3,6 +3,8 @@ package org.nl.wms.basedata_manage.controller;
|
|||||||
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nl.common.base.TableDataInfo;
|
||||||
|
import org.nl.common.domain.query.PageQuery;
|
||||||
import org.nl.common.logging.annotation.Log;
|
import org.nl.common.logging.annotation.Log;
|
||||||
import org.nl.wms.basedata_manage.service.IMdPbClassstandardService;
|
import org.nl.wms.basedata_manage.service.IMdPbClassstandardService;
|
||||||
import org.nl.wms.basedata_manage.service.dao.MdPbClassstandard;
|
import org.nl.wms.basedata_manage.service.dao.MdPbClassstandard;
|
||||||
@@ -76,6 +78,13 @@ public class ClassStandardController {
|
|||||||
return new ResponseEntity<>(iMdPbClassstandardService.buildTree(superiorList), HttpStatus.OK);
|
return new ResponseEntity<>(iMdPbClassstandardService.buildTree(superiorList), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/queryClassById")
|
||||||
|
@Log("查询分类基础列表")
|
||||||
|
//@PreAuthorize("@el.check('materialtype:list')")
|
||||||
|
public ResponseEntity<Object> queryClassById(@RequestParam Map whereJson) {
|
||||||
|
return new ResponseEntity<>(iMdPbClassstandardService.queryClassById(whereJson), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("/getClassName")
|
@GetMapping("/getClassName")
|
||||||
@Log("获取分类名称下拉框")
|
@Log("获取分类名称下拉框")
|
||||||
public ResponseEntity<Object> getClassName() {
|
public ResponseEntity<Object> getClassName() {
|
||||||
@@ -88,4 +97,11 @@ public class ClassStandardController {
|
|||||||
return new ResponseEntity<>(iMdPbClassstandardService.queryClassBycode(whereJson), HttpStatus.OK);
|
return new ResponseEntity<>(iMdPbClassstandardService.queryClassBycode(whereJson), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getClassTable")
|
||||||
|
@Log("查询物料基础类型")
|
||||||
|
//@PreAuthorize("@el.check('materialtype:list')")
|
||||||
|
public ResponseEntity<Object> queryClassTable(@RequestParam Map whereJson, PageQuery page) {
|
||||||
|
return new ResponseEntity<>(TableDataInfo.build(iMdPbClassstandardService.queryClassTable(whereJson, page)), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
package org.nl.wms.basedata_manage.controller;
|
package org.nl.wms.basedata_manage.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.map.MapUtil;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.nl.common.base.TableDataInfo;
|
import org.nl.common.base.TableDataInfo;
|
||||||
import org.nl.common.domain.query.PageQuery;
|
import org.nl.common.domain.query.PageQuery;
|
||||||
import org.nl.common.logging.annotation.Log;
|
import org.nl.common.logging.annotation.Log;
|
||||||
|
import org.nl.wms.basedata_manage.enums.MaterOptTypeEnum;
|
||||||
import org.nl.wms.basedata_manage.service.IMdMeMaterialbaseService;
|
import org.nl.wms.basedata_manage.service.IMdMeMaterialbaseService;
|
||||||
import org.nl.wms.basedata_manage.service.dao.MdMeMaterialbase;
|
import org.nl.wms.basedata_manage.service.dao.MdMeMaterialbase;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -68,6 +70,11 @@ public class MaterialbaseController {
|
|||||||
iMdMeMaterialbaseService.materialSync(whereJson);
|
iMdMeMaterialbaseService.materialSync(whereJson);
|
||||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
}
|
}
|
||||||
|
@Log("查询物料操作类型")
|
||||||
|
@PostMapping("/getMaterOptType")
|
||||||
|
public ResponseEntity<Object> getMaterOptType(@RequestBody Map map) {
|
||||||
|
String materOpt_code = MapUtil.getStr(map, "materOpt_code");
|
||||||
|
return new ResponseEntity<>(MaterOptTypeEnum.getObj(materOpt_code), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,12 +8,8 @@ import org.nl.common.base.TableDataInfo;
|
|||||||
import org.nl.common.domain.query.PageQuery;
|
import org.nl.common.domain.query.PageQuery;
|
||||||
import org.nl.common.logging.annotation.Log;
|
import org.nl.common.logging.annotation.Log;
|
||||||
import org.nl.wms.basedata_manage.service.StructrelamaterialService;
|
import org.nl.wms.basedata_manage.service.StructrelamaterialService;
|
||||||
import org.nl.wms.basedata_manage.service.dao.Structrelamaterial;
|
|
||||||
import org.nl.wms.basedata_manage.service.dto.StructrelamaterialDto;
|
|
||||||
import org.springframework.data.domain.Pageable;
|
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -36,20 +32,6 @@ public class StructrelamaterialController {
|
|||||||
return new ResponseEntity<>(TableDataInfo.build(structrelamaterialService.pageQuery(whereJson, page)),HttpStatus.OK);
|
return new ResponseEntity<>(TableDataInfo.build(structrelamaterialService.pageQuery(whereJson, page)),HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping
|
|
||||||
@Log("新增物料存放设置")
|
|
||||||
public ResponseEntity<Object> create(@Validated @RequestBody Structrelamaterial dto){
|
|
||||||
structrelamaterialService.create(dto);
|
|
||||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
|
||||||
}
|
|
||||||
|
|
||||||
@PutMapping
|
|
||||||
@Log("修改物料存放设置")
|
|
||||||
public ResponseEntity<Object> update(@Validated @RequestBody Structrelamaterial dto){
|
|
||||||
structrelamaterialService.update(dto);
|
|
||||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Log("删除物料存放设置")
|
@Log("删除物料存放设置")
|
||||||
@DeleteMapping
|
@DeleteMapping
|
||||||
public ResponseEntity<Object> delete(@RequestBody String[] ids) {
|
public ResponseEntity<Object> delete(@RequestBody String[] ids) {
|
||||||
@@ -64,10 +46,4 @@ public class StructrelamaterialController {
|
|||||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/delSet")
|
|
||||||
@Log("删除物料存放设置")
|
|
||||||
public ResponseEntity<Object> delSet(@RequestBody Map whereJson){
|
|
||||||
structrelamaterialService.delSet(whereJson);
|
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,88 @@
|
|||||||
|
package org.nl.wms.basedata_manage.enums;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取物料操作类型
|
||||||
|
*/
|
||||||
|
public enum MaterOptTypeEnum {
|
||||||
|
QBWL(0, "00", "全部物料", "1943247496885178368", "");
|
||||||
|
|
||||||
|
|
||||||
|
//顺序号
|
||||||
|
private int index;
|
||||||
|
//编码
|
||||||
|
private String code;
|
||||||
|
//名字
|
||||||
|
private String name;
|
||||||
|
//分类标识串
|
||||||
|
private String class_idStr;
|
||||||
|
//描述
|
||||||
|
private String desc;
|
||||||
|
|
||||||
|
public static JSONObject getObj(String code) {
|
||||||
|
for (MaterOptTypeEnum item : values()) {
|
||||||
|
if (item.getCode().equals(code)) {
|
||||||
|
JSONObject json=new JSONObject();
|
||||||
|
json.put("index",item.getIndex());
|
||||||
|
json.put("code",item.getCode());
|
||||||
|
json.put("name",item.getName());
|
||||||
|
json.put("class_idStr",item.getClass_idStr());
|
||||||
|
json.put("desc",item.getDesc());
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private MaterOptTypeEnum(int index, String code, String name, String class_idStr, String desc) {
|
||||||
|
this.index = index;
|
||||||
|
this.code = code;
|
||||||
|
this.name = name;
|
||||||
|
this.class_idStr = class_idStr;
|
||||||
|
this.desc = desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getClass_idStr() {
|
||||||
|
return class_idStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClass_idStr(String class_idStr) {
|
||||||
|
this.class_idStr = class_idStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDesc() {
|
||||||
|
return desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDesc(String desc) {
|
||||||
|
this.desc = desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getIndex() {
|
||||||
|
return index;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIndex(int index) {
|
||||||
|
this.index = index;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCode(String code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,9 @@
|
|||||||
package org.nl.wms.basedata_manage.service;
|
package org.nl.wms.basedata_manage.service;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.nl.common.domain.query.PageQuery;
|
||||||
import org.nl.wms.basedata_manage.service.dao.MdPbClassstandard;
|
import org.nl.wms.basedata_manage.service.dao.MdPbClassstandard;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
|
|
||||||
@@ -66,6 +68,7 @@ public interface IMdPbClassstandardService extends IService<MdPbClassstandard> {
|
|||||||
*/
|
*/
|
||||||
JSONObject buildTree(List<MdPbClassstandard> superiorList);
|
JSONObject buildTree(List<MdPbClassstandard> superiorList);
|
||||||
|
|
||||||
|
JSONObject queryClassById(Map whereJson);
|
||||||
/**
|
/**
|
||||||
* 获取分类名称下拉框
|
* 获取分类名称下拉框
|
||||||
* @return List<JSONObject>
|
* @return List<JSONObject>
|
||||||
@@ -78,4 +81,21 @@ public interface IMdPbClassstandardService extends IService<MdPbClassstandard> {
|
|||||||
* @return JSONObject
|
* @return JSONObject
|
||||||
*/
|
*/
|
||||||
JSONObject queryClassBycode(Map whereJson);
|
JSONObject queryClassBycode(Map whereJson);
|
||||||
|
|
||||||
|
IPage<MdPbClassstandard> queryClassTable(Map whereJson, PageQuery page);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前节点的所有子类节点集合数据
|
||||||
|
*
|
||||||
|
* @param class_id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<String> getChildIdSet(String class_id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前节点和其所有子类节点集合数据
|
||||||
|
* @param class_id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<String> getAllChildIdSet(String class_id);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,12 +4,7 @@ package org.nl.wms.basedata_manage.service;
|
|||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import org.nl.common.domain.query.PageQuery;
|
import org.nl.common.domain.query.PageQuery;
|
||||||
import org.nl.wms.basedata_manage.service.dao.Structattr;
|
|
||||||
import org.nl.wms.basedata_manage.service.dao.Structrelamaterial;
|
import org.nl.wms.basedata_manage.service.dao.Structrelamaterial;
|
||||||
import org.nl.wms.basedata_manage.service.dto.StructrelamaterialDto;
|
|
||||||
import org.springframework.data.domain.Pageable;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -27,40 +22,6 @@ public interface StructrelamaterialService extends IService<Structrelamaterial>
|
|||||||
*/
|
*/
|
||||||
IPage<Structrelamaterial> pageQuery(Map whereJson, PageQuery page);
|
IPage<Structrelamaterial> pageQuery(Map whereJson, PageQuery page);
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询所有数据不分页
|
|
||||||
* @param whereJson 条件参数
|
|
||||||
* @return List<StructrelamaterialDto>
|
|
||||||
*/
|
|
||||||
List<Structrelamaterial> queryAll(Map whereJson);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据ID查询
|
|
||||||
* @param material_type_id ID
|
|
||||||
* @return Structrelamaterial
|
|
||||||
*/
|
|
||||||
Structrelamaterial findById(String material_type_id);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据编码查询
|
|
||||||
* @param code code
|
|
||||||
* @return Structrelamaterial
|
|
||||||
*/
|
|
||||||
Structrelamaterial findByCode(String code);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建
|
|
||||||
* @param dto /
|
|
||||||
*/
|
|
||||||
void create(Structrelamaterial dto);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 编辑
|
|
||||||
* @param dto /
|
|
||||||
*/
|
|
||||||
void update(Structrelamaterial dto);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 多选删除
|
* 多选删除
|
||||||
* @param ids /
|
* @param ids /
|
||||||
@@ -69,6 +30,4 @@ public interface StructrelamaterialService extends IService<Structrelamaterial>
|
|||||||
|
|
||||||
void insertSet(Map whereJson);
|
void insertSet(Map whereJson);
|
||||||
|
|
||||||
void delSet(Map whereJson);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package org.nl.wms.basedata_manage.service.dao;
|
package org.nl.wms.basedata_manage.service.dao;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -118,4 +119,7 @@ public class MdPbClassstandard implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String update_time;
|
private String update_time;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String address;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package org.nl.wms.basedata_manage.service.dao;
|
package org.nl.wms.basedata_manage.service.dao;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -26,4 +27,17 @@ public class Structrelamaterial implements Serializable {
|
|||||||
private String set_name;
|
private String set_name;
|
||||||
|
|
||||||
private String set_time;
|
private String set_time;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String sect_code;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String sect_name;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String class_code;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String class_name;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
package org.nl.wms.basedata_manage.service.dao.mapper;
|
package org.nl.wms.basedata_manage.service.dao.mapper;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.nl.wms.basedata_manage.service.dao.MdPbClassstandard;
|
import org.nl.wms.basedata_manage.service.dao.MdPbClassstandard;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 基础数据分类标准表 Mapper 接口
|
* 基础数据分类标准表 Mapper 接口
|
||||||
@@ -12,4 +16,6 @@ import org.nl.wms.basedata_manage.service.dao.MdPbClassstandard;
|
|||||||
* @since 2025-05-14
|
* @since 2025-05-14
|
||||||
*/
|
*/
|
||||||
public interface MdPbClassstandardMapper extends BaseMapper<MdPbClassstandard> {
|
public interface MdPbClassstandardMapper extends BaseMapper<MdPbClassstandard> {
|
||||||
|
|
||||||
|
List<String> getChildIdSet(@Param("param") String whereJson);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,21 @@
|
|||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="org.nl.wms.basedata_manage.service.dao.mapper.MdPbClassstandardMapper">
|
<mapper namespace="org.nl.wms.basedata_manage.service.dao.mapper.MdPbClassstandardMapper">
|
||||||
|
|
||||||
|
<select id="getChildIdSet" resultType="java.lang.String">
|
||||||
|
SELECT DISTINCT
|
||||||
|
class_id
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
t1.class_id,
|
||||||
|
IF
|
||||||
|
( find_in_set( parent_class_id, @pids ) > 0, @pids := concat( @pids, ',', class_id ), 0 ) AS ischild
|
||||||
|
FROM
|
||||||
|
( SELECT class_id, parent_class_id FROM md_pb_classstandard t WHERE t.is_delete = '0' ORDER BY class_code ) t1,
|
||||||
|
( SELECT @pids := #{param} ) t2
|
||||||
|
) t3
|
||||||
|
WHERE
|
||||||
|
ischild != 0
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -4,13 +4,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.nl.wms.basedata_manage.service.dao.Structattr;
|
|
||||||
import org.nl.wms.basedata_manage.service.dao.StructattrVechielDto;
|
|
||||||
import org.nl.wms.basedata_manage.service.dao.Structrelamaterial;
|
import org.nl.wms.basedata_manage.service.dao.Structrelamaterial;
|
||||||
import org.nl.wms.basedata_manage.service.dto.QueryPageParam;
|
import org.nl.wms.basedata_manage.service.dto.QueryPageParam;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author dsh
|
* @author dsh
|
||||||
@@ -19,7 +15,7 @@ import java.util.Map;
|
|||||||
@Mapper
|
@Mapper
|
||||||
public interface StructrelamaterialMapper extends BaseMapper<Structrelamaterial>{
|
public interface StructrelamaterialMapper extends BaseMapper<Structrelamaterial>{
|
||||||
|
|
||||||
IPage<Structrelamaterial> pagequery(IPage<Structrelamaterial> pages, @Param("paramMap") QueryPageParam paramMap);
|
IPage<Structrelamaterial> pagequery(IPage<Structrelamaterial> pages, @Param("paramMap") QueryPageParam paramMap, @Param("pointCodes") List<String> classIds);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,14 +18,15 @@
|
|||||||
INNER JOIN st_ivt_sectattr se ON se.sect_id = sm.sect_id
|
INNER JOIN st_ivt_sectattr se ON se.sect_id = sm.sect_id
|
||||||
INNER JOIN md_pb_classstandard class ON class.class_id = sm.material_type_id
|
INNER JOIN md_pb_classstandard class ON class.class_id = sm.material_type_id
|
||||||
where 1=1
|
where 1=1
|
||||||
<if test="paramMap.search != null and paramMap.search !=''">
|
|
||||||
AND (class.class_code like '%${paramMap.search}%' or class.class_name like '%${paramMap.search}%')
|
|
||||||
</if>
|
|
||||||
<if test="paramMap.stor_id != null and paramMap.stor_id !=''">
|
|
||||||
AND se.stor_id = '%${paramMap.stor_id}%'
|
|
||||||
</if>
|
|
||||||
<if test="paramMap.sect_id != null and paramMap.sect_id !=''">
|
<if test="paramMap.sect_id != null and paramMap.sect_id !=''">
|
||||||
AND se.sect_id = '%${paramMap.sect_id}%'
|
AND sm.sect_id = #{paramMap.sect_id}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="pointCodes != null ">
|
||||||
|
AND class.class_id IN
|
||||||
|
<foreach collection="pointCodes" item="code" separator="," open="(" close=")">
|
||||||
|
#{code}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package org.nl.wms.basedata_manage.service.dto;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: lyd
|
* @Author: lyd
|
||||||
@@ -12,8 +13,7 @@ import java.io.Serializable;
|
|||||||
public class QueryPageParam implements Serializable {
|
public class QueryPageParam implements Serializable {
|
||||||
private String stor_id;
|
private String stor_id;
|
||||||
private String sect_id;
|
private String sect_id;
|
||||||
private String classIds;
|
private List<String> classIds;
|
||||||
|
|
||||||
private String search;
|
private String search;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,24 +4,35 @@ import cn.hutool.core.date.DateUtil;
|
|||||||
import cn.hutool.core.map.MapUtil;
|
import cn.hutool.core.map.MapUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import cn.hutool.db.Db;
|
||||||
|
import cn.hutool.db.Entity;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.nl.common.domain.query.PageQuery;
|
||||||
import org.nl.common.exception.BadRequestException;
|
import org.nl.common.exception.BadRequestException;
|
||||||
import org.nl.common.utils.IdUtil;
|
import org.nl.common.utils.IdUtil;
|
||||||
import org.nl.common.utils.PageUtil;
|
import org.nl.common.utils.PageUtil;
|
||||||
import org.nl.common.utils.SecurityUtils;
|
import org.nl.common.utils.SecurityUtils;
|
||||||
import org.nl.wms.basedata_manage.enums.BaseDataEnum;
|
import org.nl.wms.basedata_manage.enums.BaseDataEnum;
|
||||||
import org.nl.wms.basedata_manage.service.IMdPbClassstandardService;
|
import org.nl.wms.basedata_manage.service.IMdPbClassstandardService;
|
||||||
|
import org.nl.wms.basedata_manage.service.dao.BsrealStorattrDto;
|
||||||
import org.nl.wms.basedata_manage.service.dao.MdPbClassstandard;
|
import org.nl.wms.basedata_manage.service.dao.MdPbClassstandard;
|
||||||
|
import org.nl.wms.basedata_manage.service.dao.Structattr;
|
||||||
|
import org.nl.wms.basedata_manage.service.dao.mapper.BsrealStorattrMapper;
|
||||||
import org.nl.wms.basedata_manage.service.dao.mapper.MdPbClassstandardMapper;
|
import org.nl.wms.basedata_manage.service.dao.mapper.MdPbClassstandardMapper;
|
||||||
import org.nl.wms.basedata_manage.service.dto.ClassstandardDto;
|
import org.nl.wms.basedata_manage.service.dto.ClassstandardDto;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.sql.DataSource;
|
||||||
|
import java.sql.SQLException;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@@ -36,6 +47,9 @@ import java.util.stream.Collectors;
|
|||||||
@Service
|
@Service
|
||||||
public class MdPbClassstandardServiceImpl extends ServiceImpl<MdPbClassstandardMapper, MdPbClassstandard> implements IMdPbClassstandardService {
|
public class MdPbClassstandardServiceImpl extends ServiceImpl<MdPbClassstandardMapper, MdPbClassstandard> implements IMdPbClassstandardService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private MdPbClassstandardMapper mdPbClassstandardMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||||
// 查询所有分类
|
// 查询所有分类
|
||||||
@@ -306,6 +320,57 @@ public class MdPbClassstandardServiceImpl extends ServiceImpl<MdPbClassstandardM
|
|||||||
return jo;
|
return jo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONObject queryClassById(Map whereJson) {
|
||||||
|
String parent_class_id = (String) whereJson.get("parent_class_id");
|
||||||
|
|
||||||
|
/*where条件*/
|
||||||
|
String class_idStr = (String) whereJson.get("class_idStr");
|
||||||
|
String whereStr = (String) whereJson.get("whereStr");
|
||||||
|
|
||||||
|
JSONObject jo = new JSONObject();
|
||||||
|
JSONArray ja = new JSONArray();
|
||||||
|
|
||||||
|
LambdaQueryWrapper<MdPbClassstandard> lambda = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
|
String where = "1=1";
|
||||||
|
|
||||||
|
if (!StrUtil.isEmpty(whereStr)) {
|
||||||
|
where += whereStr;
|
||||||
|
}
|
||||||
|
if (StrUtil.isNotEmpty(class_idStr)) {
|
||||||
|
where += " AND class_id IN " + class_idStr;
|
||||||
|
lambda.in(MdPbClassstandard::getClass_id,class_idStr.split(","));
|
||||||
|
}
|
||||||
|
if (!StrUtil.isEmpty(parent_class_id)) {
|
||||||
|
where = " AND parent_class_id = " + parent_class_id;
|
||||||
|
lambda.eq(MdPbClassstandard::getParent_class_id,parent_class_id);
|
||||||
|
}
|
||||||
|
lambda.orderByAsc(MdPbClassstandard::getClass_id);
|
||||||
|
|
||||||
|
List<MdPbClassstandard> daoList = this.list(lambda);
|
||||||
|
for (MdPbClassstandard dao : daoList) {
|
||||||
|
// 类型转换
|
||||||
|
ClassstandardDto dto = JSONObject.parseObject(JSONObject.toJSONString(dao), ClassstandardDto.class);
|
||||||
|
|
||||||
|
if (Integer.parseInt(dto.getSub_count()) > 0) {
|
||||||
|
dto.setHasChildren(true);
|
||||||
|
dto.setLeaf(false);
|
||||||
|
} else {
|
||||||
|
dto.setHasChildren(false);
|
||||||
|
dto.setLeaf(true);
|
||||||
|
}
|
||||||
|
dto.setId(dto.getClass_id());
|
||||||
|
dto.setLabel(dto.getClass_name());
|
||||||
|
dto.setCreate_user_name(dto.getCreate_name());
|
||||||
|
dto.setUpdate_user_name(dto.getUpdate_optname());
|
||||||
|
ja.add(JSONObject.toJSON(dto));
|
||||||
|
}
|
||||||
|
jo.put("content", ja);
|
||||||
|
return jo;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<JSONObject> getClassName() {
|
public List<JSONObject> getClassName() {
|
||||||
List<MdPbClassstandard> daoList = this.list(
|
List<MdPbClassstandard> daoList = this.list(
|
||||||
@@ -398,4 +463,48 @@ public class MdPbClassstandardServiceImpl extends ServiceImpl<MdPbClassstandardM
|
|||||||
this.updateById(pidDao);
|
this.updateById(pidDao);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<MdPbClassstandard> queryClassTable(Map whereJson, PageQuery page) {
|
||||||
|
HashMap<String, String> map = new HashMap<>();
|
||||||
|
map.put("flag", "1");
|
||||||
|
String material_type_id = (String) whereJson.get("material_type_id");
|
||||||
|
String class_idStr = (String) whereJson.get("class_idStr");
|
||||||
|
LambdaQueryWrapper<MdPbClassstandard> lam = new LambdaQueryWrapper<MdPbClassstandard>();
|
||||||
|
//处理物料当前节点的所有子节点
|
||||||
|
if (!StrUtil.isEmpty(material_type_id)) {
|
||||||
|
List<String> classIds = this.getAllChildIdSet(material_type_id);
|
||||||
|
lam.in(MdPbClassstandard::getClass_id,classIds);
|
||||||
|
} else if (ObjectUtil.isNotEmpty(class_idStr)) {
|
||||||
|
List<String> classIds = this.getAllChildIdSet(class_idStr);
|
||||||
|
lam.in(MdPbClassstandard::getClass_id,classIds);
|
||||||
|
}
|
||||||
|
Page<MdPbClassstandard> pa = mdPbClassstandardMapper.selectPage(new Page<MdPbClassstandard>(page.getPage() + 1 ,page.getSize()), lam);
|
||||||
|
|
||||||
|
List<MdPbClassstandard> list = pa.getRecords();
|
||||||
|
List<MdPbClassstandard> listnew = new ArrayList<>();
|
||||||
|
for (int i = 0; i < list.size(); i++) {
|
||||||
|
MdPbClassstandard json = list.get(i);
|
||||||
|
if(!"0".equals(json.getParent_class_id())){
|
||||||
|
MdPbClassstandard jsonParent = mdPbClassstandardMapper.selectById(json.getParent_class_id());
|
||||||
|
json.setAddress(jsonParent.getClass_name());
|
||||||
|
}
|
||||||
|
listnew.add(json);
|
||||||
|
}
|
||||||
|
pa.setRecords(listnew);
|
||||||
|
return pa;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> getChildIdSet(String class_id) {
|
||||||
|
return mdPbClassstandardMapper.getChildIdSet(class_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> getAllChildIdSet(String class_id) {
|
||||||
|
List<String> ids = mdPbClassstandardMapper.getChildIdSet(class_id);
|
||||||
|
ids.add(class_id);
|
||||||
|
return ids;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ public class SectattrServiceImpl extends ServiceImpl<SectattrMapper, Sectattr> i
|
|||||||
stor_cas.put("label", stor_jo.getStor_name());
|
stor_cas.put("label", stor_jo.getStor_name());
|
||||||
|
|
||||||
List<Sectattr> sectattrList = sectattrMapper.selectList(new LambdaQueryWrapper<>(Sectattr.class)
|
List<Sectattr> sectattrList = sectattrMapper.selectList(new LambdaQueryWrapper<>(Sectattr.class)
|
||||||
.select(Sectattr::getSect_code,Sectattr::getSect_name)
|
.select(Sectattr::getSect_id,Sectattr::getSect_name)
|
||||||
.eq(StrUtil.isNotEmpty(stor_jo.getStor_id()),Sectattr::getStor_id,stor_jo.getStor_id())
|
.eq(StrUtil.isNotEmpty(stor_jo.getStor_id()),Sectattr::getStor_id,stor_jo.getStor_id())
|
||||||
.eq(StrUtil.isNotEmpty(sect_type_attr),Sectattr::getSect_type_attr,sect_type_attr)
|
.eq(StrUtil.isNotEmpty(sect_type_attr),Sectattr::getSect_type_attr,sect_type_attr)
|
||||||
.eq(Sectattr::getIs_delete,BaseDataEnum.IS_YES_NOT.code("否"))
|
.eq(Sectattr::getIs_delete,BaseDataEnum.IS_YES_NOT.code("否"))
|
||||||
@@ -191,7 +191,7 @@ public class SectattrServiceImpl extends ServiceImpl<SectattrMapper, Sectattr> i
|
|||||||
for (int j = 0; j < sectattrList.size(); j++) {
|
for (int j = 0; j < sectattrList.size(); j++) {
|
||||||
Sectattr sect_jo = sectattrList.get(j);
|
Sectattr sect_jo = sectattrList.get(j);
|
||||||
JSONObject sect_cas = new JSONObject();
|
JSONObject sect_cas = new JSONObject();
|
||||||
sect_cas.put("value", sect_jo.getSect_code());
|
sect_cas.put("value", sect_jo.getSect_id());
|
||||||
sect_cas.put("label", sect_jo.getSect_name());
|
sect_cas.put("label", sect_jo.getSect_name());
|
||||||
sect_ja.add(sect_cas);
|
sect_ja.add(sect_cas);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,9 +5,7 @@ package org.nl.wms.basedata_manage.service.impl;
|
|||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
@@ -16,14 +14,12 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.nl.common.domain.query.PageQuery;
|
import org.nl.common.domain.query.PageQuery;
|
||||||
import org.nl.common.utils.IdUtil;
|
import org.nl.common.utils.IdUtil;
|
||||||
import org.nl.common.utils.SecurityUtils;
|
import org.nl.common.utils.SecurityUtils;
|
||||||
import org.nl.wms.basedata_manage.service.IStructattrService;
|
import org.nl.wms.basedata_manage.service.IMdPbClassstandardService;
|
||||||
import org.nl.wms.basedata_manage.service.StructrelamaterialService;
|
import org.nl.wms.basedata_manage.service.StructrelamaterialService;
|
||||||
import org.nl.wms.basedata_manage.service.dao.Structattr;
|
|
||||||
import org.nl.wms.basedata_manage.service.dao.Structrelamaterial;
|
import org.nl.wms.basedata_manage.service.dao.Structrelamaterial;
|
||||||
import org.nl.wms.basedata_manage.service.dao.mapper.StructattrMapper;
|
|
||||||
import org.nl.wms.basedata_manage.service.dao.mapper.StructrelamaterialMapper;
|
import org.nl.wms.basedata_manage.service.dao.mapper.StructrelamaterialMapper;
|
||||||
import org.nl.wms.basedata_manage.service.dto.QueryPageParam;
|
import org.nl.wms.basedata_manage.service.dto.QueryPageParam;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
@@ -42,71 +38,26 @@ public class StructrelamaterialServiceImpl extends ServiceImpl<Structrelamateria
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private StructrelamaterialMapper structrelamaterialMapper;
|
private StructrelamaterialMapper structrelamaterialMapper;
|
||||||
|
@Autowired
|
||||||
|
private IMdPbClassstandardService iMdPbClassstandardService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPage<Structrelamaterial> pageQuery(Map whereJson, PageQuery page) {
|
public IPage<Structrelamaterial> pageQuery(Map whereJson, PageQuery page) {
|
||||||
String search = (String) whereJson.get("search");
|
|
||||||
String material_type_id = (String) whereJson.get("material_type_id");
|
String material_type_id = (String) whereJson.get("material_type_id");
|
||||||
String class_idStr = (String) whereJson.get("class_idStr");
|
String class_idStr = (String) whereJson.get("class_idStr");
|
||||||
//处理物料当前节点的所有子节点
|
|
||||||
if (!StrUtil.isEmpty(material_type_id)) {
|
|
||||||
//map.put("material_type_id", material_type_id);
|
|
||||||
//String classIds = classstandardService.getChildIdStr(material_type_id);
|
|
||||||
//map.put("classIds", classIds);
|
|
||||||
} else if (ObjectUtil.isNotEmpty(class_idStr)) {
|
|
||||||
// String classIds = classstandardService.getAllChildIdStr(class_idStr);
|
|
||||||
//map.put("classIds", classIds);
|
|
||||||
}
|
|
||||||
QueryPageParam param = new QueryPageParam();
|
QueryPageParam param = new QueryPageParam();
|
||||||
param.setSearch(search);
|
//处理物料当前节点的所有子节点
|
||||||
|
if (StrUtil.isNotEmpty(material_type_id)) {
|
||||||
|
List<String> classIds = iMdPbClassstandardService.getAllChildIdSet(material_type_id);
|
||||||
|
param.setClassIds(classIds);
|
||||||
|
} else if (ObjectUtil.isNotEmpty(class_idStr)) {
|
||||||
|
List<String> classIds = iMdPbClassstandardService.getAllChildIdSet(class_idStr);
|
||||||
|
param.setClassIds(classIds);
|
||||||
|
}
|
||||||
|
|
||||||
param.setSect_id((String) whereJson.get("sect_id"));
|
param.setSect_id((String) whereJson.get("sect_id"));
|
||||||
param.setStor_id((String) whereJson.get("stor_id"));
|
|
||||||
IPage<Structrelamaterial> pages = new Page<>(page.getPage() + 1, page.getSize());
|
IPage<Structrelamaterial> pages = new Page<>(page.getPage() + 1, page.getSize());
|
||||||
return structrelamaterialMapper.pagequery(pages, param);
|
return structrelamaterialMapper.pagequery(pages, param, param.getClassIds());
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Structrelamaterial> queryAll(Map whereJson) {
|
|
||||||
List<Structrelamaterial> list = structrelamaterialMapper.selectList(null);
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Structrelamaterial findById(String id) {
|
|
||||||
return structrelamaterialMapper.selectById(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Structrelamaterial findByCode(String code) {
|
|
||||||
return structrelamaterialMapper.selectById(code);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public void create(Structrelamaterial dto) {
|
|
||||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
|
||||||
String nickName = SecurityUtils.getCurrentNickName();
|
|
||||||
String now = DateUtil.now();
|
|
||||||
|
|
||||||
dto.setMaterset_id(IdUtil.getStringId());
|
|
||||||
dto.setSet_id(currentUserId);
|
|
||||||
dto.setSet_name(nickName);
|
|
||||||
dto.setSet_time(now);
|
|
||||||
|
|
||||||
structrelamaterialMapper.insert(dto);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public void update(Structrelamaterial dto) {
|
|
||||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
|
||||||
String nickName = SecurityUtils.getCurrentNickName();
|
|
||||||
String now = DateUtil.now();
|
|
||||||
|
|
||||||
dto.setSet_id(currentUserId);
|
|
||||||
dto.setSet_name(nickName);
|
|
||||||
dto.setSet_time(now);
|
|
||||||
|
|
||||||
structrelamaterialMapper.updateById(dto);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -117,38 +68,37 @@ public class StructrelamaterialServiceImpl extends ServiceImpl<Structrelamateria
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void insertSet(Map whereJson) {
|
public void insertSet(Map whereJson) {
|
||||||
/* Long currentUserId = SecurityUtils.getCurrentUserId();
|
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
String nickName = SecurityUtils.getNickName();
|
String nickName = SecurityUtils.getCurrentNickName();
|
||||||
String now = DateUtil.now();
|
String now = DateUtil.now();
|
||||||
WQLObject mater = WQLObject.getWQLObject("ST_IVT_StructRelaMaterial");
|
|
||||||
String sect_id = (String) whereJson.get("sect_id");
|
String sect_id = (String) whereJson.get("sect_id");
|
||||||
ArrayList<HashMap> class_rows = (ArrayList<HashMap>) whereJson.get("class_rows");
|
ArrayList<HashMap> class_rows = (ArrayList<HashMap>) whereJson.get("class_rows");
|
||||||
|
|
||||||
for (int i = 0; i < class_rows.size(); i++) {
|
for (int i = 0; i < class_rows.size(); i++) {
|
||||||
HashMap<String, String> class_row = class_rows.get(i);
|
HashMap<String, String> class_row = class_rows.get(i);
|
||||||
JSONObject material_set = mater.query("sect_id = '" + sect_id + "' AND material_type_id = '" + class_row.get("class_id") + "'")
|
LambdaQueryWrapper<Structrelamaterial> lambda = new LambdaQueryWrapper();
|
||||||
.uniqueResult(0);
|
lambda.eq(Structrelamaterial::getSect_id,sect_id);
|
||||||
|
lambda.eq(Structrelamaterial::getMaterial_type_id,class_row.get("class_id"));
|
||||||
|
Structrelamaterial material_set = structrelamaterialMapper.selectOne(lambda);
|
||||||
if (material_set != null) {
|
if (material_set != null) {
|
||||||
HashMap<String, String> update_map = new HashMap<>();
|
material_set.setSet_id(currentUserId);
|
||||||
update_map.put("set_id", currentUserId + "");
|
material_set.setSet_name(nickName);
|
||||||
update_map.put("set_name", nickName);
|
material_set.setSet_time(now);
|
||||||
update_map.put("set_time", now);
|
material_set.setSect_id(sect_id);
|
||||||
mater.update(update_map, "sect_id = '" + sect_id + "' AND material_type_id = '" + class_row.get("class_id") + "'");
|
material_set.setMaterial_type_id(class_row.get("class_id"));
|
||||||
|
structrelamaterialMapper.updateById(material_set);
|
||||||
} else {
|
} else {
|
||||||
JSONObject jo = new JSONObject();
|
material_set = new Structrelamaterial();
|
||||||
jo.put("sect_id", sect_id);
|
material_set.setSet_id(currentUserId);
|
||||||
jo.put("material_type_id", class_row.get("class_id"));
|
material_set.setSet_name(nickName);
|
||||||
jo.put("set_id", currentUserId + "");
|
material_set.setSet_time(now);
|
||||||
jo.put("set_name", nickName);
|
material_set.setSect_id(sect_id);
|
||||||
jo.put("set_time", now);
|
material_set.setMaterial_type_id(class_row.get("class_id"));
|
||||||
mater.insert(jo);
|
material_set.setMaterset_id(IdUtil.getStringId());
|
||||||
|
structrelamaterialMapper.insert(material_set);
|
||||||
}
|
}
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void delSet(Map whereJson) {
|
|
||||||
String materset_id = (String) whereJson.get("materset_id");
|
|
||||||
structrelamaterialMapper.deleteById(materset_id);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ export default {
|
|||||||
'lang': 'zh',
|
'lang': 'zh',
|
||||||
// 平台
|
// 平台
|
||||||
'platform': {
|
'platform': {
|
||||||
'title': 'c',
|
'title': '富佳WMS',
|
||||||
'tip1': '用户名不能为空',
|
'tip1': '用户名不能为空',
|
||||||
'tip2': '密码不能为空',
|
'tip2': '密码不能为空',
|
||||||
'tip3': '验证码不能为空'
|
'tip3': '验证码不能为空'
|
||||||
|
|||||||
@@ -14,7 +14,6 @@
|
|||||||
import ECharts from 'vue-echarts'
|
import ECharts from 'vue-echarts'
|
||||||
import 'echarts/lib/chart/line'
|
import 'echarts/lib/chart/line'
|
||||||
import 'echarts/lib/component/polar'
|
import 'echarts/lib/component/polar'
|
||||||
import { initData } from '@/api/data'
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ServerMonitor',
|
name: 'ServerMonitor',
|
||||||
components: {
|
components: {
|
||||||
@@ -95,12 +94,12 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.init()
|
/* this.init()
|
||||||
this.monitor = window.setInterval(() => {
|
this.monitor = window.setInterval(() => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.init()
|
this.init()
|
||||||
}, 2)
|
}, 2)
|
||||||
}, 3500)
|
}, 3500)*/
|
||||||
},
|
},
|
||||||
destroyed() {
|
destroyed() {
|
||||||
clearInterval(this.monitor)
|
clearInterval(this.monitor)
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
append-to-body
|
append-to-body
|
||||||
:visible.sync="dialogVisible"
|
:visible.sync="dialogVisible"
|
||||||
destroy-on-close
|
destroy-on-close
|
||||||
:show-close="false"
|
:show-close="true"
|
||||||
width="60%"
|
width="60%"
|
||||||
@close="close"
|
@close="close"
|
||||||
>
|
>
|
||||||
@@ -68,7 +68,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
import CRUD, { presenter, header, crud } from '@crud/crud'
|
||||||
import rrOperation from '@crud/RR.operation'
|
import rrOperation from '@crud/RR.operation'
|
||||||
import crudOperation from '@crud/CRUD.operation'
|
import crudOperation from '@crud/CRUD.operation'
|
||||||
import pagination from '@crud/Pagination'
|
import pagination from '@crud/Pagination'
|
||||||
@@ -80,9 +80,9 @@ import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
|||||||
import crudStructrelamaterial from '@/views/wms/basedata/materialSet/structrelamaterial'
|
import crudStructrelamaterial from '@/views/wms/basedata/materialSet/structrelamaterial'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AddShowDialog',
|
name: 'AddDialog',
|
||||||
components: { pagination, rrOperation, crudOperation, Treeselect },
|
components: { pagination, rrOperation, crudOperation, Treeselect },
|
||||||
mixins: [presenter(), header(), form(), crud()],
|
mixins: [presenter(), header(), crud()],
|
||||||
cruds() {
|
cruds() {
|
||||||
return CRUD({
|
return CRUD({
|
||||||
url: 'api/Classstandard/getClassTable',
|
url: 'api/Classstandard/getClassTable',
|
||||||
@@ -137,17 +137,12 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleClose(done) {
|
|
||||||
this.$confirm('确认关闭?')
|
|
||||||
.then(_ => {
|
|
||||||
done()
|
|
||||||
})
|
|
||||||
.catch(_ => {
|
|
||||||
})
|
|
||||||
},
|
|
||||||
close() {
|
close() {
|
||||||
this.crud.resetQuery(false)
|
this.query.material_type_id = null
|
||||||
|
this.sect_id = null
|
||||||
|
this.query.sect = null
|
||||||
this.$emit('update:dialogShow', false)
|
this.$emit('update:dialogShow', false)
|
||||||
|
this.$emit('AddChanged')
|
||||||
},
|
},
|
||||||
sectChange(val) {
|
sectChange(val) {
|
||||||
this.sect_id = val[1]
|
this.sect_id = val[1]
|
||||||
@@ -178,23 +173,25 @@ export default {
|
|||||||
}
|
}
|
||||||
return obj
|
return obj
|
||||||
})
|
})
|
||||||
|
this.crud.toQuery()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
doAdd() {
|
doAdd() {
|
||||||
const data = {}
|
const data = {}
|
||||||
const _selectData = this.$refs.multipleTable.selection
|
const _selectData = this.$refs.multipleTable.selection
|
||||||
data.class_rows = _selectData
|
data.class_rows = _selectData
|
||||||
|
if (_selectData.length === 0) {
|
||||||
|
this.crud.notify('请选择记录', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
return false
|
||||||
|
}
|
||||||
data.sect_id = this.sect_id
|
data.sect_id = this.sect_id
|
||||||
if (!this.query.sect) {
|
if (!this.crud.query.sect) {
|
||||||
this.crud.notify('请选择库区', CRUD.NOTIFICATION_TYPE.INFO)
|
this.crud.notify('请选择库区', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
crudStructrelamaterial.insertSet(data).then(() => {
|
crudStructrelamaterial.insertSet(data).then(() => {
|
||||||
this.crud.status.add = CRUD.STATUS.NORMAL
|
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
this.$emit('update:dialogShow', false)
|
this.close()
|
||||||
this.crud.toQuery()
|
|
||||||
this.crud.notify('新增成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
|
||||||
this.$parent.freshParentPage()
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,6 @@
|
|||||||
<el-cascader
|
<el-cascader
|
||||||
v-model="query.sect"
|
v-model="query.sect"
|
||||||
:options="sects"
|
:options="sects"
|
||||||
:props="{ checkStrictly: true }"
|
|
||||||
clearable
|
clearable
|
||||||
class="filter-item"
|
class="filter-item"
|
||||||
@change="sectQueryChange"
|
@change="sectQueryChange"
|
||||||
@@ -45,6 +44,22 @@
|
|||||||
</crudOperation>
|
</crudOperation>
|
||||||
<!--表格渲染-->
|
<!--表格渲染-->
|
||||||
<el-table ref="table" :max-height="590" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
<el-table ref="table" :max-height="590" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||||
|
<el-table-column
|
||||||
|
v-permission="['admin','structrelamaterial:edit','structrelamaterial:del']"
|
||||||
|
label="操作"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
fixed="right"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<udOperation
|
||||||
|
:data="scope.row"
|
||||||
|
:permission="permission"
|
||||||
|
:disabled-dle="false"
|
||||||
|
:is-visiable-edit="false"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column type="selection" width="55" />
|
<el-table-column type="selection" width="55" />
|
||||||
<el-table-column prop="sect_code" label="库区编码" />
|
<el-table-column prop="sect_code" label="库区编码" />
|
||||||
<el-table-column prop="sect_name" label="库区名称" />
|
<el-table-column prop="sect_name" label="库区名称" />
|
||||||
@@ -52,22 +67,17 @@
|
|||||||
<el-table-column prop="class_name" label="物料类别名称" />
|
<el-table-column prop="class_name" label="物料类别名称" />
|
||||||
<el-table-column prop="set_time" label="设置时间" />
|
<el-table-column prop="set_time" label="设置时间" />
|
||||||
<el-table-column prop="set_name" label="设置人" />
|
<el-table-column prop="set_name" label="设置人" />
|
||||||
<el-table-column v-permission="['admin','structrelamaterial:edit','structrelamaterial:del']" label="操作" width="150px" align="center">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini" @click="doDelete(scope.row)" />
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
</el-table>
|
||||||
<!--分页组件-->
|
<!--分页组件-->
|
||||||
<pagination />
|
<pagination />
|
||||||
</div>
|
</div>
|
||||||
<AddDialog :dialog-show.sync="addlogDing" />
|
<AddDialog :dialog-show.sync="addlogDing" @AddChanged="querytable" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import crudStructrelamaterial from '@/views/wms/basedata/materialSet/structrelamaterial'
|
import crudStructrelamaterial from '@/views/wms/basedata/materialSet/structrelamaterial'
|
||||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
import CRUD, { crud, header, presenter } from '@crud/crud'
|
||||||
import rrOperation from '@crud/RR.operation'
|
import rrOperation from '@crud/RR.operation'
|
||||||
import crudOperation from '@crud/CRUD.operation'
|
import crudOperation from '@crud/CRUD.operation'
|
||||||
import pagination from '@crud/Pagination'
|
import pagination from '@crud/Pagination'
|
||||||
@@ -77,20 +87,24 @@ import Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
|
|||||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||||
import crudMaterialbase from '@/views/wms/basedata/material/material'
|
import crudMaterialbase from '@/views/wms/basedata/material/material'
|
||||||
import AddDialog from '@/views/wms/basedata/materialSet/AddDialog'
|
import AddDialog from '@/views/wms/basedata/materialSet/AddDialog'
|
||||||
|
import udOperation from '@crud/UD.operation'
|
||||||
|
|
||||||
const defaultForm = { sect_id: null, cascader: null, material_type_id: null, set_id: null, set_name: null, set_time: null }
|
|
||||||
export default {
|
export default {
|
||||||
name: 'MaterialSet',
|
name: 'MaterialSet',
|
||||||
components: { AddDialog, pagination, crudOperation, rrOperation, Treeselect },
|
components: { AddDialog, pagination, crudOperation, rrOperation, Treeselect, udOperation },
|
||||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
mixins: [presenter(), header(), crud()],
|
||||||
cruds() {
|
cruds() {
|
||||||
return CRUD({ title: '物料存放设置',
|
return CRUD({ title: '物料存放设置',
|
||||||
props: {
|
props: {
|
||||||
// 每页数据条数
|
// 每页数据条数
|
||||||
size: 20
|
size: 20
|
||||||
},
|
},
|
||||||
optShow: { add: false, reset: true }, idField: 'class_id',
|
optShow: { add: false, reset: true, del: true },
|
||||||
sort: 'class_id,desc', url: 'api/structrelamaterial', crudMethod: { ...crudStructrelamaterial }})
|
crudMethod: { ...crudStructrelamaterial },
|
||||||
|
idField: 'materset_id',
|
||||||
|
sort: 'materset_id,desc',
|
||||||
|
url: 'api/structrelamaterial'
|
||||||
|
})
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -99,28 +113,8 @@ export default {
|
|||||||
class_idStr: null,
|
class_idStr: null,
|
||||||
permission: {
|
permission: {
|
||||||
},
|
},
|
||||||
material_type_id: null,
|
|
||||||
is_delete: false,
|
|
||||||
tableData: [],
|
|
||||||
sects: [],
|
sects: [],
|
||||||
sect_id: '',
|
sect_id: ''
|
||||||
rules: {
|
|
||||||
sect_id: [
|
|
||||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
|
||||||
],
|
|
||||||
material_type_id: [
|
|
||||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
|
||||||
],
|
|
||||||
set_id: [
|
|
||||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
|
||||||
],
|
|
||||||
set_name: [
|
|
||||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
|
||||||
],
|
|
||||||
set_time: [
|
|
||||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@@ -142,40 +136,17 @@ export default {
|
|||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
sectQueryChange(val) {
|
sectQueryChange(val) {
|
||||||
if (val.length === 1) {
|
|
||||||
this.query.stor_id = val[0]
|
|
||||||
this.query.sect_id = ''
|
|
||||||
}
|
|
||||||
if (val.length === 0) {
|
|
||||||
this.query.sect_id = ''
|
|
||||||
this.query.stor_id = ''
|
|
||||||
}
|
|
||||||
if (val.length === 2) {
|
if (val.length === 2) {
|
||||||
this.query.stor_id = val[0]
|
this.query.stor_id = val[0]
|
||||||
this.query.sect_id = val[1]
|
this.query.sect_id = val[1]
|
||||||
|
}else{
|
||||||
|
this.query.stor_id = ''
|
||||||
|
this.query.sect_id = ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
[CRUD.HOOK.beforeToAdd]() {
|
querytable() {
|
||||||
this.queryClass()
|
|
||||||
},
|
|
||||||
sectChange(val) {
|
|
||||||
this.sect_id = val[1]
|
|
||||||
},
|
|
||||||
queryClass(data) {
|
|
||||||
crudClassstandard.getClassTable(data).then(res => {
|
|
||||||
this.tableData = res.content
|
|
||||||
})
|
|
||||||
},
|
|
||||||
freshParentPage() {
|
|
||||||
this.crud.toQuery()
|
this.crud.toQuery()
|
||||||
},
|
},
|
||||||
doDelete(data) {
|
|
||||||
crudStructrelamaterial.delSet(data).then(() => {
|
|
||||||
this.crud.dleChangePage(1)
|
|
||||||
this.crud.delSuccessNotify()
|
|
||||||
this.crud.refresh()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
loadClass({ action, parentNode, callback }) {
|
loadClass({ action, parentNode, callback }) {
|
||||||
if (action === LOAD_CHILDREN_OPTIONS) {
|
if (action === LOAD_CHILDREN_OPTIONS) {
|
||||||
crudClassstandard.getClass({ pid: parentNode.id }).then(res => {
|
crudClassstandard.getClass({ pid: parentNode.id }).then(res => {
|
||||||
|
|||||||
@@ -32,12 +32,4 @@ export function insertSet(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function delSet(data) {
|
export default { add, edit, del, insertSet }
|
||||||
return request({
|
|
||||||
url: 'api/structrelamaterial/delSet',
|
|
||||||
method: 'post',
|
|
||||||
data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export default { add, edit, del, insertSet, delSet }
|
|
||||||
|
|||||||
Reference in New Issue
Block a user