1.临时提交

master
董哲奇 11 months ago
parent 79a4be237e
commit 40e232d48f

@ -1,14 +1,13 @@
package com.dsic.gj_erp.controller.jhgk;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.dsic.gj_erp.bean.ResultBean;
import com.dsic.gj_erp.pc.Manager;
import com.dsic.gj_erp.pc.*;
import com.dsic.gj_erp.pc.service.;
import com.dsic.gj_erp.pc.service.CD;
import com.dsic.gj_erp.pc.service.;
import com.dsic.gj_erp.pc.service.;
import com.dsic.gj_erp.pc.CD;
import com.dsic.gj_erp.pc.;
import com.dsic.gj_erp.pc.;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
@ -23,6 +22,7 @@ public class 三月滚动排产控制器 {
private final _;
private final _;
private final CD _CD;
private final _;
private static Semaphore semaphore = new Semaphore(1);
@ -82,6 +82,18 @@ public class 三月滚动排产控制器 {
return new ResultBean<>(map);
}
@GetMapping("getDhjhAll")
public ResultBean<?> (){
Object o = _.get();
return new ResultBean<>(o);
}
@PostMapping("saveDhjh")
public ResultBean<?> (@RequestBody _){
_.save(_);
return new ResultBean<>();
}
@GetMapping("getCdAll")
public ResultBean<?> CD(){
Object o = _CD.get();

@ -12,6 +12,8 @@ import com.dsic.gj_erp.bean.jcsj.EmGcrl;
import com.dsic.gj_erp.bean.jcsj.EmSbcnp;
import com.dsic.gj_erp.bean.jcsj.EmSbjbb;
import com.dsic.gj_erp.bean.jhgk.DmSygdxq;
import com.dsic.gj_erp.bean.jhgk.DmZrcjh;
import com.dsic.gj_erp.bean.pgd.PgdSljh;
import com.dsic.gj_erp.pc.dto.data.Bom;
import com.dsic.gj_erp.pc.dto.data.;
import com.dsic.gj_erp.pc.dto.gx.*;
@ -20,11 +22,14 @@ import com.dsic.gj_erp.pc.dto.tlt.*;
import com.dsic.gj_erp.pc.dto.;
import com.dsic.gj_erp.pc.dto.*;
import com.dsic.gj_erp.pc.service.CD;
import com.dsic.gj_erp.pc.service.;
import com.dsic.gj_erp.pc.service.;
import com.dsic.gj_erp.service.jcsj.EmGcrlService;
import com.dsic.gj_erp.service.jcsj.EmSbcnpService;
import com.dsic.gj_erp.service.jcsj.EmSbjbbService;
import com.dsic.gj_erp.service.jhgk.DmSygdxqService;
import com.dsic.gj_erp.service.jhgk.DmZrcjhService;
import com.dsic.gj_erp.service.pgd.PgdSljhService;
import com.google.common.collect.ImmutableMap;
import lombok.extern.slf4j.Slf4j;
@ -43,6 +48,8 @@ import static com.dsic.gj_erp.pc.Manager.*;
public class DataFactory {
public static void 2() {
();
.clear();
Manager.=new ArrayList<>();
List<> list=();
@ -54,28 +61,29 @@ public class DataFactory {
list.forEach( -> {
CountDownLatch latch = new CountDownLatch(.getBomList().size());
String xzglxq = .getXzglxq();
String dzglxq = .getDzglxq();
.getBomList().forEach(bom -> {
_ = (bom);
//套料图未定义/定义错误
if (_==null){
latch.countDown();
return;
}
_.setXzglxq(xzglxq);
_.setDzglxq(dzglxq);
_.setCD(CDMap);
AtomicBoolean atomicBoolean = new AtomicBoolean(false);
if (_!=null){
_.set(.getXzglxq());
_.set((bom.getDcch() + bom.getPl() + bom.getFd()));
es.execute(() -> {
try{
_.run(atomicBoolean);
_.run();
}finally {
latch.countDown();
}
});
}else {
latch.countDown();
}
// if(atomicBoolean.get()){
// String errText = StrUtil.format("船号:{},批量:{},图号:{},需求日期:{},不满足上料需求",
// bom.getDcch(), bom.getPl(), bom.getTzbh(), bom.getXzglxq());
// 清理冗余数据(list);
// throw new RuntimeException(errText);
// }
});
try {
latch.await(10, TimeUnit.SECONDS);// 指定超时时间
@ -83,13 +91,33 @@ public class DataFactory {
throw new RuntimeException(e);
}
});
(list);
if (Manager..size()>0){
log.info("排产异常--{}个未完整排产,{}",Manager..size(),Manager.);
}
}
public static List<PgdSljh> (Bom bom){
return getBean(PgdSljhService.class).(bom.getDcch(),bom.getPl(),bom.getFd(),bom.getTzbh());
}
public static Map<String,List<>> (){
List<> _ = getBean(.class).get();
Map<String,List<>> map= _.stream().collect(Collectors.groupingBy(::getDcch));
return map;
}
private static DmZrcjh (String key){
return getBean(DmZrcjhService.class).(key);
}
private static void (){
getBean(DmZrcjhService.class).();
}
private static void (List<> list){
list.forEach(->{
.getBomList().forEach(bom -> {
if (bom.get()!=null){
@ -177,7 +205,7 @@ public class DataFactory {
tmp = (DateUtil.endOfMonth(DateUtil.parse(.getXzglxq(), "yyyy/MM/dd")));
_ = tmp.getMAP().get(gx);
Optional<> _ = _.get().values().stream().findAny();
bom.set(_.get());
bom.set(_.orElse(null));
bom.set(tmp);
_.(bom.getTzbh(), 0);
.put(bom.getTzbh(), tmp);

@ -17,7 +17,9 @@ import java.util.Map;
@Setter
public class Bom {
private String dcch;
private String mbch;
private String pl;
private String _pl;//曲外板pl需要增加Q,这里
private String fd;
private String xzglxq;
@ -33,6 +35,7 @@ public class Bom {
private ;
private ;
private List<Constant.> ;
private List<ErrorType> errors;
public static Bom of(String xzxq, String dzxq, DmBom bom){
Bom _bom = new Bom();
@ -40,10 +43,35 @@ public class Bom {
_bom.xzglxq=xzxq;
_bom.dzglxq=dzxq;
_bom. =new ArrayList<>();
_bom.errors=new ArrayList<>();
return _bom;
}
public String toString() {
return JSONObject.toJSONString(this);
}
public void (){
this.errors.add(ErrorType.);
}
public void (){
this.errors.add(ErrorType.);
}
public void (){
this.errors.add(ErrorType.);
}
public void (){
this.errors.add(ErrorType.);
this.errors.add(ErrorType.);
}
private enum ErrorType{
,
,
,
,
}
}

@ -0,0 +1,5 @@
package com.dsic.gj_erp.pc.dto.tlt;
public enum ZlType {
,,
}

@ -11,6 +11,7 @@ public class 一跨平直大板 extends 套料图工序 {
this.kw = "7";
this.zl = "1010";
this.bom = bom;
this.zlType=ZlType.;
this. = ImmutableList.<Constant.>builder()
.add(Constant..)
.add(Constant..)
@ -25,6 +26,7 @@ public class 一跨平直大板 extends 套料图工序 {
this.kw = "7";
this.zl = "1110";
this.bom = bom;
this.zlType=ZlType.;
this. = ImmutableList.<Constant.>builder()
.add(Constant..)
.add(Constant..)

@ -15,6 +15,7 @@ public class 一跨进线板 extends 套料图工序 {
this.kw = "8";
this.zl = "1110";
this.bom = bom;
this.zlType=ZlType.;
this. = ImmutableList.<Constant.>builder()
.add(Constant..)
.add(Constant..)

@ -11,6 +11,7 @@ public class 七跨型板 extends 套料图工序 {
this.kw = "16";
this.zl = "1010";
this.bom = bom;
this.zlType=ZlType.;
this. = ImmutableList.<Constant.>builder()
.add(Constant..)
.add(Constant..)
@ -28,6 +29,7 @@ public class 七跨型板 extends 套料图工序 {
this.kw = "16";
this.zl = "1110";
this.bom = bom;
this.zlType=ZlType.;
this. = ImmutableList.<Constant.>builder()
.add(Constant..)
.add(Constant..)

@ -11,6 +11,7 @@ public class 三跨厚板 extends 套料图工序 {
this.kw = "14";
this.zl = "1010";
this.bom = bom;
this.zlType=ZlType.;
this. = ImmutableList.<Constant.>builder()
.add(Constant..)
.add(Constant..)
@ -25,6 +26,7 @@ public class 三跨厚板 extends 套料图工序 {
this.kw = "14";
this.zl = "1110";
this.bom = bom;
this.zlType=ZlType.;
this. = ImmutableList.<Constant.>builder()
.add(Constant..)
.add(Constant..)

@ -11,6 +11,7 @@ public class 三跨平铁 extends 套料图工序 {
this.kw = "6";
this.zl = "1010";
this.bom = bom;
this.zlType=ZlType.;
this. = ImmutableList.<Constant.>builder()
.add(Constant..)
.add(Constant..)
@ -28,6 +29,7 @@ public class 三跨平铁 extends 套料图工序 {
this.kw = "6";
this.zl = "1110";
this.bom = bom;
this.zlType=ZlType.;
this. = ImmutableList.<Constant.>builder()
.add(Constant..)
.add(Constant..)
@ -45,6 +47,7 @@ public class 三跨平铁 extends 套料图工序 {
this.kw = "6";
this.zl = "4230";
this.bom = bom;
this.zlType=ZlType.;
this. = ImmutableList.<Constant.>builder()
.add(Constant..)
.add(Constant..)

@ -11,6 +11,7 @@ public class 三跨曲板 extends 套料图工序 {
this.kw = "13";
this.zl = "1010";
this.bom = bom;
this.zlType=ZlType.;
this.();
return this;
}
@ -19,6 +20,7 @@ public class 三跨曲板 extends 套料图工序 {
this.kw = "13";
this.zl = "1110";
this.bom = bom;
this.zlType=ZlType.;
this.();
return this;
}

@ -11,6 +11,7 @@ public class 二跨T型材腹板 extends 套料图工序 {
this.kw = "11";
this.zl = "1010";
this.bom = bom;
this.zlType=ZlType.;
this.();
return this;
}
@ -19,6 +20,7 @@ public class 二跨T型材腹板 extends 套料图工序 {
this.kw = "11";
this.zl = "1110";
this.bom = bom;
this.zlType=ZlType.;
this.();
return this;
}

@ -11,6 +11,7 @@ public class 二跨T型材面板 extends 套料图工序 {
this.kw = "5";
this.zl = "1010";
this.bom = bom;
this.zlType=ZlType.;
this.();
return this;
}
@ -19,6 +20,7 @@ public class 二跨T型材面板 extends 套料图工序 {
this.kw = "5";
this.zl = "1110";
this.bom = bom;
this.zlType=ZlType.;
this.();
return this;
}

@ -11,6 +11,7 @@ public class 二跨激光切割板 extends 套料图工序 {
this.kw = "12";
this.zl = "1010";
this.bom = bom;
this.zlType=ZlType.;
this. = ImmutableList.<Constant.>builder()
.add(Constant..)
.add(Constant..)
@ -25,6 +26,7 @@ public class 二跨激光切割板 extends 套料图工序 {
this.kw = "12";
this.zl = "1110";
this.bom = bom;
this.zlType=ZlType.;
this. = ImmutableList.<Constant.>builder()
.add(Constant..)
.add(Constant..)

@ -11,6 +11,7 @@ public class 二跨超长超宽曲板 extends 套料图工序 {
this.kw = "10";
this.zl = "1010";
this.bom = bom;
this.zlType=ZlType.;
this. = ImmutableList.<Constant.>builder()
.add(Constant..)
.add(Constant..)
@ -27,6 +28,7 @@ public class 二跨超长超宽曲板 extends 套料图工序 {
_.kw = "10";
_.zl = "1110";
_.bom = bom;
_.zlType=ZlType.;
_. = ImmutableList.<Constant.>builder()
.add(Constant..)
.add(Constant..)

@ -11,6 +11,7 @@ public class 二跨超长超宽板 extends 套料图工序 {
this.kw = "9";
this.zl = "1010";
this.bom = bom;
this.zlType=ZlType.;
this.();
return this;
}
@ -19,6 +20,7 @@ public class 二跨超长超宽板 extends 套料图工序 {
this.kw = "9";
this.zl = "1110";
this.bom = bom;
this.zlType=ZlType.;
this.();
return this;
}

@ -11,6 +11,7 @@ public class 光电 extends 套料图工序 {
this.kw = "17";
this.zl = "1120";
this.bom = bom;
this.zlType=ZlType.;
this. = ImmutableList.<Constant.>builder()
.add(Constant..)
.add(Constant..)

@ -11,6 +11,7 @@ public class 四跨普通板 extends 套料图工序 {
this.kw = "15";
this.zl = "1010";
this.bom = bom;
this.zlType= ZlType.;
this.();
return this;
}
@ -19,6 +20,7 @@ public class 四跨普通板 extends 套料图工序 {
this.kw = "15";
this.zl = "1110";
this.bom = bom;
this.zlType=ZlType.;
this.();
return this;
}
@ -27,6 +29,7 @@ public class 四跨普通板 extends 套料图工序 {
this.kw = "15";
this.zl = "4230";
this.bom = bom;
this.zlType=ZlType.;
this.();
return this;
}

@ -4,57 +4,109 @@ import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjUtil;
import cn.hutool.core.util.StrUtil;
import com.dsic.gj_erp.pc.Constant;
import com.dsic.gj_erp.pc.Manager;
import com.dsic.gj_erp.bean.jhgk.DmZrcjh;
import com.dsic.gj_erp.pc.*;
import com.dsic.gj_erp.pc.dto.data.Bom;
import com.dsic.gj_erp.pc.dto.data.;
import com.dsic.gj_erp.pc.dto.tlt.ZlType;
import com.dsic.gj_erp.pc.service.;
import com.dsic.gj_erp.pc.CD;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.atomic.AtomicBoolean;
//import static com.dsic.gj_erp.pc.Constant.工序CD;
import static com.dsic.gj_erp.pc.DataFactory.;
import static com.dsic.gj_erp.pc.DataFactory.;
import static com.dsic.gj_erp.pc.Manager.from;
@Getter
@Setter
@Slf4j
public abstract class implements {
protected String kw;
protected String zl;
protected ZlType zlType;
protected String xzglxq;
protected String dzglxq;
protected _;
protected Bom bom;
protected String ;
protected Date _;
protected DateTime _;
protected DmZrcjh ;
protected List<Constant.> ;
protected Map<Constant.,CD> CD;
protected AtomicBoolean fail;
protected List<> s;
public void run(){
fail=new AtomicBoolean(false);
();
this.run(fail);
}
protected void (){
if (this.zlType==ZlType.){
this.set(this.xzglxq);
}
if (this.zlType==ZlType.){
this.set(this.dzglxq);
}
if (this.zlType==ZlType.&&this..contains(Constant..)){
//大组需求有曲外板,需要按照大组需求期计算
this.set(dzglxq);
//曲外板批量名称设置
this.bom.set_pl(this.bom.getPl()+"Q");
}
//当大组需求期无法满足小组需求时,以小组需求期为准
if (StrUtil.isAllNotEmpty(xzglxq,dzglxq)){
if (DateUtil.parse(xzglxq,"yyyy/MM/dd").isAfter(DateUtil.parse(dzglxq,"yyyy/MM/dd"))){
this.set(dzglxq);
}
}
public void run(AtomicBoolean atomicBoolean) {
if (ObjUtil.isEmpty(this.bom)||StrUtil.isEmpty(this.bom.getTzbh())){
return;
}
this._ = DateUtil.parse(this., "yyyy/MM/dd");
double = 1;
Map<String,List<>> _=DataFactory.();
this.s = _.get(bom.getDcch());
}
public void run(AtomicBoolean atomicBoolean) {
if (!this.()){
bom.();
}
double = 1;//默认数量为1,切割处理时候按照实际切割长度计算,切割产能在设备产能中单独计算
this..forEach(_ -> {
if (!this.(_,)){
//可用资源最大前推日期设置为N天,最大前推日期意味从上料开始最小施工周期
//fixme 这里应该安装工序设置,暂时写死一个日期
Optional<> = (_, DateUtil.parse(from, "yyyy/MM/dd"), DateUtil.offsetDay(this._,0), );
.ifPresent(_ -> {
if (_.(_,this.bom,)){
this.bom.set(_);
this.bom.get().add(0,_);
_ = this.2(_, );
if (_==Constant..&&!this.(_)){
this.bom.();
//使用中日程定义需求日期
this._=this.zlType==ZlType.?DateUtil.parse(this..getGjjsXz()):DateUtil.parse(this..getGjjsDz());
//再次计算上料日期
this.2(_, );
}
//只有大组需求期时,坡口结束日期需满足大组结束日期
if (StrUtil.isEmpty(xzglxq)&&StrUtil.isNotEmpty(dzglxq)&&_==Constant..){
if (this.!=null){
String =this..getGjjsDz();
if (DateUtil.parse().isBefore(DateUtil.parse(_.getDate()))){
this.bom.();
atomicBoolean.set(true);
}
}
});
}
});
//排产失败相关记录
if (bom.get().size()!=this..size()) {
Manager..add(this.bom);
@ -62,6 +114,60 @@ public abstract class 套料图工序 implements 套料图工序接口 {
}
}
protected boolean (){
AtomicBoolean =new AtomicBoolean(false);
if (ObjUtil.isEmpty(s)){
return .get();
}
if (ObjUtil.isNotEmpty(s)){
s.forEach(item->{
if (item.getPlList().contains(bom.getPl())){
.set(true);
}
});
}
return .get();
}
protected boolean ( _){
AtomicBoolean =new AtomicBoolean(false);
if (ObjUtil.isNotEmpty(s)){
s.forEach(item->{
if (item.getPlList().contains(bom.getPl())){
DateTime arriveDate;
try {
arriveDate=DateUtil.parse(item.getAllArriveData(),"yyyy/MM/dd");
}catch (Exception e){
this.bom.();
log.error("上料计划时间格式错误--月份:{},船号:{},批次范围:{},到齐日期:{}",item.getMonth(),item.getDcch(),item.getPls(),item.getAllArriveData());
return;
}
if (_.get_date().isAfter(arriveDate)){
.set(true);
}
}
});
}
return .get();
}
protected 2(Constant. _,double ){
Integer cd = CD.get(_).getCd();
DateTime dateTime = DateUtil.offsetDay(this._, cd);
_ = (dateTime);
try {
if (_.(_,this.bom,)){
this.bom.set(_);
this.bom.get().add(0,_);
}
}catch (Exception e){
e.printStackTrace();
}
return _;
}
protected boolean (Constant. _,double ){
Integer cd = CD.get(_).getCd();
DateTime dateTime = DateUtil.offsetDay(this._, cd);
@ -100,4 +206,9 @@ public abstract class 套料图工序 implements 套料图工序接口 {
this._=_;
return this;
}
public boolean getSuccess(){
return this.fail.get();
}
}

@ -1,5 +1,7 @@
package com.dsic.gj_erp.pc.dto;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.dsic.gj_erp.pc.Constant;
import com.dsic.gj_erp.pc.dto.data.Bom;
import lombok.Getter;
@ -16,6 +18,7 @@ import static com.dsic.gj_erp.pc.Manager.套料图所占工序的资源;
@Setter
public class {
private String date;
private DateTime _date;
private Map<Constant.,> MAP;
public void (Constant. ,String ,double ){
@ -32,23 +35,13 @@ public class 资源 {
AtomicBoolean atomicBoolean = new AtomicBoolean(false);
= MAP.get();
Optional.ofNullable().ifPresent(it->{
if (it.()){
it.(,bom);
(bom.getTzbh());
atomicBoolean.set(true);
}
});
return atomicBoolean.get();
}
public void (Constant. ,Bom bom,double ){
= MAP.get();
Optional.of().ifPresent(it->{
it.(,bom);
(bom.getTzbh());
});
}
private static Semaphore semaphore = new Semaphore(1);
protected static (String ) {
@ -76,6 +69,7 @@ public class 资源 {
public static of(String date,Map<Constant.,> MAP){
= new ();
.date=date;
._date= DateUtil.parse(date,"yyyy/MM/dd");
.MAP=MAP;
return ;
}

@ -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);
}
}
}

@ -28,4 +28,8 @@ public interface DmZrcjhService extends IService<DmZrcjh> {
void tj(List<DmZrcjh> dmZrcjhs);
void sh(List<DmZrcjh> dmZrcjhs);
void ();
DmZrcjh (String key);
}

@ -7,6 +7,7 @@ import cn.hutool.core.util.ObjectUtil;
import cn.hutool.poi.excel.ExcelReader;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dsic.gj_erp.bean.jhgk.*;
import com.dsic.gj_erp.mapper.jhgk.DmZrcjhMapper;
@ -16,6 +17,8 @@ import com.dsic.gj_erp.util.ExcelUtil;
import com.google.common.collect.Lists;
import org.apache.commons.lang3.StringUtils;
import org.modelmapper.ModelMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
@ -28,6 +31,9 @@ import java.util.Date;
import java.util.List;
import java.util.Map;
import static com.dsic.gj_erp.pc.Manager.from;
import static com.dsic.gj_erp.pc.Manager.to;
/**
* <p>
*
@ -46,6 +52,9 @@ public class DmZrcjhServiceImpl extends ServiceImpl<DmZrcjhMapper, DmZrcjh> impl
@Resource
DmZrcjhOldService oldService;
@Autowired
RedisTemplate<String,Object> redisTemplate;
@Override
public List<DmZrcjh> getList(JSONObject json) {
QueryWrapper<DmZrcjh> queryWrapper = new QueryWrapper<>();
@ -163,4 +172,20 @@ public class DmZrcjhServiceImpl extends ServiceImpl<DmZrcjhMapper, DmZrcjh> impl
});
updateBatchById(dmZrcjhs);
}
@Override
public void () {
redisTemplate.delete("ZRC");
List<DmZrcjh> list = list(Wrappers.<DmZrcjh>lambdaQuery().between(DmZrcjh::getGjks, from, to));
list.parallelStream().forEach(item->{
String key=item.getDcCh()+item.getDcPl()+item.getDcFd();
redisTemplate.opsForHash().put("ZRC",key,item);
});
}
@Override
public DmZrcjh (String key) {
return (DmZrcjh) redisTemplate.opsForHash().get("ZRC",key);
}
}

@ -23,5 +23,5 @@ public interface PgdSljhService extends IService<PgdSljh> {
void saveSljhFk(List<PgdSljh> sljhs, HttpServletRequest request);
void saveSljhPgdXdBack(List<PgdSljh> sljhs, HttpServletRequest request);
List<PgdSljh> (String ch,String pl,String fd,String tlth);
}

@ -1,12 +1,17 @@
package com.dsic.gj_erp.service.pgd.impl;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.dsic.gj_erp.bean.jhgk.DmZrcjh;
import com.dsic.gj_erp.bean.pgd.PgdDh;
import com.dsic.gj_erp.bean.pgd.PgdSljh;
import com.dsic.gj_erp.bean.pgd.PgdTzjh;
import com.dsic.gj_erp.mapper.pgd.PgdSljhMapper;
import com.dsic.gj_erp.pc.Manager;
import com.dsic.gj_erp.service.pgd.PgdSljhService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.AllArgsConstructor;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -14,6 +19,9 @@ import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;
import static com.dsic.gj_erp.pc.Manager.from;
import static com.dsic.gj_erp.pc.Manager.to;
/**
* <p>
*
@ -23,7 +31,11 @@ import java.util.List;
* @since 2023-11-13
*/
@Service
@AllArgsConstructor
public class PgdSljhServiceImpl extends ServiceImpl<PgdSljhMapper, PgdSljh> implements PgdSljhService {
private final RedisTemplate<String,Object> redisTemplate;
@Transactional(rollbackFor = Exception.class)
@Override
public void saveSljhPgdXd(List<PgdSljh> sljhs, HttpServletRequest request) {
@ -88,4 +100,16 @@ public class PgdSljhServiceImpl extends ServiceImpl<PgdSljhMapper, PgdSljh> impl
});
this.updateBatchById(ups);
}
@Override
public List<PgdSljh> (String ch, String pl, String fd, String tlth) {
return list(Wrappers.<PgdSljh>lambdaQuery()
.eq(PgdSljh::getCzbh,ch)
.eq(PgdSljh::getPl,pl)
.eq(PgdSljh::getFd,fd)
.eq(PgdSljh::getTlth,tlth)
.isNotNull(PgdSljh::getFkrq)
);
}
}

@ -9,9 +9,11 @@
<result column="dc_fd" property="dcFd" jdbcType="VARCHAR" />
<result column="zdh" property="zdh" jdbcType="VARCHAR" />
<result column="xzglxq" property="xzglxq" jdbcType="VARCHAR" />
<result column="dzglxq" property="dzglxq" jdbcType="VARCHAR" />
<collection property="bomList" ofType="dmBom" javaType="java.util.ArrayList" columnPrefix="bom_" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="dcch" property="dcch" jdbcType="VARCHAR" />
<result column="mbch" property="mbch" jdbcType="VARCHAR" />
<result column="pl" property="pl" jdbcType="VARCHAR" />
<result column="fd" property="fd" jdbcType="VARCHAR" />
<result column="kw" property="kw" jdbcType="VARCHAR" />
@ -33,8 +35,10 @@
xq.dc_pl,
xq.dc_fd,
xq.xzglxq,
xq.daglxq,
bom.id as bom_id,
bom.dcch as bom_dcch,
bom.mbch as bom_mbch,
bom.pl as bom_pl,
bom.fd as bom_fd,
bom.kw as bom_kw,

Loading…
Cancel
Save