package com.hzya.frame.mdm.service.impl;

import cn.dev33.satoken.stp.StpUtil;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hzya.frame.mdm.mdmModule.dao.IMdmModuleDao;
import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity;
import com.hzya.frame.mdm.mdmModuleDb.dao.IMdmModuleDbDao;
import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity;
import com.hzya.frame.mdm.mdmModuleDbFileds.dao.IMdmModuleDbFiledsDao;
import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity;
import com.hzya.frame.mdm.mdmModuleDbFiledsRule.dao.IMdmModuleDbFiledsRuleDao;
import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity;
import com.hzya.frame.mdm.mdmModuleDistribute.dao.IMdmModuleDistributeDao;
import com.hzya.frame.mdm.mdmModuleDistribute.entity.MdmModuleDistributeEntity;
import com.hzya.frame.mdm.mdmModuleDistributeDetail.dao.IMdmModuleDistributeDetailDao;
import com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity;
import com.hzya.frame.mdm.mdmModuleSource.dao.IMdmModuleSourceDao;
import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity;
import com.hzya.frame.mdm.mdmModuleView.dao.IMdmModuleViewDao;
import com.hzya.frame.mdm.mdmModuleView.entity.MdmModuleViewEntity;
import com.hzya.frame.mdm.mdmModuleViewButton.dao.IMdmModuleViewButtonDao;
import com.hzya.frame.mdm.mdmModuleViewButton.entity.MdmModuleViewButtonEntity;
import com.hzya.frame.mdm.mdmModuleViewDetail.dao.IMdmModuleViewDetailDao;
import com.hzya.frame.mdm.mdmModuleViewDetail.entity.MdmModuleViewDetailEntity;
import com.hzya.frame.mdm.mdmTableCodeRule.dao.IMdmTableCodeRuleDao;
import com.hzya.frame.mdm.mdmTableCodeRule.entity.MdmTableCodeRuleEntity;
import com.hzya.frame.mdm.service.IMdmService;
import com.hzya.frame.mdm.service.IMdmServiceCache;
import com.hzya.frame.sysnew.integtationTask.entity.IntegrationTaskEntity;
import com.hzya.frame.uuid.UUIDUtils;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;


/**
 * 主数据服务实现类
 */
@Service(value = "mdmServiceCache")
public class MdmServiceCache implements IMdmServiceCache {
    private final Logger logger = LoggerFactory.getLogger(this.getClass());
    @Resource
    private IMdmModuleDao mdmModuleDao;
    @Resource
    private IMdmModuleDbDao mdmModuleDbDao;
    @Resource
    private IMdmModuleDbFiledsDao mdmModuleDbFiledsDao;
    @Resource
    private IMdmModuleDbFiledsRuleDao mdmModuleDbFiledsRuleDao;
    @Resource
    private IMdmModuleDistributeDao mdmModuleDistributeDao;
    @Resource
    private IMdmModuleDistributeDetailDao mdmModuleDistributeDetailDao;
    @Resource
    private IMdmModuleSourceDao mdmModuleSourceDao;
    @Resource
    private IMdmModuleViewDao mdmModuleViewDao;
    @Resource
    private IMdmModuleViewButtonDao mdmModuleViewButtonDao;
    @Resource
    private IMdmModuleViewDetailDao mdmModuleViewDetailDao;
    @Resource
    private IMdmTableCodeRuleDao mdmTableCodeRuleDao;

    /**
     * @Author lvleigang
     * @Description  缓存主数据
     * @Date 4:03 下午 2024/6/11
     * @param mdmCode
     * @return com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity
     **/
    @Override
    @Cacheable(cacheNames="mdmModule",key = "#mdmCode")
    public MdmModuleEntity getMdmModuleEntity(Long mdmCode) {
        MdmModuleEntity entity = mdmModuleDao.getByMdmCode(mdmCode);
        return entity;
    }
    /**
     * @Author lvleigang
     * @Description  缓存删除主数据
     * @Date 4:03 下午 2024/6/11
     * @param entity
     * @return com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity
     **/
    @Override
    @CacheEvict(cacheNames="mdmModule",key = "#entity.mdmCode")
    public void updateMdmModuleEntity(MdmModuleEntity entity) {
        mdmModuleDao.update(entity);
    }

