|
@@ -13,6 +13,7 @@ import com.mixsmart.utils.StringUtils;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
+import org.springblade.common.utils.BaseUtils;
|
|
|
import org.springblade.common.utils.SnowFlakeUtil;
|
|
|
import org.springblade.core.log.exception.ServiceException;
|
|
|
import org.springblade.core.mp.support.Condition;
|
|
@@ -30,6 +31,7 @@ import org.springblade.manager.service.*;
|
|
|
import org.springblade.manager.service.impl.FormulaServiceImpl;
|
|
|
import org.springblade.manager.vo.AppWbsTreeContractVO;
|
|
|
import org.springblade.manager.wrapper.FormulaWrapper;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.dao.EmptyResultDataAccessException;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
@@ -126,7 +128,13 @@ public class FormulaController {
|
|
|
this.jdbcTemplate.batchUpdate(sql);
|
|
|
return R.success("公式已删除");
|
|
|
}
|
|
|
- this.service.updateById(fa);
|
|
|
+ Formula old = this.service.getById(fa.getId());
|
|
|
+ BeanUtils.copyProperties(fa,old,"formula","map","dev","scale");
|
|
|
+ old.setFormula(fa.getFormula());
|
|
|
+ old.setMap(fa.getMap());
|
|
|
+ old.setDev(fa.getDev());
|
|
|
+ old.setScale(fa.getScale());
|
|
|
+ this.service.update(Wrappers.<Formula>lambdaUpdate().set(Formula::getFormula,fa.getFormula()).set(Formula::getMap,fa.getMap()).set(Formula::getDev,fa.getDev()).set(Formula::getScale,fa.getScale()).eq(Formula::getId,fa.getId()));
|
|
|
return R.data(fa.getId());
|
|
|
}
|
|
|
}
|