|
@@ -24,6 +24,7 @@ import org.springblade.manager.service.IExcelTabService;
|
|
import org.springblade.manager.service.impl.FormulaServiceImpl;
|
|
import org.springblade.manager.service.impl.FormulaServiceImpl;
|
|
import org.springblade.manager.wrapper.FormulaWrapper;
|
|
import org.springblade.manager.wrapper.FormulaWrapper;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
+import org.springframework.dao.EmptyResultDataAccessException;
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import springfox.documentation.annotations.ApiIgnore;
|
|
import springfox.documentation.annotations.ApiIgnore;
|
|
@@ -180,11 +181,16 @@ public class FormulaController {
|
|
@ApiOperation(value = "自动填充数据", notes = "根据设计值、偏差范围、频率自动填充数据")
|
|
@ApiOperation(value = "自动填充数据", notes = "根据设计值、偏差范围、频率自动填充数据")
|
|
public R<Map<String,Object>> rangeList(RangeInfo info) throws FileNotFoundException {
|
|
public R<Map<String,Object>> rangeList(RangeInfo info) throws FileNotFoundException {
|
|
if(info.verify()){
|
|
if(info.verify()){
|
|
- if(Func.isNotEmpty(info.getPkId())){
|
|
|
|
- Map<String,Object> data = this.jdbcTemplate.queryForMap("SELECT a.e_allow_deviation as dev from m_wbs_form_element a left join m_wbs_tree b on a.f_id=b.id left join m_wbs_tree_contract c on c.init_table_name=b.init_table_name where c.p_key_id="+info.getPkId()+" and a.e_key='"+info.getKey()+"'");
|
|
|
|
- if(Func.isNotEmpty(data.get("dev"))){
|
|
|
|
- info.setDev(Func.toStr(data.get("dev")));
|
|
|
|
- }
|
|
|
|
|
|
+ info.setKey(info.getKey().replaceAll("__[\\d_]+",""));
|
|
|
|
+ if(Func.isNotEmpty(info.getPkId())&&Func.isBlank(info.getDev())){
|
|
|
|
+ try{
|
|
|
|
+ Map<String,Object> data = this.jdbcTemplate.queryForMap("SELECT a.e_allow_deviation as dev from m_wbs_form_element a left join m_wbs_tree b on a.f_id=b.id left join m_wbs_tree_contract c on c.init_table_name=b.init_table_name where c.p_key_id="+info.getPkId()+" and a.e_key='"+info.getKey()+"'");
|
|
|
|
+ if(Func.isNotEmpty(data.get("dev"))){
|
|
|
|
+ info.setDev(Func.toStr(data.get("dev")));
|
|
|
|
+ }
|
|
|
|
+ }catch (EmptyResultDataAccessException e){
|
|
|
|
+ return R.fail("元素还未设置偏差范围");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
if(Func.isBlank(info.getDev())){
|
|
if(Func.isBlank(info.getDev())){
|
|
info.setDev("-3,3");
|
|
info.setDev("-3,3");
|