config_item函数(system/core/comm…

配置文件读取技巧
//用于获取配置文件单项配置
if ( ! function_exists('config_item'))
{
	function config_item($item)
	{
		static $_config_item = array();
		//如果_config_item数组选项没有被设置,则先载入配合文件
		if ( ! isset($_config_item[$item]))
		{
			$config =& get_config();
			//如果没有此配置选项则返回FALSE
			if ( ! isset($config[$item]))
			{
				return FALSE;
			}
			$_config_item[$item] = $config[$item];
		}
		return $_config_item[$item];
	}
}






22:42:47 **** Incremental Build of configuration Debug for project PID1 **** make -j16 all arm-none-eabi-gcc "../Core/Src/gpio.c" -mcpu=cortex-m3 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32F103xB -c -I../Core/Inc -I../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I../Drivers/STM32F1xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I../Drivers/CMSIS/Include -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Core/Src/gpio.d" -MT"Core/Src/gpio.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Core/Src/gpio.o" arm-none-eabi-gcc "../Core/Src/main.c" -mcpu=cortex-m3 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32F103xB -c -I../Core/Inc -I../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I../Drivers/STM32F1xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I../Drivers/CMSIS/Include -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Core/Src/main.d" -MT"Core/Src/main.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Core/Src/main.o" arm-none-eabi-gcc "../Core/Src/motor.c" -mcpu=cortex-m3 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32F103xB -c -I../Core/Inc -I../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I../Drivers/STM32F1xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I../Drivers/CMSIS/Include -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Core/Src/motor.d" -MT"Core/Src/motor.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Core/Src/motor.o" arm-none-eabi-gcc "../Core/Src/oled.c" -mcpu=cortex-m3 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32F103xB -c -I../Core/Inc -I../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I../Drivers/STM32F1xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I../Drivers/CMSIS/Include -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Core/Src/oled.d" -MT"Core/Src/oled.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Core/Src/oled.o" arm-none-eabi-gcc "../Core/Src/stm32f1xx_hal_msp.c" -mcpu=cortex-m3 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32F103xB -c -I../Core/Inc -I../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I../Drivers/STM32F1xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I../Drivers/CMSIS/Include -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Core/Src/stm32f1xx_hal_msp.d" -MT"Core/Src/stm32f1xx_hal_msp.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Core/Src/stm32f1xx_hal_msp.o" arm-none-eabi-gcc "../Core/Src/stm32f1xx_it.c" -mcpu=cortex-m3 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32F103xB -c -I../Core/Inc -I../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I../Drivers/STM32F1xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I../Drivers/CMSIS/Include -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Core/Src/stm32f1xx_it.d" -MT"Core/Src/stm32f1xx_it.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Core/Src/stm32f1xx_it.o" ../Core/Src/main.c:34:1: error: unknown type name 'Motor_Driver' 34 | Motor_Driver motor; | ^~~~~~~~~~~~ ../Core/Src/main.c:35:1: error: unknown type name 'Encoder' 35 | Encoder encoder; | ^~~~~~~ ../Core/Src/main.c:36:1: error: unknown type name 'PID_Controller' 36 | PID_Controller pid; | ^~~~~~~~~~~~~~ ../Core/Src/main.c: In function 'main': ../Core/Src/main.c:106:3: warning: implicit declaration of function 'Motor_Init' [-Wimplicit-function-declaration] 106 | Motor_Init(&motor, &htim1, TIM_CHANNEL_1, | ^~~~~~~~~~ ../Core/Src/main.c:107:14: error: 'MOTOR_AIN1_Port' undeclared (first use in this function) 107 | MOTOR_AIN1_Port, MOTOR_AIN1_Pin, | ^~~~~~~~~~~~~~~ ../Core/Src/main.c:107:14: note: each undeclared identifier is reported only once for each function it appears in ../Core/Src/main.c:107:31: error: 'MOTOR_AIN1_Pin' undeclared (first use in this function) 107 | MOTOR_AIN1_Port, MOTOR_AIN1_Pin, | ^~~~~~~~~~~~~~ ../Core/Src/main.c:108:14: error: 'MOTOR_AIN2_Port' undeclared (first use in this function) 108 | MOTOR_AIN2_Port, MOTOR_AIN2_Pin, | ^~~~~~~~~~~~~~~ ../Core/Src/main.c:108:31: error: 'MOTOR_AIN2_Pin' undeclared (first use in this function) 108 | MOTOR_AIN2_Port, MOTOR_AIN2_Pin, | ^~~~~~~~~~~~~~ ../Core/Src/main.c:109:14: error: 'MOTOR_STBY_Port' undeclared (first use in this function) 109 | MOTOR_STBY_Port, MOTOR_STBY_Pin); | ^~~~~~~~~~~~~~~ ../Core/Src/main.c:109:31: error: 'MOTOR_STBY_Pin' undeclared (first use in this function) 109 | MOTOR_STBY_Port, MOTOR_STBY_Pin); | ^~~~~~~~~~~~~~ ../Core/Src/main.c:110:3: warning: implicit declaration of function 'Encoder_Init' [-Wimplicit-function-declaration] 110 | Encoder_Init(&encoder, &htim2); | ^~~~~~~~~~~~ ../Core/Src/main.c:111:3: warning: implicit declaration of function 'PID_Init' [-Wimplicit-function-declaration] 111 | PID_Init(&pid, 1.0f, 0.01f, 0.001f, 1000.0f); // 初始PID参数 | ^~~~~~~~ ../Core/Src/main.c:112:3: warning: implicit declaration of function 'OLED_Init' [-Wimplicit-function-declaration] 112 | OLED_Init(); | ^~~~~~~~~ ../Core/Src/main.c:113:3: warning: implicit declaration of function 'COMM_Init' [-Wimplicit-function-declaration] 113 | COMM_Init(&huart1); | ^~~~~~~~~ ../Core/Src/main.c:129:7: warning: implicit declaration of function 'COMM_Process' [-Wimplicit-function-declaration] 129 | COMM_Process(); | ^~~~~~~~~~~~ ../Core/Src/main.c:136:11: warning: implicit declaration of function 'OLED_ShowStatus' [-Wimplicit-function-declaration] 136 | OLED_ShowStatus(target_rpm, encoder.rpm, | ^~~~~~~~~~~~~~~ ../Core/Src/main.c:136:46: error: request for member 'rpm' in something not a structure or union 136 | OLED_ShowStatus(target_rpm, encoder.rpm, | ^ ../Core/Src/main.c:137:29: error: request for member 'Kp' in something not a structure or union 137 | pid.Kp, pid.Ki, pid.Kd); | ^ ../Core/Src/main.c:137:37: error: request for member 'Ki' in something not a structure or union 137 | pid.Kp, pid.Ki, pid.Kd); | ^ ../Core/Src/main.c:137:45: error: request for member 'Kd' in something not a structure or union 137 | pid.Kp, pid.Ki, pid.Kd); | ^ ../Core/Src/main.c:140:11: warning: implicit declaration of function 'COMM_SendData' [-Wimplicit-function-declaration] 140 | COMM_SendData(target_rpm, encoder.rpm, | ^~~~~~~~~~~~~ ../Core/Src/main.c:140:44: error: request for member 'rpm' in something not a structure or union 140 | COMM_SendData(target_rpm, encoder.rpm, | ^ ../Core/Src/main.c:141:27: error: request for member 'Kp' in something not a structure or union 141 | pid.Kp, pid.Ki, pid.Kd); | ^ ../Core/Src/main.c:141:35: error: request for member 'Ki' in something not a structure or union 141 | pid.Kp, pid.Ki, pid.Kd); | ^ ../Core/Src/main.c:141:43: error: request for member 'Kd' in something not a structure or union 141 | pid.Kp, pid.Ki, pid.Kd); | ^ ../Core/Src/main.c:199:1: error: expected declaration or statement at end of input 199 | } | ^ ../Core/Src/main.c: At top level: ../Core/Src/main.c:190:6: warning: 'Error_Handler' defined but not used [-Wunused-function] 190 | void Error_Handler(void) | ^~~~~~~~~~~~~ ../Core/Src/main.c:150:6: warning: 'SystemClock_Config' defined but not used [-Wunused-function] 150 | void SystemClock_Config(void) | ^~~~~~~~~~~~~~~~~~ make: *** [Core/Src/subdir.mk:61: Core/Src/main.o] Error 1 make: *** Waiting for unfinished jobs.... ../Core/Src/oled.c:11:10: fatal error: ssd1306.h: No such file or directory 11 | #include "ssd1306.h" // 第三方OLED库 | ^~~~~~~~~~~ compilation terminated. make: *** [Core/Src/subdir.mk:61: Core/Src/oled.o] Error 1 "make -j16 all" terminated with exit code 2. Build might be incomplete. 22:42:51 Build Failed. 22 errors, 10 warnings. (took 4s.507ms)
06-22
@PostMapping(value = "/grpCommRateQry.service", produces = "application/json;charset=utf-8") @ResponseBody public String grpCommRateQry(HttpServletRequest request, @RequestBody String jsonStr) { // 初始化RespBaseDomain EsalesResponseDomain domain = initResponseDomain(); JSONObject jsonObject = null; try { JSONObject obj = JSONObject.fromObject(jsonStr); CommRateDomain commRateDomain = (CommRateDomain) JSONObject.toBean(obj, CommRateDomain.class); List<CommRateDomain> list = esalesInterfaceService.getCommRateInfoList(commRateDomain); if (CollectionUtils.isEmpty(list)) { setResponseDataNull(domain); } else { domain.setData(list); } } catch (JSONException e) { setResponseJsonError(domain); } catch (Exception e) { setResponseSystemError(domain); } finally { jsonObject = JSONObject.fromObject(domain); } return jsonObject.toString(); } public List<CommRateDomain> getCommRateInfoList(CommRateDomain commRateDomain); public List<CommRateDomain> getCommRateInfoList(CommRateDomain commRateDomain) { List<CommRateDomain> commRateList = esalesInterfaceDao.getCommRateInfoList(commRateDomain); List<CommRateDomain> list = new ArrayList<>(); if (CollectionUtils.isNotEmpty(commRateList)) { for (CommRateDomain domain : commRateList) { CommRateDomain commRateInfoDomain = new CommRateDomain(); BeanUtils.copyProperties(domain, commRateInfoDomain); list.add(commRateInfoDomain); } } return list; } <parameterMap id="CommRateMap" type="map"> <parameter property="channelType" jdbcType="VARCHAR" mode="IN" /> <parameter property="salaryDate" jdbcType="DATE" mode="IN" /> <parameter property="productCode" jdbcType="DATE" mode="IN" /> <parameter property="premiumYear" jdbcType="VARCHAR" mode="IN" /> <parameter property="policyYear" jdbcType="VARCHAR" mode="IN" /> <parameter property="policyId" jdbcType="VARCHAR" mode="IN" /> <parameter property="productId" jdbcType="VARCHAR" mode="IN" /> </parameterMap> <!--获取提奖比例信息 --> <select id="getCommRateInfoList" statementType="CALLABLE" parameterMap="CommRateMap"> { call pkg_grp_salary_package.func_get_comm_rate(?,?,?,?,?,?,?)} </select> function func_get_comm_rate(p_channel_type in varchar2, p_salary_date in date, p_product_code in varchar2, p_premium_year in number, p_policy_year in number, p_policy_id in number, p_product_id in number) return number is cursor cur_product_rate(c_premium_year_concerned varchar2, c_policy_year_concerned varchar2) is select * from t_grp_product_bonus_rate br where br.product_code = p_product_code and p_salary_date between br.start_date and nvl(br.end_date, p_salary_date) and (c_premium_year_concerned = 'N' or p_premium_year between br.premium_year_lower_limit and br.premium_year_upper_limit) and (c_policy_year_concerned = 'N' or p_policy_year between br.start_pay_term_year and br.end_pay_term_year); r_product_rate cur_product_rate%rowtype; v_comm_rate t_grp_policy_bonus_det.bonus_rate%type; v_premium_year_concerned varchar2(1); v_policy_year_concerned varchar2(1); v_agency_comm_rate gls.t_agency_commision_charge.rate%type; begin v_comm_rate := 0; v_premium_year_concerned := 'N'; v_policy_year_concerned := 'N'; if p_product_code = 'T2900' then v_premium_year_concerned := 'Y'; v_policy_year_concerned := 'Y'; end if; open cur_product_rate(v_premium_year_concerned, v_policy_year_concerned); fetch cur_product_rate into r_product_rate; if cur_product_rate%notfound then v_comm_rate := -1; else if p_salary_date >= to_date('202201', 'yyyymm') then if p_channel_type = '1' then v_comm_rate := r_product_rate.ds_business_bonus_rate; elsif p_channel_type in ('2', '3') then v_comm_rate := r_product_rate.bc_business_bonus_rate; elsif p_channel_type = '4' then v_comm_rate := r_product_rate.co_business_bonus_rate; elsif p_channel_type = '9' then v_comm_rate := r_product_rate.shareholder_business_rate; elsif p_channel_type = '10' then v_comm_rate := r_product_rate.company_business_rate; end if; else --套餐/卡单 if r_product_rate.product_type = '3' then if p_channel_type = '1' then v_comm_rate := r_product_rate.ds_business_bonus_rate; elsif p_channel_type = '4' then v_comm_rate := r_product_rate.co_business_bonus_rate; end if; --非 套餐/卡单 else if p_channel_type = '1' then v_comm_rate := r_product_rate.ds_business_bonus_rate; elsif p_channel_type in ('2', '3') then if p_product_code = 'T2900' then v_comm_rate := r_product_rate.bc_business_bonus_rate; else v_agency_comm_rate := func_get_agency_comm_rate(p_policy_id, p_product_id); v_comm_rate := ((1 - v_agency_comm_rate) * r_product_rate.ds_business_bonus_rate) / (1 + v_agency_comm_rate * 2.5 / r_product_rate.bc_agency_bonus_rate); end if; elsif p_channel_type = '4' then v_comm_rate := ((1 - r_product_rate.co_business_bonus_rate - 0.05) * r_product_rate.ds_business_bonus_rate) / (1 + r_product_rate.co_business_bonus_rate * 2.5 / r_product_rate.co_business_bonus_rate); end if; end if; end if; end if; close cur_product_rate; return v_comm_rate; exception when others then return - 1; end func_get_comm_rate;能够输出合理的v_comm_rate值吗
最新发布
09-17
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值