    /**
     * @param entity
     * @return com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity
     * @Author lvleigang
     * @Description 删除模版主表
     * @Date 10:13 上午 2024/6/3
     **/
    @Override
    @CacheEvict(cacheNames="mdmModule",key = "#entity.mdmCode")
    public void deleteMdmModuleEntity(MdmModuleEntity entity) {
        entity.setUpdate();
        mdmModuleDao.logicRemoveMultiCondition(entity);
    }

    /**
     * @Author lvleigang
     * @Description  缓存主数据DB
     * @Date 4:03 下午 2024/6/11
     * @param entity
     * @return com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity
     **/
    @Override
    @Cacheable(cacheNames="mdmModuleDb",key = "#entity.mdmId")
    public List<MdmModuleDbEntity> queryMdmModuleDb(MdmModuleDbEntity entity) {
        List<MdmModuleDbEntity> mdmModuleDbEntities = mdmModuleDbDao.queryBase(entity);
        return mdmModuleDbEntities;
    }

    /**
     * @Author lvleigang
     * @Description  修改模版表数据
     * @Date 4:23 下午 2024/6/11
     * @param mdmId
     * @param mdmModuleDbEntities
     * @return void
     **/
    @Override
    @CacheEvict(cacheNames="mdmModuleDb",key = "#mdmId")
    public void saveOrUpdateMdmModuleDb(String mdmId, List<MdmModuleDbEntity> mdmModuleDbEntities) {
        if(mdmModuleDbEntities != null && mdmModuleDbEntities.size() > 0){
            for (int i = 0; i < mdmModuleDbEntities.size(); i++) {
                if("1".equals(mdmModuleDbEntities.get(i).getDataType())){
                    mdmModuleDbDao.save(mdmModuleDbEntities.get(i));
                }else {
                    mdmModuleDbDao.update(mdmModuleDbEntities.get(i));
                }
            }
        }
    }

    /**
     * @param mdmId
     * @return void
     * @Author lvleigang
     * @Description 删除模版表数据
     * @Date 4:23 下午 2024/6/11
     **/
    @Override
    @CacheEvict(cacheNames="mdmModuleDb",key = "#mdmId")
    public void deleteMdmModuleDb(String mdmId,String dbID) {
        MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity();
        mdmModuleDbEntity.setMdmId(mdmId);
        mdmModuleDbEntity.setId(dbID);
        mdmModuleDbEntity.setUpdate();
        mdmModuleDbDao.logicRemoveMultiCondition(mdmModuleDbEntity);
    }

    /**
     * @Author lvleigang
     * @Description  缓存主数据DB的所有字段
     * @Date 4:11 下午 2024/6/11
     * @param entity
     * @return java.util.List<com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity>
     **/
    @Override
    @Cacheable(cacheNames="mdmModuleDbFileds",key = "#entity.mdmId")
    public List<MdmModuleDbFiledsEntity> queryMdmModuleDbFileds(MdmModuleDbFiledsEntity entity) {
        List<MdmModuleDbFiledsEntity> mdmModuleDbFiledsEntities = mdmModuleDbFiledsDao.queryBase(entity);
        return mdmModuleDbFiledsEntities;
    }

