#E10-47# 接口优化

main
shilei 11 months ago
parent 184b88fb00
commit aa5677a352

@ -6,9 +6,6 @@ import com.weaver.ebuilder.datasource.api.enums.SqlParamType;
import com.weaver.framework.rpc.annotation.RpcReference;
import com.weaver.seconddev.cockpit.util.DatabaseUtils;
import com.weaver.seconddev.cockpit.util.JucailinCockpitUtils;
import com.weaver.teams.domain.hr.entity.FlowData;
import com.weaver.teams.domain.hr.entity.FlowDataListReq;
import com.weaver.teams.domain.hr.entity.FlowDataListRes;
import com.weaver.teams.domain.user.SimpleEmployee;
import com.weaver.teams.security.context.UserContext;
import com.weaver.workflow.common.constant.list.api.DateTimeConditionEnum;
@ -66,7 +63,7 @@ public class CockpitWorkAchievementsCmd {
}
String endday = "";
if(paramMap.containsKey("startday")){
if(paramMap.containsKey("endday")){
endday = String.valueOf(paramMap.get("endday"));
}
@ -81,18 +78,22 @@ public class CockpitWorkAchievementsCmd {
String one = "0";
String oneword = "";
String oneurl = "";
String oneunit = "";
String two = "0";
String twoword = "";
String twourl = "";
String twounit = "";
String three = "0";
String threeword = "";
String threeurl = "";
String threeunit = "";
String four = "0";
String fourword = "";
String foururl = "";
String fourunit = "";
try {
//销售 0项目 1,技术 2其它 3
@ -106,21 +107,26 @@ public class CockpitWorkAchievementsCmd {
oneword = "本年问题处理数";
String pkey = "workdata.technology.wtclsl";
oneurl = jucailinCockpitUtils.getUfPropData(pkey,tenantKey);
oneunit = "";
two = getDaysInfo(startday, endday, employeeId,tenantKey);
twoword = "本年开发人天";
pkey = "workdata.technology.kfrt";
twourl = jucailinCockpitUtils.getUfPropData(pkey,tenantKey);
twounit = "";
three = getCoWorkInfo(startday,endday, employeeId,tenantKey);
threeword = "本年协作沟通数";
pkey = "workdata.technology.gtxz";
threeurl = jucailinCockpitUtils.getUfPropData(pkey,tenantKey);
threeunit = "";
four = getWfInfo(simpleEmployee);
fourword = "本年处理流程数";
pkey = "workdata.technology.cllc";
foururl = jucailinCockpitUtils.getUfPropData(pkey,tenantKey);
fourunit = "";
}else if("1".equals(znlx)){
@ -128,29 +134,47 @@ public class CockpitWorkAchievementsCmd {
oneword = "本年验收指标";
String pkey = "workdata.project.yszb";
oneurl = jucailinCockpitUtils.getUfPropData(pkey,tenantKey);
oneunit = "万元";
//项目验收信息
two = getYsInfo(employeeId,startday,endday);
log.error("two:"+two);
two = parseJe(two);
Map<String,String>twoMap = parseJe(two);
if(twoMap.containsKey("amount")){
two = twoMap.get("amount");
}
log.error("two2:"+two);
twoword = "本年验收金额";
pkey = "workdata.project.ysje";
twourl = jucailinCockpitUtils.getUfPropData(pkey,tenantKey);
twounit = "万元";
if(twoMap.containsKey("unit")){
twounit = twoMap.get("unit");
}
three = "0.00";
threeword = "本年指标达成率";
pkey = "workdata.project.zbdcl";
threeurl = jucailinCockpitUtils.getUfPropData(pkey,tenantKey);
threeunit = "%";
//项目收款信息
four = getSkInfo(employeeId,startday,endday,tenantKey);
log.error("four:"+four);
four = parseJe(four);
Map<String,String> fourMap = parseJe(four);
if(fourMap.containsKey("amount")){
four = fourMap.get("amount");
}
log.error("four2:"+four);
fourword = "本年收款金额";
pkey = "workdata.project.skje";
foururl = jucailinCockpitUtils.getUfPropData(pkey,tenantKey);
fourunit = "万元";
if(fourMap.containsKey("unit")){
fourunit = fourMap.get("unit");
}
}else if("3".equals(znlx)){
@ -158,21 +182,25 @@ public class CockpitWorkAchievementsCmd {
oneword = "本年处理流程数";
String pkey = "workdata.other.cllc";
oneurl = jucailinCockpitUtils.getUfPropData(pkey,tenantKey);
oneunit = "";
two = getDocInfo(startday,endday,employeeId,tenantKey);
twoword = "本年文档贡献度";
pkey = "workdata.other.wdgx";
twourl = jucailinCockpitUtils.getUfPropData(pkey,tenantKey);
twounit = "";
three = getDailyInfo(startday,endday,employeeId,tenantKey);
threeword = "本年微博填写数";
pkey = "workdata.other.wbtx";
threeurl = jucailinCockpitUtils.getUfPropData(pkey,tenantKey);
threeunit = "";
four = getCoWorkInfo(startday,endday,employeeId,tenantKey);
fourword = "本年沟通协作数";
pkey = "workdata.other.gtxz";
foururl = jucailinCockpitUtils.getUfPropData(pkey,tenantKey);
fourunit = "";
}else{
@ -180,27 +208,32 @@ public class CockpitWorkAchievementsCmd {
oneword = "本年处理流程数";
String pkey = "workdata.other.cllc";
oneurl = jucailinCockpitUtils.getUfPropData(pkey,tenantKey);
oneunit = "";
two = getDocInfo(startday,endday,employeeId,tenantKey);
twoword = "本年文档贡献度";
pkey = "workdata.other.wdgx";
twourl = jucailinCockpitUtils.getUfPropData(pkey,tenantKey);
twounit = "";
three = getDailyInfo(startday,endday,employeeId,tenantKey);
threeword = "本年微博填写数";
pkey = "workdata.other.wbtx";
threeurl = jucailinCockpitUtils.getUfPropData(pkey,tenantKey);
threeunit = "";
four = getCoWorkInfo(startday,endday,employeeId,tenantKey);
fourword = "本年沟通协作数";
pkey = "workdata.other.gtxz";
foururl = jucailinCockpitUtils.getUfPropData(pkey,tenantKey);
fourunit = "";
}
Map<String,String> oneMap = new HashMap<String,String>(100);
oneMap.put("name",oneword);
oneMap.put("value",one);
oneMap.put("url",oneurl);
oneMap.put("unit",oneunit);
list.add(oneMap);
log.error("1111");
@ -208,6 +241,7 @@ public class CockpitWorkAchievementsCmd {
twoMap.put("name",twoword);
twoMap.put("value",two);
twoMap.put("url",twourl);
twoMap.put("unit",twounit);
list.add(twoMap);
log.error("2222");
@ -215,6 +249,7 @@ public class CockpitWorkAchievementsCmd {
threeMap.put("name",threeword);
threeMap.put("value",three);
threeMap.put("url",threeurl);
threeMap.put("unit",threeunit);
list.add(threeMap);
log.error("3333");
@ -223,6 +258,7 @@ public class CockpitWorkAchievementsCmd {
fourMap.put("name",fourword);
fourMap.put("value",four);
fourMap.put("url",foururl);
fourMap.put("unit",fourunit);
list.add(fourMap);
log.error("4444");
@ -804,8 +840,6 @@ public class CockpitWorkAchievementsCmd {
count = String.valueOf(recordList.get(0).get("count"));
}
}
}catch (Exception e){
e.printStackTrace();
log.error("getDailyInfo-e:"+e);
@ -819,25 +853,28 @@ public class CockpitWorkAchievementsCmd {
* @param value
* @return
*/
public static String parseJe(String value){
String convertData = "0.00";
if(StringUtils.isBlank(value)){
return convertData;
}
public Map<String,String> parseJe(String value){
Map<String,String> dataMap = new HashMap<String,String>();
String amount = "0.00";
String unit = "万元";
if(StringUtils.isNotBlank(value)){
BigDecimal dividend = new BigDecimal(value); // 被除数
if(dividend.doubleValue()>100000000){
BigDecimal divisor = new BigDecimal("100000000"); // 除数
BigDecimal result = dividend.divide(divisor, 2, RoundingMode.HALF_UP); // 设置小数点后两位,并进行四舍五入
convertData = result.toString();
amount = result.toString();
unit = "亿元";
}else if(dividend.doubleValue()>10000){
BigDecimal divisor = new BigDecimal("10000"); // 除数
BigDecimal result = dividend.divide(divisor, 2, RoundingMode.HALF_UP); // 设置小数点后两位,并进行四舍五入
convertData = result.toString();
amount = result.toString();
unit = "万元";
}
return convertData;
}
dataMap.put("unit",unit);
dataMap.put("amount",amount);
return dataMap;
}
}

@ -66,7 +66,6 @@ public class JucailinCockpitController {
Map<String, Object> dataList = new HashMap<String, Object>();
SimpleEmployee simpleEmployee = UserContext.getCurrentUser();
Map<String,Object> params = jucailinCockpitUtils.request2Map(request);
try{
dataList = jucailinCockpitService.getWorkAchievementsData(simpleEmployee,params,tenant_key);
}catch (Exception e){

Loading…
Cancel
Save