diff --git a/src/main/java/com/weaver/seconddev/jcldoor/controller/HrmSelfHelpController.java b/src/main/java/com/weaver/seconddev/jcldoor/controller/HrmSelfHelpController.java index 8c3778b..fcf160e 100644 --- a/src/main/java/com/weaver/seconddev/jcldoor/controller/HrmSelfHelpController.java +++ b/src/main/java/com/weaver/seconddev/jcldoor/controller/HrmSelfHelpController.java @@ -8,6 +8,7 @@ import com.weaver.em.msg.api.rest.OaRest; import com.weaver.framework.remote.client.rest.RestClient; import com.weaver.framework.rpc.annotation.RpcReference; import com.weaver.seconddev.jcldoor.util.DatabaseUtils; +import com.weaver.seconddev.jcldoor.util.JucailinPortalUtils; import com.weaver.teams.blog.domain.RemoteBlogInfoService; import com.weaver.teams.client.doc.remote.DocClientService; import com.weaver.teams.domain.hr.RemoteHrKpiService; @@ -98,42 +99,6 @@ public class HrmSelfHelpController { } - - @GetMapping("/testSapi11") - @WeaPermission(publicPermission = true) - public WeaResult testSapi11(HttpServletRequest request){ - - //com.weaver.workrelate.performance.api.rest.RemotePerformanceService#queryFlowData - Map dataMap = new HashMap(); - dataMap.put("test","testSapi11"); - try { - SimpleEmployee employee = UserContext.getCurrentUser(); - log.error("employee:"+employee.getEmployeeId()); - - RequestListConditionApiEntity conditionEntity = new RequestListConditionApiEntity(); - log.error("444444"); - - WeaResult requestCountInfo = wflRequestListRest.getRequestCountByTabId(employee, RequestListInitDimensionTabEnum.MINE_FLOWALL.getTabid(), conditionEntity); - log.error("requestCountInfo:"+requestCountInfo.toString()); - int code = requestCountInfo.getCode(); - log.error("code:"+code); - - RequestCountInfoPAEntity requestCountInfoPAEntity = requestCountInfo.getData(); - - log.error("requestCountInfoPAEntity:"+requestCountInfoPAEntity); - long count = requestCountInfoPAEntity.getCount(); - log.error("count:"+count); - - dataMap.put("code",code); - dataMap.put("count",count); - } catch (Exception e) { - e.printStackTrace(); - log.error("testSapi11:"+e); - dataMap.put("count","-1"); - } - return WeaResult.success(dataMap); - } - @GetMapping("/testSapi13") @WeaPermission(publicPermission = true) public WeaResult testSapi13(HttpServletRequest request){ @@ -240,365 +205,365 @@ public class HrmSelfHelpController { } - @GetMapping("/testSapi30") - @WeaPermission(publicPermission = true) - public WeaResult testSapi30(HttpServletRequest request){ - Map dataMap = new HashMap(); - dataMap.put("test","testSapi30"); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - try { - - String employeeId = request.getParameter("employeeId"); - String startday = request.getParameter("startday"); - String endday = request.getParameter("endday"); - - Calendar calendar = Calendar.getInstance(); - int year = calendar.get(Calendar.YEAR); - - if(StringUtils.isBlank(startday)){ - startday = year+"-01-01"; - } - if(StringUtils.isBlank(endday)){ - endday = sdf.format(new Date()); - } - if(StringUtils.isBlank(employeeId)){ - employeeId = String.valueOf(UserContext.getCurrentEmployeeId()); - } - - dataMap.put("employeeId",employeeId); - dataMap.put("startday",startday); - dataMap.put("endday",endday); - - String groupId = "weaver-ebuilder-form-service"; - String sourceType = "LOGIC"; - - String sql =" select CONVERT(sum(cast(t1.htzje as decimal(18,2))),CHAR) as htzje," + - " CONVERT(sum(cast(t1.htyxje as decimal(18,2))),CHAR) as htyxje," + - " CONVERT(sum(cast(t1.sumsk as decimal(18,2))),CHAR) as sumsk " + - " from uf_jxhs_xmys t1 \n" + - " where t1.ysrq>=? and t1.ysrq<= ? " + - " and ( t1.qyjl = ? "+ - " or t1.qyjl in (select cid from eteams.EMP_LINK where RELATION in ('othersenior','senior') and pid= ?)\n" + - " or t1.ysry = ? \n" + - " or t1.ysry in (select cid from eteams.EMP_LINK where RELATION in ('othersenior','senior') and pid= ?)\n" + - " or t1.dqfzr = ? \n" + - " or t1.dqfzr in (select cid from eteams.EMP_LINK where RELATION in ('othersenior','senior') and pid= ?)\n" + - " or t1.tdjl = ?\n" + - " or t1.tdjl in (select cid from eteams.EMP_LINK where RELATION in ('othersenior','senior') and pid= ?)\n" + - " or t1.tdfzr = ? \n" + - " or t1.tdfzr in (select cid from eteams.EMP_LINK where RELATION in ('othersenior','senior') and pid= ?)\n" + - " or t1.jgfzr = ?\n" + - " or t1.jgfzr in (select cid from eteams.EMP_LINK where RELATION in ('othersenior','senior') and pid= ?)\n" + - " or t1.dqzj = ? \n" + - " or t1.dqzj in (select cid from eteams.EMP_LINK where RELATION in ('othersenior','senior') and pid= ?) " + - " ) " ; - - List sqlparam = new ArrayList(); - SqlParamEntity sqlParamEntity = new SqlParamEntity(); - sqlParamEntity.setParamType(SqlParamType.VARCHAR); - sqlParamEntity.setValue(startday); - sqlparam.add(sqlParamEntity); - - sqlParamEntity = new SqlParamEntity(); - sqlParamEntity.setParamType(SqlParamType.VARCHAR); - sqlParamEntity.setValue(endday); - sqlparam.add(sqlParamEntity); - - sqlParamEntity = new SqlParamEntity(); - sqlParamEntity.setParamType(SqlParamType.VARCHAR); - sqlParamEntity.setValue(employeeId); - sqlparam.add(sqlParamEntity); - - sqlParamEntity = new SqlParamEntity(); - sqlParamEntity.setParamType(SqlParamType.VARCHAR); - sqlParamEntity.setValue(employeeId); - sqlparam.add(sqlParamEntity); - - sqlParamEntity = new SqlParamEntity(); - sqlParamEntity.setParamType(SqlParamType.VARCHAR); - sqlParamEntity.setValue(employeeId); - sqlparam.add(sqlParamEntity); - - sqlParamEntity = new SqlParamEntity(); - sqlParamEntity.setParamType(SqlParamType.VARCHAR); - sqlParamEntity.setValue(employeeId); - sqlparam.add(sqlParamEntity); - - sqlParamEntity = new SqlParamEntity(); - sqlParamEntity.setParamType(SqlParamType.VARCHAR); - sqlParamEntity.setValue(employeeId); - sqlparam.add(sqlParamEntity); - - sqlParamEntity = new SqlParamEntity(); - sqlParamEntity.setParamType(SqlParamType.VARCHAR); - sqlParamEntity.setValue(employeeId); - sqlparam.add(sqlParamEntity); - - sqlParamEntity = new SqlParamEntity(); - sqlParamEntity.setParamType(SqlParamType.VARCHAR); - sqlParamEntity.setValue(employeeId); - sqlparam.add(sqlParamEntity); - - sqlParamEntity = new SqlParamEntity(); - sqlParamEntity.setParamType(SqlParamType.VARCHAR); - sqlParamEntity.setValue(employeeId); - sqlparam.add(sqlParamEntity); - - sqlParamEntity = new SqlParamEntity(); - sqlParamEntity.setParamType(SqlParamType.VARCHAR); - sqlParamEntity.setValue(employeeId); - sqlparam.add(sqlParamEntity); - - sqlParamEntity = new SqlParamEntity(); - sqlParamEntity.setParamType(SqlParamType.VARCHAR); - sqlParamEntity.setValue(employeeId); - sqlparam.add(sqlParamEntity); - - sqlParamEntity = new SqlParamEntity(); - sqlParamEntity.setParamType(SqlParamType.VARCHAR); - sqlParamEntity.setValue(employeeId); - sqlparam.add(sqlParamEntity); - - sqlParamEntity = new SqlParamEntity(); - sqlParamEntity.setParamType(SqlParamType.VARCHAR); - sqlParamEntity.setValue(employeeId); - sqlparam.add(sqlParamEntity); - - sqlParamEntity = new SqlParamEntity(); - sqlParamEntity.setParamType(SqlParamType.VARCHAR); - sqlParamEntity.setValue(employeeId); - sqlparam.add(sqlParamEntity); - - sqlParamEntity = new SqlParamEntity(); - sqlParamEntity.setParamType(SqlParamType.VARCHAR); - sqlParamEntity.setValue(employeeId); - sqlparam.add(sqlParamEntity); - - Map result = databaseUtils.executeForQuery(sourceType, groupId, sql,sqlparam); - List> recordList = databaseUtils.getDataSourceList(result); - dataMap.put("datas",recordList); - - } catch (Exception e) { - e.printStackTrace(); - log.error("testSapi30:"+e); - dataMap.put("count","-1"); - } - return WeaResult.success(dataMap); - } - - - @GetMapping("/testSapi31") - @WeaPermission(publicPermission = true) - public WeaResult testSapi31(HttpServletRequest request){ - Map dataMap = new HashMap(); - dataMap.put("test","testSapi31"); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - try { - - String startday = request.getParameter("startday"); - String endday = request.getParameter("endday"); - String employeeId = request.getParameter("employeeId"); - - Calendar calendar = Calendar.getInstance(); - int year = calendar.get(Calendar.YEAR); - - if(StringUtils.isBlank(startday)){ - startday = year+"-01-01"; - } - if(StringUtils.isBlank(endday)){ - endday = sdf.format(new Date()); - } - - if(StringUtils.isBlank(employeeId)){ - employeeId = String.valueOf(UserContext.getCurrentEmployeeId()); - } - - dataMap.put("employeeId",employeeId); - dataMap.put("startday",startday); - dataMap.put("endday",endday); - - String groupId = "weaver-ebuilder-form-service"; - String sourceType = "LOGIC"; - - String sql =" SELECT \n" + - " CONVERT(sum(cast(t1.skje as decimal(18,2))),CHAR) as skje,\n" + //收款金额 - " CONVERT(sum(cast(t1.xmskje as decimal(18,2))),CHAR) as xmskje,\n" + // 项目收款金额 - " CONVERT(sum(cast(t1.xsyxje as decimal(18,2))),CHAR) as xsyxje," + // 销售有效金额 - " CONVERT(sum(cast(t1.xsje as decimal(18,2))),CHAR) as xsje," + // 销售金额 - " CONVERT(sum(cast(t1.xmyxje as decimal(18,2))),CHAR) as xmyxje," + //项目有效金额 - " CONVERT(sum(cast(t1.xsjxhk as decimal(18,2))),CHAR) as xsjxhk," + //有效绩效回款 - " CONVERT(sum(cast(t1.sumsk as decimal(18,2))),CHAR) as sumsk," + //总收款金额 - " CONVERT(sum(cast(t1.sjjsk as decimal(18,2))),CHAR) as sjjsk," + //实际结算款 - " CONVERT(sum(cast(t1.skjs as decimal(18,2))),CHAR) as skjs " + //收款结算 - " FROM uf_jxhs_skmx t1\n" + - " LEFT JOIN uf_jxhs_zxhtzb t2 ON t1.hth = t2.hth AND t2.hth != '' AND t2.hth IS NOT NULL \n" + - " LEFT JOIN ebdf_physical_data epd on t1.id = epd.form_data_id and epd.delete_type = 0 \n" + - " WHERE t1.skje != 0 \n" + - " and t1.skje IS NOT NULL " + - " and t1.xshsny >= ? and t1.xshsny <= ? "+ - " and (" + - " ? IN ( 2, 27, 166, 10285, 11661, 300, 876, 3593, 1416, 1647, 1844,3044480226941419013,794508876297846787 ) \n" + - " or cast(t1.xsjl AS decimal(25,0)) in( \n" + - " SELECT cid AS id FROM eteams.emp_link WHERE pid = ? and RELATION in ('othersenior','senior') \n" + - " UNION " + - " SELECT id FROM eteams.employee WHERE id = ? " + - " )\n" + - " or cast(t1.kfry AS decimal(25,0)) in(\n" + - " SELECT cid AS id FROM eteams.emp_link WHERE pid = ? and RELATION in ('othersenior','senior') \n" + - " UNION " + - " SELECT id FROM eteams.employee WHERE id = ? " + - " )\n" + - " or cast(t1.qdjl AS decimal(25,0)) in(\n" + - " SELECT cid AS id FROM eteams.emp_link WHERE pid = ? and RELATION in ('othersenior','senior') \n" + - " UNION " + - " SELECT id FROM eteams.employee WHERE id = ? " + - " )\n" + - " or cast(t1.xmjl AS decimal(25,0)) in(\n" + - " SELECT cid AS id FROM eteams.emp_link WHERE pid = ? and RELATION in ('othersenior','senior') \n" + - " UNION " + - " SELECT id FROM eteams.employee WHERE id = ? " + - " )\n" + - " )\n" + - " order by t1.id " ; - - - List sqlparam = new ArrayList(); - SqlParamEntity sqlParamEntity = new SqlParamEntity(); - sqlParamEntity.setParamType(SqlParamType.VARCHAR); - sqlParamEntity.setValue(startday); - sqlparam.add(sqlParamEntity); - - sqlParamEntity = new SqlParamEntity(); - sqlParamEntity.setParamType(SqlParamType.VARCHAR); - sqlParamEntity.setValue(endday); - sqlparam.add(sqlParamEntity); - - sqlParamEntity = new SqlParamEntity(); - sqlParamEntity.setParamType(SqlParamType.VARCHAR); - sqlParamEntity.setValue(employeeId); - sqlparam.add(sqlParamEntity); - - sqlParamEntity = new SqlParamEntity(); - sqlParamEntity.setParamType(SqlParamType.VARCHAR); - sqlParamEntity.setValue(employeeId); - sqlparam.add(sqlParamEntity); - - sqlParamEntity = new SqlParamEntity(); - sqlParamEntity.setParamType(SqlParamType.VARCHAR); - sqlParamEntity.setValue(employeeId); - sqlparam.add(sqlParamEntity); - - sqlParamEntity = new SqlParamEntity(); - sqlParamEntity.setParamType(SqlParamType.VARCHAR); - sqlParamEntity.setValue(employeeId); - sqlparam.add(sqlParamEntity); - - sqlParamEntity = new SqlParamEntity(); - sqlParamEntity.setParamType(SqlParamType.VARCHAR); - sqlParamEntity.setValue(employeeId); - sqlparam.add(sqlParamEntity); - - sqlParamEntity = new SqlParamEntity(); - sqlParamEntity.setParamType(SqlParamType.VARCHAR); - sqlParamEntity.setValue(employeeId); - sqlparam.add(sqlParamEntity); - - sqlParamEntity = new SqlParamEntity(); - sqlParamEntity.setParamType(SqlParamType.VARCHAR); - sqlParamEntity.setValue(employeeId); - sqlparam.add(sqlParamEntity); - - sqlParamEntity = new SqlParamEntity(); - sqlParamEntity.setParamType(SqlParamType.VARCHAR); - sqlParamEntity.setValue(employeeId); - sqlparam.add(sqlParamEntity); - - sqlParamEntity = new SqlParamEntity(); - sqlParamEntity.setParamType(SqlParamType.VARCHAR); - sqlParamEntity.setValue(employeeId); - sqlparam.add(sqlParamEntity); - - log.error("sql:"+sql); - Map result = databaseUtils.executeForQuery(sourceType, groupId, sql,sqlparam); - List> recordList = databaseUtils.getDataSourceList(result); - dataMap.put("datas",recordList); - - } catch (Exception e) { - e.printStackTrace(); - log.error("testSapi30:"+e); - dataMap.put("count","-1"); - } - return WeaResult.success(dataMap); - } - - - /*** - * 本年沟通协作数 - * @param request - * @return - */ - @GetMapping("/testSapi51") - @WeaPermission(publicPermission = true) - public WeaResult testSapi51(HttpServletRequest request){ - log.error("getPortalWorkFlowInfo"); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - - String groupId = "weaver-cowork-service"; - String sourceType = "LOGIC"; - - Map dataMap = new HashMap(); - try{ - String startday = request.getParameter("startday"); - String endday = request.getParameter("endday"); - String employeeId = request.getParameter("employeeId"); - - Calendar calendar = Calendar.getInstance(); - int year = calendar.get(Calendar.YEAR); - - if(StringUtils.isBlank(startday)){ - startday = year+"-01-01"; - } - if(StringUtils.isBlank(endday)){ - endday = sdf.format(new Date()); - } - - if(StringUtils.isBlank(employeeId)){ - employeeId = String.valueOf(UserContext.getCurrentEmployeeId()); - } - - String sql =" select count(1) as cou from cw_content " + - " where CREATOR= ? " + - " and left(CREATE_TIME,10)>=? and left(CREATE_TIME,10) <= ? " ; - - List sqlparam = new ArrayList(); - SqlParamEntity sqlParamEntity = new SqlParamEntity(); - sqlParamEntity.setParamType(SqlParamType.VARCHAR); - sqlParamEntity.setValue(employeeId); - sqlparam.add(sqlParamEntity); - - sqlParamEntity = new SqlParamEntity(); - sqlParamEntity.setParamType(SqlParamType.VARCHAR); - sqlParamEntity.setValue(startday); - sqlparam.add(sqlParamEntity); - - sqlParamEntity = new SqlParamEntity(); - sqlParamEntity.setParamType(SqlParamType.VARCHAR); - sqlParamEntity.setValue(endday); - sqlparam.add(sqlParamEntity); +// @GetMapping("/testSapi30") +// @WeaPermission(publicPermission = true) +// public WeaResult testSapi30(HttpServletRequest request){ +// Map dataMap = new HashMap(); +// dataMap.put("test","testSapi30"); +// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); +// try { +// +// String employeeId = request.getParameter("employeeId"); +// String startday = request.getParameter("startday"); +// String endday = request.getParameter("endday"); +// +// Calendar calendar = Calendar.getInstance(); +// int year = calendar.get(Calendar.YEAR); +// +// if(StringUtils.isBlank(startday)){ +// startday = year+"-01-01"; +// } +// if(StringUtils.isBlank(endday)){ +// endday = sdf.format(new Date()); +// } +// if(StringUtils.isBlank(employeeId)){ +// employeeId = String.valueOf(UserContext.getCurrentEmployeeId()); +// } +// +// dataMap.put("employeeId",employeeId); +// dataMap.put("startday",startday); +// dataMap.put("endday",endday); +// +// String groupId = "weaver-ebuilder-form-service"; +// String sourceType = "LOGIC"; +// +// String sql =" select CONVERT(sum(cast(t1.htzje as decimal(18,2))),CHAR) as htzje," + +// " CONVERT(sum(cast(t1.htyxje as decimal(18,2))),CHAR) as htyxje," + +// " CONVERT(sum(cast(t1.sumsk as decimal(18,2))),CHAR) as sumsk " + +// " from uf_jxhs_xmys t1 \n" + +// " where t1.ysrq>=? and t1.ysrq<= ? " + +// " and ( t1.qyjl = ? "+ +// " or t1.qyjl in (select cid from eteams.EMP_LINK where RELATION in ('othersenior','senior') and pid= ?)\n" + +// " or t1.ysry = ? \n" + +// " or t1.ysry in (select cid from eteams.EMP_LINK where RELATION in ('othersenior','senior') and pid= ?)\n" + +// " or t1.dqfzr = ? \n" + +// " or t1.dqfzr in (select cid from eteams.EMP_LINK where RELATION in ('othersenior','senior') and pid= ?)\n" + +// " or t1.tdjl = ?\n" + +// " or t1.tdjl in (select cid from eteams.EMP_LINK where RELATION in ('othersenior','senior') and pid= ?)\n" + +// " or t1.tdfzr = ? \n" + +// " or t1.tdfzr in (select cid from eteams.EMP_LINK where RELATION in ('othersenior','senior') and pid= ?)\n" + +// " or t1.jgfzr = ?\n" + +// " or t1.jgfzr in (select cid from eteams.EMP_LINK where RELATION in ('othersenior','senior') and pid= ?)\n" + +// " or t1.dqzj = ? \n" + +// " or t1.dqzj in (select cid from eteams.EMP_LINK where RELATION in ('othersenior','senior') and pid= ?) " + +// " ) " ; +// +// List sqlparam = new ArrayList(); +// SqlParamEntity sqlParamEntity = new SqlParamEntity(); +// sqlParamEntity.setParamType(SqlParamType.VARCHAR); +// sqlParamEntity.setValue(startday); +// sqlparam.add(sqlParamEntity); +// +// sqlParamEntity = new SqlParamEntity(); +// sqlParamEntity.setParamType(SqlParamType.VARCHAR); +// sqlParamEntity.setValue(endday); +// sqlparam.add(sqlParamEntity); +// +// sqlParamEntity = new SqlParamEntity(); +// sqlParamEntity.setParamType(SqlParamType.VARCHAR); +// sqlParamEntity.setValue(employeeId); +// sqlparam.add(sqlParamEntity); +// +// sqlParamEntity = new SqlParamEntity(); +// sqlParamEntity.setParamType(SqlParamType.VARCHAR); +// sqlParamEntity.setValue(employeeId); +// sqlparam.add(sqlParamEntity); +// +// sqlParamEntity = new SqlParamEntity(); +// sqlParamEntity.setParamType(SqlParamType.VARCHAR); +// sqlParamEntity.setValue(employeeId); +// sqlparam.add(sqlParamEntity); +// +// sqlParamEntity = new SqlParamEntity(); +// sqlParamEntity.setParamType(SqlParamType.VARCHAR); +// sqlParamEntity.setValue(employeeId); +// sqlparam.add(sqlParamEntity); +// +// sqlParamEntity = new SqlParamEntity(); +// sqlParamEntity.setParamType(SqlParamType.VARCHAR); +// sqlParamEntity.setValue(employeeId); +// sqlparam.add(sqlParamEntity); +// +// sqlParamEntity = new SqlParamEntity(); +// sqlParamEntity.setParamType(SqlParamType.VARCHAR); +// sqlParamEntity.setValue(employeeId); +// sqlparam.add(sqlParamEntity); +// +// sqlParamEntity = new SqlParamEntity(); +// sqlParamEntity.setParamType(SqlParamType.VARCHAR); +// sqlParamEntity.setValue(employeeId); +// sqlparam.add(sqlParamEntity); +// +// sqlParamEntity = new SqlParamEntity(); +// sqlParamEntity.setParamType(SqlParamType.VARCHAR); +// sqlParamEntity.setValue(employeeId); +// sqlparam.add(sqlParamEntity); +// +// sqlParamEntity = new SqlParamEntity(); +// sqlParamEntity.setParamType(SqlParamType.VARCHAR); +// sqlParamEntity.setValue(employeeId); +// sqlparam.add(sqlParamEntity); +// +// sqlParamEntity = new SqlParamEntity(); +// sqlParamEntity.setParamType(SqlParamType.VARCHAR); +// sqlParamEntity.setValue(employeeId); +// sqlparam.add(sqlParamEntity); +// +// sqlParamEntity = new SqlParamEntity(); +// sqlParamEntity.setParamType(SqlParamType.VARCHAR); +// sqlParamEntity.setValue(employeeId); +// sqlparam.add(sqlParamEntity); +// +// sqlParamEntity = new SqlParamEntity(); +// sqlParamEntity.setParamType(SqlParamType.VARCHAR); +// sqlParamEntity.setValue(employeeId); +// sqlparam.add(sqlParamEntity); +// +// sqlParamEntity = new SqlParamEntity(); +// sqlParamEntity.setParamType(SqlParamType.VARCHAR); +// sqlParamEntity.setValue(employeeId); +// sqlparam.add(sqlParamEntity); +// +// sqlParamEntity = new SqlParamEntity(); +// sqlParamEntity.setParamType(SqlParamType.VARCHAR); +// sqlParamEntity.setValue(employeeId); +// sqlparam.add(sqlParamEntity); +// +// Map result = databaseUtils.executeForQuery(sourceType, groupId, sql,sqlparam); +// List> recordList = databaseUtils.getDataSourceList(result); +// dataMap.put("datas",recordList); +// +// } catch (Exception e) { +// e.printStackTrace(); +// log.error("testSapi30:"+e); +// dataMap.put("count","-1"); +// } +// return WeaResult.success(dataMap); +// } +// +// +// @GetMapping("/testSapi31") +// @WeaPermission(publicPermission = true) +// public WeaResult testSapi31(HttpServletRequest request){ +// Map dataMap = new HashMap(); +// dataMap.put("test","testSapi31"); +// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); +// try { +// +// String startday = request.getParameter("startday"); +// String endday = request.getParameter("endday"); +// String employeeId = request.getParameter("employeeId"); +// +// Calendar calendar = Calendar.getInstance(); +// int year = calendar.get(Calendar.YEAR); +// +// if(StringUtils.isBlank(startday)){ +// startday = year+"-01-01"; +// } +// if(StringUtils.isBlank(endday)){ +// endday = sdf.format(new Date()); +// } +// +// if(StringUtils.isBlank(employeeId)){ +// employeeId = String.valueOf(UserContext.getCurrentEmployeeId()); +// } +// +// dataMap.put("employeeId",employeeId); +// dataMap.put("startday",startday); +// dataMap.put("endday",endday); +// +// String groupId = "weaver-ebuilder-form-service"; +// String sourceType = "LOGIC"; +// +// String sql =" SELECT \n" + +// " CONVERT(sum(cast(t1.skje as decimal(18,2))),CHAR) as skje,\n" + //收款金额 +// " CONVERT(sum(cast(t1.xmskje as decimal(18,2))),CHAR) as xmskje,\n" + // 项目收款金额 +// " CONVERT(sum(cast(t1.xsyxje as decimal(18,2))),CHAR) as xsyxje," + // 销售有效金额 +// " CONVERT(sum(cast(t1.xsje as decimal(18,2))),CHAR) as xsje," + // 销售金额 +// " CONVERT(sum(cast(t1.xmyxje as decimal(18,2))),CHAR) as xmyxje," + //项目有效金额 +// " CONVERT(sum(cast(t1.xsjxhk as decimal(18,2))),CHAR) as xsjxhk," + //有效绩效回款 +// " CONVERT(sum(cast(t1.sumsk as decimal(18,2))),CHAR) as sumsk," + //总收款金额 +// " CONVERT(sum(cast(t1.sjjsk as decimal(18,2))),CHAR) as sjjsk," + //实际结算款 +// " CONVERT(sum(cast(t1.skjs as decimal(18,2))),CHAR) as skjs " + //收款结算 +// " FROM uf_jxhs_skmx t1\n" + +// " LEFT JOIN uf_jxhs_zxhtzb t2 ON t1.hth = t2.hth AND t2.hth != '' AND t2.hth IS NOT NULL \n" + +// " LEFT JOIN ebdf_physical_data epd on t1.id = epd.form_data_id and epd.delete_type = 0 \n" + +// " WHERE t1.skje != 0 \n" + +// " and t1.skje IS NOT NULL " + +// " and t1.xshsny >= ? and t1.xshsny <= ? "+ +// " and (" + +// " ? IN ( 2, 27, 166, 10285, 11661, 300, 876, 3593, 1416, 1647, 1844,3044480226941419013,794508876297846787 ) \n" + +// " or cast(t1.xsjl AS decimal(25,0)) in( \n" + +// " SELECT cid AS id FROM eteams.emp_link WHERE pid = ? and RELATION in ('othersenior','senior') \n" + +// " UNION " + +// " SELECT id FROM eteams.employee WHERE id = ? " + +// " )\n" + +// " or cast(t1.kfry AS decimal(25,0)) in(\n" + +// " SELECT cid AS id FROM eteams.emp_link WHERE pid = ? and RELATION in ('othersenior','senior') \n" + +// " UNION " + +// " SELECT id FROM eteams.employee WHERE id = ? " + +// " )\n" + +// " or cast(t1.qdjl AS decimal(25,0)) in(\n" + +// " SELECT cid AS id FROM eteams.emp_link WHERE pid = ? and RELATION in ('othersenior','senior') \n" + +// " UNION " + +// " SELECT id FROM eteams.employee WHERE id = ? " + +// " )\n" + +// " or cast(t1.xmjl AS decimal(25,0)) in(\n" + +// " SELECT cid AS id FROM eteams.emp_link WHERE pid = ? and RELATION in ('othersenior','senior') \n" + +// " UNION " + +// " SELECT id FROM eteams.employee WHERE id = ? " + +// " )\n" + +// " )\n" + +// " order by t1.id " ; +// +// +// List sqlparam = new ArrayList(); +// SqlParamEntity sqlParamEntity = new SqlParamEntity(); +// sqlParamEntity.setParamType(SqlParamType.VARCHAR); +// sqlParamEntity.setValue(startday); +// sqlparam.add(sqlParamEntity); +// +// sqlParamEntity = new SqlParamEntity(); +// sqlParamEntity.setParamType(SqlParamType.VARCHAR); +// sqlParamEntity.setValue(endday); +// sqlparam.add(sqlParamEntity); +// +// sqlParamEntity = new SqlParamEntity(); +// sqlParamEntity.setParamType(SqlParamType.VARCHAR); +// sqlParamEntity.setValue(employeeId); +// sqlparam.add(sqlParamEntity); +// +// sqlParamEntity = new SqlParamEntity(); +// sqlParamEntity.setParamType(SqlParamType.VARCHAR); +// sqlParamEntity.setValue(employeeId); +// sqlparam.add(sqlParamEntity); +// +// sqlParamEntity = new SqlParamEntity(); +// sqlParamEntity.setParamType(SqlParamType.VARCHAR); +// sqlParamEntity.setValue(employeeId); +// sqlparam.add(sqlParamEntity); +// +// sqlParamEntity = new SqlParamEntity(); +// sqlParamEntity.setParamType(SqlParamType.VARCHAR); +// sqlParamEntity.setValue(employeeId); +// sqlparam.add(sqlParamEntity); +// +// sqlParamEntity = new SqlParamEntity(); +// sqlParamEntity.setParamType(SqlParamType.VARCHAR); +// sqlParamEntity.setValue(employeeId); +// sqlparam.add(sqlParamEntity); +// +// sqlParamEntity = new SqlParamEntity(); +// sqlParamEntity.setParamType(SqlParamType.VARCHAR); +// sqlParamEntity.setValue(employeeId); +// sqlparam.add(sqlParamEntity); +// +// sqlParamEntity = new SqlParamEntity(); +// sqlParamEntity.setParamType(SqlParamType.VARCHAR); +// sqlParamEntity.setValue(employeeId); +// sqlparam.add(sqlParamEntity); +// +// sqlParamEntity = new SqlParamEntity(); +// sqlParamEntity.setParamType(SqlParamType.VARCHAR); +// sqlParamEntity.setValue(employeeId); +// sqlparam.add(sqlParamEntity); +// +// sqlParamEntity = new SqlParamEntity(); +// sqlParamEntity.setParamType(SqlParamType.VARCHAR); +// sqlParamEntity.setValue(employeeId); +// sqlparam.add(sqlParamEntity); +// +// log.error("sql:"+sql); +// Map result = databaseUtils.executeForQuery(sourceType, groupId, sql,sqlparam); +// List> recordList = databaseUtils.getDataSourceList(result); +// dataMap.put("datas",recordList); +// +// } catch (Exception e) { +// e.printStackTrace(); +// log.error("testSapi30:"+e); +// dataMap.put("count","-1"); +// } +// return WeaResult.success(dataMap); +// } - log.error("sql:"+sql); - Map result = databaseUtils.executeForQuery(sourceType, groupId, sql,sqlparam); - List> recordList = databaseUtils.getDataSourceList(result); - if(recordList.size()>0){ - dataMap = recordList.get(0); - } - }catch (Exception e){ - log.error("testSapi51-Exception:"+e.getMessage()); - return WeaResult.fail(500,"程序执行异常"); - } - return WeaResult.success(dataMap); - } +// /*** +// * 本年沟通协作数 +// * @param request +// * @return +// */ +// @GetMapping("/testSapi51") +// @WeaPermission(publicPermission = true) +// public WeaResult testSapi51(HttpServletRequest request){ +// log.error("getPortalWorkFlowInfo"); +// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); +// +// String groupId = "weaver-cowork-service"; +// String sourceType = "LOGIC"; +// +// Map dataMap = new HashMap(); +// try{ +// String startday = request.getParameter("startday"); +// String endday = request.getParameter("endday"); +// String employeeId = request.getParameter("employeeId"); +// +// Calendar calendar = Calendar.getInstance(); +// int year = calendar.get(Calendar.YEAR); +// +// if(StringUtils.isBlank(startday)){ +// startday = year+"-01-01"; +// } +// if(StringUtils.isBlank(endday)){ +// endday = sdf.format(new Date()); +// } +// +// if(StringUtils.isBlank(employeeId)){ +// employeeId = String.valueOf(UserContext.getCurrentEmployeeId()); +// } +// +// String sql =" select count(1) as cou from cw_content " + +// " where CREATOR= ? " + +// " and left(CREATE_TIME,10)>=? and left(CREATE_TIME,10) <= ? " ; +// +// List sqlparam = new ArrayList(); +// SqlParamEntity sqlParamEntity = new SqlParamEntity(); +// sqlParamEntity.setParamType(SqlParamType.VARCHAR); +// sqlParamEntity.setValue(employeeId); +// sqlparam.add(sqlParamEntity); +// +// sqlParamEntity = new SqlParamEntity(); +// sqlParamEntity.setParamType(SqlParamType.VARCHAR); +// sqlParamEntity.setValue(startday); +// sqlparam.add(sqlParamEntity); +// +// sqlParamEntity = new SqlParamEntity(); +// sqlParamEntity.setParamType(SqlParamType.VARCHAR); +// sqlParamEntity.setValue(endday); +// sqlparam.add(sqlParamEntity); +// +// log.error("sql:"+sql); +// +// Map result = databaseUtils.executeForQuery(sourceType, groupId, sql,sqlparam); +// List> recordList = databaseUtils.getDataSourceList(result); +// if(recordList.size()>0){ +// dataMap = recordList.get(0); +// } +// }catch (Exception e){ +// log.error("testSapi51-Exception:"+e.getMessage()); +// return WeaResult.fail(500,"程序执行异常"); +// } +// return WeaResult.success(dataMap); +// } @@ -665,23 +630,23 @@ public class HrmSelfHelpController { String startday = request.getParameter("startday"); String endday = request.getParameter("endday"); - DateTimeFormatter format = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + DateTimeFormatter format = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + String defineTime = " 00:00:01"; Long count = 0L ; try{ RequestListConditionApiEntity conditionEntity = new RequestListConditionApiEntity(); SimpleEmployee employee = UserContext.getCurrentUser(); log.error("employee--:"+employee.getEmployeeId()); - LocalDateTime startDateTime = LocalDateTime.of(LocalDate.from(LocalDateTime.now().with(TemporalAdjusters.firstDayOfYear())), LocalTime.MIN); if(StringUtils.isNotBlank(startday)){ - startDateTime = LocalDateTime.parse(startday, format); + startDateTime = LocalDateTime.parse(startday+defineTime, format); } LocalDateTime endDateTime = LocalDateTime.now(); if(StringUtils.isNotBlank(endday)){ - endDateTime = LocalDateTime.parse(endday, format); + endDateTime = LocalDateTime.parse(endday+defineTime, format); } conditionEntity.setCusOperateDateStart(startDateTime); conditionEntity.setCusOperateDateEnd(endDateTime); @@ -697,7 +662,6 @@ public class HrmSelfHelpController { count = requestCountInfoPAEntity.getCount(); log.error("count--:"+count); } - }catch (Exception e){ log.error("getWorkFlowInfo-Exception:"+e.getMessage()); return WeaResult.fail(500,"程序执行异常"); @@ -710,225 +674,418 @@ public class HrmSelfHelpController { * @param request * @return */ - @GetMapping("/testSapi70") +// @GetMapping("/testSapi70") +// @WeaPermission(publicPermission = true) +// public WeaResult testSapi70(HttpServletRequest request){ +// +// log.error("testSapi70"); +// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); +// +// String groupId = "weaver-workflow-report-serviceworkflowreport"; +// String sourceType = "LOGIC"; +// +// +// Map dataMap = new HashMap(); +// String devcou = "0" ; +// try{ +// String startday = request.getParameter("startday"); +// String endday = request.getParameter("endday"); +// String employeeId = request.getParameter("employeeId"); +// +// Calendar calendar = Calendar.getInstance(); +// int year = calendar.get(Calendar.YEAR); +// +// if(StringUtils.isBlank(startday)){ +// startday = year+"-01-01"; +// } +// if(StringUtils.isBlank(endday)){ +// endday = sdf.format(new Date()); +// } +// +// if(StringUtils.isBlank(employeeId)){ +// employeeId = String.valueOf(UserContext.getCurrentEmployeeId()); +// } +// +// if(StringUtils.isNotBlank(employeeId)) +// { +// String dataSql =" select ifnull(sum(d.integer2),0) as devcou \n" + +// " from wfc_form_data l\n" + +// " inner join fto_62 d on d.id = l.dataid\n" + +// " inner join wfc_requestbase p on p.requestid = l.requestid\n" + +// " where d.multiresource5= ? \n" + +// " and d.date2 >= ? "+ +// " and d.date2 <= ? "+ +// " and d.tenant_key='"+tenant_key+"'\n" + +// " and d.is_delete='0'\n" + +// " and l.tenant_key='"+tenant_key+"'\n" + +// " and l.delete_type=0\n" + +// " and p.tenant_key='"+tenant_key+"'\n" + +// " and p.delete_type=0\n" + +// " order by d.id desc " ; +// +// List sqlparam = new ArrayList(); +// SqlParamEntity sqlParamEntity = new SqlParamEntity(); +// sqlParamEntity.setParamType(SqlParamType.VARCHAR); +// sqlParamEntity.setValue(employeeId); +// sqlparam.add(sqlParamEntity); +// +// sqlParamEntity = new SqlParamEntity(); +// sqlParamEntity.setParamType(SqlParamType.VARCHAR); +// sqlParamEntity.setValue(startday); +// sqlparam.add(sqlParamEntity); +// +// sqlParamEntity = new SqlParamEntity(); +// sqlParamEntity.setParamType(SqlParamType.VARCHAR); +// sqlParamEntity.setValue(endday); +// sqlparam.add(sqlParamEntity); +// +// log.info("dataSql:"+dataSql); +// +// Map result = databaseUtils.executeForQuery(sourceType, groupId, dataSql,sqlparam); +// List> recordList = databaseUtils.getDataSourceList(result); +// if(CollectionUtils.isNotEmpty(recordList)) { +// devcou = String.valueOf(recordList.get(0).get("devcou")); +// } +// } +// +// }catch (Exception e){ +// log.error("testSapi51-Exception:"+e.getMessage()); +// return WeaResult.fail(500,"程序执行异常"); +// } +// return WeaResult.success(devcou); +// +// } + + + + /*** + * 本年开发人天 + * @param request + * @return + */ +// @GetMapping("/testSapi71") +// @WeaPermission(publicPermission = true) +// public WeaResult testSapi71(HttpServletRequest request){ +// +// log.error("testSapi71"); +// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); +// +// String groupId = "weaver-workflow-report-serviceworkflowreport"; +// String sourceType = "LOGIC"; +// +// Map dataMap = new HashMap(); +// String devcou = "0" ; +// try{ +// String startday = request.getParameter("startday"); +// String endday = request.getParameter("endday"); +// String employeeId = request.getParameter("employeeId"); +// +// Calendar calendar = Calendar.getInstance(); +// int year = calendar.get(Calendar.YEAR); +// +// if(StringUtils.isBlank(startday)){ +// startday = year+"-01-01"; +// } +// if(StringUtils.isBlank(endday)){ +// endday = sdf.format(new Date()); +// } +// +// if(StringUtils.isBlank(employeeId)){ +// employeeId = String.valueOf(UserContext.getCurrentEmployeeId()); +// } +// +// if(StringUtils.isNotBlank(employeeId)) +// { +// String dataSql =" select count(1) as devcou \n" + +// " from wfc_form_data l\n" + +// " inner join fto_83 d on d.id = l.dataid\n" + +// " inner join wfc_requestbase p on p.requestid = l.requestid\n" + +// " where d.mutiresource= ?\n" + +// " and d.xsjfrq >= ? "+ +// " and d.xsjfrq <=? "+ +// " and d.tenant_key='"+tenant_key+"'\n" + +// " and d.is_delete='0'\n" + +// " and l.tenant_key='"+tenant_key+"'\n" + +// " and l.delete_type=0\n" + +// " and p.tenant_key='"+tenant_key+"'\n" + +// " and p.delete_type=0\n" + +// " order by d.id desc " ; +// +// List sqlparam = new ArrayList(); +// SqlParamEntity sqlParamEntity = new SqlParamEntity(); +// sqlParamEntity.setParamType(SqlParamType.VARCHAR); +// sqlParamEntity.setValue(employeeId); +// sqlparam.add(sqlParamEntity); +// +// sqlParamEntity = new SqlParamEntity(); +// sqlParamEntity.setParamType(SqlParamType.VARCHAR); +// sqlParamEntity.setValue(startday); +// sqlparam.add(sqlParamEntity); +// +// sqlParamEntity = new SqlParamEntity(); +// sqlParamEntity.setParamType(SqlParamType.VARCHAR); +// sqlParamEntity.setValue(endday); +// sqlparam.add(sqlParamEntity); +// +// log.info("dataSql:"+dataSql); +// +// Map result = databaseUtils.executeForQuery(sourceType, groupId, dataSql,sqlparam); +// List> recordList = databaseUtils.getDataSourceList(result); +// if(CollectionUtils.isNotEmpty(recordList)) { +// devcou = String.valueOf(recordList.get(0).get("devcou")); +// } +// } +// +// }catch (Exception e){ +// log.error("testSapi51-Exception:"+e.getMessage()); +// return WeaResult.fail(500,"程序执行异常"); +// } +// return WeaResult.success(devcou); +// } + + +// @GetMapping("/testSapi110") +// @WeaPermission(publicPermission = true) +// public WeaResult testSapi110(HttpServletRequest request){ +// +// Map dataMap = new HashMap(); +// dataMap.put("test","testSapi110"); +// try { +// SimpleEmployee employee = UserContext.getCurrentUser(); +// log.error("employee:"+employee.getEmployeeId()); +// +// RequestListConditionApiEntity conditionEntity = new RequestListConditionApiEntity(); +// WeaResult requestCountInfo = wflRequestListRest.getRequestCountByTabId(employee, RequestListInitDimensionTabEnum.MINE_FLOWALL.getTabid(), conditionEntity); +// log.error("testSapi110:"+requestCountInfo.toString()); +// int code = requestCountInfo.getCode(); +// log.error("testSapi110:"+code); +// RequestCountInfoPAEntity requestCountInfoPAEntity = requestCountInfo.getData(); +// log.error("testSapi110:"+requestCountInfoPAEntity.toString()); +// dataMap.put("data",requestCountInfoPAEntity); +// } catch (Exception e) { +// e.printStackTrace(); +// log.error("testSapi11:"+e); +// dataMap.put("count","-1"); +// } +// return WeaResult.success(dataMap); +// } +// +// +// @GetMapping("/testSapi112") +// @WeaPermission(publicPermission = true) +// public WeaResult testSapi112(HttpServletRequest request){ +// +// SimpleEmployee employee = UserContext.getCurrentUser(); +// log.error("employee:"+employee.getEmployeeId()); +// RequestListConditionApiEntity conditionEntity = new RequestListConditionApiEntity(); +// WeaResult requestCountInfo = wflRequestListRest.getRequestCountByTabId(employee, RequestListInitDimensionTabEnum.MINE_FLOWALL.getTabid(), conditionEntity); +// log.error("testSapi110:"+requestCountInfo.toString()); +// return requestCountInfo; +// } +// +// @GetMapping("/testSapi113") +// @WeaPermission(publicPermission = true) +// public WeaResult testSapi113(HttpServletRequest request){ +// +// SimpleEmployee employee = UserContext.getCurrentUser(); +// log.error("employee:"+employee.getEmployeeId()); +// RequestListConditionApiEntity conditionEntity = new RequestListConditionApiEntity(); +// WeaResult requestCountInfo = wflRequestListRest.getRequestCountByTabId(employee, RequestListInitDimensionTabEnum.DONE_FLOWALL.getTabid(), conditionEntity); +// log.error("testSapi110:"+requestCountInfo.toString()); +// return requestCountInfo; +// } + + + @GetMapping("/testSapi80") @WeaPermission(publicPermission = true) - public WeaResult testSapi70(HttpServletRequest request){ + public WeaResult testSapi80(HttpServletRequest request){ - log.error("testSapi70"); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + log.error("testSapi80"); - String groupId = "weaver-workflow-report-serviceworkflowreport"; - String sourceType = "LOGIC"; + JucailinPortalUtils jucailinPortalUtils = new JucailinPortalUtils(); + String pkey = "uf_zzfwcsh.taby.fieldId"; + String field_id = jucailinPortalUtils.getUfPropData(pkey,tenant_key); + log.error("field_id:"+field_id); + String groupId = "weaver-ebuilder-form-service"; + String sourceType = "LOGIC"; - Map dataMap = new HashMap(); - String devcou = "0" ; - try{ - String startday = request.getParameter("startday"); - String endday = request.getParameter("endday"); - String employeeId = request.getParameter("employeeId"); + String employeeId = request.getParameter("employeeId"); - Calendar calendar = Calendar.getInstance(); - int year = calendar.get(Calendar.YEAR); + if(StringUtils.isBlank(employeeId)){ + employeeId = String.valueOf(UserContext.getCurrentEmployeeId()); + } - if(StringUtils.isBlank(startday)){ - startday = year+"-01-01"; - } - if(StringUtils.isBlank(endday)){ - endday = sdf.format(new Date()); - } + List> dataList = new ArrayList>(); + try{ + String sql = " select distinct taby from uf_zzfwrkpz where ry=? and qy is not null and taby is not null and delete_type=0 and tenant_key ='"+tenant_key+"'"; + log.error("sql:"+sql); - if(StringUtils.isBlank(employeeId)){ - employeeId = String.valueOf(UserContext.getCurrentEmployeeId()); - } + List sqlparam = new ArrayList(); + SqlParamEntity sqlParamEntity = new SqlParamEntity(); + sqlParamEntity.setParamType(SqlParamType.VARCHAR); + sqlParamEntity.setValue(employeeId); + sqlparam.add(sqlParamEntity); - if(StringUtils.isNotBlank(employeeId)) - { - String dataSql =" select ifnull(sum(d.integer2),0) as devcou \n" + - " from wfc_form_data l\n" + - " inner join fto_62 d on d.id = l.dataid\n" + - " inner join wfc_requestbase p on p.requestid = l.requestid\n" + - " where d.multiresource5= ? \n" + - " and d.date2 >= ? "+ - " and d.date2 <= ? "+ - " and d.tenant_key='"+tenant_key+"'\n" + - " and d.is_delete='0'\n" + - " and l.tenant_key='"+tenant_key+"'\n" + - " and l.delete_type=0\n" + - " and p.tenant_key='"+tenant_key+"'\n" + - " and p.delete_type=0\n" + - " order by d.id desc " ; - - List sqlparam = new ArrayList(); - SqlParamEntity sqlParamEntity = new SqlParamEntity(); - sqlParamEntity.setParamType(SqlParamType.VARCHAR); - sqlParamEntity.setValue(employeeId); - sqlparam.add(sqlParamEntity); - - sqlParamEntity = new SqlParamEntity(); - sqlParamEntity.setParamType(SqlParamType.VARCHAR); - sqlParamEntity.setValue(startday); - sqlparam.add(sqlParamEntity); - - sqlParamEntity = new SqlParamEntity(); - sqlParamEntity.setParamType(SqlParamType.VARCHAR); - sqlParamEntity.setValue(endday); - sqlparam.add(sqlParamEntity); - - log.info("dataSql:"+dataSql); - - Map result = databaseUtils.executeForQuery(sourceType, groupId, dataSql,sqlparam); - List> recordList = databaseUtils.getDataSourceList(result); - if(CollectionUtils.isNotEmpty(recordList)) { - devcou = String.valueOf(recordList.get(0).get("devcou")); - } + Map result = databaseUtils.executeForQuery(sourceType, groupId, sql,sqlparam); + List> recordList = databaseUtils.getDataSourceList(result); + if(recordList.size()>0){ + // /api/file/preview?type=redirect&imgFormat=small&fileId=977697615197618177&module=ebuilderform&authModule=ebuilderform&source=form&fieldId=977686869110833154&customParam=%7B%22dataId%22%3A%22977697666574729218%22%7D&refId=977697666574729218&folderId=8120831157448215424 + dataList = getCustomeServiceData(groupId,sourceType,field_id,recordList,employeeId); + }else{ + dataList = getDefaultServiceData(groupId,sourceType,field_id); } - }catch (Exception e){ log.error("testSapi51-Exception:"+e.getMessage()); return WeaResult.fail(500,"程序执行异常"); } - return WeaResult.success(devcou); - + return WeaResult.success(dataList); } - /*** - * 本年开发人天 - * @param request + * + * @param groupId + * @param sourceType * @return */ - @GetMapping("/testSapi71") - @WeaPermission(publicPermission = true) - public WeaResult testSapi71(HttpServletRequest request){ - - log.error("testSapi71"); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - - String groupId = "weaver-workflow-report-serviceworkflowreport"; - String sourceType = "LOGIC"; + public Map getCustomServiceTypeName(String groupId,String sourceType,String employeeId){ + + Map optionMap = new HashMap(); + String sql = " select id,tabymmc from uf_zzfwrktaby where qy is not null and ry=? and delete_type=0 and tenant_key = '"+tenant_key+"'"; + log.error("getCustomServiceTypeName-sql:"+sql); + + List sqlparam = new ArrayList(); + SqlParamEntity sqlParamEntity = new SqlParamEntity(); + sqlParamEntity.setParamType(SqlParamType.VARCHAR); + sqlParamEntity.setValue(employeeId); + sqlparam.add(sqlParamEntity); + + Map result = databaseUtils.executeForQuery(sourceType, groupId, sql,sqlparam); + + List> recordList = databaseUtils.getDataSourceList(result); + for(int i=0;i recordMap = recordList.get(i); + String value = String.valueOf(recordMap.get("id")); + String name = String.valueOf(recordMap.get("tabymmc")); + log.error("getCustomServiceTypeName-value:"+value+" name:"+name); + optionMap.put(value,name); + } + return optionMap; + } - Map dataMap = new HashMap(); - String devcou = "0" ; - try{ - String startday = request.getParameter("startday"); - String endday = request.getParameter("endday"); - String employeeId = request.getParameter("employeeId"); - Calendar calendar = Calendar.getInstance(); - int year = calendar.get(Calendar.YEAR); + public List> getCustomeServiceData(String groupId,String sourceType,String field_id,List> recordList,String employeeId){ - if(StringUtils.isBlank(startday)){ - startday = year+"-01-01"; - } - if(StringUtils.isBlank(endday)){ - endday = sdf.format(new Date()); - } + Map optionMap = getCustomServiceTypeName(groupId,sourceType,employeeId); - if(StringUtils.isBlank(employeeId)){ - employeeId = String.valueOf(UserContext.getCurrentEmployeeId()); - } + for(int i=0;i recordMap = recordList.get(i); + String taby = String.valueOf(recordMap.get("taby")); + log.error("getCustemSelfServiceType-taby:"+taby); - if(StringUtils.isNotBlank(employeeId)) - { - String dataSql =" select count(1) as devcou \n" + - " from wfc_form_data l\n" + - " inner join fto_83 d on d.id = l.dataid\n" + - " inner join wfc_requestbase p on p.requestid = l.requestid\n" + - " where d.mutiresource= ?\n" + - " and d.xsjfrq >= ? "+ - " and d.xsjfrq <=? "+ - " and d.tenant_key='"+tenant_key+"'\n" + - " and d.is_delete='0'\n" + - " and l.tenant_key='"+tenant_key+"'\n" + - " and l.delete_type=0\n" + - " and p.tenant_key='"+tenant_key+"'\n" + - " and p.delete_type=0\n" + - " order by d.id desc " ; - - List sqlparam = new ArrayList(); - SqlParamEntity sqlParamEntity = new SqlParamEntity(); - sqlParamEntity.setParamType(SqlParamType.VARCHAR); - sqlParamEntity.setValue(employeeId); - sqlparam.add(sqlParamEntity); - - sqlParamEntity = new SqlParamEntity(); - sqlParamEntity.setParamType(SqlParamType.VARCHAR); - sqlParamEntity.setValue(startday); - sqlparam.add(sqlParamEntity); - - sqlParamEntity = new SqlParamEntity(); - sqlParamEntity.setParamType(SqlParamType.VARCHAR); - sqlParamEntity.setValue(endday); - sqlparam.add(sqlParamEntity); - - log.info("dataSql:"+dataSql); - - Map result = databaseUtils.executeForQuery(sourceType, groupId, dataSql,sqlparam); - List> recordList = databaseUtils.getDataSourceList(result); - if(CollectionUtils.isNotEmpty(recordList)) { - devcou = String.valueOf(recordList.get(0).get("devcou")); - } - } + String tabyName = optionMap.get(taby); + List> customList = getCustomeServiceDataByType(groupId,sourceType,taby,employeeId); - }catch (Exception e){ - log.error("testSapi51-Exception:"+e.getMessage()); - return WeaResult.fail(500,"程序执行异常"); + log.error("getCustemSelfServiceType-tabyName:"+tabyName); + log.error("getCustemSelfServiceType-taby:"+taby); + recordMap.put("menus",customList); + recordMap.put("name",tabyName); } - return WeaResult.success(devcou); + return recordList; } - @GetMapping("/testSapi110") - @WeaPermission(publicPermission = true) - public WeaResult testSapi110(HttpServletRequest request){ - Map dataMap = new HashMap(); - dataMap.put("test","testSapi110"); - try { - SimpleEmployee employee = UserContext.getCurrentUser(); - log.error("employee:"+employee.getEmployeeId()); - RequestListConditionApiEntity conditionEntity = new RequestListConditionApiEntity(); - WeaResult requestCountInfo = wflRequestListRest.getRequestCountByTabId(employee, RequestListInitDimensionTabEnum.MINE_FLOWALL.getTabid(), conditionEntity); - log.error("testSapi110:"+requestCountInfo.toString()); - int code = requestCountInfo.getCode(); - log.error("testSapi110:"+code); - RequestCountInfoPAEntity requestCountInfoPAEntity = requestCountInfo.getData(); - log.error("testSapi110:"+requestCountInfoPAEntity.toString()); - dataMap.put("data",requestCountInfoPAEntity); - } catch (Exception e) { - e.printStackTrace(); - log.error("testSapi11:"+e); - dataMap.put("count","-1"); + public List> getCustomeServiceDataByType(String groupId,String sourceType,String value,String employeeId){ + String sql = " select fwmc,fwdz,fwtb,taby from uf_zzfwrkpz where ry=? and qy is not null and taby is not null and taby="+value+" and delete_type=0 and tenant_key = '"+tenant_key+"'"; + log.info("getSelfServiceData--sql:"+sql); + List sqlparam = new ArrayList(); + SqlParamEntity sqlParamEntity = new SqlParamEntity(); + sqlParamEntity.setParamType(SqlParamType.VARCHAR); + sqlParamEntity.setValue(employeeId); + sqlparam.add(sqlParamEntity); + + Map result = databaseUtils.executeForQuery(sourceType, groupId, sql,sqlparam); + List> recordList = databaseUtils.getDataSourceList(result); + for(int i=0;i recordMap = recordList.get(i); + String fwtb = String.valueOf(recordMap.get("fwtb")); + String fwtburl = ""; + if(StringUtils.isNotBlank(fwtb)){ + fwtburl = "/api/file/preview?fileId="+fwtb+"&module=ebuilderform&authModule=ebuilderform&type=imgs&source=form&fieldId="+fwtb+"&imgFormat=small"; + } + recordMap.put("fwtburl",fwtburl); } - return WeaResult.success(dataMap); + return recordList; } - @GetMapping("/testSapi112") - @WeaPermission(publicPermission = true) - public WeaResult testSapi112(HttpServletRequest request){ - - SimpleEmployee employee = UserContext.getCurrentUser(); - log.error("employee:"+employee.getEmployeeId()); - RequestListConditionApiEntity conditionEntity = new RequestListConditionApiEntity(); - WeaResult requestCountInfo = wflRequestListRest.getRequestCountByTabId(employee, RequestListInitDimensionTabEnum.MINE_FLOWALL.getTabid(), conditionEntity); - log.error("testSapi110:"+requestCountInfo.toString()); - return requestCountInfo; + /*** + * 默认数据 + * @param groupId + * @param sourceType + * @return + */ + public List> getDefaultServiceData(String groupId,String sourceType,String field_id){ + + String sql = " select name,value_key as taby from field_option where field_id=? and delete_type=0 and tenant_key = '"+tenant_key+"'"; + log.info("sql:"+sql); + + List sqlparam = new ArrayList(); + SqlParamEntity sqlParamEntity = new SqlParamEntity(); + sqlParamEntity.setParamType(SqlParamType.VARCHAR); + sqlParamEntity.setValue(field_id); + sqlparam.add(sqlParamEntity); + + Map result = databaseUtils.executeForQuery(sourceType, groupId, sql,sqlparam); + List> recordList = databaseUtils.getDataSourceList(result); + for(int i=0;i recordMap = recordList.get(i); + String taby = String.valueOf(recordMap.get("taby")); + List> defaultList = getDefaultServiceDataByType(groupId,sourceType,taby); + recordMap.put("menus",defaultList); + } + return recordList; } - @GetMapping("/testSapi113") - @WeaPermission(publicPermission = true) - public WeaResult testSapi113(HttpServletRequest request){ - - SimpleEmployee employee = UserContext.getCurrentUser(); - log.error("employee:"+employee.getEmployeeId()); - RequestListConditionApiEntity conditionEntity = new RequestListConditionApiEntity(); - WeaResult requestCountInfo = wflRequestListRest.getRequestCountByTabId(employee, RequestListInitDimensionTabEnum.DONE_FLOWALL.getTabid(), conditionEntity); - log.error("testSapi110:"+requestCountInfo.toString()); - return requestCountInfo; + /*** + * 默认数据 + * @param groupId + * @param sourceType + * @param value + * @return + */ + public List> getDefaultServiceDataByType(String groupId,String sourceType,String value){ + String sql =" select t.taby,t.fwtb,t.fwmc,t.fwdz\n" + + " from uf_zzfwcsh t \n" + + " where t.delete_type=0 \n" + + " and t.taby= ? " + + " and t.tenant_key = '"+tenant_key+"'"; + + log.error("getSelfServiceData--sql:"+sql); + + List sqlparam = new ArrayList(); + SqlParamEntity sqlParamEntity = new SqlParamEntity(); + sqlParamEntity.setParamType(SqlParamType.INTEGER); + sqlParamEntity.setValue(value); + sqlparam.add(sqlParamEntity); + + Map result = databaseUtils.executeForQuery(sourceType, groupId, sql,sqlparam); + List> recordList = databaseUtils.getDataSourceList(result); + for(int i=0;i recordMap = recordList.get(i); + String fwtb = String.valueOf(recordMap.get("fwtb")); + String fwtburl = ""; + if(StringUtils.isNotBlank(fwtb)){ + fwtburl = "/api/file/preview?fileId="+fwtb+"&module=ebuilderform&authModule=ebuilderform&type=imgs&source=form&fieldId="+fwtb+"&imgFormat=small"; + } + recordMap.put("fwtburl",fwtburl); + } + return recordList; } + + } diff --git a/src/main/java/com/weaver/seconddev/jcldoor/util/JucailinPortalUtils.java b/src/main/java/com/weaver/seconddev/jcldoor/util/JucailinPortalUtils.java new file mode 100644 index 0000000..56bffc3 --- /dev/null +++ b/src/main/java/com/weaver/seconddev/jcldoor/util/JucailinPortalUtils.java @@ -0,0 +1,55 @@ +package com.weaver.seconddev.jcldoor.util; + +import com.weaver.common.base.entity.result.WeaResult; +import com.weaver.ebuilder.datasource.api.entity.SqlParamEntity; +import com.weaver.ebuilder.datasource.api.enums.SqlParamType; +import com.weaver.seconddev.jcldoor.controller.JucailinPortalController; +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.*; + +public class JucailinPortalUtils { + + private final Logger log = LoggerFactory.getLogger(JucailinPortalController.class); + + @Autowired + private DatabaseUtils databaseUtils; + + public String getUfPropData(String pkey,String tenant_key) { + String pvalue = "" ; + String groupId = "weaver-ebuilder-form-service"; + String sourceType = "LOGIC"; + try{ + if(StringUtils.isNotBlank(pkey)) + { + String dataSql =" select pvalue \n" + + " from uf_nj_prop \n" + + " where pkey= ? \n" + + " and delete_type = 0 \n" + + " and tenant_key='"+tenant_key+"'" ; + + List sqlparam = new ArrayList(); + SqlParamEntity sqlParamEntity = new SqlParamEntity(); + sqlParamEntity.setParamType(SqlParamType.VARCHAR); + sqlParamEntity.setValue(pkey); + sqlparam.add(sqlParamEntity); + + Map result = databaseUtils.executeForQuery(sourceType, groupId, dataSql,sqlparam); + List> recordList = databaseUtils.getDataSourceList(result); + if(CollectionUtils.isNotEmpty(recordList)) { + Map recordMap = recordList.get(0); + if(recordMap.containsKey("pvalue")){ + pvalue = String.valueOf(recordMap.get("pvalue")); + } + } + } + }catch (Exception e){ + log.error("getUfPropData-Exception:"+e.getMessage()); + } + return pvalue; + } +}