|
@@ -0,0 +1,56 @@
|
|
|
|
|
+package com.awspaas.user.apps.donenow_ivt.controller;
|
|
|
|
|
+
|
|
|
|
|
+import com.actionsoft.bpms.commons.mvc.view.ResponseObject;
|
|
|
|
|
+import com.actionsoft.bpms.server.bind.annotation.Mapping;
|
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
+import com.actionsoft.bpms.util.DBSql;
|
|
|
|
|
+import com.actionsoft.sdk.local.SDK;
|
|
|
|
|
+import com.actionsoft.bpms.bo.engine.BO;
|
|
|
|
|
+import com.actionsoft.bpms.server.UserContext;
|
|
|
|
|
+
|
|
|
|
|
+import java.sql.Connection;
|
|
|
|
|
+import java.sql.SQLException;
|
|
|
|
|
+import java.util.HashMap;
|
|
|
|
|
+import java.util.Map;
|
|
|
|
|
+
|
|
|
|
|
+public class caiController {
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 根据ID查询BO_EU_DNIVT_ORDER表的UNIT_COST_ADD_TAX字段
|
|
|
|
|
+ * @param uc 用户上下文
|
|
|
|
|
+ * @param id 前端传入的查询ID
|
|
|
|
|
+ * @return 包含UNIT_COST_ADD_TAX字段的响应对象
|
|
|
|
|
+ * @throws SQLException SQL异常
|
|
|
|
|
+ */
|
|
|
|
|
+ @Mapping("com.awspaas.user.apps.donenow_ivt.queryCai")
|
|
|
|
|
+ public ResponseObject queryOrderById(UserContext uc, String id) throws SQLException {
|
|
|
|
|
+ // 校验ID参数是否为空
|
|
|
|
|
+ if (StringUtils.isBlank(id)) {
|
|
|
|
|
+ return ResponseObject.newErrResponse("查询ID不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ Connection conn = null;
|
|
|
|
|
+ try {
|
|
|
|
|
+ conn = DBSql.open();
|
|
|
|
|
+ BO orderBo = SDK.getBOAPI().get("BO_EU_DNIVT_ORDER_PRODUCT", id);
|
|
|
|
|
+
|
|
|
|
|
+ if (orderBo == null) {
|
|
|
|
|
+ return ResponseObject.newErrResponse("未找到ID为【" + id + "】的订单数据");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ Object unitCostAddTax = orderBo.get("UNIT_COST_ADD_TAX");
|
|
|
|
|
+
|
|
|
|
|
+ Map<String, Object> result = new HashMap<>();
|
|
|
|
|
+ result.put("UNIT_COST_ADD_TAX", unitCostAddTax);
|
|
|
|
|
+ result.put("ORDER_ID", id);
|
|
|
|
|
+
|
|
|
|
|
+ return ResponseObject.newOkResponse(result.toString());
|
|
|
|
|
+
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ return ResponseObject.newErrResponse("系统异常:" + e.getMessage());
|
|
|
|
|
+ } finally {
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|