| | |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.zy.asrs.common.wms.entity.ManMat; |
| | | import com.zy.asrs.common.wms.entity.Mat; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Data |
| | | @ExcelIgnoreUnannotated |
| | | public class MatExcel extends ManMat { |
| | | public class MatExcel extends Mat { |
| | | |
| | | @ExcelProperty(index = 0, value = "一级分类") |
| | | private String priClass; |
| | |
| | | import com.alibaba.excel.event.AnalysisEventListener; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.zy.asrs.common.domain.entity.MatExcel; |
| | | import com.zy.asrs.common.wms.entity.ManMat; |
| | | import com.zy.asrs.common.wms.entity.ManTag; |
| | | import com.zy.asrs.common.wms.entity.Mat; |
| | | import com.zy.asrs.common.wms.entity.Tag; |
| | | import com.zy.asrs.common.wms.mapper.ManTagMapper; |
| | | import com.zy.asrs.common.wms.service.ManMatService; |
| | | import com.zy.asrs.common.wms.service.ManTagService; |
| | |
| | | // 分类 |
| | | // 一级分类 |
| | | if (!Cools.isEmpty(excel.getPriClass()) && !Cools.isEmpty(excel.getSecClass())) { |
| | | ManTag priTag = tagService.getOne(new LambdaQueryWrapper<ManTag>().eq(ManTag::getName, excel.getPriClass()).eq(ManTag::getLevel, 2)); |
| | | Tag priTag = tagService.getOne(new LambdaQueryWrapper<Tag>().eq(Tag::getName, excel.getPriClass()).eq(Tag::getLevel, 2)); |
| | | if (priTag == null) { |
| | | ManTag top = tagService.getTop(); |
| | | Tag top = tagService.getTop(); |
| | | NodeUtils nodeUtils = new NodeUtils(); |
| | | nodeUtils.executePath(top.getId()); |
| | | priTag = new ManTag( |
| | | priTag = new Tag( |
| | | null, // 编号 |
| | | excel.getPriClass(), // 名称 |
| | | top.getId(), // 父级 |
| | |
| | | } |
| | | } |
| | | // 二级分类 |
| | | ManTag secTag = tagService.getOne(new LambdaQueryWrapper<ManTag>().eq(ManTag::getName, excel.getPriClass()).eq(ManTag::getLevel, 3)); |
| | | Tag secTag = tagService.getOne(new LambdaQueryWrapper<Tag>().eq(Tag::getName, excel.getPriClass()).eq(Tag::getLevel, 3)); |
| | | if (secTag == null) { |
| | | NodeUtils nodeUtils = new NodeUtils(); |
| | | nodeUtils.executePath(priTag.getId()); |
| | | secTag = new ManTag( |
| | | secTag = new Tag( |
| | | null, // 编号 |
| | | excel.getSecClass(), // 名称 |
| | | priTag.getId(), // 父级 |
| | |
| | | tagId = tagService.getTop().getId(); |
| | | } |
| | | // 商品 |
| | | ManMat mat = matService.getOne(new LambdaQueryWrapper<ManMat>().eq(ManMat::getMatnr, excel.getMatnr())); |
| | | Mat mat = matService.getOne(new LambdaQueryWrapper<Mat>().eq(Mat::getMatnr, excel.getMatnr())); |
| | | if (mat == null) { |
| | | mat = excel; |
| | | mat.setTagId(tagId); |
| | |
| | | package com.zy.asrs.common.utils; |
| | | |
| | | import com.zy.asrs.common.wms.entity.ManTag; |
| | | import com.zy.asrs.common.wms.entity.Tag; |
| | | import com.zy.asrs.common.wms.service.ManTagService; |
| | | import com.zy.asrs.framework.common.SpringUtils; |
| | | |
| | |
| | | |
| | | public StringBuilder pathName = new StringBuilder(); |
| | | |
| | | public void executePath(ManTag tag) { |
| | | public void executePath(Tag tag) { |
| | | ManTagService bean = SpringUtils.getBean(ManTagService.class); |
| | | ManTag parent = bean.getById(tag.getParentId()); |
| | | Tag parent = bean.getById(tag.getParentId()); |
| | | if (null != parent) { |
| | | path.insert(0, parent.getId()).insert(0,","); |
| | | pathName.insert(0, parent.getName()).insert(0,","); |
| | |
| | | |
| | | public void executePath(Long parentId) { |
| | | ManTagService bean = SpringUtils.getBean(ManTagService.class); |
| | | ManTag parent = bean.getById(parentId); |
| | | Tag parent = bean.getById(parentId); |
| | | if (null != parent) { |
| | | path.insert(0, parent.getId()).insert(0,","); |
| | | pathName.insert(0, parent.getName()).insert(0,","); |
| | |
| | | package com.zy.asrs.common.utils; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.zy.asrs.common.wms.entity.ManTag; |
| | | import com.zy.asrs.common.wms.entity.Tag; |
| | | import com.zy.asrs.common.wms.service.ManTagService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.cache.annotation.Cacheable; |
| | |
| | | @Cacheable(cacheNames="tagTree",key="#id") |
| | | public ArrayList<Map> getTree(String id){ |
| | | ArrayList<Map> result = new ArrayList<>(); |
| | | ManTag tag = tagService.getById(id); |
| | | Tag tag = tagService.getById(id); |
| | | // 主节点 |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("title", tag.getName()); |
| | |
| | | /** |
| | | * 递归获取子节点数据 |
| | | */ |
| | | public void dealTag(ManTag parent, List<Map> list) { |
| | | List<ManTag> tags = tagService.list( |
| | | new LambdaQueryWrapper<ManTag>() |
| | | .eq(ManTag::getParentId, parent.getId()) |
| | | .eq(ManTag::getStatus, "1")); |
| | | for (ManTag tag : tags) { |
| | | public void dealTag(Tag parent, List<Map> list) { |
| | | List<Tag> tags = tagService.list( |
| | | new LambdaQueryWrapper<Tag>() |
| | | .eq(Tag::getParentId, parent.getId()) |
| | | .eq(Tag::getStatus, "1")); |
| | | for (Tag tag : tags) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("title", tag.getName()); |
| | | map.put("id", tag.getId()); |
| | |
| | | import com.zy.asrs.common.sys.entity.UserLogin; |
| | | import com.zy.asrs.common.sys.service.UserLoginService; |
| | | import com.zy.asrs.common.sys.service.UserService; |
| | | import com.zy.asrs.common.wms.entity.ManTag; |
| | | import com.zy.asrs.common.wms.entity.Tag; |
| | | import com.zy.asrs.common.wms.service.ManTagService; |
| | | import com.zy.asrs.framework.common.BaseRes; |
| | | import com.zy.asrs.framework.common.Cools; |
| | |
| | | return page; |
| | | } |
| | | |
| | | protected ManTag getOriginTag(){ |
| | | protected Tag getOriginTag(){ |
| | | return manTagService.getTop(); |
| | | } |
| | | |
File was renamed from zy-asrs-common/src/main/java/com/zy/asrs/common/wms/entity/ManMat.java |
| | |
| | | |
| | | import com.zy.asrs.common.wms.service.ManTagService; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.zy.asrs.framework.common.Cools; |
| | |
| | | import com.zy.asrs.common.sys.service.UserService; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @TableName("wms_man_mat") |
| | | public class ManMat implements Serializable { |
| | | public class Mat implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | |
| | | @ApiModelProperty(value= "备注") |
| | | private String memo; |
| | | |
| | | public ManMat() {} |
| | | public Mat() {} |
| | | |
| | | public ManMat(String uuid,Long tagId,String matnr,String maktx,String name,String specs,String model,String color,String brand,String unit,Double price,String sku,Double units,String barcode,String origin,String manu,String manuDate,String itemNum,Double safeQty,Double weight,Double length,Double volume,String threeCode,String supp,String suppCode,Integer beBatch,String deadTime,Integer deadWarn,Integer source,Integer inspect,Integer danger,Integer status,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) { |
| | | public Mat(String uuid, Long tagId, String matnr, String maktx, String name, String specs, String model, String color, String brand, String unit, Double price, String sku, Double units, String barcode, String origin, String manu, String manuDate, String itemNum, Double safeQty, Double weight, Double length, Double volume, String threeCode, String supp, String suppCode, Integer beBatch, String deadTime, Integer deadWarn, Integer source, Integer inspect, Integer danger, Integer status, Long createBy, Date createTime, Long updateBy, Date updateTime, String memo) { |
| | | this.uuid = uuid; |
| | | this.tagId = tagId; |
| | | this.matnr = matnr; |
| | |
| | | this.memo = memo; |
| | | } |
| | | |
| | | // ManMat manMat = new ManMat( |
| | | // Mat manMat = new Mat( |
| | | // null, // 编号 |
| | | // null, // 所属归类 |
| | | // null, // 商品编号[非空] |
| | |
| | | |
| | | public String getTagId$(){ |
| | | ManTagService manTagService = SpringUtils.getBean(ManTagService.class); |
| | | ManTag tag = manTagService.getById(this.tagId); |
| | | Tag tag = manTagService.getById(this.tagId); |
| | | if (!Cools.isEmpty(tag)){ |
| | | return String.valueOf(tag.getId()); |
| | | } |
File was renamed from zy-asrs-common/src/main/java/com/zy/asrs/common/wms/entity/ManTag.java |
| | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.zy.asrs.framework.common.Cools; |
| | |
| | | import com.zy.asrs.common.sys.service.UserService; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @TableName("wms_man_tag") |
| | | public class ManTag implements Serializable { |
| | | public class Tag implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | |
| | | @ApiModelProperty(value= "备注") |
| | | private String memo; |
| | | |
| | | public ManTag() {} |
| | | public Tag() {} |
| | | |
| | | public ManTag(String uuid,String name,Long parentId,String parentName,String path,String pathName,Integer type,String leading,String img,String brief,Integer count,Integer level,Integer sort,Integer status,Date createTime,Long createBy,Date updateTime,Long updateBy,String memo) { |
| | | public Tag(String uuid, String name, Long parentId, String parentName, String path, String pathName, Integer type, String leading, String img, String brief, Integer count, Integer level, Integer sort, Integer status, Date createTime, Long createBy, Date updateTime, Long updateBy, String memo) { |
| | | this.uuid = uuid; |
| | | this.name = name; |
| | | this.parentId = parentId; |
| | |
| | | this.memo = memo; |
| | | } |
| | | |
| | | // ManTag manTag = new ManTag( |
| | | // Tag manTag = new Tag( |
| | | // null, // 编号 |
| | | // null, // 名称 |
| | | // null, // 父级 |
| | |
| | | package com.zy.asrs.common.wms.mapper; |
| | | |
| | | import com.zy.asrs.common.wms.entity.ManMat; |
| | | import com.zy.asrs.common.wms.entity.Mat; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface ManMatMapper extends BaseMapper<ManMat> { |
| | | public interface ManMatMapper extends BaseMapper<Mat> { |
| | | |
| | | } |
| | |
| | | package com.zy.asrs.common.wms.mapper; |
| | | |
| | | import com.zy.asrs.common.wms.entity.ManTag; |
| | | import com.zy.asrs.common.wms.entity.Tag; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface ManTagMapper extends BaseMapper<ManTag> { |
| | | public interface ManTagMapper extends BaseMapper<Tag> { |
| | | |
| | | } |
| | |
| | | package com.zy.asrs.common.wms.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.zy.asrs.common.wms.entity.ManMat; |
| | | import com.zy.asrs.common.wms.entity.Mat; |
| | | |
| | | public interface ManMatService extends IService<ManMat> { |
| | | public interface ManMatService extends IService<Mat> { |
| | | |
| | | } |
| | |
| | | package com.zy.asrs.common.wms.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.zy.asrs.common.wms.entity.ManTag; |
| | | import com.zy.asrs.common.wms.entity.Tag; |
| | | |
| | | public interface ManTagService extends IService<ManTag> { |
| | | public interface ManTagService extends IService<Tag> { |
| | | |
| | | ManTag getTop(); |
| | | Tag getTop(); |
| | | |
| | | } |
| | |
| | | package com.zy.asrs.common.wms.service.impl; |
| | | |
| | | import com.zy.asrs.common.wms.mapper.ManMatMapper; |
| | | import com.zy.asrs.common.wms.entity.ManMat; |
| | | import com.zy.asrs.common.wms.entity.Mat; |
| | | import com.zy.asrs.common.wms.service.ManMatService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("manMatService") |
| | | public class ManMatServiceImpl extends ServiceImpl<ManMatMapper, ManMat> implements ManMatService { |
| | | public class ManMatServiceImpl extends ServiceImpl<ManMatMapper, Mat> implements ManMatService { |
| | | |
| | | } |
| | |
| | | package com.zy.asrs.common.wms.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.zy.asrs.common.wms.entity.Tag; |
| | | import com.zy.asrs.common.wms.mapper.ManTagMapper; |
| | | import com.zy.asrs.common.wms.entity.ManTag; |
| | | import com.zy.asrs.common.wms.service.ManTagService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.zy.asrs.framework.exception.CoolException; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("manTagService") |
| | | public class ManTagServiceImpl extends ServiceImpl<ManTagMapper, ManTag> implements ManTagService { |
| | | public class ManTagServiceImpl extends ServiceImpl<ManTagMapper, Tag> implements ManTagService { |
| | | |
| | | @Override |
| | | public synchronized ManTag getTop() { |
| | | ManTag top = this.getOne(new LambdaQueryWrapper<ManTag>().eq(ManTag::getLevel, 1)); |
| | | public synchronized Tag getTop() { |
| | | Tag top = this.getOne(new LambdaQueryWrapper<Tag>().eq(Tag::getLevel, 1)); |
| | | if (top == null) { |
| | | top = new ManTag(); |
| | | top = new Tag(); |
| | | top.setName("全部"); |
| | | top.setType(0); |
| | | top.setLevel(1); |
| | |
| | | -- save manMat record |
| | | -- save mat record |
| | | -- mysql |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'manMat/manMat.html', 'manMat管理', null , '2', null , '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'mat/mat.html', 'manMat管理', null , '2', null , '1'); |
| | | |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'manMat#view', '查询', '', '3', '0', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'manMat#btn-add', '新增', '', '3', '1', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'manMat#btn-edit', '编辑', '', '3', '2', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'manMat#btn-delete', '删除', '', '3', '3', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'manMat#btn-export', '导出', '', '3', '4', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'mat#view', '查询', '', '3', '0', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'mat#btn-add', '新增', '', '3', '1', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'mat#btn-edit', '编辑', '', '3', '2', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'mat#btn-delete', '删除', '', '3', '3', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'mat#btn-export', '导出', '', '3', '4', '1'); |
| | | |
| | | -- sqlserver |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'manMat/manMat.html', N'manMat管理', null, '2', null, '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'mat/mat.html', N'manMat管理', null, '2', null, '1'); |
| | | |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'manMat#view', N'查询', '', '3', '0', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'manMat#btn-add', N'新增', '', '3', '1', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'manMat#btn-edit', N'编辑', '', '3', '2', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'manMat#btn-delete', N'删除', '', '3', '3', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'manMat#btn-export', N'导出', '', '3', '4', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'mat#view', N'查询', '', '3', '0', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'mat#btn-add', N'新增', '', '3', '1', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'mat#btn-edit', N'编辑', '', '3', '2', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'mat#btn-delete', N'删除', '', '3', '3', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'mat#btn-export', N'导出', '', '3', '4', '1'); |
| | |
| | | -- save manTag record |
| | | -- save tag record |
| | | -- mysql |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'manTag/manTag.html', 'manTag管理', null , '2', null , '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'tag/tag.html', 'manTag管理', null , '2', null , '1'); |
| | | |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'manTag#view', '查询', '', '3', '0', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'manTag#btn-add', '新增', '', '3', '1', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'manTag#btn-edit', '编辑', '', '3', '2', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'manTag#btn-delete', '删除', '', '3', '3', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'manTag#btn-export', '导出', '', '3', '4', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'tag#view', '查询', '', '3', '0', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'tag#btn-add', '新增', '', '3', '1', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'tag#btn-edit', '编辑', '', '3', '2', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'tag#btn-delete', '删除', '', '3', '3', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'tag#btn-export', '导出', '', '3', '4', '1'); |
| | | |
| | | -- sqlserver |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'manTag/manTag.html', N'manTag管理', null, '2', null, '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'tag/tag.html', N'manTag管理', null, '2', null, '1'); |
| | | |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'manTag#view', N'查询', '', '3', '0', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'manTag#btn-add', N'新增', '', '3', '1', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'manTag#btn-edit', N'编辑', '', '3', '2', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'manTag#btn-delete', N'删除', '', '3', '3', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'manTag#btn-export', N'导出', '', '3', '4', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'tag#view', N'查询', '', '3', '0', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'tag#btn-add', N'新增', '', '3', '1', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'tag#btn-edit', N'编辑', '', '3', '2', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'tag#btn-delete', N'删除', '', '3', '3', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'tag#btn-export', N'导出', '', '3', '4', '1'); |
| | |
| | | package com.zy.asrs.wms.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.zy.asrs.common.wms.entity.ManMat; |
| | | import com.zy.asrs.common.wms.entity.Mat; |
| | | import com.zy.asrs.common.wms.service.ManMatService; |
| | | import com.zy.asrs.framework.annotations.ManagerAuth; |
| | | import com.zy.asrs.framework.common.Cools; |
| | |
| | | @RequestParam(defaultValue = "10") Integer limit, |
| | | @RequestParam(required = false) String condition, |
| | | @RequestParam(required = false) String timeRange) { |
| | | LambdaQueryWrapper<ManMat> wrapper = new LambdaQueryWrapper<>(); |
| | | LambdaQueryWrapper<Mat> wrapper = new LambdaQueryWrapper<>(); |
| | | if (!Cools.isEmpty(condition)) { |
| | | wrapper.like(ManMat::getId, condition); |
| | | wrapper.like(Mat::getId, condition); |
| | | } |
| | | if (!Cools.isEmpty(timeRange)) { |
| | | String[] range = timeRange.split(RANGE_TIME_LINK); |
| | | wrapper.ge(ManMat::getCreateTime, DateUtils.convert(range[0])); |
| | | wrapper.le(ManMat::getCreateTime, DateUtils.convert(range[1])); |
| | | wrapper.ge(Mat::getCreateTime, DateUtils.convert(range[0])); |
| | | wrapper.le(Mat::getCreateTime, DateUtils.convert(range[1])); |
| | | } |
| | | return R.ok(manMatService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | |
| | | |
| | | @RequestMapping(value = "/manMat/add/auth") |
| | | @ManagerAuth |
| | | public R add(ManMat manMat) { |
| | | manMatService.save(manMat); |
| | | public R add(Mat mat) { |
| | | manMatService.save(mat); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/manMat/update/auth") |
| | | @ManagerAuth |
| | | public R update(ManMat manMat){ |
| | | if (Cools.isEmpty(manMat) || null==manMat.getId()){ |
| | | public R update(Mat mat){ |
| | | if (Cools.isEmpty(mat) || null== mat.getId()){ |
| | | return R.error(); |
| | | } |
| | | manMatService.updateById(manMat); |
| | | manMatService.updateById(mat); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @RequestMapping(value = "/manMatQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | LambdaQueryWrapper<ManMat> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.like(ManMat::getId, condition); |
| | | Page<ManMat> page = manMatService.page(new Page<>(0, 10), wrapper); |
| | | LambdaQueryWrapper<Mat> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.like(Mat::getId, condition); |
| | | Page<Mat> page = manMatService.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (ManMat manMat : page.getRecords()){ |
| | | for (Mat mat : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", manMat.getId()); |
| | | map.put("value", manMat.getId()); |
| | | map.put("id", mat.getId()); |
| | | map.put("value", mat.getId()); |
| | | result.add(map); |
| | | } |
| | | return R.ok(result); |
| | |
| | | @ManagerAuth |
| | | public R getDataKV(@RequestParam(required = false) String condition) { |
| | | List<KeyValueVo> vos = new ArrayList<>(); |
| | | LambdaQueryWrapper<ManMat> wrapper = new LambdaQueryWrapper<>(); |
| | | LambdaQueryWrapper<Mat> wrapper = new LambdaQueryWrapper<>(); |
| | | if (!Cools.isEmpty(condition)) { |
| | | wrapper.like(ManMat::getId, condition); |
| | | wrapper.like(Mat::getId, condition); |
| | | } |
| | | manMatService.page(new Page<>(1, 30), wrapper).getRecords().forEach(item -> vos.add(new KeyValueVo(String.valueOf(item.getId()), item.getId()))); |
| | | return R.ok().add(vos); |
| | |
| | | import com.zy.asrs.common.domain.entity.MatExcel; |
| | | import com.zy.asrs.common.domain.entity.MatPrint; |
| | | import com.zy.asrs.common.utils.*; |
| | | import com.zy.asrs.common.wms.entity.ManMat; |
| | | import com.zy.asrs.common.wms.entity.ManTag; |
| | | import com.zy.asrs.common.wms.entity.Mat; |
| | | import com.zy.asrs.common.wms.entity.Tag; |
| | | import com.zy.asrs.common.wms.service.ManMatService; |
| | | import com.zy.asrs.common.wms.service.ManTagService; |
| | | import com.zy.asrs.framework.annotations.ManagerAuth; |
| | |
| | | @RequestParam(defaultValue = "10") Integer limit, |
| | | @RequestParam(required = false) String condition, |
| | | @RequestParam(required = false) String timeRange) { |
| | | LambdaQueryWrapper<ManTag> wrapper = new LambdaQueryWrapper<>(); |
| | | LambdaQueryWrapper<Tag> wrapper = new LambdaQueryWrapper<>(); |
| | | if (!Cools.isEmpty(condition)) { |
| | | wrapper.like(ManTag::getId, condition); |
| | | wrapper.like(Tag::getId, condition); |
| | | } |
| | | if (!Cools.isEmpty(timeRange)) { |
| | | String[] range = timeRange.split(RANGE_TIME_LINK); |
| | | wrapper.ge(ManTag::getCreateTime, DateUtils.convert(range[0])); |
| | | wrapper.le(ManTag::getCreateTime, DateUtils.convert(range[1])); |
| | | wrapper.ge(Tag::getCreateTime, DateUtils.convert(range[0])); |
| | | wrapper.le(Tag::getCreateTime, DateUtils.convert(range[1])); |
| | | } |
| | | return R.ok(manTagService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | |
| | | |
| | | @RequestMapping(value = "/manTag/add/auth") |
| | | @ManagerAuth |
| | | public R add(ManTag manTag) { |
| | | manTagService.save(manTag); |
| | | public R add(Tag tag) { |
| | | manTagService.save(tag); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/manTag/update/auth") |
| | | @ManagerAuth |
| | | public R update(ManTag manTag){ |
| | | if (Cools.isEmpty(manTag) || null==manTag.getId()){ |
| | | public R update(Tag tag){ |
| | | if (Cools.isEmpty(tag) || null== tag.getId()){ |
| | | return R.error(); |
| | | } |
| | | manTagService.updateById(manTag); |
| | | manTagService.updateById(tag); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @RequestMapping(value = "/manTagQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | LambdaQueryWrapper<ManTag> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.like(ManTag::getId, condition); |
| | | Page<ManTag> page = manTagService.page(new Page<>(0, 10), wrapper); |
| | | LambdaQueryWrapper<Tag> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.like(Tag::getId, condition); |
| | | Page<Tag> page = manTagService.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (ManTag manTag : page.getRecords()){ |
| | | for (Tag tag : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", manTag.getId()); |
| | | map.put("value", manTag.getId()); |
| | | map.put("id", tag.getId()); |
| | | map.put("value", tag.getId()); |
| | | result.add(map); |
| | | } |
| | | return R.ok(result); |
| | |
| | | @ManagerAuth |
| | | public R getDataKV(@RequestParam(required = false) String condition) { |
| | | List<KeyValueVo> vos = new ArrayList<>(); |
| | | LambdaQueryWrapper<ManTag> wrapper = new LambdaQueryWrapper<>(); |
| | | LambdaQueryWrapper<Tag> wrapper = new LambdaQueryWrapper<>(); |
| | | if (!Cools.isEmpty(condition)) { |
| | | wrapper.like(ManTag::getId, condition); |
| | | wrapper.like(Tag::getId, condition); |
| | | } |
| | | manTagService.page(new Page<>(1, 30), wrapper).getRecords().forEach(item -> vos.add(new KeyValueVo(String.valueOf(item.getId()), item.getId()))); |
| | | return R.ok().add(vos); |
| | |
| | | } |
| | | List<MatPrint> res = new ArrayList<>(); |
| | | for (String matnr : param){ |
| | | ManMat mat = manMatService.getOne(new LambdaQueryWrapper<ManMat>().eq(ManMat::getMatnr, matnr)); |
| | | Mat mat = manMatService.getOne(new LambdaQueryWrapper<Mat>().eq(Mat::getMatnr, matnr)); |
| | | // 打印数据注入 |
| | | MatPrint print = new MatPrint(); |
| | | print.setMatnr(mat.getMatnr()); |
| | |
| | | @RequestMapping("/mat/all/get/kv") |
| | | @ManagerAuth |
| | | public R getMatDataKV(@RequestParam(required = false) String condition) { |
| | | LambdaQueryWrapper<ManMat> wrapper = new LambdaQueryWrapper<ManMat>() |
| | | .like(ManMat::getMatnr, condition).or().like(ManMat::getMaktx, condition) |
| | | .orderByAsc(ManMat::getCreateTime); |
| | | List<ManMat> mats = manMatService.page(new Page<>(1, 30), wrapper).getRecords(); |
| | | LambdaQueryWrapper<Mat> wrapper = new LambdaQueryWrapper<Mat>() |
| | | .like(Mat::getMatnr, condition).or().like(Mat::getMaktx, condition) |
| | | .orderByAsc(Mat::getCreateTime); |
| | | List<Mat> mats = manMatService.page(new Page<>(1, 30), wrapper).getRecords(); |
| | | List<KeyValueVo> valueVos = new ArrayList<>(); |
| | | for (ManMat mat : mats) { |
| | | for (Mat mat : mats) { |
| | | KeyValueVo vo = new KeyValueVo(); |
| | | vo.setName(mat.getMatnr() + " - " + mat.getMaktx()); |
| | | vo.setValue(mat.getId()); |
| | |
| | | <script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/manMat/manMat.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/mat/mat.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/tagTree.js" charset="utf-8"></script> |
| | | |
| | | <!-- 表单弹窗 --> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <table class="layui-hide" id="manTag" lay-filter="manTag"></table> |
| | | <table class="layui-hide" id="tag" lay-filter="tag"></table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/manTag/manTag.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/tag/tag.js" charset="utf-8"></script> |
| | | </body> |
| | | <!-- 表单弹窗 --> |
| | | <script type="text/html" id="editDialog"> |