    /**
     * @Author lvleigang
     * @Description  修改数据源db的字段
     * @Date 4:25 下午 2024/6/11
     * @param mdmId
     * @param mdmModuleDbFiledsEntities
     * @return void
     **/
    @Override
    @CacheEvict(cacheNames="mdmModuleDbFileds",key = "#mdmId")
    public void saveOrUpdateMdmModuleDbFileds(String mdmId, List<MdmModuleDbFiledsEntity> mdmModuleDbFiledsEntities) {
        if(mdmModuleDbFiledsEntities != null && mdmModuleDbFiledsEntities.size() > 0){
            for (int i = 0; i < mdmModuleDbFiledsEntities.size(); i++) {
                if("1".equals(mdmModuleDbFiledsEntities.get(i).getDataType())){
                    mdmModuleDbFiledsDao.save(mdmModuleDbFiledsEntities.get(i));
                }else if ("2".equals(mdmModuleDbFiledsEntities.get(i).getDataType())) {
                    mdmModuleDbFiledsDao.update(mdmModuleDbFiledsEntities.get(i));
                }else if ("3".equals(mdmModuleDbFiledsEntities.get(i).getDataType())) {
                    mdmModuleDbFiledsDao.logicRemoveMultiCondition(mdmModuleDbFiledsEntities.get(i));
                }
            }
        }
    }

    /**
     * @param mdmId
     * @return void
     * @Author lvleigang
     * @Description 删除数据源db的字段
     * @Date 4:25 下午 2024/6/11
     **/
    @Override
    @CacheEvict(cacheNames="mdmModuleDbFileds",key = "#mdmId")
    public void deleteMdmModuleDbFileds(String mdmId,String dbID) {
        MdmModuleDbFiledsEntity entity = new MdmModuleDbFiledsEntity();
        entity.setMdmId(mdmId);
        entity.setDbId(dbID);
        entity.setUpdate();
        mdmModuleDbFiledsDao.logicRemoveMultiCondition(entity);
    }

    //
    ///**
    // * @Author lvleigang
    // * @Description  缓存主数据DB的所有字段的规则
    // * @Date 4:11 下午 2024/6/11
    // * @param entity
    // * @return java.util.List<com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity>
    // **/
    //@Override
    //@Cacheable(cacheNames="mdmModuleDbFiledsRule",key = "#entity.mdmId")
    //public List<MdmModuleDbFiledsRuleEntity> queryMdmModuleDbFiledsRule(MdmModuleDbFiledsRuleEntity entity) {
    //    List<MdmModuleDbFiledsRuleEntity> mdmModuleDbFiledsRuleEntities = mdmModuleDbFiledsRuleDao.queryBase(entity);
    //    return mdmModuleDbFiledsRuleEntities;
    //}
    //
    //@Override
    //@Cacheable(cacheNames="mdmModuleDistribute",key = "#mdmId")
    //public List<MdmModuleDistributeEntity> queryMdmModuleDistribute(String mdmId,MdmModuleDistributeEntity mdmModuleDistributeEntity) {
    //    List<MdmModuleDistributeEntity> mdmModuleDistributeEntities = mdmModuleDistributeDao.queryBase(mdmModuleDistributeEntity);
    //    //查询模块下的应用列表
    //    MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity = new MdmModuleDistributeDetailEntity();
    //    mdmModuleDistributeDetailEntity.setSts("Y");
    //    mdmModuleDistributeDetailEntity.setMdmId(mdmId);
    //    List<MdmModuleDistributeDetailEntity> mdmModuleDistributeDetailEntities = mdmModuleDistributeDetailDao.queryBase(mdmModuleDistributeDetailEntity);
    //    if(mdmModuleDistributeEntities != null && mdmModuleDistributeEntities.size() > 0){
    //        for (int i = 0; i < mdmModuleDistributeEntities.size(); i++) {
    //            List<MdmModuleDistributeDetailEntity> moduleDistributeDetailEntities = new ArrayList<>();
    //            if(mdmModuleDistributeDetailEntities != null && mdmModuleDistributeDetailEntities.size() > 0){
    //                for (int i1 = 0; i1 < mdmModuleDistributeDetailEntities.size(); i1++) {
    //                    if(mdmModuleDistributeEntities.get(i).getId().equals(mdmModuleDistributeDetailEntities.get(i1).getDistributeId())){
    //                        moduleDistributeDetailEntities.add(mdmModuleDistributeDetailEntities.get(i1));
    //                    }
    //                }
    //            }
    //            mdmModuleDistributeEntities.get(i).setMdmModuleDistributeDetailEntities(moduleDistributeDetailEntities);
    //        }
    //    }
    //    return mdmModuleDistributeEntities;
    //}
    //
    //

