|
@@ -1,7 +1,8 @@
|
|
|
package com.xt.jygl.gkyxtjyfx.hzttltj.ctl;
|
|
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
import java.util.ArrayList;
|
|
|
-import java.util.Calendar;
|
|
|
+import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
|
import javax.persistence.criteria.CriteriaBuilder;
|
|
@@ -24,319 +25,325 @@ import com.xtframe.util.StringUtils;
|
|
|
|
|
|
@Controller
|
|
|
@RequestMapping(value = "/hwttlfx")
|
|
|
-public class HwttlfxCtl extends BaseWebCtl{
|
|
|
+public class HwttlfxCtl extends BaseWebCtl {
|
|
|
|
|
|
@Autowired
|
|
|
private QueryService query;
|
|
|
@Autowired
|
|
|
private HwttlfxService hwttlfxService;
|
|
|
-
|
|
|
- @RequestMapping(value="/main")
|
|
|
- public String main(Model model,final HttpServletRequest request,String tjx,String zzbl,final String startDate,final String endDate,final String menuid){
|
|
|
|
|
|
- Specification<FlhwttlhjEntity> spec = new Specification<FlhwttlhjEntity>() {
|
|
|
+ @RequestMapping(value = "/main")
|
|
|
+ public String main(Model model, final HttpServletRequest request, String tjx, String zzbl, final String startDate, final String endDate, final String menuid) {
|
|
|
+ String start="";
|
|
|
+ String end="";
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
|
|
|
+ Date date1 = new Date();
|
|
|
+ if (StringUtils.isEmpty(startDate)) {
|
|
|
+ start = sdf.format(date1).substring(0, 5) + "01";
|
|
|
+ end = sdf.format(date1);
|
|
|
+ }
|
|
|
|
|
|
+ Specification<FlhwttlhjEntity> spec = new Specification<FlhwttlhjEntity>() {
|
|
|
@Override
|
|
|
public Predicate toPredicate(Root<FlhwttlhjEntity> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
|
|
|
List<Predicate> list = new ArrayList<Predicate>();
|
|
|
- if (StringUtils.isNotEmpty(startDate)&&StringUtils.isNotEmpty(endDate)) {
|
|
|
- list.add(cb.between(root.get("tj_month").as(String.class), startDate,endDate));
|
|
|
- }else{
|
|
|
- Calendar currentDate = Calendar.getInstance();
|
|
|
- list.add(cb.between(root.get("tj_month").as(String.class), currentDate.get(Calendar.YEAR)+"-01",
|
|
|
- currentDate.get(Calendar.YEAR)+"-"+currentDate.get(Calendar.MONTH)));
|
|
|
+ if (StringUtils.isNotEmpty(startDate) && StringUtils.isNotEmpty(endDate)) {
|
|
|
+ list.add(cb.between(root.get("tj_month").as(String.class), startDate, endDate));
|
|
|
+ } else {
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
|
|
|
+ list.add(cb.between(root.get("tj_month").as(String.class),sdf.format(new Date()).substring(0, 5) + "01",sdf.format(new Date())));
|
|
|
}
|
|
|
return cb.and(list.toArray(new Predicate[] {}));
|
|
|
}
|
|
|
};
|
|
|
-
|
|
|
+
|
|
|
List<FlhwttlhjEntity> entityList = query.findAll(spec, FlhwttlhjEntity.class);
|
|
|
- //吞吐量
|
|
|
+ // 吞吐量
|
|
|
List<String> ttl = new ArrayList<String>();
|
|
|
- //时间区间
|
|
|
+ // 时间区间
|
|
|
List<String> dateList = new ArrayList<String>();
|
|
|
- //比率
|
|
|
+ // 比率
|
|
|
List<String> bl = new ArrayList<String>();
|
|
|
String[] date;
|
|
|
- int year,month;
|
|
|
- //获取吞吐量
|
|
|
- if(StringUtils.isEmpty(tjx) || tjx.equals("GK03010202000000000000000000")){
|
|
|
- for(FlhwttlhjEntity e : entityList){
|
|
|
- ttl.add(e.getGK03010202000000000000000000()+"");
|
|
|
+ int year, month;
|
|
|
+ // 获取吞吐量
|
|
|
+ if (StringUtils.isEmpty(tjx) || tjx.equals("GK03010202000000000000000000")) {
|
|
|
+ for (FlhwttlhjEntity e : entityList) {
|
|
|
+ ttl.add((e.getGK03010202000000000000000000() / 10000) + "");
|
|
|
}
|
|
|
- //比率
|
|
|
- //同比
|
|
|
- if(StringUtils.isEmpty(zzbl)||"tb".equals(zzbl)){
|
|
|
- for(FlhwttlhjEntity e : entityList){
|
|
|
+ // 比率
|
|
|
+ // 同比
|
|
|
+ if (StringUtils.isEmpty(zzbl) || "tb".equals(zzbl)) {
|
|
|
+ for (FlhwttlhjEntity e : entityList) {
|
|
|
date = e.gettj_month().split("-");
|
|
|
- year = Integer.parseInt(date[0])-1;
|
|
|
+ year = Integer.parseInt(date[0]) - 1;
|
|
|
month = Integer.parseInt(date[1]);
|
|
|
FlhwttlhjEntity temp;
|
|
|
- //月份补0
|
|
|
- if(month<10){
|
|
|
- temp = hwttlfxService.findOne(year+"-0"+month);
|
|
|
- }else{
|
|
|
- temp = hwttlfxService.findOne(year+"-"+month);
|
|
|
+ // 月份补0
|
|
|
+ if (month < 10) {
|
|
|
+ temp = hwttlfxService.findOne(year + "-0" + month);
|
|
|
+ } else {
|
|
|
+ temp = hwttlfxService.findOne(year + "-" + month);
|
|
|
}
|
|
|
- if(temp == null || e.getGK03010202000000000000000000() == 0){
|
|
|
+ if (temp == null || e.getGK03010202000000000000000000() == 0) {
|
|
|
bl.add("0");
|
|
|
- }else{
|
|
|
- bl.add(""+(int)((e.getGK03010202000000000000000000()-temp.getGK03010202000000000000000000())/temp.getGK03010202000000000000000000()*100));
|
|
|
+ } else {
|
|
|
+ bl.add("" + (int) ((e.getGK03010202000000000000000000() - temp.getGK03010202000000000000000000()) / temp.getGK03010202000000000000000000() * 100));
|
|
|
}
|
|
|
}
|
|
|
- }else if("hb".equals(zzbl)){
|
|
|
- for(int i = 0; i < entityList.size(); i++){
|
|
|
- if(i == 0){
|
|
|
+ } else if ("hb".equals(zzbl)) {
|
|
|
+ for (int i = 0; i < entityList.size(); i++) {
|
|
|
+ if (i == 0) {
|
|
|
date = entityList.get(i).gettj_month().split("-");
|
|
|
year = Integer.parseInt(date[0]);
|
|
|
month = Integer.parseInt(date[1]);
|
|
|
FlhwttlhjEntity temp = null;
|
|
|
- if(month == 1){
|
|
|
+ if (month == 1) {
|
|
|
year = year - 1;
|
|
|
month = 12;
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
month = month - 1;
|
|
|
- if(month<10){
|
|
|
- temp = hwttlfxService.findOne(year+"-0"+month);
|
|
|
- }else{
|
|
|
- temp = hwttlfxService.findOne(year+"-"+month);
|
|
|
+ if (month < 10) {
|
|
|
+ temp = hwttlfxService.findOne(year + "-0" + month);
|
|
|
+ } else {
|
|
|
+ temp = hwttlfxService.findOne(year + "-" + month);
|
|
|
}
|
|
|
}
|
|
|
- if(temp == null || entityList.get(i).getGK03010202000000000000000000() == 0){
|
|
|
+ if (temp == null || entityList.get(i).getGK03010202000000000000000000() == 0) {
|
|
|
bl.add("0");
|
|
|
- }else{
|
|
|
- bl.add(""+(int)((entityList.get(i).getGK03010202000000000000000000()-temp.getGK03010202000000000000000000())/entityList.get(i).getGK03010202000000000000000000()*100));
|
|
|
+ } else {
|
|
|
+ bl.add("" + (int) ((entityList.get(i).getGK03010202000000000000000000() - temp.getGK03010202000000000000000000()) / entityList.get(i).getGK03010202000000000000000000() * 100));
|
|
|
}
|
|
|
- }else{
|
|
|
- if(entityList.get(i).getGK03010202000000000000000000() == 0){
|
|
|
+ } else {
|
|
|
+ if (entityList.get(i).getGK03010202000000000000000000() == 0) {
|
|
|
bl.add("0");
|
|
|
- }else{
|
|
|
- bl.add(""+(int)((entityList.get(i).getGK03010202000000000000000000()-entityList.get(i-1).getGK03010202000000000000000000())/entityList.get(i).getGK03010202000000000000000000()*100));
|
|
|
+ } else {
|
|
|
+ bl.add("" + (int) ((entityList.get(i).getGK03010202000000000000000000() - entityList.get(i - 1).getGK03010202000000000000000000()) / entityList.get(i).getGK03010202000000000000000000() * 100));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }else{
|
|
|
- for(int i = 0; i < entityList.size(); i++){
|
|
|
- if(i == 0){
|
|
|
+ } else {
|
|
|
+ for (int i = 0; i < entityList.size(); i++) {
|
|
|
+ if (i == 0) {
|
|
|
date = entityList.get(i).gettj_month().split("-");
|
|
|
year = Integer.parseInt(date[0]);
|
|
|
month = Integer.parseInt(date[1]);
|
|
|
FlhwttlhjEntity temp = null;
|
|
|
- if(month == 1){
|
|
|
+ if (month == 1) {
|
|
|
year = year - 1;
|
|
|
month = 12;
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
month = month - 1;
|
|
|
- if(month<10){
|
|
|
- temp = hwttlfxService.findOne(year+"-0"+month);
|
|
|
- }else{
|
|
|
- temp = hwttlfxService.findOne(year+"-"+month);
|
|
|
+ if (month < 10) {
|
|
|
+ temp = hwttlfxService.findOne(year + "-0" + month);
|
|
|
+ } else {
|
|
|
+ temp = hwttlfxService.findOne(year + "-" + month);
|
|
|
}
|
|
|
}
|
|
|
- if(temp == null){
|
|
|
+ if (temp == null) {
|
|
|
bl.add("0");
|
|
|
- }else{
|
|
|
- bl.add(""+(int)((entityList.get(i).getGK03010202000000000000000000()-temp.getGK03010202000000000000000000())/temp.getGK03010202000000000000000000()*100));
|
|
|
+ } else {
|
|
|
+ bl.add("" + (int) ((entityList.get(i).getGK03010202000000000000000000() - temp.getGK03010202000000000000000000()) / temp.getGK03010202000000000000000000() * 100));
|
|
|
}
|
|
|
- }else{
|
|
|
- if(entityList.get(i-1).getGK03010202000000000000000000() == 0 && entityList.get(i).getGK03010202000000000000000000() != 0){
|
|
|
+ } else {
|
|
|
+ if (entityList.get(i - 1).getGK03010202000000000000000000() == 0 && entityList.get(i).getGK03010202000000000000000000() != 0) {
|
|
|
bl.add("100");
|
|
|
- }else if(entityList.get(i).getGK03010202000000000000000000() == 0){
|
|
|
+ } else if (entityList.get(i).getGK03010202000000000000000000() == 0) {
|
|
|
bl.add("0");
|
|
|
- }else{
|
|
|
- bl.add(""+(int)((entityList.get(i).getGK03010202000000000000000000()-entityList.get(i-1).getGK03010202000000000000000000())/entityList.get(i-1).getGK03010202000000000000000000()*100));
|
|
|
+ } else {
|
|
|
+ bl.add("" + (int) ((entityList.get(i).getGK03010202000000000000000000() - entityList.get(i - 1).getGK03010202000000000000000000()) / entityList.get(i - 1).getGK03010202000000000000000000() * 100));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }else if(tjx.equals("GK03010202000010000000000000")){
|
|
|
- for(FlhwttlhjEntity e : entityList){
|
|
|
- ttl.add(e.getGK03010202000010000000000000()+"");
|
|
|
+ } else if (tjx.equals("GK03010202000010000000000000")) {
|
|
|
+ for (FlhwttlhjEntity e : entityList) {
|
|
|
+ ttl.add(e.getGK03010202000010000000000000()/10000 + "");
|
|
|
}
|
|
|
- //比率
|
|
|
- if(StringUtils.isEmpty(zzbl)||zzbl.equals("tb")){
|
|
|
- for(FlhwttlhjEntity e : entityList){
|
|
|
+ // 比率
|
|
|
+ if (StringUtils.isEmpty(zzbl) || zzbl.equals("tb")) {
|
|
|
+ for (FlhwttlhjEntity e : entityList) {
|
|
|
date = e.gettj_month().split("-");
|
|
|
- year = Integer.parseInt(date[0])-1;
|
|
|
+ year = Integer.parseInt(date[0]) - 1;
|
|
|
month = Integer.parseInt(date[1]);
|
|
|
FlhwttlhjEntity temp;
|
|
|
- if(month<10){
|
|
|
- temp = hwttlfxService.findOne(year+"-0"+month);
|
|
|
- }else{
|
|
|
- temp = hwttlfxService.findOne(year+"-"+month);
|
|
|
+ if (month < 10) {
|
|
|
+ temp = hwttlfxService.findOne(year + "-0" + month);
|
|
|
+ } else {
|
|
|
+ temp = hwttlfxService.findOne(year + "-" + month);
|
|
|
}
|
|
|
- if(temp == null || e.getGK03010202000010000000000000() == 0){
|
|
|
+ if (temp == null || e.getGK03010202000010000000000000() == 0) {
|
|
|
bl.add("0");
|
|
|
- }else{
|
|
|
- bl.add(""+(int)((e.getGK03010202000010000000000000()-temp.getGK03010202000010000000000000())/temp.getGK03010202000010000000000000()*100));
|
|
|
+ } else {
|
|
|
+ bl.add("" + (int) ((e.getGK03010202000010000000000000() - temp.getGK03010202000010000000000000()) / temp.getGK03010202000010000000000000() * 100));
|
|
|
}
|
|
|
}
|
|
|
- }else if("hb".equals(zzbl)){
|
|
|
- for(int i = 0; i < entityList.size(); i++){
|
|
|
- if(i == 0){
|
|
|
+ } else if ("hb".equals(zzbl)) {
|
|
|
+ for (int i = 0; i < entityList.size(); i++) {
|
|
|
+ if (i == 0) {
|
|
|
date = entityList.get(i).gettj_month().split("-");
|
|
|
year = Integer.parseInt(date[0]);
|
|
|
month = Integer.parseInt(date[1]);
|
|
|
FlhwttlhjEntity temp = null;
|
|
|
- if(month == 1){
|
|
|
+ if (month == 1) {
|
|
|
year = year - 1;
|
|
|
month = 12;
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
month = month - 1;
|
|
|
- if(month<10){
|
|
|
- temp = hwttlfxService.findOne(year+"-0"+month);
|
|
|
- }else{
|
|
|
- temp = hwttlfxService.findOne(year+"-"+month);
|
|
|
+ if (month < 10) {
|
|
|
+ temp = hwttlfxService.findOne(year + "-0" + month);
|
|
|
+ } else {
|
|
|
+ temp = hwttlfxService.findOne(year + "-" + month);
|
|
|
}
|
|
|
}
|
|
|
- if(temp == null || entityList.get(i).getGK03010202000010000000000000() == 0){
|
|
|
+ if (temp == null || entityList.get(i).getGK03010202000010000000000000() == 0) {
|
|
|
bl.add("0");
|
|
|
- }else{
|
|
|
- bl.add(""+(int)((entityList.get(i).getGK03010202000010000000000000()-temp.getGK03010202000010000000000000())/entityList.get(i).getGK03010202000010000000000000()*100));
|
|
|
+ } else {
|
|
|
+ bl.add("" + (int) ((entityList.get(i).getGK03010202000010000000000000() - temp.getGK03010202000010000000000000()) / entityList.get(i).getGK03010202000010000000000000() * 100));
|
|
|
}
|
|
|
- }else{
|
|
|
- if(entityList.get(i).getGK03010202000010000000000000() == 0){
|
|
|
+ } else {
|
|
|
+ if (entityList.get(i).getGK03010202000010000000000000() == 0) {
|
|
|
bl.add("0");
|
|
|
- }else{
|
|
|
- bl.add(""+(int)((entityList.get(i).getGK03010202000010000000000000()-entityList.get(i-1).getGK03010202000010000000000000())/entityList.get(i).getGK03010202000010000000000000()*100));
|
|
|
+ } else {
|
|
|
+ bl.add("" + (int) ((entityList.get(i).getGK03010202000010000000000000() - entityList.get(i - 1).getGK03010202000010000000000000()) / entityList.get(i).getGK03010202000010000000000000() * 100));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }else{
|
|
|
- for(int i = 0; i < entityList.size(); i++){
|
|
|
- if(i == 0){
|
|
|
+ } else {
|
|
|
+ for (int i = 0; i < entityList.size(); i++) {
|
|
|
+ if (i == 0) {
|
|
|
date = entityList.get(i).gettj_month().split("-");
|
|
|
year = Integer.parseInt(date[0]);
|
|
|
month = Integer.parseInt(date[1]);
|
|
|
FlhwttlhjEntity temp = null;
|
|
|
- if(month == 1){
|
|
|
+ if (month == 1) {
|
|
|
year = year - 1;
|
|
|
month = 12;
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
month = month - 1;
|
|
|
- if(month<10){
|
|
|
- temp = hwttlfxService.findOne(year+"-0"+month);
|
|
|
- }else{
|
|
|
- temp = hwttlfxService.findOne(year+"-"+month);
|
|
|
+ if (month < 10) {
|
|
|
+ temp = hwttlfxService.findOne(year + "-0" + month);
|
|
|
+ } else {
|
|
|
+ temp = hwttlfxService.findOne(year + "-" + month);
|
|
|
}
|
|
|
}
|
|
|
- if(temp == null){
|
|
|
+ if (temp == null) {
|
|
|
bl.add("0");
|
|
|
- }else{
|
|
|
- bl.add(""+(int)((entityList.get(i).getGK03010202000010000000000000()-temp.getGK03010202000010000000000000())/temp.getGK03010202000010000000000000()*100));
|
|
|
+ } else {
|
|
|
+ bl.add("" + (int) ((entityList.get(i).getGK03010202000010000000000000() - temp.getGK03010202000010000000000000()) / temp.getGK03010202000010000000000000() * 100));
|
|
|
}
|
|
|
- }else{
|
|
|
- if(entityList.get(i).getGK03010202000010000000000000() != 0 && entityList.get(i-1).getGK03010202000010000000000000() == 0){
|
|
|
+ } else {
|
|
|
+ if (entityList.get(i).getGK03010202000010000000000000() != 0 && entityList.get(i - 1).getGK03010202000010000000000000() == 0) {
|
|
|
bl.add("100");
|
|
|
- }else if(entityList.get(i).getGK03010202000010000000000000() == 0){
|
|
|
+ } else if (entityList.get(i).getGK03010202000010000000000000() == 0) {
|
|
|
bl.add("0");
|
|
|
- }else{
|
|
|
- bl.add(""+(int)((entityList.get(i).getGK03010202000010000000000000()-entityList.get(i-1).getGK03010202000010000000000000())/entityList.get(i-1).getGK03010202000010000000000000()*100));
|
|
|
+ } else {
|
|
|
+ bl.add("" + (int) ((entityList.get(i).getGK03010202000010000000000000() - entityList.get(i - 1).getGK03010202000010000000000000()) / entityList.get(i - 1).getGK03010202000010000000000000() * 100));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }else if(tjx.equals("GK03010202000020000000000000")){
|
|
|
- for(FlhwttlhjEntity e : entityList){
|
|
|
- ttl.add(e.getGK03010202000020000000000000()+"");
|
|
|
+ } else if (tjx.equals("GK03010202000020000000000000")) {
|
|
|
+ for (FlhwttlhjEntity e : entityList) {
|
|
|
+ ttl.add(e.getGK03010202000020000000000000()/10000 + "");
|
|
|
}
|
|
|
- //比率
|
|
|
- if(StringUtils.isEmpty(zzbl)||zzbl.equals("tb")){
|
|
|
- for(FlhwttlhjEntity e : entityList){
|
|
|
+ // 比率
|
|
|
+ if (StringUtils.isEmpty(zzbl) || zzbl.equals("tb")) {
|
|
|
+ for (FlhwttlhjEntity e : entityList) {
|
|
|
date = e.gettj_month().split("-");
|
|
|
- year = Integer.parseInt(date[0])-1;
|
|
|
+ year = Integer.parseInt(date[0]) - 1;
|
|
|
month = Integer.parseInt(date[1]);
|
|
|
FlhwttlhjEntity temp;
|
|
|
- if(month<10){
|
|
|
- temp = hwttlfxService.findOne(year+"-0"+month);
|
|
|
- }else{
|
|
|
- temp = hwttlfxService.findOne(year+"-"+month);
|
|
|
+ if (month < 10) {
|
|
|
+ temp = hwttlfxService.findOne(year + "-0" + month);
|
|
|
+ } else {
|
|
|
+ temp = hwttlfxService.findOne(year + "-" + month);
|
|
|
}
|
|
|
- if(temp == null || e.getGK03010202000020000000000000() == 0){
|
|
|
+ if (temp == null || e.getGK03010202000020000000000000() == 0) {
|
|
|
bl.add("0");
|
|
|
- }else{
|
|
|
- bl.add(""+(int)((e.getGK03010202000020000000000000()-temp.getGK03010202000020000000000000())/temp.getGK03010202000020000000000000()*100));
|
|
|
+ } else {
|
|
|
+ bl.add("" + (int) ((e.getGK03010202000020000000000000() - temp.getGK03010202000020000000000000()) / temp.getGK03010202000020000000000000() * 100));
|
|
|
}
|
|
|
}
|
|
|
- }else if("hb".equals(zzbl)){
|
|
|
- for(int i = 0; i < entityList.size(); i++){
|
|
|
- if(i == 0){
|
|
|
+ } else if ("hb".equals(zzbl)) {
|
|
|
+ for (int i = 0; i < entityList.size(); i++) {
|
|
|
+ if (i == 0) {
|
|
|
date = entityList.get(i).gettj_month().split("-");
|
|
|
year = Integer.parseInt(date[0]);
|
|
|
month = Integer.parseInt(date[1]);
|
|
|
FlhwttlhjEntity temp = null;
|
|
|
- if(month == 1){
|
|
|
+ if (month == 1) {
|
|
|
year = year - 1;
|
|
|
month = 12;
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
month = month - 1;
|
|
|
- if(month<10){
|
|
|
- temp = hwttlfxService.findOne(year+"-0"+month);
|
|
|
- }else{
|
|
|
- temp = hwttlfxService.findOne(year+"-"+month);
|
|
|
+ if (month < 10) {
|
|
|
+ temp = hwttlfxService.findOne(year + "-0" + month);
|
|
|
+ } else {
|
|
|
+ temp = hwttlfxService.findOne(year + "-" + month);
|
|
|
}
|
|
|
}
|
|
|
- if(temp == null || entityList.get(i).getGK03010202000020000000000000() == 0){
|
|
|
+ if (temp == null || entityList.get(i).getGK03010202000020000000000000() == 0) {
|
|
|
bl.add("0");
|
|
|
- }else{
|
|
|
- bl.add(""+(int)((entityList.get(i).getGK03010202000020000000000000()-temp.getGK03010202000020000000000000())/entityList.get(i).getGK03010202000020000000000000()*100));
|
|
|
+ } else {
|
|
|
+ bl.add("" + (int) ((entityList.get(i).getGK03010202000020000000000000() - temp.getGK03010202000020000000000000()) / entityList.get(i).getGK03010202000020000000000000() * 100));
|
|
|
}
|
|
|
- }else{
|
|
|
- if(entityList.get(i).getGK03010202000020000000000000()==0){
|
|
|
+ } else {
|
|
|
+ if (entityList.get(i).getGK03010202000020000000000000() == 0) {
|
|
|
bl.add("0");
|
|
|
- }else{
|
|
|
- bl.add(""+(int)((entityList.get(i).getGK03010202000020000000000000()-entityList.get(i-1).getGK03010202000020000000000000())/entityList.get(i).getGK03010202000020000000000000()*100));
|
|
|
+ } else {
|
|
|
+ bl.add("" + (int) ((entityList.get(i).getGK03010202000020000000000000() - entityList.get(i - 1).getGK03010202000020000000000000()) / entityList.get(i).getGK03010202000020000000000000() * 100));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }else{
|
|
|
- for(int i = 0; i < entityList.size(); i++){
|
|
|
- if(i == 0){
|
|
|
+ } else {
|
|
|
+ for (int i = 0; i < entityList.size(); i++) {
|
|
|
+ if (i == 0) {
|
|
|
date = entityList.get(i).gettj_month().split("-");
|
|
|
year = Integer.parseInt(date[0]);
|
|
|
month = Integer.parseInt(date[1]);
|
|
|
FlhwttlhjEntity temp = null;
|
|
|
- if(month == 1){
|
|
|
+ if (month == 1) {
|
|
|
year = year - 1;
|
|
|
month = 12;
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
month = month - 1;
|
|
|
- if(month<10){
|
|
|
- temp = hwttlfxService.findOne(year+"-0"+month);
|
|
|
- }else{
|
|
|
- temp = hwttlfxService.findOne(year+"-"+month);
|
|
|
+ if (month < 10) {
|
|
|
+ temp = hwttlfxService.findOne(year + "-0" + month);
|
|
|
+ } else {
|
|
|
+ temp = hwttlfxService.findOne(year + "-" + month);
|
|
|
}
|
|
|
}
|
|
|
- if(temp == null){
|
|
|
+ if (temp == null) {
|
|
|
bl.add("0");
|
|
|
- }else{
|
|
|
- bl.add(""+(int)((entityList.get(i).getGK03010202000020000000000000()-temp.getGK03010202000020000000000000())/temp.getGK03010202000020000000000000()*100));
|
|
|
+ } else {
|
|
|
+ bl.add("" + (int) ((entityList.get(i).getGK03010202000020000000000000() - temp.getGK03010202000020000000000000()) / temp.getGK03010202000020000000000000() * 100));
|
|
|
}
|
|
|
- }else{
|
|
|
- if(entityList.get(i).getGK03010202000020000000000000() != 0 && entityList.get(i-1).getGK03010202000020000000000000() == 0){
|
|
|
+ } else {
|
|
|
+ if (entityList.get(i).getGK03010202000020000000000000() != 0 && entityList.get(i - 1).getGK03010202000020000000000000() == 0) {
|
|
|
bl.add("100");
|
|
|
- }else if(entityList.get(i).getGK03010202000020000000000000() == 0){
|
|
|
+ } else if (entityList.get(i).getGK03010202000020000000000000() == 0) {
|
|
|
bl.add("0");
|
|
|
- }else{
|
|
|
- bl.add(""+(int)((entityList.get(i).getGK03010202000020000000000000()-entityList.get(i-1).getGK03010202000020000000000000())/entityList.get(i-1).getGK03010202000020000000000000()*100));
|
|
|
+ } else {
|
|
|
+ bl.add("" + (int) ((entityList.get(i).getGK03010202000020000000000000() - entityList.get(i - 1).getGK03010202000020000000000000()) / entityList.get(i - 1).getGK03010202000020000000000000() * 100));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- //获取时间区间
|
|
|
- for(FlhwttlhjEntity e : entityList){
|
|
|
- dateList.add("'"+e.gettj_month()+"'");
|
|
|
+ // 获取时间区间
|
|
|
+ for (FlhwttlhjEntity e : entityList) {
|
|
|
+ dateList.add("'" + e.gettj_month() + "'");
|
|
|
}
|
|
|
- model.addAttribute("bl",bl);
|
|
|
+ model.addAttribute("bl", bl);
|
|
|
model.addAttribute("ttl", ttl);
|
|
|
model.addAttribute("dateList", dateList);
|
|
|
- model.addAttribute("startDate", startDate);
|
|
|
- model.addAttribute("endDate", endDate);
|
|
|
+ model.addAttribute("startDate", startDate != null ? startDate : start);
|
|
|
+ model.addAttribute("endDate", endDate != null ? endDate : end);
|
|
|
model.addAttribute("zzbl", zzbl);
|
|
|
model.addAttribute("tjx", tjx);
|
|
|
model.addAttribute("menuid", menuid);
|
|
|
return "gkyxtjyfx/gkhwttlfx/gkhwttlfx";
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|