Merge remote-tracking branch 'origin/dev_2nd_LCYH' into dev_2nd_LCYH

This commit is contained in:
wangzhijiang
2023-03-28 16:34:49 +08:00
19 changed files with 500 additions and 242 deletions
@@ -248,7 +248,7 @@ public class HeadCustomEOServiceImpl extends ServiceImpl<HeadCustomEOMapper, Hea
headCustomVOOneList.add(headCustomVO);
}
if ("法规清单".equals(moduleFlag) || "虚拟清单详情".equals(moduleFlag) || "维护清单".equals(moduleFlag)) {
res = checkDefaultHead(headCustomVOOneList, cut, moduleFlag);
res = checkDefaultHead(headCustomVOOneList, cut, moduleFlag).stream().distinct().collect(Collectors.toList());
} else {
res = headCustomVOOneList;
}
@@ -4,6 +4,8 @@ import java.util.Arrays;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.alibaba.fastjson.JSONObject;
import com.jero.common.api.vo.Result;
import com.jero.common.system.query.QueryGenerator;
import com.jero.modules.ota.entity.OtaBaSjSjfzbh;
@@ -74,14 +76,12 @@ public class OtaBaSjSjfzbhController extends JeroController<OtaBaSjSjfzbh, IOtaB
/**
* 添加
*
* @param otaBaSjSjfzbh
* @return
*/
@AutoLog(value = "升级备案-本次升级的驾驶辅助功能与参数变化-添加")
@ApiOperation(value="升级备案-本次升级的驾驶辅助功能与参数变化-添加", notes="升级备案-本次升级的驾驶辅助功能与参数变化-添加")
@PostMapping(value = "/add")
public Result<?> add(@Validated @RequestBody OtaBaSjSjfzbh otaBaSjSjfzbh) {
otaBaSjSjfzbhService.add(otaBaSjSjfzbh);
public Result<?> add(@RequestBody JSONObject json) {
otaBaSjSjfzbhService.add(json);
return Result.OK("添加成功!");
}
@@ -144,6 +144,24 @@ public class OtaBaSjSjfzbhController extends JeroController<OtaBaSjSjfzbh, IOtaB
return Result.OK(otaBaSjSjfzbh);
}
/**
* 通过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 = otaBaSjSjfzbhService.queryByOtaId(otaId, otaIdT);
if (json == null) {
return Result.error("未找到对应数据");
}
return Result.OK(json);
}
/**
* 导出excel
*
@@ -4,6 +4,8 @@ import java.util.Arrays;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.alibaba.fastjson.JSONObject;
import com.jero.common.api.vo.Result;
import com.jero.common.system.query.QueryGenerator;
import com.jero.modules.ota.entity.OtaBaSjSjxtbh;
@@ -22,146 +24,165 @@ import io.swagger.annotations.ApiOperation;
import com.jero.common.aspect.annotation.AutoLog;
/**
/**
* @Description: 升级备案-本次升级的系统名称与参数变化
* @Author: jero-boot
* @Date: 2023-03-17
* @Date: 2023-03-17
* @Version: V1.0
*/
@Api(tags="升级备案-本次升级的系统名称与参数变化")
@Api(tags = "升级备案-本次升级的系统名称与参数变化")
@RestController
@RequestMapping("/ota/otaBaSjSjxtbh")
@Slf4j
public class OtaBaSjSjxtbhController extends JeroController<OtaBaSjSjxtbh, IOtaBaSjSjxtbhService> {
@Autowired
private IOtaBaSjSjxtbhService otaBaSjSjxtbhService;
/**
* 分页列表查询
*
* @param otaBaSjSjxtbh
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog(value = "升级备案-本次升级的系统名称与参数变化-分页列表查询")
@ApiOperation(value="升级备案-本次升级的系统名称与参数变化-分页列表查询", notes="升级备案-本次升级的系统名称与参数变化-分页列表查询")
@GetMapping(value = "/page")
public Result<?> queryPageList(OtaBaSjSjxtbh otaBaSjSjxtbh,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<OtaBaSjSjxtbh> queryWrapper = QueryGenerator.initQueryWrapper(otaBaSjSjxtbh, req.getParameterMap());
Page<OtaBaSjSjxtbh> page = new Page<OtaBaSjSjxtbh>(pageNo, pageSize);
IPage<OtaBaSjSjxtbh> pageList = otaBaSjSjxtbhService.page(page, queryWrapper);
return Result.OK(pageList);
}
@Autowired
private IOtaBaSjSjxtbhService otaBaSjSjxtbhService;
/**
* 列表查询
*
* @return
*/
@AutoLog(value = "升级备案-本次升级的系统名称与参数变化-列表查询")
@ApiOperation(value="升级备案-本次升级的系统名称与参数变化-列表查询", notes="升级备案-本次升级的系统名称与参数变化-列表查询")
@GetMapping(value = "/list")
public Result<List<OtaBaSjSjxtbh>> queryList() {
* 分页列表查询
*
* @param otaBaSjSjxtbh
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog(value = "升级备案-本次升级的系统名称与参数变化-分页列表查询")
@ApiOperation(value = "升级备案-本次升级的系统名称与参数变化-分页列表查询", notes = "升级备案-本次升级的系统名称与参数变化-分页列表查询")
@GetMapping(value = "/page")
public Result<?> queryPageList(OtaBaSjSjxtbh otaBaSjSjxtbh,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<OtaBaSjSjxtbh> queryWrapper = QueryGenerator.initQueryWrapper(otaBaSjSjxtbh, req.getParameterMap());
Page<OtaBaSjSjxtbh> page = new Page<OtaBaSjSjxtbh>(pageNo, pageSize);
IPage<OtaBaSjSjxtbh> pageList = otaBaSjSjxtbhService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 列表查询
*
* @return
*/
@AutoLog(value = "升级备案-本次升级的系统名称与参数变化-列表查询")
@ApiOperation(value = "升级备案-本次升级的系统名称与参数变化-列表查询", notes = "升级备案-本次升级的系统名称与参数变化-列表查询")
@GetMapping(value = "/list")
public Result<List<OtaBaSjSjxtbh>> queryList() {
List<OtaBaSjSjxtbh> list = otaBaSjSjxtbhService.queryList();
return Result.OK(list);
}
/**
* 添加
*
* @param otaBaSjSjxtbh
* @return
*/
@AutoLog(value = "升级备案-本次升级的系统名称与参数变化-添加")
@ApiOperation(value="升级备案-本次升级的系统名称与参数变化-添加", notes="升级备案-本次升级的系统名称与参数变化-添加")
@PostMapping(value = "/add")
public Result<?> add(@Validated @RequestBody OtaBaSjSjxtbh otaBaSjSjxtbh) {
otaBaSjSjxtbhService.add(otaBaSjSjxtbh);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param otaBaSjSjxtbh
* @return
*/
@AutoLog(value = "升级备案-本次升级的系统名称与参数变化-编辑")
@ApiOperation(value="升级备案-本次升级的系统名称与参数变化-编辑", notes="升级备案-本次升级的系统名称与参数变化-编辑")
@PutMapping(value = "/edit")
public Result<?> edit(@Validated @RequestBody OtaBaSjSjxtbh otaBaSjSjxtbh) {
otaBaSjSjxtbhService.editById(otaBaSjSjxtbh);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "升级备案-本次升级的系统名称与参数变化-通过id删除")
@ApiOperation(value="升级备案-本次升级的系统名称与参数变化-通过id删除", notes="升级备案-本次升级的系统名称与参数变化-通过id删除")
@DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
otaBaSjSjxtbhService.deleteById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "升级备案-本次升级的系统名称与参数变化-批量删除")
@ApiOperation(value="升级备案-本次升级的系统名称与参数变化-批量删除", notes="升级备案-本次升级的系统名称与参数变化-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.otaBaSjSjxtbhService.deleteByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
@AutoLog(value = "升级备案-本次升级的系统名称与参数变化-通过id查询")
@ApiOperation(value="升级备案-本次升级的系统名称与参数变化-通过id查询", notes="升级备案-本次升级的系统名称与参数变化-通过id查询")
@GetMapping(value = "/queryById")
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
OtaBaSjSjxtbh otaBaSjSjxtbh = otaBaSjSjxtbhService.queryById(id);
if(otaBaSjSjxtbh==null) {
return Result.error("未找到对应数据");
}
return Result.OK(otaBaSjSjxtbh);
}
}
/**
* 导出excel
*
* @param request
* @param otaBaSjSjxtbh
*/
* 添加
*
* @param otaBaSjSjxtbh
* @return
*/
@AutoLog(value = "升级备案-本次升级的系统名称与参数变化-添加")
@ApiOperation(value = "升级备案-本次升级的系统名称与参数变化-添加", notes = "升级备案-本次升级的系统名称与参数变化-添加")
@PostMapping(value = "/add")
public Result<?> add(@RequestBody JSONObject json) {
otaBaSjSjxtbhService.add(json);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param otaBaSjSjxtbh
* @return
*/
@AutoLog(value = "升级备案-本次升级的系统名称与参数变化-编辑")
@ApiOperation(value = "升级备案-本次升级的系统名称与参数变化-编辑", notes = "升级备案-本次升级的系统名称与参数变化-编辑")
@PutMapping(value = "/edit")
public Result<?> edit(@Validated @RequestBody OtaBaSjSjxtbh otaBaSjSjxtbh) {
otaBaSjSjxtbhService.editById(otaBaSjSjxtbh);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "升级备案-本次升级的系统名称与参数变化-通过id删除")
@ApiOperation(value = "升级备案-本次升级的系统名称与参数变化-通过id删除", notes = "升级备案-本次升级的系统名称与参数变化-通过id删除")
@DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
otaBaSjSjxtbhService.deleteById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "升级备案-本次升级的系统名称与参数变化-批量删除")
@ApiOperation(value = "升级备案-本次升级的系统名称与参数变化-批量删除", notes = "升级备案-本次升级的系统名称与参数变化-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.otaBaSjSjxtbhService.deleteByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
@AutoLog(value = "升级备案-本次升级的系统名称与参数变化-通过id查询")
@ApiOperation(value = "升级备案-本次升级的系统名称与参数变化-通过id查询", notes = "升级备案-本次升级的系统名称与参数变化-通过id查询")
@GetMapping(value = "/queryById")
public Result<?> queryById(@RequestParam(name = "id", required = true) String id) {
OtaBaSjSjxtbh otaBaSjSjxtbh = otaBaSjSjxtbhService.queryById(id);
if (otaBaSjSjxtbh == null) {
return Result.error("未找到对应数据");
}
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
*
* @param request
* @param otaBaSjSjxtbh
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, OtaBaSjSjxtbh otaBaSjSjxtbh) {
return super.exportXls(request, otaBaSjSjxtbh, OtaBaSjSjxtbh.class, "升级备案-本次升级的系统名称与参数变化");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, OtaBaSjSjxtbh.class);
@@ -115,6 +115,12 @@ public class OtaBaSjList implements Serializable {
@ApiModelProperty(value = "备注")
private java.lang.String bz;
/**升级驾驶附件*/
@Excel(name = "升级驾驶附件", width = 15)
@ApiModelProperty(value = "升级驾驶附件")
private java.lang.String sjjsfj;
public void updateData(OtaBaSjSjmbcx otaBaSjSjmbcx) {
this.cpdjbh = otaBaSjSjmbcx.getBabh();
this.ggpc = otaBaSjSjmbcx.getBapc();
@@ -1,5 +1,6 @@
package com.jero.modules.ota.service;
import com.alibaba.fastjson.JSONObject;
import com.jero.modules.ota.entity.OtaBaSjSjfzbh;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
@@ -18,7 +19,7 @@ public interface IOtaBaSjSjfzbhService extends IService<OtaBaSjSjfzbh> {
* @param otaBaSjSjfzbh
* @return
*/
void add(OtaBaSjSjfzbh otaBaSjSjfzbh);
void add(JSONObject json);
/**
* 更新
@@ -58,4 +59,6 @@ public interface IOtaBaSjSjfzbhService extends IService<OtaBaSjSjfzbh> {
* @return
*/
List<OtaBaSjSjfzbh> queryList();
JSONObject queryByOtaId(String otaId, String otaIdT);
}
@@ -1,5 +1,6 @@
package com.jero.modules.ota.service;
import com.alibaba.fastjson.JSONObject;
import com.jero.modules.ota.entity.OtaBaSjSjxtbh;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
@@ -15,10 +16,8 @@ public interface IOtaBaSjSjxtbhService extends IService<OtaBaSjSjxtbh> {
/**
* 保存
*
* @param otaBaSjSjxtbh
* @return
*/
void add(OtaBaSjSjxtbh otaBaSjSjxtbh);
void add(JSONObject json);
/**
* 更新
@@ -58,4 +57,6 @@ public interface IOtaBaSjSjxtbhService extends IService<OtaBaSjSjxtbh> {
* @return
*/
List<OtaBaSjSjxtbh> queryList();
JSONObject queryByOtaId(String otaId, String otaIdT);
}
@@ -29,6 +29,8 @@ public class OtaBaSjListServiceImpl extends ServiceImpl<OtaBaSjListMapper, OtaBa
@Autowired
private IOtaBaSjLsjlService otaBaSjLsjlService;
/**
* 保存
*
@@ -1,89 +1,191 @@
package com.jero.modules.ota.service.impl;
import com.jero.modules.ota.entity.OtaBaSjSjfzbh;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.jero.modules.oss.service.IOSSFileService;
import com.jero.modules.ota.entity.*;
import com.jero.modules.ota.enums.OtaModuleEnum;
import com.jero.modules.ota.enums.OtaTitleEnum;
import com.jero.modules.ota.mapper.OtaBaSjSjfzbhMapper;
import com.jero.modules.ota.service.IOtaBaCxTxjlService;
import com.jero.modules.ota.service.IOtaBaSjListService;
import com.jero.modules.ota.service.IOtaBaSjSjfzbhService;
import com.jero.modules.ota.utils.ComparisonUtil;
import com.jero.modules.system.service.ISysDictService;
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 java.util.List;
import java.util.Date;
import java.lang.reflect.Field;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 升级备案-本次升级的驾驶辅助功能与参数变化
* @Author: jero-boot
* @Date: 2023-03-17
* @Date: 2023-03-17
* @Version: V1.0
*/
@Service
public class OtaBaSjSjfzbhServiceImpl extends ServiceImpl<OtaBaSjSjfzbhMapper, OtaBaSjSjfzbh> implements IOtaBaSjSjfzbhService {
/**
* 保存
*
* @param otaBaSjSjfzbh
* @return
*/
@Override
public void add(OtaBaSjSjfzbh otaBaSjSjfzbh) {
@Autowired
private IOtaBaSjListService otaBaSjListService;
@Autowired
private IOtaBaCxTxjlService otaBaCxTxjlService;
@Autowired
private ISysDictService sysDictService;
@Autowired
private IOSSFileService ossFileService;
/**
* 保存
*
*/
@Override
public void add(JSONObject json) {
List<OtaBaSjSjfzbh> newList = new ArrayList<>();
List<OtaBaSjSjfzbh> oldList;
Date now = new Date();
otaBaSjSjfzbh.setCreateTime(now);
otaBaSjSjfzbh.setUpdateTime(now);
save(otaBaSjSjfzbh);
String otaId = (String) json.get("otaId");
if (StringUtils.isNotEmpty(otaId)) {
oldList = getByOtaId(otaId);
deleteByOtaId(otaId);
JSONArray list = json.getJSONArray("list");
for (Object obj : list) {
Map<String, Object> objMap = (HashMap) obj;
OtaBaSjSjfzbh otaBaSjSjfzbh = new OtaBaSjSjfzbh();
Field[] fields = OtaBaSjSjfzbh.class.getDeclaredFields();
for (Field field : fields) {
if (field.getName().equals("createTime") || field.getName().equals("updateTime")) {
continue;
}
Object bjObj = objMap.get(field.getName());
if (null != bjObj) {
try {
field.setAccessible(true);
field.set(otaBaSjSjfzbh, bjObj.toString());
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
}
otaBaSjSjfzbh.setOtaId(otaId);
otaBaSjSjfzbh.setCreateTime(now);
otaBaSjSjfzbh.setUpdateTime(now);
newList.add(otaBaSjSjfzbh);
}
if (ObjectUtils.isEmpty(oldList)) {
oldList = new ArrayList<>();
}
ComparisonUtil cu = new ComparisonUtil();
List<OtaBaCxTxjl> reList = cu.comparisonListRecord(otaId, OtaModuleEnum.SJ_SJJSMCBH, OtaTitleEnum.GNMC.getName(), oldList, newList, sysDictService);
saveOrUpdateBatch(newList);
otaBaCxTxjlService.saveBatch(reList);
String fj = (String) json.get("fj");
if (StringUtils.isNotEmpty(fj)) {
OtaBaSjList otaBaSjList = otaBaSjListService.queryById(otaId);
if (ObjectUtils.isNotEmpty(otaBaSjList)) {
otaBaSjList.setSjjsfj(fj);
otaBaSjListService.editById(otaBaSjList);
}
}
}
}
/**
* 更新
*
* @param otaBaSjSjfzbh
* @return
*/
@Override
public void deleteByOtaId(String otaId) {
List<OtaBaSjSjfzbh> list = this.getByOtaId(otaId);
List<String> ids = new ArrayList<>();
for (OtaBaSjSjfzbh bh : list) {
ids.add(bh.getId());
}
this.deleteByIds(ids);
}
/**
* 更新
*
* @param otaBaSjSjfzbh
* @return
*/
@Override
public void editById(OtaBaSjSjfzbh otaBaSjSjfzbh) {
Date now = new Date();
Date now = new Date();
otaBaSjSjfzbh.setUpdateTime(now);
saveOrUpdate(otaBaSjSjfzbh);
saveOrUpdate(otaBaSjSjfzbh);
}
/**
* 通过id删除
*
* @param id
* @return
*/
@Override
/**
* 通过id删除
*
* @param id
* @return
*/
@Override
public void deleteById(String id) {
removeById(id);
}
/**
* 批量删除
*
* @param ids
* @return
*/
@Override
/**
* 批量删除
*
* @param ids
* @return
*/
@Override
public void deleteByIds(List<String> ids) {
removeByIds(ids);
}
/**
* 通过id查询
*
* @param id
* @return
*/
@Override
/**
* 通过id查询
*
* @param id
* @return
*/
@Override
public OtaBaSjSjfzbh queryById(String id) {
return getById(id);
}
/**
* 列表查询
*
* @return
*/
@Override
* 列表查询
*
* @return
*/
@Override
public List<OtaBaSjSjfzbh> queryList() {
return list();
}
@Override
public JSONObject queryByOtaId(String otaId, String otaIdT) {
List<OtaBaSjSjfzbh> res = this.getByOtaId(otaId);
if (ObjectUtil.isEmpty(res)) {
res = getByOtaId(otaIdT);
}
JSONObject json = new JSONObject();
json.put("list", res);
OtaBaSjList otaBaSjList = otaBaSjListService.queryById(otaId);
if (ObjectUtils.isNotEmpty(otaBaSjList) && ObjectUtils.isNotEmpty(otaBaSjList.getSjjsfj())) {
json.put("fj", otaBaSjList.getSjjsfj());
}
return json;
}
private List<OtaBaSjSjfzbh> getByOtaId(String otaId) {
if (org.apache.commons.lang3.StringUtils.isEmpty(otaId)) {
return null;
}
LambdaQueryWrapper<OtaBaSjSjfzbh> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(OtaBaSjSjfzbh::getOtaId, otaId);
return this.list(queryWrapper);
}
}
@@ -1,89 +1,174 @@
package com.jero.modules.ota.service.impl;
import com.jero.modules.ota.entity.OtaBaSjSjxtbh;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.jero.modules.oss.service.IOSSFileService;
import com.jero.modules.ota.entity.*;
import com.jero.modules.ota.enums.OtaModuleEnum;
import com.jero.modules.ota.enums.OtaTitleEnum;
import com.jero.modules.ota.mapper.OtaBaSjSjxtbhMapper;
import com.jero.modules.ota.service.IOtaBaCxTxjlService;
import com.jero.modules.ota.service.IOtaBaSjSjxtbhService;
import com.jero.modules.ota.utils.ComparisonUtil;
import com.jero.modules.system.service.ISysDictService;
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 java.util.List;
import java.util.Date;
import java.lang.reflect.Field;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 升级备案-本次升级的系统名称与参数变化
* @Author: jero-boot
* @Date: 2023-03-17
* @Date: 2023-03-17
* @Version: V1.0
*/
@Service
public class OtaBaSjSjxtbhServiceImpl extends ServiceImpl<OtaBaSjSjxtbhMapper, OtaBaSjSjxtbh> implements IOtaBaSjSjxtbhService {
@Autowired
private IOtaBaCxTxjlService otaBaCxTxjlService;
/**
* 保存
*
* @param otaBaSjSjxtbh
* @return
*/
@Override
public void add(OtaBaSjSjxtbh otaBaSjSjxtbh) {
@Autowired
private ISysDictService sysDictService;
@Autowired
private IOSSFileService ossFileService;
/**
* 保存
*/
@Override
public void add(JSONObject json) {
List<OtaBaSjSjxtbh> newList = new ArrayList<>();
List<OtaBaSjSjxtbh> oldList;
Date now = new Date();
otaBaSjSjxtbh.setCreateTime(now);
otaBaSjSjxtbh.setUpdateTime(now);
save(otaBaSjSjxtbh);
String otaId = (String) json.get("otaId");
if (StringUtils.isNotEmpty(otaId)) {
oldList = getByOtaId(otaId);
deleteByOtaId(otaId);
JSONArray list = json.getJSONArray("list");
for (Object obj : list) {
Map<String, Object> objMap = (HashMap) obj;
OtaBaSjSjxtbh otaBaSjSjxtbh = new OtaBaSjSjxtbh();
Field[] fields = OtaBaSjSjxtbh.class.getDeclaredFields();
for (Field field : fields) {
if (field.getName().equals("createTime") || field.getName().equals("updateTime")) {
continue;
}
Object bjObj = objMap.get(field.getName());
if (null != bjObj) {
try {
field.setAccessible(true);
field.set(otaBaSjSjxtbh, bjObj.toString());
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
}
otaBaSjSjxtbh.setOtaId(otaId);
otaBaSjSjxtbh.setCreateTime(now);
otaBaSjSjxtbh.setUpdateTime(now);
newList.add(otaBaSjSjxtbh);
}
if (ObjectUtils.isEmpty(oldList)) {
oldList = new ArrayList<>();
}
ComparisonUtil cu = new ComparisonUtil();
List<OtaBaCxTxjl> reList = cu.comparisonListRecord(otaId, OtaModuleEnum.SJ_SJXTMCBH, OtaTitleEnum.XTMC.getName(), oldList, newList, sysDictService);
saveOrUpdateBatch(newList);
otaBaCxTxjlService.saveBatch(reList);
}
}
/**
* 更新
*
* @param otaBaSjSjxtbh
* @return
*/
@Override
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);
}
/**
* 更新
*
* @param otaBaSjSjxtbh
* @return
*/
@Override
public void editById(OtaBaSjSjxtbh otaBaSjSjxtbh) {
Date now = new Date();
Date now = new Date();
otaBaSjSjxtbh.setUpdateTime(now);
saveOrUpdate(otaBaSjSjxtbh);
saveOrUpdate(otaBaSjSjxtbh);
}
/**
* 通过id删除
*
* @param id
* @return
*/
@Override
/**
* 通过id删除
*
* @param id
* @return
*/
@Override
public void deleteById(String id) {
removeById(id);
}
/**
* 批量删除
*
* @param ids
* @return
*/
@Override
/**
* 批量删除
*
* @param ids
* @return
*/
@Override
public void deleteByIds(List<String> ids) {
removeByIds(ids);
}
/**
* 通过id查询
*
* @param id
* @return
*/
@Override
/**
* 通过id查询
*
* @param id
* @return
*/
@Override
public OtaBaSjSjxtbh queryById(String id) {
return getById(id);
}
/**
* 列表查询
*
* @return
*/
@Override
* 列表查询
*
* @return
*/
@Override
public List<OtaBaSjSjxtbh> queryList() {
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) {
if (org.apache.commons.lang3.StringUtils.isEmpty(otaId)) {
return null;
}
LambdaQueryWrapper<OtaBaSjSjxtbh> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(OtaBaSjSjxtbh::getOtaId, otaId);
return this.list(queryWrapper);
}
}
+1 -1
View File
@@ -619,7 +619,7 @@ module.exports = {
Deliverables: 'Deliverables',
personLiable: 'Assignee',
PrehomoConfirmation: 'Pre-Homo Confirmation',
verificationAndConformityconfirmation: 'Validation Compliance Check ',
verificationAndConformityconfirmation: 'Validation Compliance Check',
StandardImplementationDate: 'New Type Execution Date',
regulatoryEngineer: 'Regulation Engineer',
certifiedEngineer: 'Homo Engineer',
+2 -2
View File
@@ -1819,8 +1819,8 @@ module.exports = {
pleaseFillInTheInformationTaskProcess:'请填写工程接口人和责任人信息后再发起任务流程',
complianceReporting:'合规报告',
youCanOnlySelectStatusClearSubmit:'只能选择流程状态为清单待提交的数据',
note:':附件包括测试项目清单测试报告测试标准或技术规范',
format:'支持doc/docx/pdf格式,大小50M以内',
note:':附件包括测试项目清单测试报告测试标准或技术规范',
format:'支持doc/docx/pdf格式大小50M以内',
cantTransferToYourself:"不能转办给自己",
noteone:':支持CSV格式大小20M以内数量1-20个',
notecsv:':支持CSV格式大小20M以内',
@@ -1612,6 +1612,9 @@
/deep/ .ant-table-column-title {
font-weight: bold !important;
}
::v-deep .ant-table-thead > tr > th .ant-table-header-column {
max-width: none !important;
}
</style>
<style lang="less">
.popconfirm {
@@ -243,6 +243,7 @@ export default {
}
this.record=record
this.visible = true
this.confirmLoading = false
this.formInline = {}
this.formInline.dataList = [{}]
this.$nextTick(() => {
@@ -447,7 +447,7 @@ export default {
this.$refs.upgradecompletionRef.addModel(record,flag)
},
// 查看
detailclick(){
detailclick(record){
},
// 维护
@@ -23,6 +23,7 @@
:disabled="disabled"
v-model="formInline.zsl"
:title='formInline.zsl'
:max-length="50"
:placeholder="$t('PleaseSelect')"></a-input>
</a-form-model-item>
</div>
@@ -145,6 +146,7 @@ export default {
this.formInline.dateofproduction=[]
this.formInline.dateofproduction.push(res.result.scrqks)
this.formInline.dateofproduction.push(res.result.scrqjs)
this.formInline.id = res.result.vinList
this.$forceUpdate()
}
@@ -57,7 +57,7 @@
<span slot="upgradepackagesize" slot-scope="text,record">
<a-input :placeholder="$t('pleaseEnter')" v-model="record.sjbdx" :title='record.sjbdx' :max-length="50"></a-input>
</span>
<span slot="differentialupgradeornot" slot-scope="text,record">
<span slot="differentialupgradeornot" slot-scope="text,record" :max-length="50">
<a-input :placeholder="$t('pleaseEnter')" v-model="record.sfcfsj" :title='record.sfcfsj'></a-input>
</span>
<!-- 操作列-->
@@ -41,7 +41,7 @@
</div>
<div class="title-text-add-input">
<!-- <span class="title-text-text">中文</span> -->
<a-input class="box-input" v-model="form.babh" :title='form.babh' :placeholder="$t('pleaseEnter')" disabled style="width:93%"></a-input>
<a-input class="box-input" v-model="form.babh" :title='form.babh' :placeholder="$t('pleaseEnter')" disabled style="width:93%" :max-length="50"></a-input>
</div>
</div>
</a-col>
@@ -52,7 +52,7 @@
</div>
<div class="title-text-add-input">
<!-- <span class="title-text-text">中文</span> -->
<a-input class="box-input" v-model="form.qymc" :title='form.qymc' :placeholder="$t('pleaseEnter')" disabled style="width:93%"></a-input>
<a-input class="box-input" v-model="form.qymc" :title='form.qymc' :placeholder="$t('pleaseEnter')" disabled style="width:93%" :max-length="50"></a-input>
</div>
</div>
</a-col>
@@ -77,7 +77,7 @@
<span class="title-text-text" :title="$t('producttrademark')">{{$t('producttrademark')}}</span>
</div>
<a-form-model-item class="itemModel">
<a-input disabled class="box-input" :placeholder="$t('pleaseEnter')" :title='form.cpsb' v-model="form.cpsb"></a-input>
<a-input disabled class="box-input" :placeholder="$t('pleaseEnter')" :title='form.cpsb' v-model="form.cpsb" :max-length="50"></a-input>
</a-form-model-item>
</div>
@@ -88,7 +88,7 @@
<span class="title-text-text" :title="$t('productname')">{{$t('productname')}}</span>
</div>
<a-form-model-item class="itemModel">
<a-input disabled class="box-input" :placeholder="$t('pleaseEnter')" :title='form.cpmc' v-model="form.cpmc"></a-input>
<a-input disabled class="box-input" :placeholder="$t('pleaseEnter')" :title='form.cpmc' v-model="form.cpmc" :max-length="50"></a-input>
</a-form-model-item>
</div>
@@ -99,7 +99,7 @@
<span class="title-text-text" :title="$t('productModel')">{{$t('productModel')}}</span>
</div>
<a-form-model-item class="itemModel">
<a-input disabled class="box-input" :placeholder="$t('pleaseEnter')" :title='form.cpxh' v-model="form.cpxh"></a-input>
<a-input disabled class="box-input" :placeholder="$t('pleaseEnter')" :title='form.cpxh' v-model="form.cpxh" :max-length="50"></a-input>
</a-form-model-item>
</div>
@@ -197,7 +197,15 @@ import ImportFile from '@/components/ImportFileData/index'
}
getAction('/ota/otaBaSjSjmbcx/queryByOtaId',{otaIdT:otaIdT,otaId:otaId}).then(res=>{
if(res.code == 200){
this.form=res.result ==null?{}:res.result
if(res.result==null){
this.form=res.result
this.form.cxmb=undefined
this.form.bapc=undefined
this.form.dllx1=undefined
this.form.dllx2=undefined
}else{
this.form=res.result
}
}
})
@@ -11,6 +11,7 @@
<a-form-model-item class="itemModel" prop="sjbbhcs" >
<a-textarea
:placeholder="$t('controlsystem')"
:max-length="500"
v-model.trim="queryParam.sjbbhcs" :rows="4"/>
</a-form-model-item>
</div>
@@ -645,7 +645,7 @@
align: 'left',
ellipsis: true,
dataIndex: 'applicableSupplement',
width: 180
width: 200
},
{
title: this.$t('certificationType'),
@@ -1305,7 +1305,7 @@
actiProcInstId: row.verifyPId,
projectTaskInventoryId: row.id,
projectLibraryId: row.projectLibraryId,
TaskKey: row.taskDefinitionKey,
TaskKey: TaskKey,
flowType: 4,
isDisplay: false,
Sponsor: 'regulationOwnerName',
@@ -2870,6 +2870,11 @@
color: #00B3BE;
cursor: pointer;
}
::v-deep .ant-table-thead > tr > th .ant-table-header-column {
max-width: none !important;
}
</style>
<style lang="less">
.box-input .ant-select-selection {