From 0230a6125fe0691da3408cd0aba9dbff697311b3 Mon Sep 17 00:00:00 2001 From: shilei <798989044@qq.com> Date: Wed, 13 Mar 2024 15:44:02 +0800 Subject: [PATCH] =?UTF-8?q?#E10-02#=20=E6=96=B0=E5=A2=9E=E6=97=A5=E6=8A=A5?= =?UTF-8?q?=E3=80=81=E5=8D=8F=E4=BD=9C=E3=80=81=E6=96=87=E6=A1=A3=E3=80=81?= =?UTF-8?q?=E6=B5=81=E7=A8=8B=E7=9A=84=E6=B5=8B=E8=AF=95=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/HrmSelfHelpController.java | 232 +++++++++++++----- 1 file changed, 176 insertions(+), 56 deletions(-) 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 aff55eb..5e7efb7 100644 --- a/src/main/java/com/weaver/seconddev/jcldoor/controller/HrmSelfHelpController.java +++ b/src/main/java/com/weaver/seconddev/jcldoor/controller/HrmSelfHelpController.java @@ -37,9 +37,8 @@ import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import java.io.IOException; import java.text.SimpleDateFormat; -import java.time.LocalDate; -import java.time.Month; -import java.time.YearMonth; +import java.time.*; +import java.time.format.DateTimeFormatter; import java.time.temporal.TemporalAdjusters; import java.util.*; @@ -1633,45 +1632,45 @@ public class HrmSelfHelpController { String sourceType = "LOGIC"; String sql =" SELECT \n" + - " sum(cast(t1.skje as decimal(18,2))) as skje,\n" + //收款金额 - " sum(cast(t1.xmskje as decimal(18,2))) as xmskje,\n" + // 项目收款金额 - " sum(cast(t1.xsyxje as decimal(18,2))) as xsyxje," + // 销售有效金额 - " sum(cast(t1.xsje as decimal(18,2))) as xsje," + // 销售金额 - " sum(cast(t1.xmyxje as decimal(18,2))) as xmyxje," + //项目有效金额 - " sum(cast(t1.xsjxhk as decimal(18,2))) as xsjxhk," + //有效绩效回款 - " sum(cast(t1.sumsk as decimal(18,2))) as sumsk," + //总收款金额 - " sum(cast(t1.sjjsk as decimal(18,2))) as sjjsk," + //实际结算款 - " sum(cast(t1.skjs as decimal(18,2))) 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" + - " 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.skrq >= '" + startday+"' and skrq <='"+endday+"' "+ - " and (" + - " '"+employeeId+"' 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 = '"+employeeId+"' and RELATION in ('othersenior','senior') \n" + - " UNION " + - " SELECT id FROM eteams.employee WHERE id = '"+employeeId+"' " + - " )\n" + - " or cast(t1.kfry AS decimal(25,0)) in(\n" + - " SELECT cid AS id FROM eteams.emp_link WHERE pid = '"+employeeId+"' and RELATION in ('othersenior','senior') \n" + - " UNION " + - " SELECT id FROM eteams.employee WHERE id = '"+employeeId+"' " + - " )\n" + - " or cast(t1.qdjl AS decimal(25,0)) in(\n" + - " SELECT cid AS id FROM eteams.emp_link WHERE pid = '"+employeeId+"' and RELATION in ('othersenior','senior') \n" + - " UNION " + - " SELECT id FROM eteams.employee WHEREHERE id = '"+employeeId+"' " + - " )\n" + - " or cast(t1.xmjl AS decimal(25,0)) in(\n" + - " SELECT cid AS id FROM eteams.emp_link WHERE pid = '"+employeeId+"' and RELATION in ('othersenior','senior') \n" + - " UNION " + - " SELECT id FROM eteams.employee WHERE id = '"+employeeId+"' " + - " )\n" + - " )\n" + - " order by t1.id " ; + " sum(cast(t1.skje as decimal(18,2))) as skje,\n" + //收款金额 + " sum(cast(t1.xmskje as decimal(18,2))) as xmskje,\n" + // 项目收款金额 + " sum(cast(t1.xsyxje as decimal(18,2))) as xsyxje," + // 销售有效金额 + " sum(cast(t1.xsje as decimal(18,2))) as xsje," + // 销售金额 + " sum(cast(t1.xmyxje as decimal(18,2))) as xmyxje," + //项目有效金额 + " sum(cast(t1.xsjxhk as decimal(18,2))) as xsjxhk," + //有效绩效回款 + " sum(cast(t1.sumsk as decimal(18,2))) as sumsk," + //总收款金额 + " sum(cast(t1.sjjsk as decimal(18,2))) as sjjsk," + //实际结算款 + " sum(cast(t1.skjs as decimal(18,2))) 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" + + " 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.skrq >= '" + startday+"' and skrq <='"+endday+"' "+ + " and (" + + " '"+employeeId+"' 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 = '"+employeeId+"' and RELATION in ('othersenior','senior') \n" + + " UNION " + + " SELECT id FROM eteams.employee WHERE id = '"+employeeId+"' " + + " )\n" + + " or cast(t1.kfry AS decimal(25,0)) in(\n" + + " SELECT cid AS id FROM eteams.emp_link WHERE pid = '"+employeeId+"' and RELATION in ('othersenior','senior') \n" + + " UNION " + + " SELECT id FROM eteams.employee WHERE id = '"+employeeId+"' " + + " )\n" + + " or cast(t1.qdjl AS decimal(25,0)) in(\n" + + " SELECT cid AS id FROM eteams.emp_link WHERE pid = '"+employeeId+"' and RELATION in ('othersenior','senior') \n" + + " UNION " + + " SELECT id FROM eteams.employee WHEREHERE id = '"+employeeId+"' " + + " )\n" + + " or cast(t1.xmjl AS decimal(25,0)) in(\n" + + " SELECT cid AS id FROM eteams.emp_link WHERE pid = '"+employeeId+"' and RELATION in ('othersenior','senior') \n" + + " UNION " + + " SELECT id FROM eteams.employee WHERE id = '"+employeeId+"' " + + " )\n" + + " )\n" + + " order by t1.id " ; log.error("sql:"+sql); Map result = databaseUtils.execute(sourceType, groupId, sql); @@ -1786,22 +1785,27 @@ public class HrmSelfHelpController { } - @GetMapping("/testSapi50") - @WeaPermission(publicPermission = true) - public WeaResult testSapi50(HttpServletRequest request){ - log.error("getPortalWorkFlowInfo"); - int blogcount = 0 ; - try{ - long employeeId = UserContext.getCurrentEmployeeId(); - blogcount = remoteBlogInfoService.countByCreator(tenant_key,employeeId); - }catch (Exception e){ - log.error("getWorkFlowInfo-Exception:"+e.getMessage()); - return WeaResult.fail(500,"程序执行异常"); - } - return WeaResult.success(blogcount); - } +// @GetMapping("/testSapi50") +// @WeaPermission(publicPermission = true) +// public WeaResult testSapi50(HttpServletRequest request){ +// log.error("getPortalWorkFlowInfo"); +// int blogcount = 0 ; +// try{ +// long employeeId = UserContext.getCurrentEmployeeId(); +// blogcount = remoteBlogInfoService.countByCreator(tenant_key,employeeId); +// }catch (Exception e){ +// log.error("getWorkFlowInfo-Exception:"+e.getMessage()); +// return WeaResult.fail(500,"程序执行异常"); +// } +// return WeaResult.success(blogcount); +// } + /*** + * 本年沟通协作数 + * @param request + * @return + */ @GetMapping("/testSapi51") @WeaPermission(publicPermission = true) public WeaResult testSapi51(HttpServletRequest request){ @@ -1850,6 +1854,11 @@ public class HrmSelfHelpController { } + /*** + * 本年文档贡献度 + * @param request + * @return + */ @GetMapping("/testSapi52") @WeaPermission(publicPermission = true) public WeaResult testSapi52(HttpServletRequest request){ @@ -1899,6 +1908,117 @@ public class HrmSelfHelpController { } + /** + * 本年处理流程数 + * @param request + * @return + */ + @GetMapping("/testSapi60") + @WeaPermission(publicPermission = true) + public WeaResult testSapi60(HttpServletRequest request){ + log.error("testSapi60"); + + String startday = request.getParameter("startday"); + String endday = request.getParameter("endday"); + DateTimeFormatter format = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + + Long count = 0L ; + try{ + RequestListConditionApiEntity conditionEntity = new RequestListConditionApiEntity(); + SimpleEmployee employee = UserContext.getCurrentUser(); + LocalDateTime startDateTime = LocalDateTime.of(LocalDate.from(LocalDateTime.now().with(TemporalAdjusters.firstDayOfYear())), LocalTime.MIN); + if(StringUtils.isNotBlank(startday)){ + startDateTime = LocalDateTime.parse(startday, format); + } + + LocalDateTime endDateTime = LocalDateTime.now(); + if(StringUtils.isNotBlank(endday)){ + endDateTime = LocalDateTime.parse(endday, format); + } + conditionEntity.setCusOperateDateStart(startDateTime); + conditionEntity.setCusOperateDateEnd(endDateTime); + + WeaResult RequestCountInfoPAEntity = wflRequestListRest.getRequestCountByTabId(employee, RequestListInitDimensionTabEnum.DONE_FLOWALL.getTabid(), conditionEntity); + int code = RequestCountInfoPAEntity.getCode(); + if(code == 200){ + count = RequestCountInfoPAEntity.getData().getCount(); + } + }catch (Exception e){ + log.error("getWorkFlowInfo-Exception:"+e.getMessage()); + return WeaResult.fail(500,"程序执行异常"); + } + return WeaResult.success(count); + } + + + /*** + * 本年微博数量 + * @param request + * @return + */ + @GetMapping("/testSapi62") + @WeaPermission(publicPermission = true) + public WeaResult testSapi62(HttpServletRequest request){ + log.error("testSapi62"); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + + String groupId = "weaver-blog-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 blogcount\n" + + " from blog " + + " where creator='"+employeeId+"'\n" + + " and left(BLOG_TIME,10) >='"+startday+"'\n" + + " and left(BLOG_TIME,10) <='"+endday+"'\n" + + " and type='blog'\n" + + " and TENANT_KEY = '"+tenant_key+"'\n" + + " and MODULE = 'blog'\n" + + " and DELETE_TYPE = 0\n" + + " and CONTENT is not null" ; + + log.error("sql:"+sql); + Map result = databaseUtils.execute(sourceType, groupId, sql); + 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); + } + + + + + + + + +