修改OTA优化
This commit is contained in:
+5
-1
@@ -127,7 +127,11 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
|
||||
@Cacheable(value = CacheConstant.SYS_DICT_CACHE,key = "#code+':'+#key+#cut")
|
||||
public String queryDictTextByKeyEn(String code, String key,String cut) {
|
||||
log.debug("无缓存dictText的时候调用这里!");
|
||||
return sysDictMapper.queryDictTextByKeyEn(code, key);
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
return sysDictMapper.queryDictTextByKey(code, key);
|
||||
}else{
|
||||
return sysDictMapper.queryDictTextByKeyEn(code, key);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+24
-2
@@ -12,6 +12,8 @@ import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.modules.extRepo.entity.ExtRepoData;
|
||||
import com.jero.modules.ota.entity.OtaBaCxList;
|
||||
import com.jero.modules.ota.service.IOtaBaCxListService;
|
||||
import com.jero.modules.ota.utils.ComparisonUtil;
|
||||
import com.jero.modules.system.service.ISysDictService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -26,6 +28,7 @@ import org.springframework.web.servlet.ModelAndView;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -43,6 +46,8 @@ import java.util.Map;
|
||||
public class OtaBaCxListController extends JeroController<OtaBaCxList, IOtaBaCxListService> {
|
||||
@Autowired
|
||||
private IOtaBaCxListService otaBaCxListService;
|
||||
@Autowired
|
||||
private ISysDictService sysDictService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
@@ -94,7 +99,23 @@ public class OtaBaCxListController extends JeroController<OtaBaCxList, IOtaBaCxL
|
||||
}
|
||||
queryWrapper.orderByDesc(OtaBaCxList::getCreateTime);
|
||||
IPage<OtaBaCxList> pageList = otaBaCxListService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
for (OtaBaCxList pa : pageList.getRecords()) {
|
||||
pa.setBazt_dictText(sysDictService.queryDictTextByKeyEn("recordstatus", pa.getBazt(), req.getParameter("cut")));
|
||||
}
|
||||
Map<String, Object> resMap = new HashMap<>();
|
||||
resMap.put("list", pageList);
|
||||
//有审批周期的数据
|
||||
int days = 0;
|
||||
int spzqSum = 0;
|
||||
List<OtaBaCxList> list = otaBaCxListService.list(queryWrapper);
|
||||
for (OtaBaCxList cx : list) {
|
||||
if (StringUtils.isNotEmpty(cx.getSpzq())) {
|
||||
days++;
|
||||
spzqSum += Integer.parseInt(cx.getSpzq());
|
||||
}
|
||||
}
|
||||
resMap.put("pjspzq", days == 0 ? 0 : Math.floor(spzqSum / days));
|
||||
return Result.OK(resMap);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -219,9 +240,10 @@ public class OtaBaCxListController extends JeroController<OtaBaCxList, IOtaBaCxL
|
||||
String ids = json.getString("ids");
|
||||
String bazt = json.getString("bazt");
|
||||
String batjsj = json.getString("batjsj");
|
||||
String tgthsj = json.getString("tgthsj");
|
||||
String bz = json.getString("bz");
|
||||
String cut = json.getString("cut");
|
||||
otaBaCxListService.batchRecord(ids, bazt, batjsj, bz, cut);
|
||||
otaBaCxListService.batchRecord(ids, bazt, batjsj,tgthsj, bz, cut);
|
||||
return Result.OK("备案维护成功!");
|
||||
}
|
||||
|
||||
|
||||
+26
-3
@@ -12,6 +12,8 @@ import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.modules.ota.entity.OtaBaCxList;
|
||||
import com.jero.modules.ota.entity.OtaBaSjList;
|
||||
import com.jero.modules.ota.service.IOtaBaSjListService;
|
||||
import com.jero.modules.ota.utils.ComparisonUtil;
|
||||
import com.jero.modules.system.service.ISysDictService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -25,7 +27,9 @@ import org.springframework.web.servlet.ModelAndView;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
@@ -41,6 +45,8 @@ import java.util.List;
|
||||
public class OtaBaSjListController extends JeroController<OtaBaSjList, IOtaBaSjListService> {
|
||||
@Autowired
|
||||
private IOtaBaSjListService otaBaSjListService;
|
||||
@Autowired
|
||||
private ISysDictService sysDictService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
@@ -90,8 +96,24 @@ public class OtaBaSjListController extends JeroController<OtaBaSjList, IOtaBaSjL
|
||||
}
|
||||
queryWrapper.orderByDesc(OtaBaSjList::getCreateTime);
|
||||
IPage<OtaBaSjList> pageList = otaBaSjListService.page(page, queryWrapper);
|
||||
this.otaBaSjListService.disposeData(pageList.getRecords(),otaBaSjList);
|
||||
return Result.OK(pageList);
|
||||
for (OtaBaSjList pa : pageList.getRecords()) {
|
||||
pa.setBazt_dictText(sysDictService.queryDictTextByKeyEn("recordstatus", pa.getBazt(), req.getParameter("cut")));
|
||||
}
|
||||
this.otaBaSjListService.disposeData(pageList.getRecords(), otaBaSjList);
|
||||
Map<String, Object> resMap = new HashMap<>();
|
||||
resMap.put("list", pageList);
|
||||
//有审批周期的数据
|
||||
int days = 0;
|
||||
int spzqSum = 0;
|
||||
List<OtaBaSjList> list = otaBaSjListService.list(queryWrapper);
|
||||
for (OtaBaSjList sj : list) {
|
||||
if (StringUtils.isNotEmpty(sj.getSpzq())) {
|
||||
days++;
|
||||
spzqSum += Integer.parseInt(sj.getSpzq());
|
||||
}
|
||||
}
|
||||
resMap.put("pjspzq", days == 0 ? 0 : Math.floor(spzqSum / days));
|
||||
return Result.OK(resMap);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -215,9 +237,10 @@ public class OtaBaSjListController extends JeroController<OtaBaSjList, IOtaBaSjL
|
||||
String ids = json.getString("ids");
|
||||
String bazt = json.getString("bazt");
|
||||
String batjsj = json.getString("batjsj");
|
||||
String tgthsj = json.getString("tgthsj");
|
||||
String bz = json.getString("bz");
|
||||
String cut = json.getString("cut");
|
||||
otaBaSjListService.batchRecord(ids, bazt, batjsj, bz, cut);
|
||||
otaBaSjListService.batchRecord(ids, bazt, batjsj, tgthsj, bz, cut);
|
||||
return Result.OK("备案维护成功!");
|
||||
}
|
||||
|
||||
|
||||
+20
@@ -4,6 +4,7 @@ import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
@@ -97,6 +98,9 @@ public class OtaBaCxList implements Serializable {
|
||||
@Dict(dicCode = "recordstatus")
|
||||
private java.lang.String bazt;
|
||||
|
||||
@TableField(exist = false)
|
||||
private java.lang.String bazt_dictText;
|
||||
|
||||
/**备案提交时间*/
|
||||
@Excel(name = "备案提交时间", width = 15, format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@@ -126,6 +130,22 @@ public class OtaBaCxList implements Serializable {
|
||||
@ApiModelProperty(value = "在线升级驾驶附件")
|
||||
private java.lang.String zxsjjsfj;
|
||||
|
||||
|
||||
/**通过退回时间*/
|
||||
@Excel(name = "通过退回时间", width = 15, format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "通过退回时间")
|
||||
private java.util.Date tgthsj;
|
||||
|
||||
/**审批周期*/
|
||||
@Excel(name = "审批周期", width = 15)
|
||||
@ApiModelProperty(value = "审批周期")
|
||||
private java.lang.String spzq;
|
||||
|
||||
|
||||
|
||||
|
||||
public void updateData(OtaBaCxJbxx otaBaCxJbxx){
|
||||
this.cpdjbh = otaBaCxJbxx.getDjbh();
|
||||
this.ggpc = otaBaCxJbxx.getGgpc();
|
||||
|
||||
+15
@@ -125,6 +125,9 @@ public class OtaBaSjList implements Serializable {
|
||||
@Dict(dicCode = "recordstatus")
|
||||
private java.lang.String bazt;
|
||||
|
||||
@TableField(exist = false)
|
||||
private java.lang.String bazt_dictText;
|
||||
|
||||
/**
|
||||
* 备案提交时间
|
||||
*/
|
||||
@@ -168,6 +171,18 @@ public class OtaBaSjList implements Serializable {
|
||||
@TableField(exist = false)
|
||||
private String rwmc;
|
||||
|
||||
/**通过退回时间*/
|
||||
@Excel(name = "通过退回时间", width = 15, format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "通过退回时间")
|
||||
private java.util.Date tgthsj;
|
||||
|
||||
/**审批周期*/
|
||||
@Excel(name = "审批周期", width = 15)
|
||||
@ApiModelProperty(value = "审批周期")
|
||||
private java.lang.String spzq;
|
||||
|
||||
public void updateData(OtaBaSjSjmbcx otaBaSjSjmbcx) {
|
||||
this.cpdjbh = otaBaSjSjmbcx.getBabh();
|
||||
this.ggpc = otaBaSjSjmbcx.getBapc();
|
||||
|
||||
+1
-1
@@ -64,7 +64,7 @@ public interface IOtaBaCxListService extends IService<OtaBaCxList> {
|
||||
/**
|
||||
* 备案维护
|
||||
*/
|
||||
void batchRecord(String ids, String bazt, String batjsj, String bz, String cut);
|
||||
void batchRecord(String ids, String bazt, String batjsj, String tgthsj,String bz, String cut);
|
||||
|
||||
void exportTemplate(HttpServletResponse response, HttpServletRequest request);
|
||||
|
||||
|
||||
+1
-1
@@ -66,7 +66,7 @@ public interface IOtaBaSjListService extends IService<OtaBaSjList> {
|
||||
/**
|
||||
* 备案维护
|
||||
*/
|
||||
void batchRecord(String ids, String bazt, String batjsj, String bz, String cut);
|
||||
void batchRecord(String ids, String bazt, String batjsj, String tgthsj,String bz, String cut);
|
||||
|
||||
void exportTemplate(HttpServletResponse response, HttpServletRequest request) throws Exception;
|
||||
|
||||
|
||||
+21
-2
@@ -23,6 +23,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.*;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@@ -152,15 +153,33 @@ public class OtaBaCxListServiceImpl extends ServiceImpl<OtaBaCxListMapper, OtaBa
|
||||
* 备案维护
|
||||
*/
|
||||
@Override
|
||||
public void batchRecord(String ids, String bazt, String batjsj, String bz, String cut) {
|
||||
public void batchRecord(String ids, String bazt, String batjsj, String tgthsj,String bz, String cut) {
|
||||
try {
|
||||
if (StringUtils.isNotEmpty(ids)) {
|
||||
String[] idList = ids.split(",");
|
||||
for (String id : idList) {
|
||||
OtaBaCxList otaBaCxList = this.queryById(id);
|
||||
otaBaCxList.setBazt(bazt);
|
||||
otaBaCxList.setBatjsj(sdf.parse(batjsj));
|
||||
otaBaCxList.setBatjsj(null);
|
||||
if (StringUtils.isNotEmpty(batjsj)) {
|
||||
otaBaCxList.setBatjsj(sdf.parse(batjsj));
|
||||
}
|
||||
otaBaCxList.setTgthsj(null);
|
||||
if (StringUtils.isNotEmpty(tgthsj)) {
|
||||
otaBaCxList.setTgthsj(sdf.parse(tgthsj));
|
||||
}
|
||||
otaBaCxList.setSpzq(null);
|
||||
if(null != otaBaCxList.getBatjsj() && null != otaBaCxList.getTgthsj()){
|
||||
Calendar calendar1 = Calendar.getInstance();
|
||||
calendar1.setTime(otaBaCxList.getBatjsj());
|
||||
|
||||
Calendar calendar2 = Calendar.getInstance();
|
||||
calendar2.setTime(otaBaCxList.getTgthsj());
|
||||
int daysDifference = (int) Math.floor((calendar2.getTimeInMillis() - calendar1.getTimeInMillis()) / (1000 * 60 * 60 * 24));
|
||||
otaBaCxList.setSpzq(String.valueOf(daysDifference));
|
||||
}
|
||||
otaBaCxList.setBz(bz);
|
||||
this.deleteById(otaBaCxList.getId());
|
||||
this.saveOrUpdate(otaBaCxList);
|
||||
//添加历史记录数据
|
||||
OtaBaCxLsjl lsjl = new OtaBaCxLsjl();
|
||||
|
||||
+26
-2
@@ -1,6 +1,7 @@
|
||||
package com.jero.modules.ota.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.modules.ota.entity.OtaBaSjList;
|
||||
@@ -22,6 +23,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -67,6 +69,10 @@ public class OtaBaSjListServiceImpl extends ServiceImpl<OtaBaSjListMapper, OtaBa
|
||||
@Autowired
|
||||
private IOtaBaSjQtsjxxService otaBaSjQtsjxxService;
|
||||
|
||||
@Override
|
||||
public <E extends IPage<OtaBaSjList>> E page(E page) {
|
||||
return super.page(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
@@ -150,15 +156,33 @@ public class OtaBaSjListServiceImpl extends ServiceImpl<OtaBaSjListMapper, OtaBa
|
||||
* 备案维护
|
||||
*/
|
||||
@Override
|
||||
public void batchRecord(String ids, String bazt, String batjsj, String bz, String cut) {
|
||||
public void batchRecord(String ids, String bazt, String batjsj,String tgthsj, String bz, String cut) {
|
||||
try {
|
||||
if (StringUtils.isNotEmpty(ids)) {
|
||||
String[] idList = ids.split(",");
|
||||
for (String id : idList) {
|
||||
OtaBaSjList otaBaSjList = this.queryById(id);
|
||||
otaBaSjList.setBazt(bazt);
|
||||
otaBaSjList.setBatjsj(sdf.parse(batjsj));
|
||||
otaBaSjList.setBatjsj(null);
|
||||
if (StringUtils.isNotEmpty(batjsj)) {
|
||||
otaBaSjList.setBatjsj(sdf.parse(batjsj));
|
||||
}
|
||||
otaBaSjList.setTgthsj(null);
|
||||
if (StringUtils.isNotEmpty(tgthsj)) {
|
||||
otaBaSjList.setTgthsj(sdf.parse(tgthsj));
|
||||
}
|
||||
otaBaSjList.setSpzq(null);
|
||||
if(null != otaBaSjList.getBatjsj() && null != otaBaSjList.getTgthsj()){
|
||||
Calendar calendar1 = Calendar.getInstance();
|
||||
calendar1.setTime(otaBaSjList.getBatjsj());
|
||||
|
||||
Calendar calendar2 = Calendar.getInstance();
|
||||
calendar2.setTime(otaBaSjList.getTgthsj());
|
||||
int daysDifference = (int) Math.floor((calendar2.getTimeInMillis() - calendar1.getTimeInMillis()) / (1000 * 60 * 60 * 24));
|
||||
otaBaSjList.setSpzq(String.valueOf(daysDifference));
|
||||
}
|
||||
otaBaSjList.setBz(bz);
|
||||
this.deleteById(otaBaSjList.getId());
|
||||
this.saveOrUpdate(otaBaSjList);
|
||||
//添加历史记录数据
|
||||
OtaBaSjLsjl lsjl = new OtaBaSjLsjl();
|
||||
|
||||
@@ -1844,7 +1844,7 @@ module.exports = {
|
||||
averageapprovalperiod:'Average approval period',
|
||||
day:'day',
|
||||
passreturntime:'Pass/return time',
|
||||
approvalcycle:'Approval cycle',
|
||||
approvalcycle:'Approval cycle(day)',
|
||||
transittime:'Transit Time',
|
||||
returntime:'Return time',
|
||||
}
|
||||
@@ -1945,7 +1945,7 @@ module.exports = {
|
||||
averageapprovalperiod:'平均审批周期',
|
||||
day:'天',
|
||||
passreturntime:'通过/退回时间',
|
||||
approvalcycle:'审批周期',
|
||||
approvalcycle:'审批周期(天)',
|
||||
transittime:'通过时间',
|
||||
returntime:'退回时间',
|
||||
}
|
||||
Reference in New Issue
Block a user