新火炬后端单体项目初始化代码
zhangherong
2025-08-02 a5aa9503efd20103df066219c512b47b7f65e363
src/main/java/org/jeecg/modules/mes/service/impl/MesProductionOrderServiceImpl.java
@@ -4,6 +4,7 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.common.constant.CommonConstant;
import org.jeecg.modules.mdc.util.DateUtils;
import org.jeecg.modules.mes.entity.MesProductionOrder;
import org.jeecg.modules.mes.mapper.MesProductionOrderMapper;
import org.jeecg.modules.mes.service.IMesProductionOrderService;
@@ -25,26 +26,18 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public Map<String, MesProductionOrder> saveOrUpdateProductionOrder(List<ProductionOrderDTO> productionOrderDTOList) {
        List<MesProductionOrder> addList = new ArrayList<>();
        List<MesProductionOrder> updateList = new ArrayList<>();
        Map<String, MesProductionOrder> resultMap = new HashMap<>();
        for (ProductionOrderDTO productionOrderDTO : productionOrderDTOList) {
            MesProductionOrder updated = getByOrderCode(productionOrderDTO.getAUFNR());
            if (updated == null) {
                updated = new MesProductionOrder(productionOrderDTO);
                addList.add(updated);
                resultMap.put(updated.getOrderCode(), updated);
                this.getBaseMapper().insert(updated);
            } else {
                updated.updateEntity(productionOrderDTO);
                updateList.add(updated);
                resultMap.put(updated.getOrderCode(), updated);
                this.getBaseMapper().updateById(updated);
            }
        }
        if(CollectionUtil.isEmpty(addList)){
            super.saveBatch(addList);
        }
        if(CollectionUtil.isEmpty(updateList)){
            super.updateBatchById(updateList);
        }
        return resultMap;
    }
@@ -61,5 +54,21 @@
        return null;
    }
    @Override
    public String getLastSyncCreateDate() {
        String lastSyncDate = this.getBaseMapper().getLastSyncCreateDate();
        if(lastSyncDate == null){
            return null;
        }
        return lastSyncDate.replaceAll("-", "");
    }
    @Override
    public String getLastSyncUpdateDate() {
        String lastSyncDate = this.getBaseMapper().getLastSyncUpdateDate();
        if(lastSyncDate == null){
            return null;
        }
        return lastSyncDate.replaceAll("-", "");
    }
}