开发OTA备案工具
This commit is contained in:
+3
-3
@@ -156,11 +156,11 @@ public class OtaBaCxKsjjsmccsController extends JeroController<OtaBaCxKsjjsmccs,
|
|||||||
@GetMapping(value = "/queryByOtaId")
|
@GetMapping(value = "/queryByOtaId")
|
||||||
public Result<?> queryByOtaId(@RequestParam(name = "otaId", required = true) String otaId,
|
public Result<?> queryByOtaId(@RequestParam(name = "otaId", required = true) String otaId,
|
||||||
@RequestParam(name = "otaIdT", required = true) String otaIdT) {
|
@RequestParam(name = "otaIdT", required = true) String otaIdT) {
|
||||||
List<OtaBaCxKsjjsmccs> otaBaCxKsjjsmccsList = otaBaCxKsjjsmccsService.queryByOtaId(otaId, otaIdT);
|
JSONObject json = otaBaCxKsjjsmccsService.queryByOtaId(otaId, otaIdT);
|
||||||
if (otaBaCxKsjjsmccsList == null) {
|
if (json == null) {
|
||||||
return Result.error("未找到对应数据");
|
return Result.error("未找到对应数据");
|
||||||
}
|
}
|
||||||
return Result.OK(otaBaCxKsjjsmccsList);
|
return Result.OK(json);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+3
-3
@@ -156,11 +156,11 @@ public class OtaBaCxKsjxtmccsController extends JeroController<OtaBaCxKsjxtmccs,
|
|||||||
@GetMapping(value = "/queryByOtaId")
|
@GetMapping(value = "/queryByOtaId")
|
||||||
public Result<?> queryByOtaId(@RequestParam(name = "otaId", required = true) String otaId,
|
public Result<?> queryByOtaId(@RequestParam(name = "otaId", required = true) String otaId,
|
||||||
@RequestParam(name = "otaIdT", required = true) String otaIdT) {
|
@RequestParam(name = "otaIdT", required = true) String otaIdT) {
|
||||||
List<OtaBaCxKsjxtmccs> otaBaCxKsjxtmccsList = otaBaCxKsjxtmccsService.queryByOtaId(otaId, otaIdT);
|
JSONObject json = otaBaCxKsjxtmccsService.queryByOtaId(otaId, otaIdT);
|
||||||
if (otaBaCxKsjxtmccsList == null) {
|
if (json == null) {
|
||||||
return Result.error("未找到对应数据");
|
return Result.error("未找到对应数据");
|
||||||
}
|
}
|
||||||
return Result.OK(otaBaCxKsjxtmccsList);
|
return Result.OK(json);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+39
@@ -0,0 +1,39 @@
|
|||||||
|
package com.jero.modules.ota.entity;
|
||||||
|
|
||||||
|
public class AttachmentEO {
|
||||||
|
private String id;
|
||||||
|
private String fileName;
|
||||||
|
|
||||||
|
public AttachmentEO() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public AttachmentEO(String id, String fileName) {
|
||||||
|
this.id = id;
|
||||||
|
this.fileName = fileName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFileName() {
|
||||||
|
return fileName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFileName(String fileName) {
|
||||||
|
this.fileName = fileName;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "{" +
|
||||||
|
"id='" + id + '\'' +
|
||||||
|
", fileName='" + fileName + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -3,7 +3,10 @@ package com.jero.modules.ota.entity;
|
|||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -91,4 +94,7 @@ public class OtaBaCxAqcs implements Serializable {
|
|||||||
@ApiModelProperty(value = "证明材料")
|
@ApiModelProperty(value = "证明材料")
|
||||||
private java.lang.String zmcl;
|
private java.lang.String zmcl;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<AttachmentEO> zmclList;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-1
@@ -116,7 +116,17 @@ public class OtaBaCxList implements Serializable {
|
|||||||
@ApiModelProperty(value = "备注")
|
@ApiModelProperty(value = "备注")
|
||||||
private java.lang.String bz;
|
private java.lang.String bz;
|
||||||
|
|
||||||
public void upadteData(OtaBaCxJbxx otaBaCxJbxx){
|
/**在线升级系统附件*/
|
||||||
|
@Excel(name = "在线升级系统附件", width = 15)
|
||||||
|
@ApiModelProperty(value = "在线升级系统附件")
|
||||||
|
private java.lang.String zxsjxtfj;
|
||||||
|
|
||||||
|
/**在线升级驾驶附件*/
|
||||||
|
@Excel(name = "在线升级驾驶附件", width = 15)
|
||||||
|
@ApiModelProperty(value = "在线升级驾驶附件")
|
||||||
|
private java.lang.String zxsjjsfj;
|
||||||
|
|
||||||
|
public void updateData(OtaBaCxJbxx otaBaCxJbxx){
|
||||||
this.cpdjbh = otaBaCxJbxx.getDjbh();
|
this.cpdjbh = otaBaCxJbxx.getDjbh();
|
||||||
this.ggpc = otaBaCxJbxx.getGgpc();
|
this.ggpc = otaBaCxJbxx.getGgpc();
|
||||||
this.cpsb = otaBaCxJbxx.getCpsb();
|
this.cpsb = otaBaCxJbxx.getCpsb();
|
||||||
|
|||||||
+6
@@ -3,7 +3,10 @@ package com.jero.modules.ota.entity;
|
|||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -121,4 +124,7 @@ public class OtaBaCxZxsjyq implements Serializable {
|
|||||||
@ApiModelProperty(value = "证明材料")
|
@ApiModelProperty(value = "证明材料")
|
||||||
private java.lang.String zmcl;
|
private java.lang.String zmcl;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<AttachmentEO> zmclList;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+2
@@ -18,5 +18,7 @@
|
|||||||
<result column="batjsj" property="batjsj" />
|
<result column="batjsj" property="batjsj" />
|
||||||
<result column="cjsj" property="cjsj" />
|
<result column="cjsj" property="cjsj" />
|
||||||
<result column="bz" property="bz" />
|
<result column="bz" property="bz" />
|
||||||
|
<result column="zxsjxtfj" property="zxsjxtfj" />
|
||||||
|
<result column="zxsjjsfj" property="zxsjjsfj" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
</mapper>
|
</mapper>
|
||||||
+1
-1
@@ -60,5 +60,5 @@ public interface IOtaBaCxKsjjsmccsService extends IService<OtaBaCxKsjjsmccs> {
|
|||||||
*/
|
*/
|
||||||
List<OtaBaCxKsjjsmccs> queryList();
|
List<OtaBaCxKsjjsmccs> queryList();
|
||||||
|
|
||||||
List<OtaBaCxKsjjsmccs> queryByOtaId(String otaId, String otaIdT);
|
JSONObject queryByOtaId(String otaId, String otaIdT);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -60,5 +60,5 @@ public interface IOtaBaCxKsjxtmccsService extends IService<OtaBaCxKsjxtmccs> {
|
|||||||
*/
|
*/
|
||||||
List<OtaBaCxKsjxtmccs> queryList();
|
List<OtaBaCxKsjxtmccs> queryList();
|
||||||
|
|
||||||
List<OtaBaCxKsjxtmccs> queryByOtaId(String otaId, String otaIdT);
|
JSONObject queryByOtaId(String otaId, String otaIdT);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-3
@@ -58,14 +58,11 @@ public interface IOtaBaCxListService extends IService<OtaBaCxList> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 列表查询
|
* 列表查询
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
List<OtaBaCxList> queryList();
|
List<OtaBaCxList> queryList();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备案维护
|
* 备案维护
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
void batchRecord(String ids, String bazt, String batjsj, String bz, String cut);
|
void batchRecord(String ids, String bazt, String batjsj, String bz, String cut);
|
||||||
|
|
||||||
@@ -74,4 +71,5 @@ public interface IOtaBaCxListService extends IService<OtaBaCxList> {
|
|||||||
void importData(MultipartFile file, String cut);
|
void importData(MultipartFile file, String cut);
|
||||||
|
|
||||||
void exportData(String otaId, HttpServletResponse response, HttpServletRequest request);
|
void exportData(String otaId, HttpServletResponse response, HttpServletRequest request);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+14
@@ -1,11 +1,14 @@
|
|||||||
package com.jero.modules.ota.service.impl;
|
package com.jero.modules.ota.service.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.jero.modules.ota.entity.AttachmentEO;
|
||||||
import com.jero.modules.ota.entity.OtaBaCxAqcs;
|
import com.jero.modules.ota.entity.OtaBaCxAqcs;
|
||||||
import com.jero.modules.ota.entity.OtaBaCxJbxx;
|
import com.jero.modules.ota.entity.OtaBaCxJbxx;
|
||||||
import com.jero.modules.ota.mapper.OtaBaCxAqcsMapper;
|
import com.jero.modules.ota.mapper.OtaBaCxAqcsMapper;
|
||||||
import com.jero.modules.ota.service.IOtaBaCxAqcsService;
|
import com.jero.modules.ota.service.IOtaBaCxAqcsService;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -39,6 +42,13 @@ public class OtaBaCxAqcsServiceImpl extends ServiceImpl<OtaBaCxAqcsMapper, OtaBa
|
|||||||
otaBaCxAqcs.setCreateTime(now);
|
otaBaCxAqcs.setCreateTime(now);
|
||||||
}
|
}
|
||||||
otaBaCxAqcs.setUpdateTime(now);
|
otaBaCxAqcs.setUpdateTime(now);
|
||||||
|
if (null != otaBaCxAqcs.getZmclList() && otaBaCxAqcs.getZmclList().size() > 0) {
|
||||||
|
JSONArray obj = new JSONArray();
|
||||||
|
for (AttachmentEO aeo : otaBaCxAqcs.getZmclList()) {
|
||||||
|
obj.add(aeo);
|
||||||
|
}
|
||||||
|
otaBaCxAqcs.setZmcl(obj.toString());
|
||||||
|
}
|
||||||
saveOrUpdate(otaBaCxAqcs);
|
saveOrUpdate(otaBaCxAqcs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -105,6 +115,10 @@ public class OtaBaCxAqcsServiceImpl extends ServiceImpl<OtaBaCxAqcsMapper, OtaBa
|
|||||||
if (ObjectUtils.isEmpty(res)) {
|
if (ObjectUtils.isEmpty(res)) {
|
||||||
res = getByOtaId(otaIdT);
|
res = getByOtaId(otaIdT);
|
||||||
}
|
}
|
||||||
|
if (ObjectUtils.isNotEmpty(res) && StringUtils.isNotEmpty(res.getZmcl())) {
|
||||||
|
List<AttachmentEO> aeoList = JSONArray.parseArray(res.getZmcl(), AttachmentEO.class);
|
||||||
|
res.setZmclList(aeoList);
|
||||||
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -40,13 +40,13 @@ public class OtaBaCxJbxxServiceImpl extends ServiceImpl<OtaBaCxJbxxMapper, OtaBa
|
|||||||
//在保存的时候设置一个id 并返回前端 下次保存的时候判断是否为更新
|
//在保存的时候设置一个id 并返回前端 下次保存的时候判断是否为更新
|
||||||
otaBaCxList = new OtaBaCxList();
|
otaBaCxList = new OtaBaCxList();
|
||||||
otaBaCxList.setId(UUID.randomUUID().toString().replace("-", ""));
|
otaBaCxList.setId(UUID.randomUUID().toString().replace("-", ""));
|
||||||
otaBaCxList.upadteData(otaBaCxJbxx);
|
otaBaCxList.updateData(otaBaCxJbxx);
|
||||||
otaBaCxListService.add(otaBaCxList);
|
otaBaCxListService.add(otaBaCxList);
|
||||||
otaBaCxJbxx.setOtaId(otaBaCxList.getId());
|
otaBaCxJbxx.setOtaId(otaBaCxList.getId());
|
||||||
otaBaCxJbxx.setCreateTime(now);
|
otaBaCxJbxx.setCreateTime(now);
|
||||||
}else{
|
}else{
|
||||||
otaBaCxList = otaBaCxListService.queryById(otaBaCxJbxx.getOtaId());
|
otaBaCxList = otaBaCxListService.queryById(otaBaCxJbxx.getOtaId());
|
||||||
otaBaCxList.upadteData(otaBaCxJbxx);
|
otaBaCxList.updateData(otaBaCxJbxx);
|
||||||
otaBaCxListService.editById(otaBaCxList);
|
otaBaCxListService.editById(otaBaCxList);
|
||||||
}
|
}
|
||||||
otaBaCxJbxx.setUpdateTime(now);
|
otaBaCxJbxx.setUpdateTime(now);
|
||||||
|
|||||||
+24
-6
@@ -4,13 +4,13 @@ import cn.hutool.core.util.ObjectUtil;
|
|||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.jero.modules.ota.entity.OtaBaCxJsfzbacs;
|
import com.jero.modules.ota.entity.*;
|
||||||
import com.jero.modules.ota.entity.OtaBaCxKsjjsmccs;
|
|
||||||
import com.jero.modules.ota.entity.OtaBaCxKsjxtmccs;
|
|
||||||
import com.jero.modules.ota.entity.OtaBaCxSjmk;
|
|
||||||
import com.jero.modules.ota.mapper.OtaBaCxKsjjsmccsMapper;
|
import com.jero.modules.ota.mapper.OtaBaCxKsjjsmccsMapper;
|
||||||
import com.jero.modules.ota.service.IOtaBaCxKsjjsmccsService;
|
import com.jero.modules.ota.service.IOtaBaCxKsjjsmccsService;
|
||||||
|
import com.jero.modules.ota.service.IOtaBaCxListService;
|
||||||
import com.jero.modules.system.util.StringUtils;
|
import com.jero.modules.system.util.StringUtils;
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
@@ -18,6 +18,7 @@ import java.util.*;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 车型备案-可在线升级的驾驶辅助功能名称与参数
|
* @Description: 车型备案-可在线升级的驾驶辅助功能名称与参数
|
||||||
* @Author: jero-boot
|
* @Author: jero-boot
|
||||||
@@ -27,6 +28,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||||||
@Service
|
@Service
|
||||||
public class OtaBaCxKsjjsmccsServiceImpl extends ServiceImpl<OtaBaCxKsjjsmccsMapper, OtaBaCxKsjjsmccs> implements IOtaBaCxKsjjsmccsService {
|
public class OtaBaCxKsjjsmccsServiceImpl extends ServiceImpl<OtaBaCxKsjjsmccsMapper, OtaBaCxKsjjsmccs> implements IOtaBaCxKsjjsmccsService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IOtaBaCxListService otaBaCxListService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存
|
* 保存
|
||||||
*
|
*
|
||||||
@@ -59,6 +63,14 @@ public class OtaBaCxKsjjsmccsServiceImpl extends ServiceImpl<OtaBaCxKsjjsmccsMap
|
|||||||
otaBaCxJsfzbacs.setUpdateTime(now);
|
otaBaCxJsfzbacs.setUpdateTime(now);
|
||||||
save(otaBaCxJsfzbacs);
|
save(otaBaCxJsfzbacs);
|
||||||
}
|
}
|
||||||
|
String fj = (String) json.get("fj");
|
||||||
|
if (StringUtils.isNotEmpty(fj)) {
|
||||||
|
OtaBaCxList otaBaCxList = otaBaCxListService.queryById(otaId);
|
||||||
|
if (ObjectUtils.isNotEmpty(otaBaCxList)) {
|
||||||
|
otaBaCxList.setZxsjjsfj(fj);
|
||||||
|
otaBaCxListService.editById(otaBaCxList);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -119,12 +131,18 @@ public class OtaBaCxKsjjsmccsServiceImpl extends ServiceImpl<OtaBaCxKsjjsmccsMap
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<OtaBaCxKsjjsmccs> queryByOtaId(String otaId, String otaIdT) {
|
public JSONObject queryByOtaId(String otaId, String otaIdT) {
|
||||||
List<OtaBaCxKsjjsmccs> res = this.getByOtaId(otaId);
|
List<OtaBaCxKsjjsmccs> res = this.getByOtaId(otaId);
|
||||||
if (ObjectUtil.isEmpty(res)) {
|
if (ObjectUtil.isEmpty(res)) {
|
||||||
res = getByOtaId(otaIdT);
|
res = getByOtaId(otaIdT);
|
||||||
}
|
}
|
||||||
return res;
|
JSONObject json = new JSONObject();
|
||||||
|
json.put("list", res);
|
||||||
|
OtaBaCxList otaBaCxList = otaBaCxListService.queryById(otaId);
|
||||||
|
if (ObjectUtils.isNotEmpty(otaBaCxList) && ObjectUtils.isNotEmpty(otaBaCxList.getZxsjjsfj())) {
|
||||||
|
json.put("fj", otaBaCxList.getZxsjjsfj());
|
||||||
|
}
|
||||||
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<OtaBaCxKsjjsmccs> getByOtaId(String otaId) {
|
private List<OtaBaCxKsjjsmccs> getByOtaId(String otaId) {
|
||||||
|
|||||||
+25
-2
@@ -7,9 +7,13 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
import com.jero.modules.ota.entity.OtaBaCxJbxx;
|
import com.jero.modules.ota.entity.OtaBaCxJbxx;
|
||||||
import com.jero.modules.ota.entity.OtaBaCxKsjjsmccs;
|
import com.jero.modules.ota.entity.OtaBaCxKsjjsmccs;
|
||||||
import com.jero.modules.ota.entity.OtaBaCxKsjxtmccs;
|
import com.jero.modules.ota.entity.OtaBaCxKsjxtmccs;
|
||||||
|
import com.jero.modules.ota.entity.OtaBaCxList;
|
||||||
import com.jero.modules.ota.mapper.OtaBaCxKsjxtmccsMapper;
|
import com.jero.modules.ota.mapper.OtaBaCxKsjxtmccsMapper;
|
||||||
import com.jero.modules.ota.service.IOtaBaCxKsjxtmccsService;
|
import com.jero.modules.ota.service.IOtaBaCxKsjxtmccsService;
|
||||||
|
import com.jero.modules.ota.service.IOtaBaCxListService;
|
||||||
import com.jero.modules.system.util.StringUtils;
|
import com.jero.modules.system.util.StringUtils;
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
@@ -26,6 +30,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||||||
@Service
|
@Service
|
||||||
public class OtaBaCxKsjxtmccsServiceImpl extends ServiceImpl<OtaBaCxKsjxtmccsMapper, OtaBaCxKsjxtmccs> implements IOtaBaCxKsjxtmccsService {
|
public class OtaBaCxKsjxtmccsServiceImpl extends ServiceImpl<OtaBaCxKsjxtmccsMapper, OtaBaCxKsjxtmccs> implements IOtaBaCxKsjxtmccsService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IOtaBaCxListService otaBaCxListService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存
|
* 保存
|
||||||
*
|
*
|
||||||
@@ -58,7 +65,17 @@ public class OtaBaCxKsjxtmccsServiceImpl extends ServiceImpl<OtaBaCxKsjxtmccsMap
|
|||||||
otaBaCxKsjxtmccs.setUpdateTime(now);
|
otaBaCxKsjxtmccs.setUpdateTime(now);
|
||||||
save(otaBaCxKsjxtmccs);
|
save(otaBaCxKsjxtmccs);
|
||||||
}
|
}
|
||||||
|
String fj = (String) json.get("fj");
|
||||||
|
if (StringUtils.isNotEmpty(fj)) {
|
||||||
|
OtaBaCxList otaBaCxList = otaBaCxListService.queryById(otaId);
|
||||||
|
if (ObjectUtils.isNotEmpty(otaBaCxList)) {
|
||||||
|
otaBaCxList.setZxsjxtfj(fj);
|
||||||
|
otaBaCxListService.editById(otaBaCxList);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -118,12 +135,18 @@ public class OtaBaCxKsjxtmccsServiceImpl extends ServiceImpl<OtaBaCxKsjxtmccsMap
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<OtaBaCxKsjxtmccs> queryByOtaId(String otaId, String otaIdT) {
|
public JSONObject queryByOtaId(String otaId, String otaIdT) {
|
||||||
List<OtaBaCxKsjxtmccs> res = getByOtaId(otaId);
|
List<OtaBaCxKsjxtmccs> res = getByOtaId(otaId);
|
||||||
if (ObjectUtil.isEmpty(res)) {
|
if (ObjectUtil.isEmpty(res)) {
|
||||||
res = getByOtaId(otaIdT);
|
res = getByOtaId(otaIdT);
|
||||||
}
|
}
|
||||||
return res;
|
JSONObject json = new JSONObject();
|
||||||
|
json.put("list", res);
|
||||||
|
OtaBaCxList otaBaCxList = otaBaCxListService.queryById(otaId);
|
||||||
|
if (ObjectUtils.isNotEmpty(otaBaCxList) && ObjectUtils.isNotEmpty(otaBaCxList.getZxsjxtfj())) {
|
||||||
|
json.put("fj", otaBaCxList.getZxsjxtfj());
|
||||||
|
}
|
||||||
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<OtaBaCxKsjxtmccs> getByOtaId(String otaId) {
|
private List<OtaBaCxKsjxtmccs> getByOtaId(String otaId) {
|
||||||
|
|||||||
+15
@@ -1,11 +1,15 @@
|
|||||||
package com.jero.modules.ota.service.impl;
|
package com.jero.modules.ota.service.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.jero.modules.ota.entity.AttachmentEO;
|
||||||
import com.jero.modules.ota.entity.OtaBaCxJbxx;
|
import com.jero.modules.ota.entity.OtaBaCxJbxx;
|
||||||
import com.jero.modules.ota.entity.OtaBaCxZxsjyq;
|
import com.jero.modules.ota.entity.OtaBaCxZxsjyq;
|
||||||
import com.jero.modules.ota.mapper.OtaBaCxZxsjyqMapper;
|
import com.jero.modules.ota.mapper.OtaBaCxZxsjyqMapper;
|
||||||
import com.jero.modules.ota.service.IOtaBaCxZxsjyqService;
|
import com.jero.modules.ota.service.IOtaBaCxZxsjyqService;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -40,6 +44,13 @@ public class OtaBaCxZxsjyqServiceImpl extends ServiceImpl<OtaBaCxZxsjyqMapper, O
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
otaBaCxZxsjyq.setUpdateTime(now);
|
otaBaCxZxsjyq.setUpdateTime(now);
|
||||||
|
if (null != otaBaCxZxsjyq.getZmclList() && otaBaCxZxsjyq.getZmclList().size() > 0) {
|
||||||
|
JSONArray obj = new JSONArray();
|
||||||
|
for (AttachmentEO aeo : otaBaCxZxsjyq.getZmclList()) {
|
||||||
|
obj.add(aeo);
|
||||||
|
}
|
||||||
|
otaBaCxZxsjyq.setZmcl(obj.toString());
|
||||||
|
}
|
||||||
saveOrUpdate(otaBaCxZxsjyq);
|
saveOrUpdate(otaBaCxZxsjyq);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -106,6 +117,10 @@ public class OtaBaCxZxsjyqServiceImpl extends ServiceImpl<OtaBaCxZxsjyqMapper, O
|
|||||||
if (ObjectUtils.isEmpty(res)) {
|
if (ObjectUtils.isEmpty(res)) {
|
||||||
res = getByOtaId(otaIdT);
|
res = getByOtaId(otaIdT);
|
||||||
}
|
}
|
||||||
|
if (ObjectUtils.isNotEmpty(res) && StringUtils.isNotEmpty(res.getZmcl())) {
|
||||||
|
List<AttachmentEO> aeoList = JSONArray.parseArray(res.getZmcl(), AttachmentEO.class);
|
||||||
|
res.setZmclList(aeoList);
|
||||||
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user