|
|
|
@ -22,7 +22,7 @@ import org.springframework.util.StringUtils;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.StringJoiner;
|
|
|
|
|
import java.util.logging.Logger;
|
|
|
|
|
import java.util.concurrent.atomic.AtomicReference;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Description : 获取生产过程上下文对象接口实现【BUSI】
|
|
|
|
@ -180,28 +180,32 @@ public class MesProductionCustomContextStepService extends BaseStepService imple
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Boolean addProductionStatisticsContext(StationRequestBean reqBean, int count) {
|
|
|
|
|
public Integer addProductionStatisticsContext(StationRequestBean reqBean, int count) {
|
|
|
|
|
|
|
|
|
|
MesProdShiftContext mesProdShiftKvBean = getMesProdShiftKvBean(reqBean.getOrganizeCode(), reqBean.getWorkCenterCode());
|
|
|
|
|
//String key = new StringJoiner(MesPcnExtConstWords.AND).add(mesProdShiftKvBean.getShiftGroup()).add(mesProdShiftKvBean.getShiftCode()).toString();
|
|
|
|
|
String key = new StringJoiner(MesPcnExtConstWords.AND).add(mesProdShiftKvBean.getShiftGroup()).toString();
|
|
|
|
|
|
|
|
|
|
List<StationKvBean> stationKvBeans = getProductionStatisticsContext(reqBean);
|
|
|
|
|
List<StationKvBean> stationKvBeans = getProductionStatisticsContext(reqBean);
|
|
|
|
|
|
|
|
|
|
AtomicReference<Integer> amount = new AtomicReference<>();
|
|
|
|
|
amount.set(count);
|
|
|
|
|
|
|
|
|
|
if (CollectionUtils.isEmpty(stationKvBeans)) {
|
|
|
|
|
String name = "加工数";
|
|
|
|
|
String value = count + "";
|
|
|
|
|
List<StationKvBean> generateStationKvBeans = StationKvBeanUtil.addStationKvBeanList(new ArrayList<>(), new StationKvBean(key, name, value),
|
|
|
|
|
new StationKvBean("color", "颜色", MesExtEnumUtil.COLOR.BLACK.getValue()));
|
|
|
|
|
saveProductionStatisticsContext(reqBean, generateStationKvBeans);
|
|
|
|
|
stationKvBeans = StationKvBeanUtil.addStationKvBeanList(new ArrayList<>(),
|
|
|
|
|
new StationKvBean(mesProdShiftKvBean.getShiftGroup(), name, value), new StationKvBean("color", "颜色", MesExtEnumUtil.COLOR.BLACK.getValue()));
|
|
|
|
|
} else {
|
|
|
|
|
stationKvBeans.stream().forEach(stationKvBean -> {
|
|
|
|
|
if (stationKvBean.getKey().contains(key)) {
|
|
|
|
|
if (stationKvBean.getKey().contains(mesProdShiftKvBean.getShiftGroup())) {
|
|
|
|
|
stationKvBean.setValue(stationKvBean == null ? count + "" : (Integer.valueOf(stationKvBean.getValue()) + count) + "");
|
|
|
|
|
amount.set(Integer.valueOf(stationKvBean.getValue()));
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
saveProductionStatisticsContext(reqBean, stationKvBeans);
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
saveProductionStatisticsContext(reqBean, stationKvBeans);
|
|
|
|
|
|
|
|
|
|
return amount.get();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//可复用条码KEY
|
|
|
|
|