package cn.cerc.mis.client;

import org.springframework.stereotype.Component;

import cn.cerc.core.Utils;
import cn.cerc.mis.core.AbstractForm;
import cn.cerc.mis.core.BookHandle;
import cn.cerc.mis.core.IPage;
import cn.cerc.mis.core.LocalService;
import cn.cerc.mis.page.JsonPage;
import lombok.extern.slf4j.Slf4j;

@Slf4j
@Component
public class ProxyService extends AbstractForm {

    @Override
    public IPage execute() throws Exception {
        JsonPage jsonPage = new JsonPage(this);
        String service = getRequest().getParameter("service");
        if (Utils.isEmpty(service)) {
            return jsonPage.setResultMessage(false, "service 不允许为空");
        }

        String dataIn = getRequest().getParameter("dataIn");
        if (Utils.isEmpty(dataIn)) {
            return jsonPage.setResultMessage(false, "dataIn 不允许为空");
        }

        log.info("token User corpNo: " + this.getCorpNo());

        String[] uri = this.getRequest().getRequestURI().split("/");
        String curBookNo = uri[1];
        if (Utils.isEmpty(curBookNo)) {
            return jsonPage.setResultMessage(false, "目标帐套  不允许为空");
        }

        if (curBookNo.equals(this.getCorpNo())) {
            return jsonPage.setResultMessage(false, "服务调用错误");
        }

        BookHandle bHandle = new BookHandle(this, curBookNo);
        try {
            LocalService svr = new LocalService(bHandle, service);
            svr.getDataIn().setJSON(dataIn);
            jsonPage.put("result", svr.exec());
            jsonPage.put("message", svr.getMessage());
            jsonPage.put("data", svr.getDataOut().toString());
        } catch (Exception e) {
            jsonPage.setResultMessage(false, e.getMessage());
        }
        return jsonPage;
    }

}

@@ -838,33 +838,32 @@
 %E4%B8%BA%E7%A9%BA%22);%0A        %7D%0A
-%0A
         log.info
@@ -868,30 +868,19 @@
 fo(%22
-token User corpNo: %22 +
+%E8%AF%B7%E6%B1%82%E8%80%85%E5%B8%90%E5%A5%97 %7B%7D %22,
  thi
@@ -1109,32 +1109,73 @@
 %E8%AE%B8%E4%B8%BA%E7%A9%BA%22);%0A        %7D
+%0A        log.info(%22%E5%93%8D%E5%BA%94%E8%80%85%E5%B8%90%E5%A5%97 %7B%7D%22, curBookNo);
 %0A%0A        if (cu

Update ProxyService.java