ludc
2024-12-05 90c86c95de1d20a3c3a44cab3482388a8c221a5e
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebUIDataController.java
@@ -12,10 +12,10 @@
import com.vci.pagemodel.ReferConfigVO;
import com.vci.pagemodel.UIFormDataVO;
import com.vci.starter.web.util.VciBaseUtil;
import com.vci.web.query.UIDataGridQuery;
import com.vci.web.query.UIFormQuery;
import com.vci.web.query.UITreeQuery;
import com.vci.web.service.UIDataServiceI;
import com.vci.query.UIDataGridQuery;
import com.vci.query.UIFormQuery;
import com.vci.query.UITreeQuery;
import com.vci.web.service.uidataservice.UIDataCommonServiceI;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -40,7 +40,7 @@
     * 界面的数据服务
     */
    @Autowired
    private UIDataServiceI uiDataService;
    private UIDataCommonServiceI uiDataService;
    /**
     * 日志
@@ -53,10 +53,17 @@
     * @return 列表数据
     */
    @PostMapping("/dataGridQuery")
    @VciUnCheckRight
    //@VciUnCheckRight
    @VciBusinessLog(operateName = "列表数据的查询",description = "${param.btmname}里的${param.tableDefineId}")
    public DataGrid dataGrid(UIDataGridQuery dataGridQuery) throws PLException {
        return uiDataService.getDataForGrid(dataGridQuery);
    public BaseResult dataGrid(UIDataGridQuery dataGridQuery) throws Exception {
        try {
            return BaseResult.dataGrid(uiDataService.getDataForGrid(dataGridQuery));
        }catch (Exception e){
            e.printStackTrace();
            String errorMsg = "表单数据查询时出现错误,原因:"+ VciBaseUtil.getExceptionMessage(e);
            logger.error(errorMsg);
            throw new VciBaseException(errorMsg);
        }
    }
    /**
@@ -65,7 +72,7 @@
     * @return 表单的数据
     */
    @PostMapping("/dataFormQuery")
    @VciUnCheckRight
    //@VciUnCheckRight
    @VciBusinessLog(operateName = "表单的查询",description = "${param.btmname}里的${param.formDefineId}")
    public BaseResult<UIFormDataVO> getDataForForm(UIFormQuery formQuery){
        try {
@@ -84,10 +91,36 @@
     * @return 树的数据
     */
    @PostMapping("/getDataForTree")
    @VciUnCheckRight
    //@VciUnCheckRight
    @VciBusinessLog(operateName = "树的查询",description = "${param.btmname}")
    public List<Tree> getDataForTree(UITreeQuery treeQuery){
        return uiDataService.getDataForTree(treeQuery);
    public BaseResult getDataForTree(UITreeQuery treeQuery){
        try {
            return BaseResult.tree(uiDataService.getDataForTree(treeQuery));
        }catch (Exception e){
            e.printStackTrace();
            String errorMsg = "树的数据查询出现错误,原因:"+ VciBaseUtil.getExceptionMessage(e);
            logger.error(errorMsg);
            throw new VciBaseException(errorMsg);
        }
    }
    /**
     * 根据查询模板查询数据,返回值按照页面定义
     * @param treeQuery 树查询对象
     * @return 树的数据
     */
    @PostMapping("/getDataByTemp")
    //@VciUnCheckRight
    @VciBusinessLog(operateName = "查询")
    public BaseResult getDataByTemp(UITreeQuery treeQuery){
        try {
            return uiDataService.getDataByTemp(treeQuery);
        }catch (Exception e){
            e.printStackTrace();
            String errorMsg = "数据查询出现错误,原因:"+ VciBaseUtil.getExceptionMessage(e);
            logger.error(errorMsg);
            throw new VciBaseException(errorMsg);
        }
    }
    /**
@@ -96,7 +129,7 @@
     * @return 执行的结果
     */
    @PostMapping("/addSave")
    @VciUnCheckRight
    //@VciUnCheckRight
    @VciBusinessLog(operateName = "添加数据",description = "${param.btmname}")
    public BaseResult<Map<String,Object>> addSave(@RequestBody FormDataDTO formDataDTO){
        try {
@@ -270,6 +303,7 @@
        re.setData(dataMapList);
        return re;
    }
    /**
     * 变更所有者
     * @param btmname 业务类型
@@ -306,4 +340,5 @@
            return objectBaseResult;
        }
    }
}