Commit 140d5d54 authored by 赵啸非's avatar 赵啸非

添加公司专利配置

parent 5cfd0629
......@@ -103,7 +103,7 @@ export default {
return {
number: 0,
uploadList: [],
uploadFileUrl: "/enterprise/file/commonupload", // 上传的地址
uploadFileUrl: "/office/file/commonupload", // 上传的地址
headers: {},
fileList: [],
};
......@@ -112,7 +112,7 @@ export default {
watch: {
value: {
handler(val) {
if (val) {
if (val&&val!=='') {
this.showFileList();
} else {
this.fileList = [];
......@@ -137,8 +137,8 @@ export default {
// 然后将数组转为对象数组
const fileNamelist =this.fileName.split(',');
for (var i = 0; i < filePathlist.length; i++) {
if(filePathlist[i]==='') continue
let item = {}
console.log(fileNamelist.length === filePathlist.length)
if (fileNamelist.length === filePathlist.length) {
item.name = fileNamelist[i];
} else {
......
......@@ -55,6 +55,9 @@ const router = new Router({
...restBuilder('staff/record', 'staff/record'),//客户访问记录信息
...restBuilder('news/category', 'news/category'),//新闻频道分类
...restBuilder('news/category', 'news/category'),//新闻频道分类
//以下为基础路由配置
builder('', 'Home'),
builder('index', 'Home'),
......
......@@ -3,6 +3,9 @@ import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.company.model.CompanyEntity;
import java.util.ArrayList;
import java.util.List;
import com.mortals.xhx.module.company.model.CompanyLabelsEntity;
import com.mortals.xhx.module.company.model.CompanyPatentEntity;
import lombok.Data;
import com.mortals.framework.annotation.Excel;
import java.math.BigDecimal;
......@@ -19,5 +22,8 @@ public class CompanyVo extends BaseEntityLong {
/** 主键ID,主键,自增长列表 */
private List <Long> idList;
//公司专利
private List<CompanyPatentEntity> companyPatentList=new ArrayList<>();;
}
\ No newline at end of file
package com.mortals.xhx.module.company.service.impl;
import com.mortals.framework.model.PageInfo;
import com.mortals.xhx.module.company.model.*;
import com.mortals.xhx.module.company.service.CompanyPatentService;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.xhx.module.company.dao.CompanyDao;
import com.mortals.xhx.module.company.model.CompanyEntity;
import com.mortals.xhx.module.company.service.CompanyService;
import org.springframework.beans.factory.annotation.Autowired;
import com.mortals.xhx.module.company.model.CompanyLabelsEntity;
import com.mortals.xhx.module.company.model.CompanyLabelsQuery;
import com.mortals.xhx.module.company.service.CompanyLabelsService;
import org.springframework.util.ObjectUtils;
import java.util.Date;
import java.util.Arrays;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
/**
* CompanyService
* 公司 service实现
*
* @author zxfei
* @date 2023-09-18
*/
* CompanyService
* 公司 service实现
*
* @author zxfei
* @date 2023-09-18
*/
@Service("companyService")
@Slf4j
public class CompanyServiceImpl extends AbstractCRUDServiceImpl<CompanyDao, CompanyEntity, Long> implements CompanyService {
@Autowired
private CompanyLabelsService companyLabelsService;
@Autowired
private CompanyPatentService companyPatentService;
@Override
protected void findAfter(CompanyEntity params, PageInfo pageInfo, Context context, List<CompanyEntity> list) throws AppException {
list.stream().peek(item -> {
List<CompanyPatentEntity> companyPatentEntities = companyPatentService.find(new CompanyPatentQuery().companyId(item.getId()));
item.setCompanyPatentList(companyPatentEntities);
}).count();
}
@Override
protected void saveAfter(CompanyEntity entity, Context context) throws AppException {
if(!ObjectUtils.isEmpty(entity.getCompanyLabelsList())){
entity.getCompanyLabelsList().stream().peek(item->{
if (!ObjectUtils.isEmpty(entity.getCompanyLabelsList())) {
entity.getCompanyLabelsList().stream().peek(item -> {
item.setCompanyId(entity.getId());
item.setCreateUserId(this.getContextUserId(context));
item.setCreateTime(new Date());
}).count();
companyLabelsService.save(entity.getCompanyLabelsList());
}
if (!ObjectUtils.isEmpty(entity.getCompanyPatentList())) {
entity.getCompanyPatentList().stream().peek(item -> {
item.setCompanyId(entity.getId());
item.setCreateUserId(this.getContextUserId(context));
item.setCreateTime(new Date());
}).count();
companyPatentService.save(entity.getCompanyPatentList());
}
super.saveAfter(entity, context);
}
@Override
protected void updateAfter(CompanyEntity entity, Context context) throws AppException {
if(!ObjectUtils.isEmpty(entity.getCompanyLabelsList())){
if (!ObjectUtils.isEmpty(entity.getCompanyLabelsList())) {
Long[] companyLabelsIds = companyLabelsService.find(new CompanyLabelsQuery().companyId(entity.getId())).stream().map(CompanyLabelsEntity::getId).toArray(Long[]::new);
companyLabelsService.remove(companyLabelsIds,context);
entity.getCompanyLabelsList().stream().peek(item ->{
companyLabelsService.remove(companyLabelsIds, context);
entity.getCompanyLabelsList().stream().peek(item -> {
item.setCompanyId(entity.getId());
item.setCreateUserId(this.getContextUserId(context));
item.setCreateTime(new Date());
......@@ -55,13 +79,32 @@ public class CompanyServiceImpl extends AbstractCRUDServiceImpl<CompanyDao, Comp
}).count();
companyLabelsService.save(entity.getCompanyLabelsList());
}
if (!ObjectUtils.isEmpty(entity.getCompanyPatentList())) {
Long[] companyPantentIds = companyPatentService.find(new CompanyPatentQuery().companyId(entity.getId())).stream().map(CompanyPatentEntity::getId).toArray(Long[]::new);
companyPatentService.remove(companyPantentIds, context);
entity.getCompanyLabelsList().stream().peek(item -> {
item.setCompanyId(entity.getId());
item.setCreateUserId(this.getContextUserId(context));
item.setCreateTime(new Date());
item.setUpdateUserId(this.getContextUserId(context));
item.setUpdateTime(new Date());
}).count();
companyPatentService.save(entity.getCompanyPatentList());
}
super.updateAfter(entity, context);
}
@Override
protected void removeAfter(Long[] ids, Context context, int result) throws AppException {
List<CompanyLabelsEntity> companyLabelslist = companyLabelsService.find(new CompanyLabelsQuery().companyIdList(Arrays.asList(ids)));
companyLabelsService.removeList(companyLabelslist,context);
companyLabelsService.removeList(companyLabelslist, context);
List<CompanyPatentEntity> companyPatentEntities = companyPatentService.find(new CompanyPatentQuery().companyIdList(Arrays.asList(ids)));
companyPatentService.removeList(companyPatentEntities, context);
super.removeAfter(ids, context, result);
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment