py文件重新上传后,修改预测项和调度项setting的pyFile
| | |
| | | import com.iailab.framework.tenant.core.db.dynamic.TenantDS; |
| | | import com.iailab.module.model.mcs.pre.entity.MmModelArithSettingsEntity; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | * @param list |
| | | */ |
| | | void insertList(List<MmModelArithSettingsEntity> list); |
| | | |
| | | void updatePyFile(@Param("likeValue") String likeValue,@Param("value") String value); |
| | | } |
| | |
| | | void saveList(List<MmModelArithSettingsEntity> list); |
| | | |
| | | List<MmModelArithSettingsEntity> getByModelId(String modelId); |
| | | |
| | | void updatePyFile(String pyModule, String fileName); |
| | | } |
| | |
| | | modelIdMap.put(modelId, list); |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public void updatePyFile(String pyModule, String fileName) { |
| | | baseMapper.updatePyFile(pyModule + "." + fileName.substring(0,fileName.lastIndexOf("_")),pyModule + "." + fileName); |
| | | } |
| | | } |
| | |
| | | import com.iailab.framework.tenant.core.db.dynamic.TenantDS; |
| | | import com.iailab.module.model.mcs.sche.entity.StScheduleModelSettingEntity; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | |
| | | @TenantDS |
| | | @Mapper |
| | | public interface StScheduleModelSettingDao extends BaseMapperX<StScheduleModelSettingEntity> { |
| | | void updatePyFile(@Param("likeValue") String likeValue, @Param("value") String value); |
| | | } |
| | |
| | | void deleteByModelId(String modelId); |
| | | |
| | | void saveList(String modelId, List<StScheduleModelSettingSaveReqVO> saveList); |
| | | |
| | | void updatePyFile(String pyModule, String fileName); |
| | | } |
| | |
| | | baseDao.insert(entity); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void updatePyFile(String pyModule, String fileName) { |
| | | baseDao.updatePyFile(pyModule + "." + fileName.substring(0,fileName.lastIndexOf("_")),pyModule + "." + fileName); |
| | | } |
| | | } |
| | |
| | | import com.iailab.framework.security.core.util.SecurityFrameworkUtils; |
| | | import com.iailab.framework.tenant.core.context.TenantContextHolder; |
| | | import com.iailab.module.infra.api.config.ConfigApi; |
| | | import com.iailab.module.model.mcs.pre.service.MmModelArithSettingsService; |
| | | import com.iailab.module.model.mcs.sche.service.StScheduleModelSettingService; |
| | | import com.iailab.module.model.mpk.common.MdkConstant; |
| | | import com.iailab.module.model.mpk.common.utils.CmdUtils; |
| | | import com.iailab.module.model.mpk.common.utils.DllUtils; |
| | |
| | | |
| | | @Autowired |
| | | private ProjectPackageHistoryModelService projectPackageHistoryModelService; |
| | | |
| | | @Autowired |
| | | private MmModelArithSettingsService mmModelArithSettingsService; |
| | | |
| | | @Autowired |
| | | private StScheduleModelSettingService stScheduleModelSettingService; |
| | | |
| | | @Autowired |
| | | private ConfigApi configApi; |
| | |
| | | } |
| | | } |
| | | |
| | | // 修改预测项pyFile参数 |
| | | mmModelArithSettingsService.updatePyFile(dto.getPyModule(),fileName); |
| | | // 修改调度项pyFile参数 |
| | | stScheduleModelSettingService.updatePyFile(dto.getPyModule(),fileName); |
| | | |
| | | MpkFileEntity entity = ConvertUtils.sourceToTarget(dto, MpkFileEntity.class); |
| | | entity.setUpdater(SecurityFrameworkUtils.getLoginUserId()); |
| | | entity.setUpdateDate(new Date()); |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.iailab.module.model.mcs.pre.dao.MmModelArithSettingsDao"> |
| | | <update id="updatePyFile"> |
| | | update t_mm_model_arith_settings set value = #{value} where `key` = 'pyFile' and `value` like CONCAT(#{likeValue},'%') |
| | | </update> |
| | | <select id="getMmModelArithSettings" resultType="com.iailab.module.model.mcs.pre.entity.MmModelArithSettingsEntity" |
| | | parameterType="map"> |
| | | SELECT |
对比新文件 |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > |
| | | <mapper namespace="com.iailab.module.model.mcs.sche.dao.StScheduleModelSettingDao"> |
| | | <update id="updatePyFile"> |
| | | update t_st_schedule_model_setting set value = #{value} where `key` = 'pyFile' and `value` like CONCAT(#{likeValue},'%') |
| | | </update> |
| | | </mapper> |
| | |
| | | jstring keyJString = env->NewStringUTF("pyFile"); |
| | | jobject javaValueObj = env->CallObjectMethod(settings, getMID, keyJString); |
| | | const char* strValue = env->GetStringUTFChars((jstring)javaValueObj, NULL); |
| | | cout << strValue << endl; |
| | | |
| | | PyObject* pModule = create_py_module(strValue); |
| | | /*PyObject* pModule = create_py_module("${pyModule}.${pyName}");*/ |