add:策略管理,单据管理
This commit is contained in:
@@ -0,0 +1,90 @@
|
||||
package org.nl.common.utils;
|
||||
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2022/11/29 2:55 下午
|
||||
* 三叉Map
|
||||
*/
|
||||
public class ForkMap<L,M,R> implements Serializable {
|
||||
|
||||
transient Map<Integer,Node> items=new HashMap<>();
|
||||
transient Set<L> keySet = new HashSet<>();
|
||||
|
||||
public <M> M getM(L key){
|
||||
Node<L,M,R> node = items.get(hash(key));
|
||||
if (node==null){
|
||||
return null;
|
||||
}
|
||||
return node.middle;
|
||||
}
|
||||
|
||||
public <L> L getNode(M desc){
|
||||
for (Node<L,M,R> value : items.values()) {
|
||||
if (value.middle.equals(desc)){
|
||||
return value.left;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public <R> R getR(L key){
|
||||
Node<L,M,R> node = items.get(hash(key));
|
||||
if (node==null){
|
||||
return null;
|
||||
}
|
||||
return node.right;
|
||||
}
|
||||
public Set<L> getKeySet(){
|
||||
return keySet;
|
||||
}
|
||||
|
||||
public static <L,M,R> ForkMap pushAll(ForkMap... maps){
|
||||
ForkMap<L,M,R> forkMap = new ForkMap();
|
||||
for (ForkMap<L,M,R> map : maps) {
|
||||
for (L key : map.getKeySet()) {
|
||||
L key1 = key;
|
||||
M m = map.getM(key1);
|
||||
R r = map.getR(key1);
|
||||
forkMap.put(key1, m, r);
|
||||
}
|
||||
}
|
||||
return forkMap;
|
||||
}
|
||||
|
||||
public static <V> ForkMap of(V...keys){
|
||||
ForkMap<V,V,V> map = new ForkMap<V,V,V>();
|
||||
for (int i = 0; i < keys.length/3; i++) {
|
||||
map.put(keys[i*3+1],keys[i*3],keys[i*3+2]);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
public ForkMap put(L key, M middle,R right) {
|
||||
Node node = new Node(key, middle, right);
|
||||
items.put(hash(key),node);
|
||||
keySet.add(key);
|
||||
return this;
|
||||
}
|
||||
|
||||
static class Node<L,M,R>{
|
||||
private L left;
|
||||
private M middle;
|
||||
private R right;
|
||||
Node(L left, M middle, R right) {
|
||||
this.left = left;
|
||||
this.middle = middle;
|
||||
this.right = right;
|
||||
}
|
||||
}
|
||||
static final int hash(Object key) {
|
||||
int h;
|
||||
return (key == null) ? 0 : (h = key.hashCode()) ^ (h >>> 16);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
package org.nl.wms.pm_manage.form_data.controller;
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson.parser.Feature;
|
||||
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.nl.common.base.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.pm_manage.form_data.service.IPmFormDataService;
|
||||
import org.nl.wms.pm_manage.form_data.service.dao.PmFormData;
|
||||
import org.nl.wms.pm_manage.form_data.service.dao.mapper.PmFormDataMapper;
|
||||
import org.nl.wms.pm_manage.form_data.service.dto.FormDataQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import org.nl.common.logging.annotation.Log;
|
||||
/**
|
||||
* <p>
|
||||
* 表单信息表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2024-03-25
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/pmFormData")
|
||||
@SaIgnore
|
||||
public class PmFormDataController {
|
||||
|
||||
@Autowired
|
||||
private IPmFormDataService iPmFormDataService;
|
||||
@Autowired
|
||||
private PmFormDataMapper pFormDataMapper;
|
||||
|
||||
|
||||
@GetMapping()
|
||||
@Log("查询数据")
|
||||
public ResponseEntity<Object> queryAll(FormDataQuery query, PageQuery page) {
|
||||
return new ResponseEntity<>(TableDataInfo.build(iPmFormDataService.queryTree(query, page)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PutMapping()
|
||||
@Log("修改单据结构")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ResponseEntity<Object> update(@RequestBody JSONObject param) {
|
||||
//逻辑判断:如果有数据了则不允许修改
|
||||
String s = param.toString(SerializerFeature.SortField);
|
||||
PmFormData pmFormData = JSONObject.parseObject(s, PmFormData.class, Feature.OrderedField);
|
||||
//生产入库单存在报工数超过合格数,需要人工修改正确报工数=合格数,进行手动回传
|
||||
String id = pmFormData.getId();
|
||||
PmFormData pmFormData1 = iPmFormDataService.getById(id);
|
||||
pmFormData1.setRemark(pmFormData.getRemark());
|
||||
pmFormData1.setUpdate_name(SecurityUtils.getCurrentUserId());
|
||||
pmFormData1.setUpdate_time(DateUtil.now());
|
||||
iPmFormDataService.updateById(pmFormData1);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@DeleteMapping
|
||||
@Transactional
|
||||
@Log("删除单据")
|
||||
public ResponseEntity<Object> delete(@RequestBody String[] ids) {
|
||||
if (ids.length > 0) {
|
||||
pFormDataMapper.delete(new LambdaUpdateWrapper<PmFormData>().in(PmFormData::getId, ids));
|
||||
pFormDataMapper.delete(new LambdaUpdateWrapper<PmFormData>().in(PmFormData::getParent_id, ids));
|
||||
}
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/getSonFormData/{id}")
|
||||
public ResponseEntity<Object> getSonDtlFormData(@PathVariable String id) {
|
||||
//参数判读,参数解析,调用参数入库
|
||||
//Page<BmFormStruc> page = iBmFormStrucService.page(pageQuery.build(), query.build());
|
||||
return new ResponseEntity<>(iPmFormDataService.getSonDtlFormData(id), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/confirmStatus")
|
||||
@SaIgnore
|
||||
@Log("单据完成")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ResponseEntity<Object> confirmStatus(@RequestBody JSONObject form) {
|
||||
JSONArray data = form.getJSONArray("data");
|
||||
String status = form.getString("status");
|
||||
if (!ObjectUtils.isEmpty(data)) {
|
||||
Set<String> ids = data.stream()
|
||||
.map(item -> (String) item)
|
||||
.collect(Collectors.toSet());
|
||||
iPmFormDataService.update(
|
||||
new LambdaUpdateWrapper<PmFormData>()
|
||||
.set(PmFormData::getStatus,status)
|
||||
.set(PmFormData::getUpdate_time,DateUtil.now())
|
||||
.set(PmFormData::getUpdate_name, "人工手动完成")
|
||||
.in(PmFormData::getId, ids));
|
||||
}
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/sync/{type}")
|
||||
@Log("单据同步")
|
||||
public ResponseEntity<Object> sync(@RequestParam String type, String formDtl) {
|
||||
//参数判读,参数解析,调用参数入库
|
||||
iPmFormDataService.syncFormData("type", formDtl);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
package org.nl.wms.pm_manage.form_data.service;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.pm_manage.form_data.service.dao.PmFormData;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.wms.pm_manage.form_data.service.dto.FormDataQuery;
|
||||
import org.nl.wms.pm_manage.form_data.service.dto.PmFormDataDto;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 表单信息表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2024-03-25
|
||||
*/
|
||||
public interface IPmFormDataService extends IService<PmFormData> {
|
||||
|
||||
Integer syncFormData(String type,String dataString);
|
||||
|
||||
|
||||
|
||||
List<PmFormData> getByType(String from_type);
|
||||
|
||||
Object queryAll(FormDataQuery query, PageQuery page);
|
||||
|
||||
Page<PmFormDataDto> queryTree(FormDataQuery query, PageQuery page);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
Object getSonDtlFormData(String id);
|
||||
|
||||
void dynamicSql(String sql);
|
||||
|
||||
List<PmFormData> getByParentId(String...parent_id);
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package org.nl.wms.pm_manage.form_data.service.dao;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class FormDataIdCode {
|
||||
private String id;
|
||||
private String code;
|
||||
}
|
||||
@@ -0,0 +1,371 @@
|
||||
package org.nl.wms.pm_manage.form_data.service.dao;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nl.common.domain.handler.FastjsonSortTypeHandler;
|
||||
import org.nl.wms.sch_manage.enums.StatusEnum;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 表单信息表
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2024-03-25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName(value = "pm_form_data", autoResultMap = true)
|
||||
public class PmFormData implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 业务单据单据id
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
* 单据编码
|
||||
*/
|
||||
private String code;
|
||||
/**
|
||||
* 对应流程实例id
|
||||
*/
|
||||
private String proc_inst_id;
|
||||
|
||||
/**
|
||||
* 业务单据编号
|
||||
*/
|
||||
private String source_form_id;
|
||||
|
||||
/**
|
||||
* 业务单据编号
|
||||
*/
|
||||
private String source_form_type;
|
||||
|
||||
/**
|
||||
* 业务单据日期
|
||||
*/
|
||||
private String source_form_date;
|
||||
|
||||
/**
|
||||
* 单据类型
|
||||
*/
|
||||
private String form_type;
|
||||
|
||||
/**
|
||||
* 业务单据状态
|
||||
*/
|
||||
private String status = StatusEnum.FORM_STATUS.code("生成");
|
||||
|
||||
|
||||
/**
|
||||
* 物料id
|
||||
*/
|
||||
private String material_id;
|
||||
|
||||
/**
|
||||
* 对应明细:生产入库单-入库数量FRealQty/采购入库单-采购数量FRealQty
|
||||
*/
|
||||
private BigDecimal qty;
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private BigDecimal plan_qty;
|
||||
/**
|
||||
* 已分配数量
|
||||
*/
|
||||
private BigDecimal assign_qty;
|
||||
|
||||
/**
|
||||
* 实际数量
|
||||
*/
|
||||
private BigDecimal actual_qty;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit_id;
|
||||
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
private String pcsn;
|
||||
/**
|
||||
* 载具
|
||||
*/
|
||||
private String vehicle_code;
|
||||
/**
|
||||
* 载具组盘id
|
||||
*/
|
||||
private String vehicle_id;
|
||||
|
||||
/**
|
||||
* 自定义表单字段
|
||||
*/
|
||||
@TableField(typeHandler = FastjsonSortTypeHandler.class)
|
||||
private JSONObject form_data = new JSONObject();;
|
||||
|
||||
/**
|
||||
* 关联上级表单id
|
||||
*/
|
||||
private String parent_id;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 创建id
|
||||
*/
|
||||
private String create_time;
|
||||
|
||||
/**
|
||||
* 创建id
|
||||
*/
|
||||
private String create_name;
|
||||
|
||||
/**
|
||||
* 创建id
|
||||
*/
|
||||
private String update_time;
|
||||
|
||||
/**
|
||||
* 创建id
|
||||
*/
|
||||
private String update_name;
|
||||
|
||||
/**
|
||||
* 备注说明
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 条码
|
||||
*/
|
||||
private String bar_code;
|
||||
|
||||
|
||||
/**
|
||||
* 对应表头:生产入库单-生产组织prdOrgId/采购入库单-采购组织FPurchaseOrgId
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String prdOrgId;
|
||||
|
||||
|
||||
/**
|
||||
* 对应表头:生产入库单-入库组织FStockOrgId/采购入库单-收料组织FStockOrgId
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String stockOrgId;
|
||||
|
||||
/**
|
||||
* 拣选出库的载具
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String outVehicleCode;
|
||||
|
||||
|
||||
/**
|
||||
* 货主类型1
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String ownerTypeIdHead;
|
||||
|
||||
/**
|
||||
* 对应表头:生产入库单-货主FOwnerId0
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String ownerIdHead_Id;
|
||||
|
||||
/**
|
||||
* 物料名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String material_name;
|
||||
|
||||
|
||||
/**
|
||||
* 单重
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String single_weight;
|
||||
|
||||
|
||||
/**
|
||||
* 物料规格
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String material_spec;
|
||||
|
||||
/**
|
||||
* 对应明细:生产入库单-关联物料编码FMaterialId/采购入库单-关联物料编码FMaterialId
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String material_code;
|
||||
|
||||
|
||||
/**
|
||||
* 对应明细:生产入库单,采购入库单-单位FUnitCode
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String unit_code;
|
||||
|
||||
|
||||
/**
|
||||
* 生产订单行号
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String moEntrySeq;
|
||||
|
||||
/**
|
||||
* 单据编号
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String billNo;
|
||||
|
||||
|
||||
/**
|
||||
* 单位名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String unit_name;
|
||||
|
||||
|
||||
/**
|
||||
* 对应明细:生产入库单-货主类型FOwnerTypeId,默认(BD_OwnerOrg)
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String ownerTypeId;
|
||||
|
||||
/**
|
||||
* 对应明细:生产入库单-货主FOwnerId
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String ownerId_Id;
|
||||
|
||||
/**
|
||||
* 供应商
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String supplierId;
|
||||
|
||||
/**
|
||||
* 计价单位
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String remainInStockUnitId;
|
||||
|
||||
|
||||
/**
|
||||
* 对应明细:生产入库单-关联订单号FMoBillNo/采购入库单-关联订单号FPoOrderNo
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String moNumber;
|
||||
|
||||
/**
|
||||
* 对应明细:生产入库单-关联订单号Id-FMoId
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String moId;
|
||||
|
||||
|
||||
/**
|
||||
* 对应明细:生产入库单-关联订单号明细Id-FMoEntryId/采购入库单-关联订单号明细FPoOrderEntryId
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String moEntryId;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 对应明细:生产入库单-关联源头订单号明细Id-FSrcEntryId/采购入库单-关联源头订单号编号FSrcBillNo
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String srcBillNo;
|
||||
|
||||
/**
|
||||
* 对应明细:生产入库单-生产车间FWorkShopId1
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String workShopId1;
|
||||
|
||||
|
||||
/**
|
||||
* 对应明细:生产入库单-应收数量FMustQty
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private BigDecimal mustQty;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 对应明细:生产入库单-入库类型FInStockType,默认: 1
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String inStockType;
|
||||
|
||||
/**
|
||||
* 对应明细:生产入库单-库存状态FStockStatusId,默认: 10000
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String stockStatusId;
|
||||
|
||||
|
||||
/**
|
||||
* 对应明细:生产入库单-ERP仓库FStockId
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String stockId;
|
||||
|
||||
|
||||
/**
|
||||
* 对应明细:生产入库单-保管者类型FKeeperTypeId,默认(BD_KeeperOrg)
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String keeperTypeId;
|
||||
|
||||
|
||||
/**
|
||||
* 对应明细:生产入库单-保管者FKeeperId
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String keeperId;
|
||||
|
||||
|
||||
/**
|
||||
* 对应表头:采购入库单-业务类型FBusinessType:默认(CG)
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String businessType;
|
||||
|
||||
|
||||
/**
|
||||
* 对应明细:采购入库单-采购员FPurchaserId
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String purchaserId;
|
||||
|
||||
|
||||
/**
|
||||
* 对应明细:生产入库单-含税价FTaxPrice
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String taxPrice;
|
||||
|
||||
|
||||
/**
|
||||
* 自定义表单字段
|
||||
*/
|
||||
@TableField(typeHandler = FastjsonSortTypeHandler.class)
|
||||
private JSONObject erp_data = new JSONObject();
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package org.nl.wms.pm_manage.form_data.service.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
import org.nl.wms.pm_manage.form_data.service.dao.PmFormData;
|
||||
import org.nl.wms.pm_manage.form_data.service.dto.FormDataQuery;
|
||||
import org.nl.wms.pm_manage.form_data.service.dto.PmFormDataDto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 表单信息表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2024-03-25
|
||||
*/
|
||||
public interface PmFormDataMapper extends BaseMapper<PmFormData> {
|
||||
|
||||
List<PmFormData> query(@Param("query") FormDataQuery query);
|
||||
|
||||
List<PmFormDataDto> queryTree(@Param("query") FormDataQuery query);
|
||||
|
||||
List<PmFormDataDto> queryTree2(@Param("query") FormDataQuery query);
|
||||
|
||||
List<PmFormDataDto> queryCtuOrderList(@Param("query") FormDataQuery query);
|
||||
|
||||
|
||||
List<PmFormDataDto> selectChilds(List<String> parents);
|
||||
|
||||
@Update("${sql}")
|
||||
void dynamicSql(@Param("sql") String sql);
|
||||
|
||||
|
||||
Set<String> existFormDataList(@Param("form_type") String form_type);
|
||||
|
||||
Set<String> existFormCodeDataList();
|
||||
|
||||
BigDecimal queryTreeCounts(@Param("query") FormDataQuery query);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?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.pm_manage.form_data.service.dao.PmFormDataDao">
|
||||
<resultMap id="BaseResultMap" type="org.nl.wms.pm_manage.form_data.service.dao.PmFormData">
|
||||
<!--
|
||||
WARNING - This element is automatically generated by MyBatis Generator !
|
||||
Do not modify this file directly, any changes will be overwritten.
|
||||
-->
|
||||
<id column="id" property="id" jdbcType="BIGINT"/>
|
||||
<result property="form_id" column="form_id" jdbcType="BIGINT"/>
|
||||
<result property="form_type" column="form_type" jdbcType="VARCHAR"/>
|
||||
<result property="status" column="status" jdbcType="VARCHAR"/>
|
||||
<result property="create_name" column="create_name" jdbcType="VARCHAR"/>
|
||||
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="material_id" column="material_id" jdbcType="BIGINT"/>
|
||||
<result property="qty" column="qty" jdbcType="DECIMAL"/>
|
||||
<result property="pcsn" column="pcsn" jdbcType="VARCHAR"/>
|
||||
<result property="vehicle_code" column="vehicle_code" jdbcType="VARCHAR"/>
|
||||
<result property="parent_id" column="parent_id" jdbcType="BIGINT"/>
|
||||
<result property="form_data" column="form_data" typeHandler="org.nl.common.domain.handler.FastjsonSortTypeHandler"/>
|
||||
<result property="unit_id" column="unit_id" jdbcType="BIGINT"/>
|
||||
</resultMap>
|
||||
<resultMap id="ResultMapWithBLOBs" type="org.nl.wms.pm_manage.form_data.service.dao.PmFormData" extends="BaseResultMap">
|
||||
<!--
|
||||
WARNING - This element is automatically generated by MyBatis Generator !
|
||||
Do not modify this file directly, any changes will be overwritten.
|
||||
-->
|
||||
<result property="form_data" column="form_data" typeHandler="org.nl.common.domain.handler.FastjsonSortTypeHandler"/>
|
||||
</resultMap>
|
||||
</mapper>
|
||||
@@ -0,0 +1,34 @@
|
||||
package org.nl.wms.pm_manage.form_data.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import org.nl.common.domain.query.BaseQuery;
|
||||
import org.nl.common.domain.query.QParam;
|
||||
import org.nl.common.enums.QueryTEnum;
|
||||
import org.nl.wms.pm_manage.form_data.service.dao.PmFormData;
|
||||
import java.util.Map;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2024/5/11 17:46
|
||||
*/
|
||||
@Data
|
||||
public class FormDataQuery extends BaseQuery<PmFormData> {
|
||||
private String form_type;
|
||||
private String code;
|
||||
private String bill_code;
|
||||
private String site_code;
|
||||
private String search;
|
||||
private String pcsn;
|
||||
private String parent_id;
|
||||
private String mater;
|
||||
private String[] status;
|
||||
private String start_time;
|
||||
private String end_time;
|
||||
|
||||
private Map<String,String> form_query;
|
||||
|
||||
@Override
|
||||
public void paramMapping() {
|
||||
super.doP.put("search", QParam.builder().k(new String[]{"code"}).type(QueryTEnum.EQ).build());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,201 @@
|
||||
package org.nl.wms.pm_manage.form_data.service.dto;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Data;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 表单信息表
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2024-03-25
|
||||
*/
|
||||
@Data
|
||||
public class PmFormDataDto implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 业务单据单据id
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
* 单据编码
|
||||
*/
|
||||
private String code;
|
||||
/**
|
||||
* 对应流程实例id
|
||||
*/
|
||||
private String proc_inst_id;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 业务单据编号
|
||||
*/
|
||||
private String source_form_id;
|
||||
/**
|
||||
* 业务单据编号
|
||||
*/
|
||||
private String source_form_type;
|
||||
|
||||
/**
|
||||
* 业务单据日期
|
||||
*/
|
||||
private String source_form_date;
|
||||
|
||||
/**
|
||||
* 单据类型
|
||||
*/
|
||||
private String form_type;
|
||||
|
||||
/**
|
||||
* 业务单据状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 业务单据状态
|
||||
*/
|
||||
private String bill_status;
|
||||
|
||||
/**
|
||||
* 物料状态
|
||||
*/
|
||||
private String material_status;
|
||||
/**
|
||||
* 业务单据状态
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 创建id
|
||||
*/
|
||||
private String create_time;
|
||||
|
||||
/**
|
||||
* 创建id
|
||||
*/
|
||||
private String create_name;
|
||||
|
||||
/**
|
||||
* 物料id
|
||||
*/
|
||||
private String material_id;
|
||||
/**
|
||||
* 物料name
|
||||
*/
|
||||
private String material_name;
|
||||
/**
|
||||
* 物料code
|
||||
*/
|
||||
private String material_code;
|
||||
/**
|
||||
* 物料spec
|
||||
*/
|
||||
private String material_spec;
|
||||
/**
|
||||
* 物料单重
|
||||
*/
|
||||
private String single_weight;
|
||||
/**
|
||||
* 单据编号
|
||||
*/
|
||||
private String billNo;
|
||||
/**
|
||||
* 源单编号
|
||||
*/
|
||||
private String srcBillNo;
|
||||
|
||||
/**
|
||||
* 条码
|
||||
*/
|
||||
private String bar_code;
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private BigDecimal qty;
|
||||
/**
|
||||
* 冻结数量
|
||||
*/
|
||||
private BigDecimal frozen_qty;
|
||||
|
||||
/**
|
||||
* 库存数量
|
||||
*/
|
||||
private BigDecimal sto_qty;
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private BigDecimal plan_qty;
|
||||
/**
|
||||
* 已分配数量
|
||||
*/
|
||||
private BigDecimal assign_qty;
|
||||
/**
|
||||
* 实际数量
|
||||
*/
|
||||
private BigDecimal actual_qty;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit_id;
|
||||
/**
|
||||
* 单位名称
|
||||
*/
|
||||
private String unit_name;
|
||||
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
private String pcsn;
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
private String product_area;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private String is_delete;
|
||||
/**
|
||||
* 载具
|
||||
*/
|
||||
private String vehicle_code;
|
||||
/**
|
||||
* 载具组盘id
|
||||
*/
|
||||
private String vehicle_id;
|
||||
/**
|
||||
* 出库单据号
|
||||
*/
|
||||
private String prd_ppbom_no;
|
||||
|
||||
/**
|
||||
* 自定义表单字段
|
||||
*/
|
||||
private JSONObject form_data;
|
||||
|
||||
|
||||
/**
|
||||
* 关联上级表单id
|
||||
*/
|
||||
private String parent_id;
|
||||
|
||||
private Boolean HasChildren=Boolean.FALSE;
|
||||
|
||||
private List<PmFormDataDto> children;
|
||||
|
||||
public void setChildren(List<PmFormDataDto> children) {
|
||||
if (!CollectionUtils.isEmpty(children)){
|
||||
this.HasChildren=Boolean.TRUE;
|
||||
}
|
||||
this.children = children;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,195 @@
|
||||
package org.nl.wms.pm_manage.form_data.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
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 lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.base.TableDataInfo;
|
||||
import org.nl.common.domain.constant.DictConstantPool;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.CopyUtil;
|
||||
import org.nl.wms.basedata_manage.service.IMdMeMaterialbaseService;
|
||||
import org.nl.wms.basedata_manage.service.IStructattrService;
|
||||
import org.nl.wms.pm_manage.form_data.service.IPmFormDataService;
|
||||
import org.nl.wms.pm_manage.form_data.service.dao.PmFormData;
|
||||
import org.nl.wms.pm_manage.form_data.service.dao.mapper.PmFormDataMapper;
|
||||
import org.nl.wms.pm_manage.form_data.service.dto.FormDataQuery;
|
||||
import org.nl.wms.pm_manage.form_data.service.dto.PmFormDataDto;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 表单信息表 服务实现类
|
||||
* 表单结构
|
||||
* ---------------BmFormStruc---------------
|
||||
* /\
|
||||
* / \
|
||||
* / \
|
||||
* 表单数据 / \表单同步配置表
|
||||
* PmFormData BmFormSync
|
||||
* 表单回显时:自定义字段通过表单结构获取lebel
|
||||
* 表单同步设置时:通过表单结构获取所有字段,进行配置字段映射,或者class处理
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2024-03-25
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class PmFormDataServiceImpl extends ServiceImpl<PmFormDataMapper, PmFormData> implements IPmFormDataService {
|
||||
|
||||
@Autowired
|
||||
private IMdMeMaterialbaseService iMdMeMaterialbaseService;
|
||||
|
||||
|
||||
@Lazy
|
||||
@Autowired
|
||||
IPmFormDataService iPmFormDataService;
|
||||
|
||||
@Autowired
|
||||
private IStructattrService iStIvtStructattrService;
|
||||
|
||||
|
||||
@Override
|
||||
public Integer syncFormData(String form_type, String dataString) {
|
||||
if (StringUtils.isEmpty(form_type) || StringUtils.isEmpty(dataString)) {
|
||||
throw new BadRequestException("请求参数不能为空");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Object queryAll(FormDataQuery query, PageQuery pageQuery) {
|
||||
Page page = PageHelper.startPage(pageQuery.getPage() + 1, pageQuery.getSize());
|
||||
page.setOrderBy("id DESC");
|
||||
this.baseMapper.query(query);
|
||||
List<PmFormData> content = page.getResult();
|
||||
List<String> ids = content.stream().map(PmFormData::getId).collect(Collectors.toList());
|
||||
Map<String, List<PmFormData>> childMap = new HashMap<>();
|
||||
if (!CollectionUtils.isEmpty(ids)) {
|
||||
List<PmFormData> childs = this.list(new QueryWrapper<PmFormData>().in("parent_id", ids));
|
||||
childMap = childs.stream().collect(Collectors.groupingBy(PmFormData::getParent_id));
|
||||
}
|
||||
List<PmFormDataDto> list = new ArrayList<>();
|
||||
for (PmFormData record : content) {
|
||||
PmFormDataDto strucDto = new PmFormDataDto();
|
||||
BeanUtils.copyProperties(record, strucDto);
|
||||
list.add(strucDto);
|
||||
List<PmFormData> dtl = childMap.get(record.getId());
|
||||
if (!CollectionUtils.isEmpty(dtl)) {
|
||||
strucDto.setHasChildren(true);
|
||||
strucDto.setChildren(CopyUtil.copyList(dtl, PmFormDataDto.class));
|
||||
}
|
||||
}
|
||||
TableDataInfo build = TableDataInfo.build(page);
|
||||
build.setContent(list);
|
||||
return build;
|
||||
}
|
||||
|
||||
@Override
|
||||
public com.baomidou.mybatisplus.extension.plugins.pagination.Page<PmFormDataDto> queryTree(FormDataQuery query, PageQuery pageQuery) {
|
||||
Page page = PageHelper.startPage(pageQuery.getPage() + 1, pageQuery.getSize());
|
||||
page.setOrderBy("id DESC");
|
||||
if (ObjectUtil.isNotEmpty(query.getMater()) || ObjectUtil.isNotEmpty(query.getPcsn()) || ObjectUtil.isNotEmpty(query.getBill_code())) {
|
||||
if (ObjectUtil.isNotEmpty(query.getPcsn())) {
|
||||
query.setPcsn(query.getPcsn().trim());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(query.getMater())) {
|
||||
query.setMater(query.getMater().trim());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(query.getBill_code())) {
|
||||
query.setBill_code(query.getBill_code().trim());
|
||||
}
|
||||
}
|
||||
List<PmFormDataDto> pmFormDataList = this.baseMapper.queryTree2(query);
|
||||
if (ObjectUtil.isNotEmpty(pmFormDataList)) {
|
||||
handleFormDataList(pmFormDataList, query);
|
||||
}
|
||||
com.baomidou.mybatisplus.extension.plugins.pagination.Page<PmFormDataDto> dtoPage = new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(page.getPages(), page.getPageSize(), page.getTotal());
|
||||
dtoPage.setRecords(pmFormDataList);
|
||||
return dtoPage;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void handleFormDataList(List<PmFormDataDto> pmFormDataDtos, FormDataQuery query) {
|
||||
List<String> parents = pmFormDataDtos.stream().map(PmFormDataDto::getId).collect(Collectors.toList());
|
||||
List<PmFormDataDto> childs = this.baseMapper.selectChilds(parents);
|
||||
if (!CollectionUtils.isEmpty(childs)) {
|
||||
Map<String, List<PmFormDataDto>> childMap = childs.stream().collect(Collectors.groupingBy(PmFormDataDto::getParent_id));
|
||||
for (PmFormDataDto dataDto : pmFormDataDtos) {
|
||||
String productArea = dataDto.getForm_data().getString("product_area");
|
||||
dataDto.setProduct_area(productArea);
|
||||
List<PmFormDataDto> children = childMap.get(dataDto.getId());
|
||||
if (children != null) {
|
||||
for (PmFormDataDto child : children) {
|
||||
String childProductArea = child.getForm_data().getString("product_area");
|
||||
child.setProduct_area(childProductArea);
|
||||
if (child.getPlan_qty() != null && child.getAssign_qty().compareTo(BigDecimal.ZERO) == 0) {
|
||||
BigDecimal total = child.getPlan_qty().subtract(child.getAssign_qty().add(child.getActual_qty() == null ? BigDecimal.ZERO : child.getActual_qty()));
|
||||
child.setQty(total.compareTo(BigDecimal.ZERO) > 0 ? total : BigDecimal.ZERO);
|
||||
}
|
||||
}
|
||||
}
|
||||
dataDto.setChildren(children);
|
||||
}
|
||||
} else {
|
||||
if (ObjectUtil.isNotEmpty(query.getMater()) || ObjectUtil.isNotEmpty(query.getPcsn()) || ObjectUtil.isNotEmpty(query.getBill_code()) || ObjectUtil.isNotEmpty(query.getStatus())) {
|
||||
BigDecimal counts = this.baseMapper.queryTreeCounts(query);
|
||||
for (PmFormDataDto r : pmFormDataDtos) {
|
||||
r.setSto_qty(counts);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getSonDtlFormData(String id) {
|
||||
if (StringUtils.isEmpty(id)) {
|
||||
throw new BadRequestException("请求参数不能为空");
|
||||
}
|
||||
FormDataQuery query = new FormDataQuery();
|
||||
query.setParent_id(id);
|
||||
return this.baseMapper.queryTree(query);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public List<PmFormData> getByType(String from_type) {
|
||||
Assert.notNull(from_type, "表单类型参数不能为空");
|
||||
return this.list(new QueryWrapper<PmFormData>().eq("form_type", from_type));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dynamicSql(String sql) {
|
||||
if (StringUtils.isNotEmpty(sql)) {
|
||||
this.baseMapper.dynamicSql(sql);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PmFormData> getByParentId(String[] parent_id) {
|
||||
Assert.notNull(parent_id, "请求参数不能为空");
|
||||
QueryWrapper<PmFormData> query = new QueryWrapper<PmFormData>().in("parent_id", parent_id);
|
||||
return this.list(query);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,130 @@
|
||||
package org.nl.wms.sch_manage.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.ForkMap;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2024/4/23 10:49
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum StatusEnum {
|
||||
//单据状态库类型
|
||||
/**
|
||||
* 流程相关
|
||||
*/
|
||||
MODEL_STATUS(ForkMap.of("发布", "10", null, "未发布", "30", null)),
|
||||
FLOW_STATUS(ForkMap.of("启动", "10", null, "节点完成", "20", null, "暂停", "30", null, "完成", "80", null, "异常完成", "82", null)),
|
||||
/**
|
||||
* 单据状态
|
||||
*/
|
||||
FORM_STATUS(ForkMap.of("生成", "10", null, "已分配", "13", null, "下发", "15", null, "执行中", "20", null, "暂停", "30", null, "完成", "80", null, "强制完成", "82", null, "取消", "90", null)),
|
||||
|
||||
/**
|
||||
* 出入库单据类型退货出库
|
||||
*/
|
||||
IOBILL_TYPE_IN(ForkMap.of("生产入库", "10", "inStorageTask", "调拨入库", "11", "inStorageTask", "退货入库", "12", "inStorageTask", "拣选回库",
|
||||
"13", "inStorageTask", "盘点入库", "14", "inStorageTask", "托盘入库", "30", "inStorageTask", "二楼CTU入库", "80", "inStorageTask")),
|
||||
IOBILL_TYPE_OUT(ForkMap.of("销售出库", "20", "outStorageTask", "生产出库", "21", "outStorageTask", "调拨出库", "22", "outStorageTask",
|
||||
"拣选出库", "23", "conveyorOutStorageTask", "盘点出库", "24", "outStorageTask", "出库拣选", "25", "toPickPlatformTask",
|
||||
"退货出库", "26", "outStorageTask", "托盘出库", "40", "outStorageTask", "二楼CTU出库", "81", "inStorageTask", "二楼出库AGV搬运",
|
||||
"82", "inStorageTask", "二楼空架AGV搬运", "83", "inStorageTask")),
|
||||
|
||||
|
||||
IOBILL_TYPE_MOVE(ForkMap.of("移库", "50", "moveStorageTask", "异常位移库", "51", "moveStorageTask")),
|
||||
EXT_TASK_TYPE(ForkMap.of("盘点", "60", "moveStorageTask")),
|
||||
OTHER_TASK_TYPE(ForkMap.of("转运", "70", "tranforTask")),
|
||||
profit_loss(ForkMap.of("盘亏", "0", null, "盘盈", "1", null, "实盘", "2", null)),
|
||||
|
||||
/**
|
||||
* ERP回传单据类型
|
||||
*/
|
||||
ERP_TYPE(ForkMap.of("PRD_MO", "10", "生产订单", "PUR_ReceiveBill", "11", "收料通知单",
|
||||
"SAL_SaleOrder", "12", "销售订单", "PRD_INSTOCK", "13", "生产入库单", "STK_InStock", "14", "采购入库单",
|
||||
"SAL_RETURNSTOCK", "15", "销售退货入库单", "PUR_MRB", "18", "采购退料出库单",
|
||||
"SUB_PickMtrl", "19", "委外用料清单", "PRD_PPBOM", "20", "生产用料清单", "PRD_PickMtrl", "21", "生产领料单",
|
||||
"SP_PickMtrl", "22", "简单生产领料单", "STK_TransferDirect", "23", "调拨出库单", "STK_MisDelivery", "26", "其他出库单", "PRD_ReturnMtrl", "27", "生产退料单", "PRD_FeedMtrl", "28", "生产补料单", "SUB_RETURNMTRL", "29", "委外退料单")),
|
||||
|
||||
/**
|
||||
* 任务优先级
|
||||
*/
|
||||
PRIORITY_TYPE(ForkMap.of(
|
||||
"最低", "1", null, "普通", "5", null, "较高", "6", null, "加急", "7", null, "移库", "8", null
|
||||
)),
|
||||
|
||||
/**
|
||||
* 任务类型
|
||||
*/
|
||||
TASK_TYPE(ForkMap.pushAll(IOBILL_TYPE_IN.code, IOBILL_TYPE_OUT.code, IOBILL_TYPE_MOVE.code, EXT_TASK_TYPE.code, OTHER_TASK_TYPE.code)),
|
||||
|
||||
ACS_TYPE(ForkMap.of(
|
||||
"立库", "1", null, "AGV任务", "2", null, "CTU任务", "3", null,"三楼CTU", "4", null
|
||||
)),
|
||||
ACS_SYSTEM_TYPE(ForkMap.of(
|
||||
"NDC", "1", null, "仙工", "2", null,"海柔CTU", "5", null, "海康CTU", "6", null
|
||||
)),
|
||||
|
||||
/**
|
||||
* 点位锁类型
|
||||
*/
|
||||
LOCK(ForkMap.of("无锁", "00", null, "入库锁", "10", null, "入库盘点锁", "16", null, "出库锁", "20", null, "盘点出库锁", "26", null, "移库锁", "50", null, "异常锁定", "60", null, "空出锁", "70", null)),
|
||||
STRATEGY_TYPE(ForkMap.of("入库", "1", null, "出库", "2", null, "出入库", "3", null)),
|
||||
|
||||
|
||||
PRODUCT_AREA(ForkMap.of("一层车间", "A1", null, "二层车间", "A2", null, "三层车间", "A3", null)),
|
||||
|
||||
|
||||
REGION_INFO(ForkMap.of("主存区拣选平台", "PICK01", null, "一楼出入库输送线", "IOConveyor", null, "二楼出入库输送线", "IOConveyor2", null, "拣选台秤重区", "WEIGH01", null,
|
||||
"二楼CTU货架对接位", "CTU_POSITION", null, "二楼AGV产线对接位", "AGV_POSITION", null,"二楼空货架缓存区", "SHELF_POSITION", null)),
|
||||
|
||||
|
||||
STOCK_INFO(ForkMap.of("托盘库", "FStockPallet", null, "料箱库", "FStockId", null, "虚拟库", "FicStockId", null, "二楼ctu缓存库", "CStockId", null,
|
||||
"二楼货架缓存库", "HStockId", null)),
|
||||
|
||||
|
||||
SORT_TYPE(ForkMap.of(
|
||||
"升序", "1", null, "降序", "2", null
|
||||
)),
|
||||
POINT_TYPE(ForkMap.of(
|
||||
"空货架", "0", null, "满货架", "1", null
|
||||
)),
|
||||
BIND_TYPE(ForkMap.of(
|
||||
"解绑", "0", null, "绑定", "1", null, "不操作", "3", null
|
||||
));
|
||||
/**
|
||||
* L:label
|
||||
* M:编码
|
||||
* R:指定服务类
|
||||
*/
|
||||
private ForkMap<String, String, String> code;
|
||||
|
||||
public String code(String desc) {
|
||||
String code = this.getCode().getNode(desc);
|
||||
if (StringUtils.isNotEmpty(code)) {
|
||||
return code;
|
||||
}
|
||||
throw new BadRequestException(this.name() + "对应类型" + desc + "未定义");
|
||||
}
|
||||
|
||||
public String getR(String code) {
|
||||
for (String key : this.getCode().getKeySet()) {
|
||||
if (key.equals(code)){
|
||||
String r = this.getCode().getR(key);
|
||||
if (StringUtils.isEmpty(r)) {
|
||||
throw new BadRequestException(this.name() + "对应编码" + code + "未定义R的数据");
|
||||
}
|
||||
return r;
|
||||
}
|
||||
}
|
||||
throw new BadRequestException(this.name() + "对应编码" + code + "未定义x的数据");
|
||||
}
|
||||
|
||||
public Boolean check(String code) {
|
||||
ForkMap<String, String, String> map = this.getCode();
|
||||
return map.getKeySet().contains(code);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user