中扬CRM客户关系管理系统
#
luxiaotao1123
2023-07-31 ef8f08ff763cae09314fa90e0582f8f120c62ff1
#
1个文件已添加
2个文件已修改
60 ■■■■■ 已修改文件
src/main/java/com/zy/crm/common/web/DatavController.java 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/datav/sql/1.sql 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/crm/common/web/DatavController.java
@@ -1,8 +1,13 @@
package com.zy.crm.common.web;
import com.core.common.R;
import org.springframework.core.io.ClassPathResource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.PostConstruct;
import java.io.IOException;
import java.io.InputStream;
/**
 * Created by vincent on 2023/7/25
@@ -10,32 +15,36 @@
@RestController
public class DatavController {
    private String sql1;
    @PostConstruct
    public void init() throws IOException {
        this.sql1 = read(new ClassPathResource("datav/sql/1.sql").getInputStream());
    }
    @GetMapping("/1test")
    public R test1() {
        /**
         * select
         * (case  when A.org='1002208180000267' then '嘉善'
         *        when A.org='1002208180000506' then '广德'
         *        else '' end) as 组织,
         * A.DocNo as 单号,A3.Code as 项目号,
         * (case  when A.DocState='0' then '开立'
         *        when A.DocState='1' then '已审核'
         *        when A.DocState='2' then '开工'
         *        when A.DocState='3' then '完工'
         *        when A.DocState='4' then '核准中'
         *        ELSE''  end) as 状态,
         * A.StartDate as 计划开工日,
         * A.CompleteDate as 计划完工日,A2.Code as 料号,A2.name as 品名,A2.SPECS as 规格 , a.ProductQty as 生产数量,TotalCompleteQty as 完工数量
         * from MO_MO as A
         * left join CBO_ItemMaster as A2 on (A.ItemMaster = A2.ID)
         * left join CBO_Project as A3 on (A.Project = A3.ID)
         * where
         * A.MODocType != '1002306121624435'  --过滤内部研发项目
         * and A.IsWBSTask!=1                 --过滤现场施工任务
         * and A.DocState != '3'              --过滤完工状态的订单
         * ORDER BY A.CompleteDate
         */
        return R.ok();
        return R.ok(this.sql1);
    }
    public static String read(InputStream inputStream) {
        StringBuilder stringBuilder = new StringBuilder();
        byte[] buffer = new byte[1024];
        try {
            int bytesRead;
            while ((bytesRead = inputStream.read(buffer)) != -1) {
                stringBuilder.append(new String(buffer, 0, bytesRead));
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                inputStream.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return stringBuilder.toString();
    }
}
src/main/resources/application.yml
@@ -1,5 +1,5 @@
server:
  port: 9528
  port: 9529
  servlet:
#    context-path: /crm
    context-path:
src/main/resources/datav/sql/1.sql
New file
@@ -0,0 +1 @@
abc