parent
79a4be237e
commit
40e232d48f
@ -0,0 +1,5 @@
|
|||||||
|
package com.dsic.gj_erp.pc.dto.tlt;
|
||||||
|
|
||||||
|
public enum ZlType {
|
||||||
|
小组,大组,焊接机器人肘板
|
||||||
|
}
|
@ -0,0 +1,51 @@
|
|||||||
|
package com.dsic.gj_erp.pc.service;
|
||||||
|
|
||||||
|
import com.dsic.gj_erp.pc.工序CD;
|
||||||
|
import com.dsic.gj_erp.pc.订货计划;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.cache.annotation.CacheEvict;
|
||||||
|
import org.springframework.cache.annotation.CachePut;
|
||||||
|
import org.springframework.cache.annotation.Cacheable;
|
||||||
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class 订货计划滚动信息接口 {
|
||||||
|
|
||||||
|
private static final String KEY="dhjh";
|
||||||
|
private final RedisTemplate<String,Object> redisTemplate;
|
||||||
|
|
||||||
|
@CachePut(cacheNames = {KEY},key = "#plan.getKey()")
|
||||||
|
public Object save(订货计划 plan){
|
||||||
|
return plan;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Cacheable(value = {KEY},key = "#id")
|
||||||
|
public Object get(String id){
|
||||||
|
return new HashMap<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
@CacheEvict(value = {KEY}, key="#id")
|
||||||
|
public Object remove(String id){
|
||||||
|
return new HashMap<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<订货计划> get(){
|
||||||
|
Set<String> keys = redisTemplate.keys(KEY+"::*");
|
||||||
|
List<订货计划> list=new ArrayList<>();
|
||||||
|
if (keys==null){
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
for (String key:keys){
|
||||||
|
订货计划 _订货计划= (订货计划) redisTemplate.opsForValue().get(key);
|
||||||
|
list.add(_订货计划);
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,49 @@
|
|||||||
|
package com.dsic.gj_erp.pc;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@Slf4j
|
||||||
|
public class 订货计划 {
|
||||||
|
private String month;
|
||||||
|
private String index;
|
||||||
|
private String dcch;
|
||||||
|
private String pls;//批量范围
|
||||||
|
private List<String> plList;
|
||||||
|
private String tonnage;
|
||||||
|
private String sumWeight;
|
||||||
|
private String allArriveData;//到齐日期
|
||||||
|
|
||||||
|
public String getKey(){
|
||||||
|
return this.month+this.dcch+pls;
|
||||||
|
}
|
||||||
|
public synchronized List<String> getPlList(){
|
||||||
|
if (this.plList!=null){
|
||||||
|
return this.plList;
|
||||||
|
}
|
||||||
|
List<String> split = StrUtil.split(pls, "-");
|
||||||
|
String logMsg=StrUtil.format("订货计划--船号:{},批量范围格式错误:{}",dcch,pls);
|
||||||
|
if (split.size()!=2){
|
||||||
|
log.error(logMsg);
|
||||||
|
throw new RuntimeException(logMsg);
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
int start=Integer.parseInt(split.get(0));
|
||||||
|
int end=Integer.parseInt(split.get(1));
|
||||||
|
for (int i=start;i<=end;i++){
|
||||||
|
this.plList.add(i+"");
|
||||||
|
}
|
||||||
|
return this.plList;
|
||||||
|
}catch (Exception e){
|
||||||
|
log.error(logMsg);
|
||||||
|
throw new RuntimeException(logMsg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue