|
@ -271,10 +271,10 @@ public class StatisticsAllService extends BaseService {
|
|
|
* @param level 级别
|
|
|
* @return
|
|
|
*/
|
|
|
public JSONObject getSignRate(String endDate, String area, int level,String year) throws Exception {
|
|
|
public JSONObject getSignRate(String endDate, String area, int level, String year) throws Exception {
|
|
|
JSONObject json = new JSONObject();
|
|
|
long signAmount = getIndexTotal(endDate, area, level, "13");
|
|
|
PopulationBase peopleNum = peopleNumDao.findByCodeAndYear(area, Integer.valueOf(year));
|
|
|
PopulationBase peopleNum = getPopulationBase(area,year);
|
|
|
DecimalFormat df = new DecimalFormat("0.0000");
|
|
|
|
|
|
if (peopleNum != null && peopleNum.getNum() > 0) {
|
|
@ -300,10 +300,10 @@ public class StatisticsAllService extends BaseService {
|
|
|
* @param level 级别
|
|
|
* @return
|
|
|
*/
|
|
|
public JSONObject getSignTaskRate(String endDate, String area, int level,String year) throws Exception {
|
|
|
public JSONObject getSignTaskRate(String endDate, String area, int level, String year) throws Exception {
|
|
|
JSONObject json = new JSONObject();
|
|
|
long signAmount = getIndexTotal(endDate, area, level, "13");
|
|
|
PopulationBase peopleNum = peopleNumDao.findByCodeAndYear(area, Integer.valueOf(year));
|
|
|
PopulationBase peopleNum = getPopulationBase(area,year);
|
|
|
DecimalFormat df = new DecimalFormat("0.0000");
|
|
|
|
|
|
if (peopleNum != null && peopleNum.getTaskNum() > 0) {
|
|
@ -331,7 +331,7 @@ public class StatisticsAllService extends BaseService {
|
|
|
* @param level
|
|
|
* @return
|
|
|
*/
|
|
|
public JSONObject getGroupInfo(String endDate, String lowCode, String area, int level) throws ParseException {
|
|
|
public JSONObject getGroupInfo(String endDate, String lowCode, String area, int level, String year) throws ParseException {
|
|
|
JSONObject json = new JSONObject();
|
|
|
long total = 0;
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
@ -393,43 +393,21 @@ public class StatisticsAllService extends BaseService {
|
|
|
|
|
|
int num = 0;
|
|
|
int taskNum = 0;
|
|
|
String redisNum = "";
|
|
|
try {
|
|
|
redisNum = redisTemplate.opsForValue().get("people:num:" + area);
|
|
|
} catch (Exception e) {
|
|
|
redisNum = "";
|
|
|
}
|
|
|
if (StringUtils.isEmpty(redisNum)) {
|
|
|
PopulationBase peopleNum = peopleNumDao.findByCodeAndYear(area, Integer.valueOf(Constant.getNowYear()));
|
|
|
if (peopleNum != null) {
|
|
|
if (lowCode.equals("3")) {
|
|
|
num = peopleNum.getSixFiveNum();
|
|
|
taskNum = peopleNum.getSixFiveTaskNum();
|
|
|
} else if (lowCode.equals("1")) {
|
|
|
num = peopleNum.getGxyNum();
|
|
|
taskNum = peopleNum.getGxyTaskNum();
|
|
|
} else if (lowCode.equals("2")) {
|
|
|
num = peopleNum.getTnbNum();
|
|
|
taskNum = peopleNum.getTnbTaskNum();
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
JSONObject peopleNum = new JSONObject(redisNum);
|
|
|
if (peopleNum != null) {
|
|
|
|
|
|
if (lowCode.equals("3")) {
|
|
|
num = peopleNum.getInt("sixFiveNum");
|
|
|
taskNum = peopleNum.getInt("sixFiveTaskNum");
|
|
|
} else if (lowCode.equals("1")) {
|
|
|
num = peopleNum.getInt("gxyNum");
|
|
|
taskNum = peopleNum.getInt("gxyTaskNum");
|
|
|
} else if (lowCode.equals("2")) {
|
|
|
num = peopleNum.getInt("tnbNum");
|
|
|
taskNum = peopleNum.getInt("tnbTaskNum");
|
|
|
}
|
|
|
PopulationBase peopleNum = getPopulationBase(area,year);
|
|
|
if (peopleNum != null) {
|
|
|
if (lowCode.equals("3")) {
|
|
|
num = peopleNum.getSixFiveNum();
|
|
|
taskNum = peopleNum.getSixFiveTaskNum();
|
|
|
} else if (lowCode.equals("1")) {
|
|
|
num = peopleNum.getGxyNum();
|
|
|
taskNum = peopleNum.getGxyTaskNum();
|
|
|
} else if (lowCode.equals("2")) {
|
|
|
num = peopleNum.getTnbNum();
|
|
|
taskNum = peopleNum.getTnbTaskNum();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
DecimalFormat df = new DecimalFormat("0.0000");
|
|
|
json.put("sign", total);
|
|
|
JSONObject signRate = new JSONObject();
|
|
@ -460,7 +438,7 @@ public class StatisticsAllService extends BaseService {
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public JSONArray getLevelTwoLowLevelTotal(String date, String area, int level, String index, int sort, String lowLevel, String lowCode) throws Exception {
|
|
|
public JSONArray getLevelTwoLowLevelTotal(String date, String area, int level, String index, int sort, String lowLevel, String lowCode, String year) throws Exception {
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
String low_level = String.valueOf(StringUtils.isEmpty(lowLevel) ? (level - 1) : lowLevel);
|
|
|
List<Map<String, Object>> resultList = new ArrayList<>();
|
|
@ -484,62 +462,29 @@ public class StatisticsAllService extends BaseService {
|
|
|
map.put("amount", map.get("amount") != null ? Long.valueOf(map.get("amount").toString()) : 0L);
|
|
|
|
|
|
if (!low_level.equals("1")) {
|
|
|
String redisNum = "";
|
|
|
try {
|
|
|
redisNum = redisTemplate.opsForValue().get("people:num:" + map.get("code").toString());
|
|
|
} catch (Exception e) {
|
|
|
redisNum = "";
|
|
|
}
|
|
|
if (StringUtils.isEmpty(redisNum)) {
|
|
|
PopulationBase peopleNum = peopleNumDao.findByCodeAndYear(map.get("code").toString(), Integer.valueOf(Constant.getNowYear()));
|
|
|
if (peopleNum != null) {
|
|
|
int num = 0;
|
|
|
int taskNum = 0;
|
|
|
|
|
|
if (lowCode.equals("3")) {
|
|
|
num = peopleNum.getSixFiveNum();
|
|
|
taskNum = peopleNum.getSixFiveTaskNum();
|
|
|
} else if (lowCode.equals("1")) {
|
|
|
num = peopleNum.getGxyNum();
|
|
|
taskNum = peopleNum.getGxyTaskNum();
|
|
|
} else if (lowCode.equals("2")) {
|
|
|
num = peopleNum.getTnbNum();
|
|
|
taskNum = peopleNum.getTnbTaskNum();
|
|
|
}
|
|
|
map.put("rate", df.format(((long) map.get("amount") * 1.0000) / num * 100));
|
|
|
map.put("taskRate", df.format(((long) map.get("amount") * 1.0000) / taskNum * 100));
|
|
|
map.put("targetRate", df.format(taskNum * 1.0000 / num * 100));
|
|
|
map.put("rateString", map.get("amount") + "/" + num);
|
|
|
map.put("taskRateString", map.get("amount") + "/" + taskNum);
|
|
|
map.put("targetRateString", taskNum + "/" + num);
|
|
|
map.put("num", num);
|
|
|
map.put("task", taskNum);
|
|
|
}
|
|
|
} else {
|
|
|
JSONObject peopleNum = new JSONObject(redisNum);
|
|
|
if (peopleNum != null) {
|
|
|
int num = 0;
|
|
|
int taskNum = 0;
|
|
|
|
|
|
if (lowCode.equals("3")) {
|
|
|
num = peopleNum.getInt("sixFiveNum");
|
|
|
taskNum = peopleNum.getInt("sixFiveTaskNum");
|
|
|
} else if (lowCode.equals("1")) {
|
|
|
num = peopleNum.getInt("gxyNum");
|
|
|
taskNum = peopleNum.getInt("gxyTaskNum");
|
|
|
} else if (lowCode.equals("2")) {
|
|
|
num = peopleNum.getInt("tnbNum");
|
|
|
taskNum = peopleNum.getInt("tnbTaskNum");
|
|
|
}
|
|
|
map.put("rate", df.format(((long) map.get("amount") * 1.0000) / num * 100));
|
|
|
map.put("taskRate", df.format(((long) map.get("amount") * 1.0000) / taskNum * 100));
|
|
|
map.put("targetRate", df.format(taskNum * 1.0000 / num * 100));
|
|
|
map.put("rateString", map.get("amount") + "/" + num);
|
|
|
map.put("taskRateString", map.get("amount") + "/" + taskNum);
|
|
|
map.put("targetRateString", taskNum + "/" + num);
|
|
|
map.put("num", num);
|
|
|
map.put("task", taskNum);
|
|
|
PopulationBase peopleNum = getPopulationBase(area,year);
|
|
|
if (peopleNum != null) {
|
|
|
int num = 0;
|
|
|
int taskNum = 0;
|
|
|
|
|
|
if (lowCode.equals("3")) {
|
|
|
num = peopleNum.getSixFiveNum();
|
|
|
taskNum = peopleNum.getSixFiveTaskNum();
|
|
|
} else if (lowCode.equals("1")) {
|
|
|
num = peopleNum.getGxyNum();
|
|
|
taskNum = peopleNum.getGxyTaskNum();
|
|
|
} else if (lowCode.equals("2")) {
|
|
|
num = peopleNum.getTnbNum();
|
|
|
taskNum = peopleNum.getTnbTaskNum();
|
|
|
}
|
|
|
map.put("rate", df.format(((long) map.get("amount") * 1.0000) / num * 100));
|
|
|
map.put("taskRate", df.format(((long) map.get("amount") * 1.0000) / taskNum * 100));
|
|
|
map.put("targetRate", df.format(taskNum * 1.0000 / num * 100));
|
|
|
map.put("rateString", map.get("amount") + "/" + num);
|
|
|
map.put("taskRateString", map.get("amount") + "/" + taskNum);
|
|
|
map.put("targetRateString", taskNum + "/" + num);
|
|
|
map.put("num", num);
|
|
|
map.put("task", taskNum);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@ -581,7 +526,7 @@ public class StatisticsAllService extends BaseService {
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public JSONArray getLowLevelTotal(String date, String area, int level, String index, int sort, String lowLevel) throws Exception {
|
|
|
public JSONArray getLowLevelTotal(String date, String area, int level, String index, int sort, String lowLevel, String year) throws Exception {
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
String low_level = String.valueOf(StringUtils.isEmpty(lowLevel) ? (level - 1) : lowLevel);
|
|
|
List<Map<String, Object>> resultList = new ArrayList<>();
|
|
@ -603,36 +548,16 @@ public class StatisticsAllService extends BaseService {
|
|
|
map.put("amount", map.get("amount") != null ? Long.valueOf(map.get("amount").toString()) : 0L);
|
|
|
|
|
|
if (!low_level.equals("1")) {
|
|
|
String redisNum = "";
|
|
|
try {
|
|
|
redisNum = redisTemplate.opsForValue().get("people:num:" + map.get("code").toString());
|
|
|
} catch (Exception e) {
|
|
|
redisNum = "";
|
|
|
}
|
|
|
if (StringUtils.isEmpty(redisNum)) {
|
|
|
PopulationBase peopleNum = peopleNumDao.findByCodeAndYear(map.get("code").toString(), Integer.valueOf(Constant.getNowYear()));
|
|
|
if (peopleNum != null) {
|
|
|
map.put("rate", df.format(((long) map.get("amount") * 1.0000) / peopleNum.getNum() * 100));
|
|
|
map.put("taskRate", df.format(((long) map.get("amount") * 1.0000) / peopleNum.getTaskNum() * 100));
|
|
|
map.put("targetRate", df.format(peopleNum.getTaskNum() * 1.0000 / peopleNum.getNum() * 100));
|
|
|
map.put("rateString", map.get("amount") + "/" + peopleNum.getNum());
|
|
|
map.put("taskRateString", map.get("amount") + "/" + peopleNum.getTaskNum());
|
|
|
map.put("targetRateString", peopleNum.getTaskNum() + "/" + peopleNum.getNum());
|
|
|
map.put("num", peopleNum.getNum());
|
|
|
map.put("task", peopleNum.getTaskNum());
|
|
|
}
|
|
|
} else {
|
|
|
JSONObject peopleNum = new JSONObject(redisNum);
|
|
|
if (peopleNum != null) {
|
|
|
map.put("rate", df.format(((long) map.get("amount") * 1.0000) / peopleNum.getInt("num") * 100));
|
|
|
map.put("taskRate", df.format(((long) map.get("amount") * 1.0000) / peopleNum.getInt("taskNum") * 100));
|
|
|
map.put("targetRate", df.format(peopleNum.getInt("taskNum") * 1.0000 / peopleNum.getInt("num") * 100));
|
|
|
map.put("rateString", map.get("amount") + "/" + peopleNum.getInt("num"));
|
|
|
map.put("taskRateString", map.get("amount") + "/" + peopleNum.getInt("taskNum"));
|
|
|
map.put("targetRateString", peopleNum.getInt("taskNum") + "/" + peopleNum.getInt("num"));
|
|
|
map.put("num", peopleNum.getInt("num"));
|
|
|
map.put("task", peopleNum.getInt("taskNum"));
|
|
|
}
|
|
|
PopulationBase peopleNum = getPopulationBase(area,year);
|
|
|
if (peopleNum != null) {
|
|
|
map.put("rate", df.format(((long) map.get("amount") * 1.0000) / peopleNum.getNum() * 100));
|
|
|
map.put("taskRate", df.format(((long) map.get("amount") * 1.0000) / peopleNum.getTaskNum() * 100));
|
|
|
map.put("targetRate", df.format(peopleNum.getTaskNum() * 1.0000 / peopleNum.getNum() * 100));
|
|
|
map.put("rateString", map.get("amount") + "/" + peopleNum.getNum());
|
|
|
map.put("taskRateString", map.get("amount") + "/" + peopleNum.getTaskNum());
|
|
|
map.put("targetRateString", peopleNum.getTaskNum() + "/" + peopleNum.getNum());
|
|
|
map.put("num", peopleNum.getNum());
|
|
|
map.put("task", peopleNum.getTaskNum());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@ -675,7 +600,7 @@ public class StatisticsAllService extends BaseService {
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public JSONArray getLowLevelTotalTeamLeader(String date, String area, int level, String index, int sort, String lowLevel) throws Exception {
|
|
|
public JSONArray getLowLevelTotalTeamLeader(String date, String area, int level, String index, int sort, String lowLevel, String year) throws Exception {
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
String low_level = String.valueOf(StringUtils.isEmpty(lowLevel) ? (level - 1) : lowLevel);
|
|
|
List<Map<String, Object>> resultList = new ArrayList<>();
|
|
@ -693,40 +618,22 @@ public class StatisticsAllService extends BaseService {
|
|
|
|
|
|
if (resultList != null) {
|
|
|
DecimalFormat df = new DecimalFormat("0.0000");
|
|
|
for (Map<String, Object> map : resultList) {
|
|
|
for (int i=0;i<resultList.size();i++) {
|
|
|
Map<String, Object> map=resultList.get(i);
|
|
|
map.put("amount", map.get("amount") != null ? Long.valueOf(map.get("amount").toString()) : 0L);
|
|
|
|
|
|
if (!low_level.equals("1")) {
|
|
|
String redisNum = "";
|
|
|
try {
|
|
|
redisNum = redisTemplate.opsForValue().get("people:num:" + map.get("code").toString());
|
|
|
} catch (Exception e) {
|
|
|
redisNum = "";
|
|
|
}
|
|
|
if (StringUtils.isEmpty(redisNum)) {
|
|
|
PopulationBase peopleNum = peopleNumDao.findByCodeAndYear(map.get("code").toString(), Integer.valueOf(Constant.getNowYear()));
|
|
|
if (peopleNum != null) {
|
|
|
map.put("rate", df.format(((long) map.get("amount") * 1.0000) / peopleNum.getNum() * 100));
|
|
|
map.put("taskRate", df.format(((long) map.get("amount") * 1.0000) / peopleNum.getTaskNum() * 100));
|
|
|
map.put("targetRate", df.format(peopleNum.getTaskNum() * 1.0000 / peopleNum.getNum() * 100));
|
|
|
map.put("rateString", map.get("amount") + "/" + peopleNum.getNum());
|
|
|
map.put("taskRateString", map.get("amount") + "/" + peopleNum.getTaskNum());
|
|
|
map.put("targetRateString", peopleNum.getTaskNum() + "/" + peopleNum.getNum());
|
|
|
map.put("num", peopleNum.getNum());
|
|
|
map.put("task", peopleNum.getTaskNum());
|
|
|
}
|
|
|
} else {
|
|
|
JSONObject peopleNum = new JSONObject(redisNum);
|
|
|
if (peopleNum != null) {
|
|
|
map.put("rate", df.format(((long) map.get("amount") * 1.0000) / peopleNum.getInt("num") * 100));
|
|
|
map.put("taskRate", df.format(((long) map.get("amount") * 1.0000) / peopleNum.getInt("taskNum") * 100));
|
|
|
map.put("targetRate", df.format(peopleNum.getInt("taskNum") * 1.0000 / peopleNum.getInt("num") * 100));
|
|
|
map.put("rateString", map.get("amount") + "/" + peopleNum.getInt("num"));
|
|
|
map.put("taskRateString", map.get("amount") + "/" + peopleNum.getInt("taskNum"));
|
|
|
map.put("targetRateString", peopleNum.getInt("taskNum") + "/" + peopleNum.getInt("num"));
|
|
|
map.put("num", peopleNum.getInt("num"));
|
|
|
map.put("task", peopleNum.getInt("taskNum"));
|
|
|
}
|
|
|
String code=map.get("code").toString();
|
|
|
PopulationBase peopleNum = getPopulationBase(code,year);
|
|
|
if (peopleNum != null) {
|
|
|
map.put("rate", df.format(((long) map.get("amount") * 1.0000) / peopleNum.getNum() * 100));
|
|
|
map.put("taskRate", df.format(((long) map.get("amount") * 1.0000) / peopleNum.getTaskNum() * 100));
|
|
|
map.put("targetRate", df.format(peopleNum.getTaskNum() * 1.0000 / peopleNum.getNum() * 100));
|
|
|
map.put("rateString", map.get("amount") + "/" + peopleNum.getNum());
|
|
|
map.put("taskRateString", map.get("amount") + "/" + peopleNum.getTaskNum());
|
|
|
map.put("targetRateString", peopleNum.getTaskNum() + "/" + peopleNum.getNum());
|
|
|
map.put("num", peopleNum.getNum());
|
|
|
map.put("task", peopleNum.getTaskNum());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@ -1866,58 +1773,26 @@ public class StatisticsAllService extends BaseService {
|
|
|
* @param index
|
|
|
* @return
|
|
|
*/
|
|
|
public JSONObject getDateTotal(String startDate, String endDate, int interval, String area, int level, String index, String lowCode) throws Exception {
|
|
|
public JSONObject getDateTotal(String startDate, String endDate, int interval, String area, int level, String index, String lowCode, String year) throws Exception {
|
|
|
int taskNum = 0;
|
|
|
JSONObject json = new JSONObject();
|
|
|
|
|
|
if (level > 1 && StringUtils.isEmpty(lowCode)) {
|
|
|
String redisNum = "";
|
|
|
try {
|
|
|
redisNum = redisTemplate.opsForValue().get("people:num:" + area);
|
|
|
} catch (Exception e) {
|
|
|
redisNum = "";
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isEmpty(redisNum)) {
|
|
|
PopulationBase peopleNum = peopleNumDao.findByCodeAndYear(area, Integer.valueOf(Constant.getNowYear()));
|
|
|
if (peopleNum != null) {
|
|
|
taskNum = peopleNum.getTaskNum();
|
|
|
}
|
|
|
} else {
|
|
|
JSONObject peopleNum = new JSONObject(redisNum);
|
|
|
if (peopleNum != null) {
|
|
|
taskNum = peopleNum.getInt("taskNum");
|
|
|
}
|
|
|
PopulationBase peopleNum = getPopulationBase(area,year);
|
|
|
if (peopleNum != null) {
|
|
|
taskNum = peopleNum.getTaskNum();
|
|
|
}
|
|
|
}
|
|
|
if (!StringUtils.isEmpty(lowCode)) {
|
|
|
String redisNum = "";
|
|
|
try {
|
|
|
redisNum = redisTemplate.opsForValue().get("people:num:" + area);
|
|
|
} catch (Exception e) {
|
|
|
redisNum = "";
|
|
|
}
|
|
|
if (StringUtils.isEmpty(redisNum)) {
|
|
|
PopulationBase peopleNum = peopleNumDao.findByCodeAndYear(area, Integer.valueOf(Constant.getNowYear()));
|
|
|
if (peopleNum != null) {
|
|
|
if (lowCode.equals("3")) {
|
|
|
taskNum = peopleNum.getSixFiveTaskNum();
|
|
|
} else if (lowCode.equals("1")) {
|
|
|
taskNum = peopleNum.getGxyTaskNum();
|
|
|
} else if (lowCode.equals("2")) {
|
|
|
taskNum = peopleNum.getTnbTaskNum();
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
JSONObject peopleNum = new JSONObject(redisNum);
|
|
|
if (peopleNum != null) {
|
|
|
if (lowCode.equals("3")) {
|
|
|
taskNum = peopleNum.getInt("sixFiveTaskNum");
|
|
|
} else if (lowCode.equals("1")) {
|
|
|
taskNum = peopleNum.getInt("gxyTaskNum");
|
|
|
} else if (lowCode.equals("2")) {
|
|
|
taskNum = peopleNum.getInt("tnbTaskNum");
|
|
|
}
|
|
|
PopulationBase peopleNum = getPopulationBase(area,year);
|
|
|
if (peopleNum != null) {
|
|
|
if (lowCode.equals("3")) {
|
|
|
taskNum = peopleNum.getSixFiveTaskNum();
|
|
|
} else if (lowCode.equals("1")) {
|
|
|
taskNum = peopleNum.getGxyTaskNum();
|
|
|
} else if (lowCode.equals("2")) {
|
|
|
taskNum = peopleNum.getTnbTaskNum();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@ -2509,11 +2384,11 @@ public class StatisticsAllService extends BaseService {
|
|
|
Integer expenseStatus0amountNum = expenseStatus0.get(map.get("code").toString());
|
|
|
Integer expenseStatus1amountNum = expenseStatus1.get(map.get("code").toString());
|
|
|
Integer expenseStatus1SigjnNum = expenseStatus1Sigjn.get(map.get("code").toString());
|
|
|
if(expenseStatus0amountNum==null){
|
|
|
expenseStatus0amountNum=0;
|
|
|
if (expenseStatus0amountNum == null) {
|
|
|
expenseStatus0amountNum = 0;
|
|
|
}
|
|
|
if(expenseStatus1amountNum==null){
|
|
|
expenseStatus1amountNum=0;
|
|
|
if (expenseStatus1amountNum == null) {
|
|
|
expenseStatus1amountNum = 0;
|
|
|
}
|
|
|
map.put("amount", map.get("amount") != null ? Long.valueOf(map.get("amount").toString()) : 0L);
|
|
|
map.put("weChatAmount0", expenseStatus0amountNum);//微信关注未交费数
|
|
@ -2715,7 +2590,7 @@ public class StatisticsAllService extends BaseService {
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public JSONArray getLevelTwoLowLevelTotalTeamLeader(String date, String area, int level, String index, int sort, String lowLevel, String lowCode) throws Exception {
|
|
|
public JSONArray getLevelTwoLowLevelTotalTeamLeader(String date, String area, int level, String index, int sort, String lowLevel, String lowCode, String year) throws Exception {
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
String low_level = String.valueOf(StringUtils.isEmpty(lowLevel) ? (level - 1) : lowLevel);
|
|
|
List<Map<String, Object>> resultList = new ArrayList<>();
|
|
@ -2739,62 +2614,29 @@ public class StatisticsAllService extends BaseService {
|
|
|
map.put("amount", map.get("amount") != null ? Long.valueOf(map.get("amount").toString()) : 0L);
|
|
|
|
|
|
if (!low_level.equals("1")) {
|
|
|
String redisNum = "";
|
|
|
try {
|
|
|
redisNum = redisTemplate.opsForValue().get("people:num:" + map.get("code").toString());
|
|
|
} catch (Exception e) {
|
|
|
redisNum = "";
|
|
|
}
|
|
|
if (StringUtils.isEmpty(redisNum)) {
|
|
|
PopulationBase peopleNum = peopleNumDao.findByCodeAndYear(map.get("code").toString(), Integer.valueOf(Constant.getNowYear()));
|
|
|
if (peopleNum != null) {
|
|
|
int num = 0;
|
|
|
int taskNum = 0;
|
|
|
|
|
|
if (lowCode.equals("3")) {
|
|
|
num = peopleNum.getSixFiveNum();
|
|
|
taskNum = peopleNum.getSixFiveTaskNum();
|
|
|
} else if (lowCode.equals("1")) {
|
|
|
num = peopleNum.getGxyNum();
|
|
|
taskNum = peopleNum.getGxyTaskNum();
|
|
|
} else if (lowCode.equals("2")) {
|
|
|
num = peopleNum.getTnbNum();
|
|
|
taskNum = peopleNum.getTnbTaskNum();
|
|
|
}
|
|
|
map.put("rate", df.format(((long) map.get("amount") * 1.0000) / num * 100));
|
|
|
map.put("taskRate", df.format(((long) map.get("amount") * 1.0000) / taskNum * 100));
|
|
|
map.put("targetRate", df.format(taskNum * 1.0000 / num * 100));
|
|
|
map.put("rateString", map.get("amount") + "/" + num);
|
|
|
map.put("taskRateString", map.get("amount") + "/" + taskNum);
|
|
|
map.put("targetRateString", taskNum + "/" + num);
|
|
|
map.put("num", num);
|
|
|
map.put("task", taskNum);
|
|
|
}
|
|
|
} else {
|
|
|
JSONObject peopleNum = new JSONObject(redisNum);
|
|
|
if (peopleNum != null) {
|
|
|
int num = 0;
|
|
|
int taskNum = 0;
|
|
|
|
|
|
if (lowCode.equals("3")) {
|
|
|
num = peopleNum.getInt("sixFiveNum");
|
|
|
taskNum = peopleNum.getInt("sixFiveTaskNum");
|
|
|
} else if (lowCode.equals("1")) {
|
|
|
num = peopleNum.getInt("gxyNum");
|
|
|
taskNum = peopleNum.getInt("gxyTaskNum");
|
|
|
} else if (lowCode.equals("2")) {
|
|
|
num = peopleNum.getInt("tnbNum");
|
|
|
taskNum = peopleNum.getInt("tnbTaskNum");
|
|
|
}
|
|
|
map.put("rate", df.format(((long) map.get("amount") * 1.0000) / num * 100));
|
|
|
map.put("taskRate", df.format(((long) map.get("amount") * 1.0000) / taskNum * 100));
|
|
|
map.put("targetRate", df.format(taskNum * 1.0000 / num * 100));
|
|
|
map.put("rateString", map.get("amount") + "/" + num);
|
|
|
map.put("taskRateString", map.get("amount") + "/" + taskNum);
|
|
|
map.put("targetRateString", taskNum + "/" + num);
|
|
|
map.put("num", num);
|
|
|
map.put("task", taskNum);
|
|
|
PopulationBase peopleNum = getPopulationBase(map.get("code").toString(),year);
|
|
|
if (peopleNum != null) {
|
|
|
int num = 0;
|
|
|
int taskNum = 0;
|
|
|
|
|
|
if (lowCode.equals("3")) {
|
|
|
num = peopleNum.getSixFiveNum();
|
|
|
taskNum = peopleNum.getSixFiveTaskNum();
|
|
|
} else if (lowCode.equals("1")) {
|
|
|
num = peopleNum.getGxyNum();
|
|
|
taskNum = peopleNum.getGxyTaskNum();
|
|
|
} else if (lowCode.equals("2")) {
|
|
|
num = peopleNum.getTnbNum();
|
|
|
taskNum = peopleNum.getTnbTaskNum();
|
|
|
}
|
|
|
map.put("rate", df.format(((long) map.get("amount") * 1.0000) / num * 100));
|
|
|
map.put("taskRate", df.format(((long) map.get("amount") * 1.0000) / taskNum * 100));
|
|
|
map.put("targetRate", df.format(taskNum * 1.0000 / num * 100));
|
|
|
map.put("rateString", map.get("amount") + "/" + num);
|
|
|
map.put("taskRateString", map.get("amount") + "/" + taskNum);
|
|
|
map.put("targetRateString", taskNum + "/" + num);
|
|
|
map.put("num", num);
|
|
|
map.put("task", taskNum);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@ -2836,6 +2678,7 @@ public class StatisticsAllService extends BaseService {
|
|
|
String filesize = df.format(size);
|
|
|
return filesize + "%";
|
|
|
}
|
|
|
|
|
|
public double getRangeDouuble(int first, int second, int i) {
|
|
|
if (second == 0 && first > 0) {
|
|
|
//如果分母为0 分子不为0 返回100%
|
|
@ -2849,6 +2692,7 @@ public class StatisticsAllService extends BaseService {
|
|
|
String filesize = df.format(size);
|
|
|
return Double.valueOf(filesize);
|
|
|
}
|
|
|
|
|
|
public JSONArray getLevelTwoLowLevelTotalSignAndRenew(String area, int level, String index, int sort, String lowLevel, String year) throws Exception {
|
|
|
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
@ -2973,4 +2817,10 @@ public class StatisticsAllService extends BaseService {
|
|
|
return switchJo;
|
|
|
}
|
|
|
|
|
|
public PopulationBase getPopulationBase(String code,String year){
|
|
|
|
|
|
String sql="select * from wlyy_people_num where code=? and year=? ";
|
|
|
List<PopulationBase> peopleNum = jdbcTemplate.query(sql,new BeanPropertyRowMapper(PopulationBase.class),code,year);
|
|
|
return peopleNum.get(0);
|
|
|
}
|
|
|
}
|