合并分支 'fix_20230524' 到 'master'
Fix 20230524 查看合并请求 laws-nio/laws-weilai!332
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;
|
||||
|
||||
|
||||
+15
-16
@@ -63,17 +63,17 @@ public class OtaBaCxJbxxServiceImpl extends ServiceImpl<OtaBaCxJbxxMapper, OtaBa
|
||||
* @return
|
||||
*/
|
||||
public OtaBaCxJbxx add(OtaBaCxJbxx otaBaCxJbxx) throws Exception {
|
||||
String ggpc = otaBaCxJbxx.getGgpc();
|
||||
String djbh = otaBaCxJbxx.getDjbh();
|
||||
//对比填写记录用的
|
||||
OtaBaCxJbxx otaBaCxJbxxOld = new OtaBaCxJbxx();
|
||||
Date now = new Date();
|
||||
OtaBaCxList otaBaCxList;
|
||||
if (StringUtils.isEmpty(otaBaCxJbxx.getOtaId())) {
|
||||
if (StringUtils.isNotEmpty(ggpc)) {
|
||||
if (StringUtils.isNotEmpty(djbh)) {
|
||||
List<OtaBaCxJbxx> xxList = this.list();
|
||||
for (OtaBaCxJbxx xx : xxList) {
|
||||
if (ggpc.equals(xx.getGgpc())) {
|
||||
throw new JeroBootException("公告批次重复");
|
||||
if (djbh.equals(xx.getDjbh())) {
|
||||
throw new JeroBootException("产品登记编号重复");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -87,11 +87,11 @@ public class OtaBaCxJbxxServiceImpl extends ServiceImpl<OtaBaCxJbxxMapper, OtaBa
|
||||
otaBaCxJbxx.setCreateTime(now);
|
||||
} else {
|
||||
otaBaCxJbxxOld = this.getByOtaId(otaBaCxJbxx.getOtaId());
|
||||
if (StringUtils.isNotEmpty(ggpc)) {
|
||||
if (StringUtils.isNotEmpty(djbh)) {
|
||||
List<OtaBaCxJbxx> xxList = this.list();
|
||||
for (OtaBaCxJbxx xx : xxList) {
|
||||
if (!xx.getOtaId().equals(otaBaCxJbxx.getOtaId()) && ggpc.equals(xx.getGgpc())) {
|
||||
throw new JeroBootException("公告批次重复");
|
||||
if (!xx.getOtaId().equals(otaBaCxJbxx.getOtaId()) && djbh.equals(xx.getDjbh())) {
|
||||
throw new JeroBootException("产品登记编号重复");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -241,26 +241,25 @@ public class OtaBaCxJbxxServiceImpl extends ServiceImpl<OtaBaCxJbxxMapper, OtaBa
|
||||
if (cpbh.length() > 500) {
|
||||
throw new JeroBootException("产品登记编号字数超过500");
|
||||
}
|
||||
jbxx.setDjbh(cpbh);
|
||||
|
||||
row = s.getRow(4);
|
||||
cell = row.getCell(1);
|
||||
String ggpc = ImportFileUtil.getCellValue(cell, wb);
|
||||
if (StringUtils.isNotEmpty(ggpc)) {
|
||||
if (StringUtils.isNotEmpty(cpbh)) {
|
||||
List<OtaBaCxJbxx> xxList = this.list();
|
||||
for (OtaBaCxJbxx xx : xxList) {
|
||||
if (ggpc.equals(xx.getGgpc())) {
|
||||
throw new JeroBootException("公告批次重复");
|
||||
if (cpbh.equals(xx.getDjbh())) {
|
||||
throw new JeroBootException("产品登记编号重复");
|
||||
}
|
||||
}
|
||||
}
|
||||
jbxx.setGgpc(ggpc);
|
||||
jbxx.setDjbh(cpbh);
|
||||
|
||||
row = s.getRow(1);
|
||||
cell = row.getCell(1);
|
||||
jbxx.setQymc(ImportFileUtil.getCellValue(cell, wb));
|
||||
row = s.getRow(3);
|
||||
cell = row.getCell(1);
|
||||
jbxx.setCplb(ImportFileUtil.getCellValueDict(cell, wb, "product_category", sysDictService, cut));
|
||||
row = s.getRow(4);
|
||||
cell = row.getCell(1);
|
||||
jbxx.setGgpc(ImportFileUtil.getCellValue(cell, wb));
|
||||
row = s.getRow(5);
|
||||
cell = row.getCell(1);
|
||||
jbxx.setCpsb(ImportFileUtil.getCellValue(cell, wb));
|
||||
|
||||
+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();
|
||||
|
||||
+1
-1
@@ -141,7 +141,7 @@ public class OtaBaSjGnxtwhServiceImpl extends ServiceImpl<OtaBaSjGnxtwhMapper, O
|
||||
for (OtaBaSjGnxtwh wh : list) {
|
||||
String[] strs = wh.getDykzq().split(",");
|
||||
for (String str : strs) {
|
||||
if (str.equals(kzq)) {
|
||||
if (kzq.contains(str)) {
|
||||
return wh.getGnxt();
|
||||
}
|
||||
}
|
||||
|
||||
+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();
|
||||
|
||||
+29
-15
@@ -31,9 +31,7 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.io.*;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
@@ -262,19 +260,35 @@ public class OtaBaSjSjmbclServiceImpl extends ServiceImpl<OtaBaSjSjmbclMapper, O
|
||||
mbcl.setVinList(vinList.get(0).getVin() + "-" + vinList.get(vinList.size() - 1).getVin());
|
||||
|
||||
//生成VIN码文件
|
||||
LinkedHashMap map = new LinkedHashMap();
|
||||
map.put("1", "VIN");
|
||||
List exportData = new ArrayList<Map>();
|
||||
Map vrow = null;
|
||||
for (int i = 0; i < vinList.size(); i++) {
|
||||
vrow = new LinkedHashMap<String, String>();
|
||||
vrow.put("1", vinList.get(i).getVin());
|
||||
exportData.add(vrow);
|
||||
}
|
||||
// LinkedHashMap map = new LinkedHashMap();
|
||||
// map.put("1", "VIN");
|
||||
// List exportData = new ArrayList<Map>();
|
||||
// Map vrow = null;
|
||||
// for (int i = 0; i < vinList.size(); i++) {
|
||||
// vrow = new LinkedHashMap<String, String>();
|
||||
// vrow.put("1", vinList.get(i).getVin());
|
||||
// exportData.add(vrow);
|
||||
// }
|
||||
// String fileName = "VIN码.csv";
|
||||
// File file = CSVUtil.createCSVFile(exportData, map, uploadPath + System.currentTimeMillis(), fileName);
|
||||
// String filePath = uploadPath + "/" + file.getName();
|
||||
|
||||
String fileName = "VIN码.csv";
|
||||
File file = CSVUtil.createCSVFile(exportData, map, uploadPath + System.currentTimeMillis(), fileName);
|
||||
String filePath = uploadPath + "/" + file.getName();
|
||||
OSSFile ossFile = ossFileService.uploadLocalOfCos(ImportFileUtil.createMfileByFile(file), "/ota", "", CutEnum.CN.getValue());
|
||||
File csvFileDir = new File(uploadPath + System.currentTimeMillis());
|
||||
csvFileDir.mkdirs();
|
||||
File csvFile = new File(csvFileDir.getAbsolutePath() + "/" + fileName);
|
||||
try (BufferedWriter writer = new BufferedWriter(new FileWriter(csvFile))) {
|
||||
// 写入数据
|
||||
for (VinObj data : vinList) {
|
||||
String row = data.getVin();
|
||||
writer.write(row);
|
||||
writer.newLine();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
System.err.println("生成CSV文件失败:" + e.getMessage());
|
||||
}
|
||||
|
||||
OSSFile ossFile = ossFileService.uploadLocalOfCos(ImportFileUtil.createMfileByFile(csvFile), "/ota", "", CutEnum.CN.getValue());
|
||||
mbcl.setCsv(ossFile.getId());
|
||||
}
|
||||
}
|
||||
|
||||
+16
-2
@@ -19,6 +19,7 @@ import com.jero.modules.ota.utils.ComparisonUtil;
|
||||
import com.jero.modules.ota.utils.ImportFileUtil;
|
||||
import com.jero.modules.project.util.WordUtil;
|
||||
import com.jero.modules.split.common.FileUnZip;
|
||||
import com.jero.modules.system.entity.SysDepart;
|
||||
import com.jero.modules.system.service.ISysDictService;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@@ -193,6 +194,17 @@ public class OtaBaSjSjxtbhServiceImpl extends ServiceImpl<OtaBaSjSjxtbhMapper, O
|
||||
if (ObjectUtil.isEmpty(res)) {
|
||||
res = getByOtaId(otaIdT);
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(res)) {
|
||||
Collections.sort(res, (arg0, arg1) -> {
|
||||
if (null == arg0.getXtmc()) {
|
||||
arg0.setXtmc("");
|
||||
}
|
||||
if (null == arg1.getXtmc()) {
|
||||
arg1.setXtmc("");
|
||||
}
|
||||
return arg0.getXtmc().compareTo(arg1.getXtmc());
|
||||
});
|
||||
}
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("list", res);
|
||||
return json;
|
||||
@@ -257,13 +269,15 @@ public class OtaBaSjSjxtbhServiceImpl extends ServiceImpl<OtaBaSjSjxtbhMapper, O
|
||||
List<String> oldYjbbList = otaBaSjSjxtbh.stream().map(OtaBaSjSjxtbh::getYjbb).distinct().collect(Collectors.toList());
|
||||
List<String> oldTempFileNameList = new ArrayList<>();
|
||||
oldYjbbList.forEach(sjSjxtbh -> {
|
||||
oldTempFileNameList.add(sjSjxtbh.replaceAll("见","") + ".docx");
|
||||
if (StringUtils.isNotEmpty(sjSjxtbh)) {
|
||||
oldTempFileNameList.add(sjSjxtbh.replaceAll("见", "") + ".docx");
|
||||
}
|
||||
});
|
||||
|
||||
int tempFileIndex = 1;
|
||||
String tempFilePath = uploadPath + "tempFile" + "/" + otaId;
|
||||
File tempFile = new File(tempFilePath);
|
||||
if(!tempFile.exists()){
|
||||
if (!tempFile.exists()) {
|
||||
tempFile.mkdirs();
|
||||
}
|
||||
List<String> tempFileNames = new ArrayList<>();
|
||||
|
||||
+22
-21
@@ -389,27 +389,28 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
|
||||
for(ProjectRelatedPersonnel relatedPersonnel : projectRelatedPersonnelList){
|
||||
if(allList.size()>0){
|
||||
if(!allList.contains(dutyPerson)){
|
||||
|
||||
if(roleCode.equals(com.jero.modules.project.enums.ProjectRoleEnum.STUDIO_ENGINEER.getValue())){
|
||||
if(relatedPersonnel.getEngineeringInterfacePerson() != null){
|
||||
String engineeringInterfacePerson = dutyPerson+","+relatedPersonnel.getEngineeringInterfacePerson();
|
||||
relatedPersonnel.setEngineeringInterfacePerson(engineeringInterfacePerson);
|
||||
}else {
|
||||
relatedPersonnel.setEngineeringInterfacePerson(dutyPerson);
|
||||
}
|
||||
}else if(roleCode.equals(com.jero.modules.project.enums.ProjectRoleEnum.REGULATI_ENGINEER.getValue())){
|
||||
if(relatedPersonnel.getEngineerLawSet() != null){
|
||||
String engineerLawSet = dutyPerson+","+relatedPersonnel.getEngineerLawSet();
|
||||
relatedPersonnel.setEngineerLawSet(engineerLawSet);
|
||||
}else {
|
||||
relatedPersonnel.setEngineerLawSet(dutyPerson);
|
||||
}
|
||||
}else if(roleCode.equals(com.jero.modules.project.enums.ProjectRoleEnum.HOMOLOGATION_ENGINEER.getValue())){
|
||||
if(relatedPersonnel.getEngineerAttSet() !=null){
|
||||
String engineerAttSet = dutyPerson+","+relatedPersonnel.getEngineerAttSet();
|
||||
relatedPersonnel.setEngineerAttSet(engineerAttSet);
|
||||
}else {
|
||||
relatedPersonnel.setEngineerAttSet(dutyPerson);
|
||||
if (StringUtils.isNotEmpty(roleCode)) {
|
||||
if(roleCode.equals(com.jero.modules.project.enums.ProjectRoleEnum.STUDIO_ENGINEER.getValue())){
|
||||
if(relatedPersonnel.getEngineeringInterfacePerson() != null){
|
||||
String engineeringInterfacePerson = dutyPerson+","+relatedPersonnel.getEngineeringInterfacePerson();
|
||||
relatedPersonnel.setEngineeringInterfacePerson(engineeringInterfacePerson);
|
||||
}else {
|
||||
relatedPersonnel.setEngineeringInterfacePerson(dutyPerson);
|
||||
}
|
||||
}else if(roleCode.equals(com.jero.modules.project.enums.ProjectRoleEnum.REGULATI_ENGINEER.getValue())){
|
||||
if(relatedPersonnel.getEngineerLawSet() != null){
|
||||
String engineerLawSet = dutyPerson+","+relatedPersonnel.getEngineerLawSet();
|
||||
relatedPersonnel.setEngineerLawSet(engineerLawSet);
|
||||
}else {
|
||||
relatedPersonnel.setEngineerLawSet(dutyPerson);
|
||||
}
|
||||
}else if(roleCode.equals(com.jero.modules.project.enums.ProjectRoleEnum.HOMOLOGATION_ENGINEER.getValue())){
|
||||
if(relatedPersonnel.getEngineerAttSet() !=null){
|
||||
String engineerAttSet = dutyPerson+","+relatedPersonnel.getEngineerAttSet();
|
||||
relatedPersonnel.setEngineerAttSet(engineerAttSet);
|
||||
}else {
|
||||
relatedPersonnel.setEngineerAttSet(dutyPerson);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user