#E10-02# 新增日报、协作、文档、流程的测试接口

main
shilei 1 year ago
parent 95752794f3
commit 0230a6125f

@ -37,9 +37,8 @@ import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.io.IOException; import java.io.IOException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.LocalDate; import java.time.*;
import java.time.Month; import java.time.format.DateTimeFormatter;
import java.time.YearMonth;
import java.time.temporal.TemporalAdjusters; import java.time.temporal.TemporalAdjusters;
import java.util.*; import java.util.*;
@ -1633,45 +1632,45 @@ public class HrmSelfHelpController {
String sourceType = "LOGIC"; String sourceType = "LOGIC";
String sql =" SELECT \n" + String sql =" SELECT \n" +
" sum(cast(t1.skje as decimal(18,2))) as skje,\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.xmskje as decimal(18,2))) as xmskje,\n" + // 项目收款金额
" sum(cast(t1.xsyxje as decimal(18,2))) as xsyxje," + // 销售有效金额 " sum(cast(t1.xsyxje as decimal(18,2))) as xsyxje," + // 销售有效金额
" sum(cast(t1.xsje as decimal(18,2))) as xsje," + // 销售金额 " sum(cast(t1.xsje as decimal(18,2))) as xsje," + // 销售金额
" sum(cast(t1.xmyxje as decimal(18,2))) as xmyxje," + //项目有效金额 " sum(cast(t1.xmyxje as decimal(18,2))) as xmyxje," + //项目有效金额
" sum(cast(t1.xsjxhk as decimal(18,2))) as xsjxhk," + //有效绩效回款 " sum(cast(t1.xsjxhk as decimal(18,2))) as xsjxhk," + //有效绩效回款
" sum(cast(t1.sumsk as decimal(18,2))) as sumsk," + //总收款金额 " sum(cast(t1.sumsk as decimal(18,2))) as sumsk," + //总收款金额
" sum(cast(t1.sjjsk as decimal(18,2))) as sjjsk," + //实际结算款 " sum(cast(t1.sjjsk as decimal(18,2))) as sjjsk," + //实际结算款
" sum(cast(t1.skjs as decimal(18,2))) as skjs " + //收款结算 " sum(cast(t1.skjs as decimal(18,2))) as skjs " + //收款结算
" FROM uf_jxhs_skmx t1\n" + " 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 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" + " JOIN ebdf_physical_data epd on t1.id = epd.form_data_id and epd.delete_type = 0 \n" +
" WHERE t1.skje != 0 \n" + " WHERE t1.skje != 0 \n" +
" and t1.skje IS NOT NULL " + " and t1.skje IS NOT NULL " +
" and t1.skrq >= '" + startday+"' and skrq <='"+endday+"' "+ " and t1.skrq >= '" + startday+"' and skrq <='"+endday+"' "+
" and (" + " and (" +
" '"+employeeId+"' IN ( 2, 27, 166, 10285, 11661, 300, 876, 3593, 1416, 1647, 1844,3044480226941419013,794508876297846787 ) \n" + " '"+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" + " 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" + " SELECT cid AS id FROM eteams.emp_link WHERE pid = '"+employeeId+"' and RELATION in ('othersenior','senior') \n" +
" UNION " + " UNION " +
" SELECT id FROM eteams.employee WHERE id = '"+employeeId+"' " + " SELECT id FROM eteams.employee WHERE id = '"+employeeId+"' " +
" )\n" + " )\n" +
" or cast(t1.kfry AS decimal(25,0)) in(\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" + " SELECT cid AS id FROM eteams.emp_link WHERE pid = '"+employeeId+"' and RELATION in ('othersenior','senior') \n" +
" UNION " + " UNION " +
" SELECT id FROM eteams.employee WHERE id = '"+employeeId+"' " + " SELECT id FROM eteams.employee WHERE id = '"+employeeId+"' " +
" )\n" + " )\n" +
" or cast(t1.qdjl AS decimal(25,0)) in(\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" + " SELECT cid AS id FROM eteams.emp_link WHERE pid = '"+employeeId+"' and RELATION in ('othersenior','senior') \n" +
" UNION " + " UNION " +
" SELECT id FROM eteams.employee WHEREHERE id = '"+employeeId+"' " + " SELECT id FROM eteams.employee WHEREHERE id = '"+employeeId+"' " +
" )\n" + " )\n" +
" or cast(t1.xmjl AS decimal(25,0)) in(\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" + " SELECT cid AS id FROM eteams.emp_link WHERE pid = '"+employeeId+"' and RELATION in ('othersenior','senior') \n" +
" UNION " + " UNION " +
" SELECT id FROM eteams.employee WHERE id = '"+employeeId+"' " + " SELECT id FROM eteams.employee WHERE id = '"+employeeId+"' " +
" )\n" + " )\n" +
" )\n" + " )\n" +
" order by t1.id " ; " order by t1.id " ;
log.error("sql:"+sql); log.error("sql:"+sql);
Map<String, Object> result = databaseUtils.execute(sourceType, groupId, sql); Map<String, Object> result = databaseUtils.execute(sourceType, groupId, sql);
@ -1786,22 +1785,27 @@ public class HrmSelfHelpController {
} }
@GetMapping("/testSapi50") // @GetMapping("/testSapi50")
@WeaPermission(publicPermission = true) // @WeaPermission(publicPermission = true)
public WeaResult<Object> testSapi50(HttpServletRequest request){ // public WeaResult<Object> testSapi50(HttpServletRequest request){
log.error("getPortalWorkFlowInfo"); // log.error("getPortalWorkFlowInfo");
int blogcount = 0 ; // int blogcount = 0 ;
try{ // try{
long employeeId = UserContext.getCurrentEmployeeId(); // long employeeId = UserContext.getCurrentEmployeeId();
blogcount = remoteBlogInfoService.countByCreator(tenant_key,employeeId); // blogcount = remoteBlogInfoService.countByCreator(tenant_key,employeeId);
}catch (Exception e){ // }catch (Exception e){
log.error("getWorkFlowInfo-Exception:"+e.getMessage()); // log.error("getWorkFlowInfo-Exception:"+e.getMessage());
return WeaResult.fail(500,"程序执行异常"); // return WeaResult.fail(500,"程序执行异常");
} // }
return WeaResult.success(blogcount); // return WeaResult.success(blogcount);
} // }
/***
*
* @param request
* @return
*/
@GetMapping("/testSapi51") @GetMapping("/testSapi51")
@WeaPermission(publicPermission = true) @WeaPermission(publicPermission = true)
public WeaResult<Object> testSapi51(HttpServletRequest request){ public WeaResult<Object> testSapi51(HttpServletRequest request){
@ -1850,6 +1854,11 @@ public class HrmSelfHelpController {
} }
/***
*
* @param request
* @return
*/
@GetMapping("/testSapi52") @GetMapping("/testSapi52")
@WeaPermission(publicPermission = true) @WeaPermission(publicPermission = true)
public WeaResult<Object> testSapi52(HttpServletRequest request){ public WeaResult<Object> testSapi52(HttpServletRequest request){
@ -1899,6 +1908,117 @@ public class HrmSelfHelpController {
} }
/**
*
* @param request
* @return
*/
@GetMapping("/testSapi60")
@WeaPermission(publicPermission = true)
public WeaResult<Object> 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> 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<Object> testSapi62(HttpServletRequest request){
log.error("testSapi62");
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String groupId = "weaver-blog-service";
String sourceType = "LOGIC";
Map<String,Object> dataMap = new HashMap<String,Object>();
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<String, Object> result = databaseUtils.execute(sourceType, groupId, sql);
List<Map<String,Object>> 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);
}

Loading…
Cancel
Save