1.增加默认设备日产能,防止产能为0时设备无效

2.修复排产报错
3.临时设置排产计算默认区间为4月份
master
董哲奇 1 year ago
parent 52aa862205
commit ed78a22991

@ -183,9 +183,9 @@ public class ComputePlan {
dateTimes.forEach(date -> {
String dateStr = date.toString("yyyy/MM/dd");
//todo 根据人员请假情况,计算当前日期设备是否可用
if (ObjectUtil.isEmpty(_empSizeByDay)||_empSizeByDay.get(dateStr).size()<=0){
return;
}
// if (ObjectUtil.isEmpty(_empSizeByDay)||_empSizeByDay.get(dateStr).size()<=0){
// return;
// }
if (realDeviceList.get(dateStr) == null) {
JSONArray arr = new JSONArray();
arr.add(item);
@ -255,6 +255,9 @@ public class ComputePlan {
Double degsYb=deviceJson.getDouble("degsYb");
degs=ObjectUtil.isEmpty(degs)?0.0:degs;
degsYb=ObjectUtil.isEmpty(degsYb)?0.0:degsYb;
if (StrUtil.isEmpty(gcrl.getPb())){
capacity.setCapacity(degs * 7);
}
if ("3".equals(gcrl.getPb())) {
capacity.setCapacity(degs * 7 + degsYb * 7);
}

@ -187,8 +187,6 @@ public class DmQfxqServiceImpl extends ServiceImpl<DmQfxqMapper, DmQfxq> impleme
}
});
ydjhService.saveBatch(ydjhList);
}
private void removeByMulti(Map<String, List<DmYdjh>> map){
@ -200,18 +198,17 @@ public class DmQfxqServiceImpl extends ServiceImpl<DmQfxqMapper, DmQfxq> impleme
private void removeByMulti(List<DmYdjh> list,String dcCh,String dcPl,int size){
List<String> tzbhList = list.stream().map(DmYdjh::getTzbh).collect(Collectors.toList());
if (tzbhList.size()<=size){
if (tzbhList.size()>size){
AtomicInteger index=new AtomicInteger(tzbhList.size()/size+1);
this.remove(tzbhList.subList(tzbhList.size()/size*size, tzbhList.size()),dcCh,dcPl);
do {
int i = index.decrementAndGet();
List<String> list1 = tzbhList.subList((index.get()-1)*size, i*size);
this.remove(list1,dcCh,dcPl);
}while (index.get()>1);
}else {
this.remove(tzbhList,dcCh,dcPl);
return;
}
AtomicInteger index=new AtomicInteger(tzbhList.size()/size);
do {
int i = index.decrementAndGet();
int i1 = tzbhList.size() % ((index.get()) * size);
int last=i1>0?i1:i*size;
List<String> list1 = tzbhList.subList((index.get())*size, last);
this.remove(list1,dcCh,dcPl);
}while (index.get()>0);
}
private void remove(List<String> list,String dcCh,String dcPl){

@ -38,6 +38,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.sql.Date;
import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.stream.Collectors;
@ -85,11 +86,11 @@ public class DmSygdMxServiceImpl extends ServiceImpl<DmSygdMxMapper, DmSygdMx> i
public ResultBean sygdPC() {
//todo 重复导入(三月滚动计划)的数据处理
//零件 删除
String begin=DateUtil.format(DateUtil.nextMonth(),"yyyy/MM/01");
String end =DateUtil.format(DateUtil.endOfMonth(DateUtil.offsetMonth(DateUtil.date(),3)),"yyyy/MM/dd");
// String begin=DateUtil.format(DateUtil.nextMonth(),"yyyy/MM/01");
// String end =DateUtil.format(DateUtil.endOfMonth(DateUtil.offsetMonth(DateUtil.date(),3)),"yyyy/MM/dd");
//测试日期
// String begin = "2023/08/01";
// String end = "2023/10/31";
String begin = "2024/04/01";
String end = "2024/05/01";
//todo 零件
ljService.remove(new QueryWrapper<DmSygdMxLj>().between("xzglxq", begin, end));
//todo 三月滚动明细
@ -123,7 +124,7 @@ public class DmSygdMxServiceImpl extends ServiceImpl<DmSygdMxMapper, DmSygdMx> i
public void ypc(List<DmSygdMx> list) {
// Map<String, List<DmSygdMx>> mxMap = list.stream().filter(l->StrUtil.isNotEmpty(l.getTzbh())).collect(Collectors.groupingBy(l -> l.getKw() + l.getZl()));
ComputePlan c=ComputePlan.instance();
c.computeRealCapacity();
c.computeRealCapacity(DateUtil.beginOfMonth(DateUtil.date()), DateUtil.endOfMonth(DateUtil.date()));
Map<String,List<RealCapacity>> rel=c.getRealCapacityMap();
//加工工序list

@ -80,10 +80,10 @@ public class DmYdjhServiceImpl extends ServiceImpl<DmYdjhMapper, DmYdjh> impleme
Map<String,Object> map=new HashMap<>();
//月度计划汇总
//汇总时生成切割之前的派工单 状态为空
String begin= DateUtil.format(DateUtil.nextMonth(),"yyyy/MM/01");
String end =DateUtil.format(DateUtil.endOfMonth(DateUtil.offsetMonth(DateUtil.date(),1)),"yyyy/MM/dd");
// String begin="2023/08/01";
// String end ="2023/08/31";
// String begin= DateUtil.format(DateUtil.nextMonth(),"yyyy/MM/01");
// String end =DateUtil.format(DateUtil.endOfMonth(DateUtil.offsetMonth(DateUtil.date(),1)),"yyyy/MM/dd");
String begin="2024/02/01";
String end ="2024/03/1";
//图纸计划
List<PgdTzjh> tzjhList=tzjhService.list(new QueryWrapper<PgdTzjh>().between("qgxqrq",begin,end).orderByAsc("czbh,pl,qgxqrq"));

Loading…
Cancel
Save