Explorar o código

Merge branch 'dev' of liubing/wlyy2.0 into dev

liubing %!s(int64=2) %!d(string=hai) anos
pai
achega
c5ca946a21

+ 43 - 12
business/base-service/src/main/java/com/yihu/jw/dailyReport/service/DailyReportUploadService.java

@ -3785,6 +3785,8 @@ public class DailyReportUploadService {
        List<Map<String,Object>> doctorTypeHourList = jdbcTemplate.queryForList(doctorTypeSql);
        result.put("doctorTypeHourList",doctorTypeHourList);//按人员统计总用时与参与人数
        JSONObject bugObj = selectBugTotal(memberId,startDate,endDate,dept);
        result.putAll(bugObj);
        return result;
    }
@ -5056,23 +5058,40 @@ public class DailyReportUploadService {
    }
    public JSONObject select(String doctorId,String startDate,String endDate,String dept) throws Exception {
    public JSONObject selectBugTotal(String doctorId, String startDate, String endDate, String dept) throws Exception {
        String sqlCondition = "";
        if (StringUtils.isNoneBlank(dept)){
            sqlCondition = " SELECT d.zt_id as ztId FROM base_doctor d LEFT JOIN base_doctor_hospital dh ON d.id=dh.doctor_code where dh.dept_code='"+dept+"' ";
            sqlCondition = " SELECT d.zt_id as ztId FROM base_doctor d LEFT JOIN base_doctor_hospital dh ON d.id=dh.doctor_code where d.del=1 and dh.del=1 and dh.dept_code='"+dept+"' ";
        }
        if (!StringUtils.isNoneBlank(dept)&&StringUtils.isNoneBlank(doctorId)){
        if (StringUtils.isNoneBlank(doctorId)){
            sqlCondition = " SELECT d.zt_id as ztId FROM base_doctor d where d.id = '"+doctorId+"' ";
        }
        List<Map<String,Object>> mapList = jdbcTemplate.queryForList(sqlCondition);
        String str = "";
        if (mapList!=null&&mapList.size()!=0){
            for (Map<String,Object> map:mapList){
                str = "'"+map.get("ztId")+"',";
                str += "'"+map.get("ztId")+"',";
            }
        }
        str = str.substring(0,str.length()-1);
        String sql = "SELECT count(1) as total FROM zt_bug  where resolvedBy in ("+str+") ";
        sqlCondition = " ";
        if (StringUtils.isNotBlank(startDate)){
            sqlCondition += " and lastEditedDate>='"+startDate+"' ";
        }
        if (StringUtils.isNotBlank(endDate)){
            sqlCondition += " and lastEditedDate<='"+endDate+"' ";
        }
        String sql = "  select * from ( " +
                " select count(distinct id) total,'resolve' `status` from zt_bug " +
                " where  (resolvedBy in ("+str+")) or  " +
                " (assignedTo in ("+str+") and `status` in ('closed')) or " +
                " (closedBy in ("+str+")and `status` in ('closed')) " +
                "  and deleted='0' " +sqlCondition+
                " union ALL " +
                " select count(distinct id) total,'unresolved' `status` from zt_bug " +
                " where assignedTo in ("+str+") and `status` in ('active','resolved') and deleted='0' " +sqlCondition+
                " )A ";
        String url = "http://172.19.103.134:10023/ykyy/jdbcSQLQuery";
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
@ -5080,18 +5099,30 @@ public class DailyReportUploadService {
        String content = response.getContent();
        logger.info("response:"+content);
        JSONObject rs = JSON.parseObject(content);
        String total = "0";//总bug数;
        Long total = 0l;//总bug数;
        Long resolveBugTotal=0l;//已解决BUG数
        Long unresolvedBugTotal=0l;//待解决BUG数
        Integer status = rs.getInteger("status");
        if(status!=null&&status == 200){
            JSONArray array = rs.getJSONArray("detailModelList");
            if (array!=null&&array.size()!=0){
                JSONObject jsonObject = array.getJSONObject(0);
                total = jsonObject.getString("total");
                total = array.stream().mapToLong(t ->((JSONObject)t).get("total") == null ? 0 :Long.parseLong(((JSONObject)t).getString("total"))).sum();
                for (int i=0;i<array.size();i++){
                    JSONObject tmp = array.getJSONObject(i);
                    String bugStatus = tmp.getString("status");
                    Long statusTotal  =Long.parseLong(tmp.getString("total"));
                    if("resolve".equals(bugStatus)){
                        resolveBugTotal = statusTotal;
                    }else {
                        unresolvedBugTotal = statusTotal;
                    }
                }
            }
        }
        String yijiejueSql = "SELECT count(1) as total FROM zt_bug  where resolvedBy in ("+str+") ";
        JSONObject result = new JSONObject();
        result.put("bugtotal",total);
        result.put("resolveBugTotal",resolveBugTotal);
        result.put("unresolvedBugTotal",unresolvedBugTotal);
        return result;
    }
}

+ 5 - 1
gateway/ag-basic/src/main/java/com/yihu/jw/gateway/config/MultipartConfig.java

@ -2,6 +2,7 @@ package com.yihu.jw.gateway.config;
import com.yihu.jw.gateway.filter.CsrfFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.context.annotation.Bean;
@ -19,10 +20,13 @@ public class MultipartConfig {
    @Autowired
    CsrfFilter csrfFilter;
    @Value("${server.tomcat.basedir}")
    String tomcatLocation;
    @Bean
    MultipartConfigElement multipartConfigElement() {
        MultipartConfigFactory factory = new MultipartConfigFactory();
        String location = "/data/apps/temp";
        String location = tomcatLocation;
        File tmpFile = new File(location);
        if (!tmpFile.exists()) {
            tmpFile.mkdirs();

+ 1 - 1
gateway/ag-basic/src/main/resources/application.yml

@ -1,7 +1,7 @@
server:
  port: ${server.ag-basic-port}
  tomcat:
    basedir: /data/apps/temp
    basedir: /data1/apps/temp1
    max-http-form-post-size: -1
  max-http-header-size: 102400

+ 6 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/config/MultipartConfig.java

@ -1,5 +1,6 @@
package com.yihu.jw.base.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@ -12,10 +13,14 @@ import java.io.*;
@Configuration
public class MultipartConfig {
    @Value("${server.tomcat.basedir}")
    String tomcatLocation;
    @Bean
    MultipartConfigElement multipartConfigElement() {
        MultipartConfigFactory factory = new MultipartConfigFactory();
        String location = "/data/apps/temp2";
        String location = tomcatLocation;
        File tmpFile = new File(location);
        if (!tmpFile.exists()) {
            tmpFile.mkdirs();

+ 1 - 1
svr/svr-base/src/main/resources/application.yml

@ -2,7 +2,7 @@
server:
  port: ${server.svr-base-port}
  tomcat:
    basedir: /data/apps/temp2
    basedir: /data1/apps/temp2
express:
  sf_url: http://bsp-oisp.sf-express.com/bsp-oisp/sfexpressService
  sf_code: JKZL