    //
    //@Override
    //@Cacheable(cacheNames="mdmTableCodeRule",key = "#entity.mdmId")
    //public List<MdmTableCodeRuleEntity> queryMdmTableCodeRuleEntity(MdmTableCodeRuleEntity entity) {
    //    List<MdmTableCodeRuleEntity> mdmTableCodeRuleEntityList = mdmTableCodeRuleDao.queryBase(entity);
    //    return mdmTableCodeRuleEntityList;
    //}
    //
    //
    //
    //@Override
    //@CacheEvict(cacheNames="mdmTableCodeRule",key = "#mdmId")
    //public void saveMdmTableCodeRule(String mdmId, List<MdmTableCodeRuleEntity> mdmTableCodeRuleEntities) {
    //    MdmTableCodeRuleEntity mdmTableCodeRuleEntity = new MdmTableCodeRuleEntity();
    //    mdmTableCodeRuleEntity.setMdmId(mdmId);
    //    mdmTableCodeRuleEntity.setSts("Y");
    //    mdmTableCodeRuleEntity.setUpdate();
    //    mdmTableCodeRuleDao.logicRemoveMultiCondition(mdmTableCodeRuleEntity);
    //    if(mdmTableCodeRuleEntities != null && mdmTableCodeRuleEntities.size() > 0){
    //        for (int i = 0; i < mdmTableCodeRuleEntities.size(); i++) {
    //            mdmTableCodeRuleDao.save(mdmTableCodeRuleEntities.get(i));
    //        }
    //    }
    //}
    //


