Merge remote-tracking branch 'origin/dev_2nd_LCYH' into dev_2nd_LCYH
This commit is contained in:
+18
@@ -143,6 +143,24 @@ public class OtaBaSjSjxtbhController extends JeroController<OtaBaSjSjxtbh, IOtaB
|
|||||||
return Result.OK(otaBaSjSjxtbh);
|
return Result.OK(otaBaSjSjxtbh);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过otaId查询
|
||||||
|
*
|
||||||
|
* @param otaId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "升级备案-本次升级的系统名称与参数变化-通过otaId查询")
|
||||||
|
@ApiOperation(value = "升级备案-本次升级的系统名称与参数变化-通过otaId查询", notes = "升级备案-本次升级的系统名称与参数变化-通过otaId查询")
|
||||||
|
@GetMapping(value = "/queryByOtaId")
|
||||||
|
public Result<?> queryByOtaId(@RequestParam(name = "otaId", required = true) String otaId,
|
||||||
|
@RequestParam(name = "otaIdT", required = true) String otaIdT) {
|
||||||
|
JSONObject json = otaBaSjSjxtbhService.queryByOtaId(otaId, otaIdT);
|
||||||
|
if (json == null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(json);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出excel
|
* 导出excel
|
||||||
*
|
*
|
||||||
|
|||||||
+2
@@ -57,4 +57,6 @@ public interface IOtaBaSjSjxtbhService extends IService<OtaBaSjSjxtbh> {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<OtaBaSjSjxtbh> queryList();
|
List<OtaBaSjSjxtbh> queryList();
|
||||||
|
|
||||||
|
JSONObject queryByOtaId(String otaId, String otaIdT);
|
||||||
}
|
}
|
||||||
|
|||||||
+33
-1
@@ -1,17 +1,22 @@
|
|||||||
package com.jero.modules.ota.service.impl;
|
package com.jero.modules.ota.service.impl;
|
||||||
|
|
||||||
|
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.jero.modules.ota.entity.OtaBaCxKsjjsmccs;
|
import com.jero.modules.ota.entity.OtaBaCxKsjjsmccs;
|
||||||
|
import com.jero.modules.ota.entity.OtaBaCxList;
|
||||||
import com.jero.modules.ota.entity.OtaBaSjSjxtbh;
|
import com.jero.modules.ota.entity.OtaBaSjSjxtbh;
|
||||||
import com.jero.modules.ota.mapper.OtaBaSjSjxtbhMapper;
|
import com.jero.modules.ota.mapper.OtaBaSjSjxtbhMapper;
|
||||||
import com.jero.modules.ota.service.IOtaBaSjSjxtbhService;
|
import com.jero.modules.ota.service.IOtaBaSjSjxtbhService;
|
||||||
import com.jero.modules.system.util.StringUtils;
|
import com.jero.modules.system.util.StringUtils;
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -32,9 +37,10 @@ public class OtaBaSjSjxtbhServiceImpl extends ServiceImpl<OtaBaSjSjxtbhMapper, O
|
|||||||
String otaId = (String) json.get("otaId");
|
String otaId = (String) json.get("otaId");
|
||||||
List<OtaBaSjSjxtbh> newList = new ArrayList<>();
|
List<OtaBaSjSjxtbh> newList = new ArrayList<>();
|
||||||
if (StringUtils.isNotEmpty(otaId)) {
|
if (StringUtils.isNotEmpty(otaId)) {
|
||||||
|
deleteByOtaId(otaId);
|
||||||
JSONArray list = json.getJSONArray("list");
|
JSONArray list = json.getJSONArray("list");
|
||||||
for (Object obj : list) {
|
for (Object obj : list) {
|
||||||
OtaBaSjSjxtbh bh = JSONObject.parseObject(obj.toString(),OtaBaSjSjxtbh.class);
|
OtaBaSjSjxtbh bh = JSONObject.parseObject(obj.toString(), OtaBaSjSjxtbh.class);
|
||||||
bh.setOtaId(otaId);
|
bh.setOtaId(otaId);
|
||||||
bh.setCreateTime(now);
|
bh.setCreateTime(now);
|
||||||
bh.setUpdateTime(now);
|
bh.setUpdateTime(now);
|
||||||
@@ -99,4 +105,30 @@ public class OtaBaSjSjxtbhServiceImpl extends ServiceImpl<OtaBaSjSjxtbhMapper, O
|
|||||||
public List<OtaBaSjSjxtbh> queryList() {
|
public List<OtaBaSjSjxtbh> queryList() {
|
||||||
return list();
|
return list();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONObject queryByOtaId(String otaId, String otaIdT) {
|
||||||
|
List<OtaBaSjSjxtbh> res = this.getByOtaId(otaId);
|
||||||
|
if (ObjectUtil.isEmpty(res)) {
|
||||||
|
res = getByOtaId(otaIdT);
|
||||||
|
}
|
||||||
|
JSONObject json = new JSONObject();
|
||||||
|
json.put("list", res);
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<OtaBaSjSjxtbh> getByOtaId(String otaId) {
|
||||||
|
LambdaQueryWrapper<OtaBaSjSjxtbh> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(OtaBaSjSjxtbh::getOtaId, otaId);
|
||||||
|
return this.list(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void deleteByOtaId(String otaId) {
|
||||||
|
List<OtaBaSjSjxtbh> list = this.getByOtaId(otaId);
|
||||||
|
List<String> ids = new ArrayList<>();
|
||||||
|
for (OtaBaSjSjxtbh bh : list) {
|
||||||
|
ids.add(bh.getId());
|
||||||
|
}
|
||||||
|
this.deleteByIds(ids);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user