|
|
@ -4,25 +4,31 @@ package com.dsic.gj_erp.service.jhgk.impl;
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
import com.dsic.gj_erp.bean.jcsj.EmGcrl;
|
|
|
|
import com.dsic.gj_erp.bean.ResultBean;
|
|
|
|
import com.dsic.gj_erp.bean.jcsj.EmSbcnp;
|
|
|
|
|
|
|
|
import com.dsic.gj_erp.bean.jhgk.DmQfxq;
|
|
|
|
import com.dsic.gj_erp.bean.jhgk.DmQfxq;
|
|
|
|
import com.dsic.gj_erp.bean.jhgk.DmSygdMx;
|
|
|
|
import com.dsic.gj_erp.bean.jhgk.DmSygdMx;
|
|
|
|
import com.dsic.gj_erp.bean.jhgk.DmYdjh;
|
|
|
|
import com.dsic.gj_erp.bean.jhgk.DmYdjh;
|
|
|
|
|
|
|
|
import com.dsic.gj_erp.bean.jiuzhou.Sljh;
|
|
|
|
import com.dsic.gj_erp.bean.pgd.*;
|
|
|
|
import com.dsic.gj_erp.bean.pgd.*;
|
|
|
|
import com.dsic.gj_erp.mapper.jhgk.DmYdjhMapper;
|
|
|
|
import com.dsic.gj_erp.mapper.jhgk.DmYdjhMapper;
|
|
|
|
import com.dsic.gj_erp.service.jcsj.DmBomService;
|
|
|
|
|
|
|
|
import com.dsic.gj_erp.service.jcsj.EmGcrlService;
|
|
|
|
|
|
|
|
import com.dsic.gj_erp.service.jhgk.DmQfxqService;
|
|
|
|
import com.dsic.gj_erp.service.jhgk.DmQfxqService;
|
|
|
|
import com.dsic.gj_erp.service.jhgk.DmSygdMxService;
|
|
|
|
|
|
|
|
import com.dsic.gj_erp.service.jhgk.DmYdjhService;
|
|
|
|
import com.dsic.gj_erp.service.jhgk.DmYdjhService;
|
|
|
|
|
|
|
|
import com.dsic.gj_erp.service.jiuzhou.SljhService;
|
|
|
|
import com.dsic.gj_erp.service.pgd.*;
|
|
|
|
import com.dsic.gj_erp.service.pgd.*;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
|
|
import org.springframework.context.ApplicationEventPublisher;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
import java.util.*;
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
|
@ -49,6 +55,8 @@ public class DmYdjhServiceImpl extends ServiceImpl<DmYdjhMapper, DmYdjh> impleme
|
|
|
|
private PgdPwjhService pwService;
|
|
|
|
private PgdPwjhService pwService;
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private PgdQgjhService qgService;
|
|
|
|
private PgdQgjhService qgService;
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private SljhService sljhService;
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<DmSygdMx> tjydjh() {
|
|
|
|
public List<DmSygdMx> tjydjh() {
|
|
|
@ -58,7 +66,7 @@ public class DmYdjhServiceImpl extends ServiceImpl<DmYdjhMapper, DmYdjh> impleme
|
|
|
|
//3.根据前方需求期,重新为三月滚动明细排产(板),排产后的数据添加到月度计划,并且反写数据到三月滚动明细
|
|
|
|
//3.根据前方需求期,重新为三月滚动明细排产(板),排产后的数据添加到月度计划,并且反写数据到三月滚动明细
|
|
|
|
// List<DmQfxq> qfxqList= qfxqService.list(new QueryWrapper<DmQfxq>().eq("substring(db,0,8) ", DateUtil.format(DateUtil.nextMonth(),"yyyy/MM")));
|
|
|
|
// List<DmQfxq> qfxqList= qfxqService.list(new QueryWrapper<DmQfxq>().eq("substring(db,0,8) ", DateUtil.format(DateUtil.nextMonth(),"yyyy/MM")));
|
|
|
|
int i = qfxqService.count(new QueryWrapper<DmQfxq>()
|
|
|
|
int i = qfxqService.count(new QueryWrapper<DmQfxq>()
|
|
|
|
.eq("substring(xzglxq,0,8) ", DateUtil.format(DateUtil.nextMonth(),"yyyy/MM")));
|
|
|
|
.eq("substring(xzglxq,0,8) ", DateUtil.format(DateUtil.nextMonth(), "yyyy/MM")));
|
|
|
|
if (i < 1) {
|
|
|
|
if (i < 1) {
|
|
|
|
System.out.println("下月的前方需求信息未导入!");
|
|
|
|
System.out.println("下月的前方需求信息未导入!");
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
@ -130,32 +138,37 @@ public class DmYdjhServiceImpl extends ServiceImpl<DmYdjhMapper, DmYdjh> impleme
|
|
|
|
return map;
|
|
|
|
return map;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private ApplicationEventPublisher publisher;
|
|
|
|
|
|
|
|
|
|
|
|
//下发 派工单状态改为编制 生成零件信息
|
|
|
|
//下发 派工单状态改为编制 生成零件信息
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void xf(List<DmYdjh> ydjhList){
|
|
|
|
public void xf(List<DmYdjh> ydjhList) {
|
|
|
|
|
|
|
|
|
|
|
|
//修改状态
|
|
|
|
//修改状态
|
|
|
|
List<String> idList=ydjhList.stream().map(DmYdjh::getId).collect(Collectors.toList());
|
|
|
|
List<String> idList = ydjhList.stream().map(DmYdjh::getId).collect(Collectors.toList());
|
|
|
|
if (idList.size()>100){
|
|
|
|
|
|
|
|
|
|
|
|
if (idList.size() > 100) {
|
|
|
|
List<String> list = idList.subList(idList.size() / 100 * 100, idList.size());
|
|
|
|
List<String> list = idList.subList(idList.size() / 100 * 100, idList.size());
|
|
|
|
AtomicInteger index=new AtomicInteger(idList.size()/100+1);
|
|
|
|
AtomicInteger index = new AtomicInteger(idList.size() / 100 + 1);
|
|
|
|
this.update(new UpdateWrapper<DmYdjh>().set("zt","2")
|
|
|
|
this.update(new UpdateWrapper<DmYdjh>().set("zt", "2")
|
|
|
|
.in( "id",list)
|
|
|
|
.in("id", list)
|
|
|
|
);
|
|
|
|
);
|
|
|
|
baseMapper.xfbc(list);
|
|
|
|
baseMapper.xfbc(list);
|
|
|
|
baseMapper.tqlj(list);
|
|
|
|
baseMapper.tqlj(list);
|
|
|
|
do {
|
|
|
|
do {
|
|
|
|
int i = index.decrementAndGet();
|
|
|
|
int i = index.decrementAndGet();
|
|
|
|
List<String> list1 = idList.subList((index.get()-1)*100, i*100);
|
|
|
|
List<String> list1 = idList.subList((index.get() - 1) * 100, i * 100);
|
|
|
|
this.update(new UpdateWrapper<DmYdjh>().set("zt","2")
|
|
|
|
this.update(new UpdateWrapper<DmYdjh>().set("zt", "2")
|
|
|
|
.in( "id",list1)
|
|
|
|
.in("id", list1)
|
|
|
|
);
|
|
|
|
);
|
|
|
|
baseMapper.xfbc(list1);
|
|
|
|
baseMapper.xfbc(list1);
|
|
|
|
baseMapper.tqlj(list1);
|
|
|
|
baseMapper.tqlj(list1);
|
|
|
|
}while (index.get()>1);
|
|
|
|
}while (index.get()>1);
|
|
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
|
}else {
|
|
|
|
this.update(new UpdateWrapper<DmYdjh>().set("zt","2")
|
|
|
|
this.update(new UpdateWrapper<DmYdjh>().set("zt", "2")
|
|
|
|
.in( "id",idList)
|
|
|
|
.in("id", idList)
|
|
|
|
);
|
|
|
|
);
|
|
|
|
//修改汇总状态 改为 编制
|
|
|
|
//修改汇总状态 改为 编制
|
|
|
|
baseMapper.xfbc(idList);
|
|
|
|
baseMapper.xfbc(idList);
|
|
|
@ -163,6 +176,7 @@ public class DmYdjhServiceImpl extends ServiceImpl<DmYdjhMapper, DmYdjh> impleme
|
|
|
|
baseMapper.tqlj(idList);
|
|
|
|
baseMapper.tqlj(idList);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
publisher.publishEvent(ydjhList);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|