    //@Override
    //@CacheEvict(cacheNames="mdmModuleDbFiledsRule",key = "#mdmId")
    //public void saveMdmModuleDbFiledsRule(String mdmId, List<MdmModuleDbFiledsRuleEntity> mdmModuleDbFiledsRuleEntities) {
    //    MdmModuleDbFiledsRuleEntity mdmModuleDbFiledsRuleEntity = new MdmModuleDbFiledsRuleEntity();
    //    mdmModuleDbFiledsRuleEntity.setMdmId(mdmId);
    //    mdmModuleDbFiledsRuleEntity.setSts("Y");
    //    mdmModuleDbFiledsRuleEntity.setUpdate();
    //    mdmModuleDbFiledsRuleDao.logicRemoveMultiCondition(mdmModuleDbFiledsRuleEntity);
    //    if(mdmModuleDbFiledsRuleEntities != null && mdmModuleDbFiledsRuleEntities.size() > 0){
    //        for (int i = 0; i < mdmModuleDbFiledsRuleEntities.size(); i++) {
    //            if("1".equals(mdmModuleDbFiledsRuleEntities.get(i).getDataType())){
    //                mdmModuleDbFiledsRuleDao.save(mdmModuleDbFiledsRuleEntities.get(i));
    //            }else {
    //                mdmModuleDbFiledsRuleDao.update(mdmModuleDbFiledsRuleEntities.get(i));
    //            }
    //        }
    //    }
    //}
    //
    //@Override
    //@Cacheable(cacheNames="mdmModuleViewDetail",key = "#entity.mdmId")
    //public List<MdmModuleViewDetailEntity> queryMdmModuleViewDetail(MdmModuleViewDetailEntity entity) {
    //    List<MdmModuleViewDetailEntity> mdmModuleViewDetailEntities = mdmModuleViewDetailDao.queryBase(entity);
    //    return mdmModuleViewDetailEntities;
    //}
    //
    //@Override
    //@Cacheable(cacheNames="mdmModuleView",key = "#entity.mdmId")
    //public List<MdmModuleViewEntity> queryMdmModuleView(MdmModuleViewEntity entity) {
    //    List<MdmModuleViewEntity> moduleViewEntities = mdmModuleViewDao.queryBase(entity);
    //    return moduleViewEntities;
    //}
    //
    //@Override
    //@Cacheable(cacheNames="mdmModuleViewButton",key = "#entity.mdmId")
    //public List<MdmModuleViewButtonEntity> queryMdmModuleViewButton(MdmModuleViewButtonEntity entity) {
    //    List<MdmModuleViewButtonEntity> mdmModuleViewButtonEntities = mdmModuleViewButtonDao.queryBase(entity);
    //    return mdmModuleViewButtonEntities;
    //}
    //
    //@Override
    //@CacheEvict(cacheNames="mdmModuleView",key = "#mdmId")
    //public void saveMdmModuleView(String mdmId, MdmModuleViewEntity mdmModuleViewEntity) {
    //    mdmModuleViewDao.update(mdmModuleViewEntity);
    //}
    //
    //@Override
    //@CacheEvict(cacheNames="mdmModuleViewDetail",key = "#mdmId")
    //public void saveMdmModuleViewDetail(String mdmId, List<MdmModuleViewDetailEntity> mdmModuleViewDetailEntities) {
    //    MdmModuleViewDetailEntity mdmModuleViewDetailEntity = new MdmModuleViewDetailEntity();
    //    mdmModuleViewDetailEntity.setMdmId(mdmId);
    //    mdmModuleViewDetailEntity.setUpdate();
    //    mdmModuleViewDetailDao.logicRemoveMultiCondition(mdmModuleViewDetailEntity);
    //    if(mdmModuleViewDetailEntities != null && mdmModuleViewDetailEntities.size() > 0){
    //        for (int i = 0; i < mdmModuleViewDetailEntities.size(); i++) {
    //            if("1".equals(mdmModuleViewDetailEntities.get(i).getDataType())){
    //                mdmModuleViewDetailDao.save(mdmModuleViewDetailEntities.get(i));
    //            }else {
    //                mdmModuleViewDetailDao.update(mdmModuleViewDetailEntities.get(i));
    //            }
    //        }
    //    }
    //}
    //
    //@Override
    //@CacheEvict(cacheNames="mdmModuleViewButton",key = "#mdmId")
    //public void saveMdmModuleViewButton(String mdmId, List<MdmModuleViewButtonEntity> mdmModuleViewButtonEntities) {
    //    MdmModuleViewButtonEntity mdmModuleViewButtonEntity = new MdmModuleViewButtonEntity();
    //    mdmModuleViewButtonEntity.setMdmId(mdmId);
    //    mdmModuleViewButtonEntity.setUpdate();
    //    mdmModuleViewButtonDao.logicRemoveMultiCondition(mdmModuleViewButtonEntity);
    //    if(mdmModuleViewButtonEntities != null && mdmModuleViewButtonEntities.size() > 0){
    //        for (int i = 0; i < mdmModuleViewButtonEntities.size(); i++) {
    //            if("1".equals(mdmModuleViewButtonEntities.get(i).getDataType())){
    //                mdmModuleViewButtonDao.save(mdmModuleViewButtonEntities.get(i));
    //            }else {
    //                mdmModuleViewButtonDao.update(mdmModuleViewButtonEntities.get(i));
    //            }
    //        }
    //    }
    //}
    //
    //@Override
    //@Cacheable(cacheNames="mdmModuleDistributeDetail",key = "#entity.mdmId")
    //public     List<MdmModuleDistributeDetailEntity> queryMdmModuleDistributeDetail(MdmModuleDistributeDetailEntity entity){
    //    List<MdmModuleDistributeDetailEntity> mdmModuleDistributeDetailEntities = mdmModuleDistributeDetailDao.queryBase(entity);
    //    return mdmModuleDistributeDetailEntities;
    //}
    //
    //@Override
    //@CacheEvict(cacheNames="mdmModuleDistribute",key = "#mdmId")
    //public void saveMdmModuleDistribute(String mdmId, List<MdmModuleDistributeEntity> mdmModuleDistributeEntities) {
    //    //先删除
    //    MdmModuleDistributeEntity mdmModuleDistributeEntity = new MdmModuleDistributeEntity();
    //    mdmModuleDistributeEntity.setMdmId(mdmId);
    //    mdmModuleDistributeEntity.setUpdate();
    //    mdmModuleDistributeDao.logicRemoveMultiCondition(mdmModuleDistributeEntity);
    //    //保存主数据
    //    if (mdmModuleDistributeEntities != null && mdmModuleDistributeEntities.size() > 0) {
    //        for (int i = 0; i < mdmModuleDistributeEntities.size(); i++) {
    //            MdmModuleDistributeEntity moduleDistributeEntity = mdmModuleDistributeEntities.get(i);
    //            moduleDistributeEntity.setMdmId(mdmId);
    //            if (moduleDistributeEntity.getId() != null && !"".equals(moduleDistributeEntity.getId())) {
    //                moduleDistributeEntity.setUpdate();
    //                //修改
    //                mdmModuleDistributeDao.update(moduleDistributeEntity);
    //            } else {
    //                //新增
    //                moduleDistributeEntity.setCreate();
    //                mdmModuleDistributeDao.save(moduleDistributeEntity);
    //            }
    //            if(moduleDistributeEntity.getMdmModuleDistributeDetailEntities() != null && moduleDistributeEntity.getMdmModuleDistributeDetailEntities().size() > 0){
    //                for (int i1 = 0; i1 < moduleDistributeEntity.getMdmModuleDistributeDetailEntities().size(); i1++) {
    //                    MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity = moduleDistributeEntity.getMdmModuleDistributeDetailEntities().get(i1);
    //                    mdmModuleDistributeDetailEntity.setMdmId(mdmId);
    //                    mdmModuleDistributeDetailEntity.setDistributeId(moduleDistributeEntity.getId());
    //                    if (mdmModuleDistributeDetailEntity.getId() != null && !"".equals(mdmModuleDistributeDetailEntity.getId())) {
    //                        mdmModuleDistributeDetailEntity.setUpdate();
    //                        //修改
    //                        mdmModuleDistributeDetailDao.update(mdmModuleDistributeDetailEntity);
    //                    } else {
    //                        //新增
    //                        mdmModuleDistributeDetailEntity.setCreate();
    //                        mdmModuleDistributeDetailDao.save(mdmModuleDistributeDetailEntity);
    //                    }
    //                }
    //            }
    //        }
    //    }
    //}
    //
    //@Override
    //@Cacheable(cacheNames="mdmModuleSource",key = "#entity.mdmId")
    //public List<MdmModuleSourceEntity> queryMdmModuleSource(MdmModuleSourceEntity entity) {
    //    List<MdmModuleSourceEntity> mdmModuleSourceEntities = mdmModuleSourceDao.queryBase(entity);
    //    return mdmModuleSourceEntities;
    //}
    //
    //@Override
    //@CacheEvict(cacheNames="mdmModuleSource",key = "#mdmId")
    //public void saveMdmModuleSource(String mdmId, List<MdmModuleSourceEntity> mdmModuleSourceEntities) {
    //    //先删除
    //    MdmModuleSourceEntity mdmModuleSourceEntity = new MdmModuleSourceEntity();
    //    mdmModuleSourceEntity.setMdmId(mdmId);
    //    mdmModuleSourceEntity.setUpdate();
    //    mdmModuleSourceDao.logicRemoveMultiCondition(mdmModuleSourceEntity);
    //    //保存主数据
    //    if (mdmModuleSourceEntities != null && mdmModuleSourceEntities.size() > 0) {
    //        for (int i = 0; i < mdmModuleSourceEntities.size(); i++) {
    //            MdmModuleSourceEntity mdmModuleSourceEntity1 = mdmModuleSourceEntities.get(i);
    //            mdmModuleSourceEntity1.setMdmId(mdmId);
    //            if (mdmModuleSourceEntity1.getId() != null && !"".equals(mdmModuleSourceEntity1.getId())) {
    //                mdmModuleSourceEntity1.setUpdate();
    //                //修改
    //                mdmModuleSourceDao.update(mdmModuleSourceEntity1);
    //            } else {
    //                //新增
    //                mdmModuleSourceEntity1.setCreate();
    //                mdmModuleSourceDao.save(mdmModuleSourceEntity1);
    //            }
    //        }
    //    }
    //}









}
