style: 删除外标及分享相关功能

This commit is contained in:
2024-06-19 15:19:19 +08:00
parent 28bc40daae
commit 187398feed
24 changed files with 5 additions and 1431 deletions
@@ -26,7 +26,6 @@ import com.jero.modules.laws.standard.entity.LawsEnterpriseStandard;
import com.jero.modules.laws.standard.entity.LawsOverseasStandard;
import com.jero.modules.laws.standard.service.ILawsDomesticStandardService;
import com.jero.modules.laws.standard.service.ILawsEnterpriseStandardService;
import com.jero.modules.laws.standard.service.ILawsOverseasStandardService;
import com.jero.modules.system.service.ISysUserService;
import com.jero.modules.system.util.MyStringUtils;
import com.jero.modules.system.vo.IdMapBody;
@@ -72,8 +71,6 @@ public class SarFileCompareInfoController extends JeroController<SarFileCompareI
@Autowired
private ILawsDomesticStandardService lawsDomesticStandardService; //国内标准
@Autowired
private ILawsOverseasStandardService lawsOverseasStandardService; //海外标准
@Autowired
private ILawsEnterpriseStandardService ILawsEnterpriseStandardService; //企业标准
@Autowired
private ISysUserService sysUserService;
@@ -127,7 +124,6 @@ public class SarFileCompareInfoController extends JeroController<SarFileCompareI
// 获取编号对应的国内、海外、企业信息
if (!serialNumberList.isEmpty()){
lawsDomesticStandards = lawsDomesticStandardService.list(new QueryWrapper<LawsDomesticStandard>().lambda().in(LawsDomesticStandard::getStandardNumber, serialNumberList));
lawsOverseasStandards = lawsOverseasStandardService.list(new QueryWrapper<LawsOverseasStandard>().lambda().in(LawsOverseasStandard::getStandardNumber, serialNumberList));
lawsEnterpriseStandards = ILawsEnterpriseStandardService.list(new QueryWrapper<LawsEnterpriseStandard>().lambda().in(LawsEnterpriseStandard::getStandardNumber, serialNumberList));
}
@@ -154,8 +154,6 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
@Autowired
private ILawsDomesticStandardService lawsDomesticStandardService;
@Autowired
private ILawsOverseasStandardService lawsOverseasStandardService;
@Autowired
private ILawsEnterpriseStandardService lawsEnterpriseStandardService;
@Resource
private EnterpriseStandardAuthDeptService enterpriseAuthDeptService;
@@ -1002,8 +1000,6 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
private void executeUpdateWrapperByModel(String module, UpdateWrapper updateWrapper) {
if (TableNameEnum.DOMESTIC_REGULATIONS.getValue().equals(module)) {
lawsDomesticStandardService.update(updateWrapper);
} else if (TableNameEnum.FOREIGN_REGULATIONS.getValue().equals(module)) {
lawsOverseasStandardService.update(updateWrapper);
} else if (TableNameEnum.ENTERPRISE_STANDARDS.getValue().equals(module)) {
lawsEnterpriseStandardService.update(updateWrapper);
} else if (TableNameEnum.DOCUMENT_SPLIT.getValue().equals(module)) {
@@ -1017,11 +1013,6 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
lawsDomesticStandard.setId(id);
lawsDomesticStandardService.save(lawsDomesticStandard);
return lawsDomesticStandard.getId();
} else if (TableNameEnum.FOREIGN_REGULATIONS.getValue().equals(module)) {
LawsOverseasStandard lawsOverseasStandard = new LawsOverseasStandard();
lawsOverseasStandard.setId(id);
lawsOverseasStandardService.save(lawsOverseasStandard);
return lawsOverseasStandard.getId();
} else if (TableNameEnum.ENTERPRISE_STANDARDS.getValue().equals(module)) {
LawsEnterpriseStandard lawsEnterpriseStandard = new LawsEnterpriseStandard();
lawsEnterpriseStandard.setId(id);
@@ -2195,38 +2186,6 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
// 管理员有所有外标的权限
List<String> roleList = sysUserRoleService.getRole(user.getUsername());
adminRoleCodeList.addAll(enterpriseDetailRoleCodeList);
if (module.equals(TableNameEnum.FOREIGN_REGULATIONS.getValue())
&& roleList != null
&& roleList.stream().noneMatch(adminRoleCodeList::contains)) {
// 获取汽车研发总院及其所有子部门
List<SysDepartTreeModel> departList = departService.queryTreeByKeyWord("汽车研究总院");
List<String> departIdList = departService.getAllId(departList);
List<SysUser> userByDepIds = sysUserService.getUserByDepIds(departIdList, user.getUsername());
List<LawsOverseasStandard> list = lawsOverseasStandardService.list();
List<String> allFbIdList = list.stream().map(LawsOverseasStandard::getId).collect(Collectors.toList());
List<String> fbIdList = lawsOverseasStandardService.getAllAuthControlFbId();
idSearch = true;
// 外标判断当前登陆人是不是汽车研究总院及子部门的员工,如果是则根据授权部门进行权限限制
// 如果不是则需要将引进标准的id从所有id中排除掉
if (!CollectionUtils.isEmpty(userByDepIds)) {
LambdaQueryWrapper<EnterpriseStandardAuthDept> esAdWrapper = new LambdaQueryWrapper<>();
// 查询当前用户的部门
List<SysDepart> userDepartList = departService.queryUserDeparts(user.getId());
// 找出授权部门表有的数据
List<String> userDepartIdList = userDepartList.stream().map(SysDepart::getId).collect(Collectors.toList());
esAdWrapper.in(!userDepartIdList.isEmpty(), EnterpriseStandardAuthDept::getAuthDept, userDepartIdList);
esAdWrapper.in(!fbIdList.isEmpty(), EnterpriseStandardAuthDept::getStandardId, fbIdList);
esAdWrapper.isNull(EnterpriseStandardAuthDept::getAuthExpireDate);
List<EnterpriseStandardAuthDept> authDeptFb = enterpriseAuthDeptService.list(esAdWrapper);
List<String> authDeptIdList = authDeptFb.stream().map(EnterpriseStandardAuthDept::getStandardId).collect(Collectors.toList());
if (fbIdList.size() == authDeptIdList.size()) {
idSearch = false;
}
fbIdList.removeAll(authDeptIdList);
}
allFbIdList.removeAll(fbIdList);
idSet.addAll(allFbIdList);
}
// 体系
String standardSystem = (String) parameterMap.get(FieldCommon.STANDARD_SYSTEM);
if (StrUtil.isNotBlank(standardSystem)) {
@@ -2692,11 +2651,6 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
gbUpdateWrapper.set(LawsDomesticStandard::getStandardState, "7");
gbUpdateWrapper.in(LawsDomesticStandard::getStandardNumber, standardNumbers);
lawsDomesticStandardService.update(gbUpdateWrapper);
// 外标
LambdaUpdateWrapper<LawsOverseasStandard> fbUpdateWrapper = new LambdaUpdateWrapper<>();
fbUpdateWrapper.set(LawsOverseasStandard::getStandardState, "7");
fbUpdateWrapper.in(LawsOverseasStandard::getStandardNumber, standardNumbers);
lawsOverseasStandardService.update(fbUpdateWrapper);
// 企标
LambdaUpdateWrapper<LawsEnterpriseStandard> qbUpdateWrapper = new LambdaUpdateWrapper<>();
qbUpdateWrapper.set(LawsEnterpriseStandard::getStandardState, "9");
@@ -2773,14 +2727,6 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
result.put("source", TableNameEnum.DOMESTIC_REGULATIONS.getValue());
return result;
}
LawsOverseasStandard fbStandard = lawsOverseasStandardService.getOne(new LambdaQueryWrapper<LawsOverseasStandard>()
.eq(LawsOverseasStandard::getStandardNumber, standardNumber));
if (fbStandard != null) {
this.addLookHistory(fbStandard.getId(), "1", TableNameEnum.FOREIGN_REGULATIONS.getValue(), standardNumber);
result = this.getByIdAndModule(fbStandard.getId(), TableNameEnum.FOREIGN_REGULATIONS.getValue(), "1", standardNumber);
result.put("source", TableNameEnum.FOREIGN_REGULATIONS.getValue());
return result;
}
LawsEnterpriseStandard esStandard = lawsEnterpriseStandardService.getOne(new LambdaQueryWrapper<LawsEnterpriseStandard>()
.eq(LawsEnterpriseStandard::getStandardNumber, standardNumber));
if (esStandard != null) {
@@ -74,9 +74,6 @@ public class ImportUtil {
@Resource
private ILawsDomesticStandardService lawsDomeStandardService;
@Resource
private ILawsOverseasStandardService overseasStandardService;
@Resource
private PartNameService partNameService;
@@ -203,32 +200,6 @@ public class ImportUtil {
}
}
}
if ((TableNameEnum.FOREIGN_REGULATIONS.getValue().equals(tag.getIsModel()))) {
// 校验standardClass
if (!this.dictValid("standard_type_overseas", standardClass)) {
log.error("" + row + "" + tag.getDbFieldTxt() + "填写错误 ");
errMsg.append("").append(row).append("").append(tag.getDbFieldTxt()).append("填写错误 ");
} else {
String foreignStandardNumber = standardNumber + " " + standardClass + "-" + yearNumber;
QueryWrapper<LawsOverseasStandard> domesticStandardQueryWrapper = new QueryWrapper<>();
domesticStandardQueryWrapper.eq(FieldCommon.STANDARD_NUMBER, foreignStandardNumber);
domesticStandardQueryWrapper.eq(FieldCommon.DEL_FLAG, YesOrNoEnum.NO.getValue());
LawsOverseasStandard lawsOverseasStandard = overseasStandardService.getOne(domesticStandardQueryWrapper);
standardValidFlag = true;
if (lawsOverseasStandard != null) {
log.error("" + line + "行的标准编号已存在 ");
errMsg.append("").append(line).append("行的标准编号已存在");
break;
}
standardClass = this.convertDictValue("standard_type_overseas", standardClass);
// 判断是否有重复数据
if (keyMap.containsKey(foreignStandardNumber)) {
errMsgList.add("" + keyMap.get(foreignStandardNumber) + "行'标准编号'与第" + line + "行数据重复。");
} else {
keyMap.put(foreignStandardNumber, line);
}
}
}
// 将转好的值加入Map
parameterMap.put(FieldCommon.STANDARD_NUMBER_TEMP, standardNumber);
parameterMap.put(FieldCommon.STANDARD_CLASS, standardClass);
@@ -975,8 +946,6 @@ public class ImportUtil {
lawsEnterpriseStandardService.list().forEach(lawsEnterpriseStandard -> standardNoList.add(lawsEnterpriseStandard.getStandardNumber()));
} else if (TableNameEnum.DOMESTIC_REGULATIONS.getValue().equals(model)) {
lawsDomeStandardService.list().forEach(lawsDomesticStandard -> standardNoList.add(lawsDomesticStandard.getStandardNumber()));
} else if (TableNameEnum.FOREIGN_REGULATIONS.getValue().equals(model)) {
overseasStandardService.list().forEach(lawsOverseasStandard -> standardNoList.add(lawsOverseasStandard.getStandardNumber()));
}
return new HashSet<>(standardNoList).containsAll(Arrays.asList(standardNo));
}
@@ -103,11 +103,4 @@ public interface EnterpriseStandardAuthUserService extends IService<EnterpriseSt
*/
void isDeleteHorizontalOverstep(String standardId);
/**
* 校验外标权限
* @param standardId
* @param userId
* @return
*/
boolean fbDetailPermission(String standardId, String standardNumber, String userId);
}
@@ -11,7 +11,6 @@ import com.jero.common.constant.enums.YesOrNoEnum;
import com.jero.common.exception.JeroBootException;
import com.jero.common.util.MessageUtils;
import com.jero.modules.laws.common.constant.FieldCommon;
import com.jero.modules.laws.common.vo.ManyStandardSelectionBox;
import com.jero.modules.laws.enterprise.entity.EnterpriseStandardAuthDept;
import com.jero.modules.laws.enterprise.entity.EnterpriseStandardAuthUser;
import com.jero.modules.laws.enterprise.mapper.EnterpriseStandardAuthDeptMapper;
@@ -20,16 +19,13 @@ import com.jero.modules.laws.enterprise.service.EnterpriseStandardAuthDeptServic
import com.jero.modules.laws.enterprise.service.EnterpriseStandardAuthUserService;
import com.jero.modules.laws.standard.controller.TempAuthRecordQueryDto;
import com.jero.modules.laws.standard.entity.LawsEnterpriseStandard;
import com.jero.modules.laws.standard.entity.LawsOverseasStandard;
import com.jero.modules.laws.standard.entity.LawsStandardTempPermission;
import com.jero.modules.laws.standard.service.ILawsEnterpriseStandardService;
import com.jero.modules.laws.standard.service.ILawsOverseasStandardService;
import com.jero.modules.sys.entity.LawsEnterpriseStandardLevel;
import com.jero.modules.sys.entity.LawsGrade;
import com.jero.modules.sys.service.ILawsEnterpriseStandardLevelService;
import com.jero.modules.sys.service.ILawsGradeService;
import com.jero.modules.sys.utils.UserUtils;
import com.jero.modules.system.entity.SysDepart;
import com.jero.modules.system.entity.SysUser;
import com.jero.modules.system.model.DepartIdModel;
import com.jero.modules.system.service.ISysDepartService;
@@ -98,9 +94,6 @@ public class EnterpriseStandardAuthUserServiceImpl extends ServiceImpl<Enterpris
@Resource
private ILawsEnterpriseStandardService esService;
@Resource
private ILawsOverseasStandardService fbService;
@Resource
private ISysDepartService departService;
@@ -502,46 +495,6 @@ public class EnterpriseStandardAuthUserServiceImpl extends ServiceImpl<Enterpris
throw new JeroBootException(MessageUtils.getMessage(ResultCommon.YOU_HAVE_NOT_DATA_AUTH, standardId));
}
@Override
public boolean fbDetailPermission(String standardId, String standardNumber,String userId) {
if (StrUtil.isBlank(standardId) && StrUtil.isBlank(standardNumber)) {
throw new JeroBootException("标准id和标准编号不能同时为空");
}
if (StrUtil.isBlank(standardId)) {
LambdaQueryWrapper<LawsOverseasStandard> fbWrapper = new LambdaQueryWrapper<>();
fbWrapper.eq(LawsOverseasStandard::getStandardNumber, standardNumber);
LawsOverseasStandard fb = fbService.getOne(fbWrapper);
standardId = fb.getId();
}
// 管理员有所有企标的权限
SysUser currentUser = sysUserService.getById(userId);
// 管理员有所有企标的权限
List<String> roleList = sysUserRoleService.getRole(currentUser.getUsername());
if (roleList != null && roleList.stream().anyMatch(adminRoleCodeList::contains)) {
return true;
}
// 能够查看所有企标详情的权限
if (roleList != null && roleList.stream().anyMatch(enterpriseDetailRoleCodeList::contains)) {
return true;
}
// 判断是不是引用标准,不是引用标准不做权限校验
List<String> allAuthControlFbId = fbService.getAllAuthControlFbId();
if (!allAuthControlFbId.contains(standardId)) {
return true;
}
// 获取当前用户的所在部门Id
// 查询当前用户的部门
List<SysDepart> userDepartList = departService.queryUserDeparts(userId);
List<String> departIdList = userDepartList.stream().map(SysDepart::getId).collect(Collectors.toList());
// 是引用标准就得判断权限
LambdaQueryWrapper<EnterpriseStandardAuthDept> adWrapper = new LambdaQueryWrapper<>();
adWrapper.in(EnterpriseStandardAuthDept::getAuthDept, departIdList);
adWrapper.eq(EnterpriseStandardAuthDept::getStandardId, standardId);
adWrapper.isNull(EnterpriseStandardAuthDept::getAuthExpireDate);
List<EnterpriseStandardAuthDept> list = authDeptService.list(adWrapper);
return !list.isEmpty();
}
@Override
public void delFlagSet(List<Map<String, Object>> records) {
String userId = UserUtils.getUserId();
@@ -11,7 +11,6 @@ import com.jero.modules.laws.standard.entity.LawsEnterpriseStandard;
import com.jero.modules.laws.standard.service.ILawsDomesticStandardService;
import com.jero.modules.laws.standard.service.ILawsEnterpriseStandardService;
import com.jero.modules.laws.standard.service.ILawsNewsFeedService;
import com.jero.modules.laws.standard.service.ILawsOverseasStandardService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
@@ -36,8 +35,6 @@ public class HomeSearchCheckEsPlanJob implements Job {
@Resource
private ILawsDomesticStandardService lawsDomesticStandardService;
@Resource
private ILawsOverseasStandardService lawsOverseasStandardService;
@Resource
private ILawsEnterpriseStandardService lawsEnterpriseStandardService;
@Resource
private ILawsNewsFeedService lawsNewsFeedService;
@@ -61,10 +58,6 @@ public class HomeSearchCheckEsPlanJob implements Job {
case LawsHomeSearchCommon.LAWS_DOMESTIC_STANDARD:
checkLawsDomesticStandard(resourceType, mapHash);
break;
// 比对国外标准
// case LawsHomeSearchCommon.LAWS_OVERSEAS_STANDARD:
// checkLawsOverseasStandard(resourceType, mapHash);
// break;
// 比对企业标准
case LawsHomeSearchCommon.LAWS_ENTERPRISE_STANDARD:
checkLawsEnterpriseStandard(resourceType, mapHash);
@@ -111,22 +104,6 @@ public class HomeSearchCheckEsPlanJob implements Job {
}
}
private void checkLawsOverseasStandard(String resourceType, Map<String, Integer> mapHash) {
// List<LawsOverseasStandard> listLawsOverseasStandard = lawsOverseasStandardService.list();
// int count2 = mapHash.getOrDefault(LawsHomeSearchCommon.LAWS_OVERSEAS_STANDARD, 0);
// int m2 = 0;
// if(!CollectionUtils.isEmpty(listLawsOverseasStandard)){
// m2 = listLawsOverseasStandard.size();
// }
// if(count2 != m2 || !StringUtils.isBlank(resourceType)){
// removeES(LawsHomeSearchCommon.LAWS_OVERSEAS_STANDARD);
// if(!CollectionUtils.isEmpty(listLawsOverseasStandard)){
// List<String> listIds = listLawsOverseasStandard.stream().map(LawsOverseasStandard::getId).collect(Collectors.toList());
// addES(listIds, LawsHomeSearchCommon.LAWS_OVERSEAS_STANDARD);
// }
// }
}
private void checkLawsDomesticStandard(String resourceType, Map<String, Integer> mapHash) {
List<LawsDomesticStandard> listLawsDomesticStandard = lawsDomesticStandardService.list();
// 比对数据
@@ -34,7 +34,6 @@ import com.jero.modules.laws.standard.entity.LawsOverseasStandard;
import com.jero.modules.laws.standard.service.ILawsDomesticStandardService;
import com.jero.modules.laws.standard.service.ILawsEnterpriseStandardService;
import com.jero.modules.laws.standard.service.ILawsNewsFeedService;
import com.jero.modules.laws.standard.service.ILawsOverseasStandardService;
import com.jero.modules.oss.entity.OSSFile;
import com.jero.modules.oss.service.IOSSFileService;
import com.jero.modules.tag.entity.LawsTag;
@@ -83,8 +82,6 @@ public class LawsHomeSearchServiceImpl implements ILawsHomeSearchService {
@Resource
private ILawsDomesticStandardService lawsDomesticStandardService;
@Resource
private ILawsOverseasStandardService lawsOverseasStandardService;
@Resource
private ILawsEnterpriseStandardService lawsEnterpriseStandardService;
@Resource
private ILawsNewsFeedService lawsNewsFeedService;
@@ -424,14 +421,6 @@ public class LawsHomeSearchServiceImpl implements ILawsHomeSearchService {
return listLawsEnterpriseStandard;
}
private List<LawsOverseasStandard> listLawsOverseasStandard(List<String> lawsOverseasStandardIds) {
List<LawsOverseasStandard> listLawsOverseasStandard = new ArrayList<>();
if(!CollectionUtils.isEmpty(lawsOverseasStandardIds)){
listLawsOverseasStandard = lawsOverseasStandardService.listByIds(lawsOverseasStandardIds);
}
return listLawsOverseasStandard;
}
private List<LawsDomesticStandard> listLawsDomesticStandard(List<String> lawsDomesticStandardIds) {
List<LawsDomesticStandard> listLawsDomesticStandard = new ArrayList<>();
if(!CollectionUtils.isEmpty(lawsDomesticStandardIds)){
@@ -1188,9 +1177,6 @@ public class LawsHomeSearchServiceImpl implements ILawsHomeSearchService {
case LawsHomeSearchCommon.LAWS_DOMESTIC_STANDARD:
updateLawsDomesticStandardToEs(resourceType,ids,opType);
break;
// case LawsHomeSearchCommon.LAWS_OVERSEAS_STANDARD:
// updateLawsOverseasStandardToEs(resourceType,ids,opType);
// break;
case LawsHomeSearchCommon.LAWS_ENTERPRISE_STANDARD:
updateLawsEnterpriseStandardToEs(resourceType,ids,opType);
break;
@@ -1390,50 +1376,6 @@ public class LawsHomeSearchServiceImpl implements ILawsHomeSearchService {
}
}
private void updateLawsOverseasStandardToEs(String resourceType, String ids,String opType) {
// 批量操作
// 从第0个下标开始
int startIndex = 0;
int batchCount = 2000;
List<String> listIds = Arrays.asList(ids.split(","));
while (startIndex < listIds.size()) {
int endIndex = getEndIndex(startIndex, batchCount, listIds);
List<String> listIdsSub = listIds.subList(startIndex, endIndex);
List<LawsOverseasStandard> listLawsOverseasStandard = lawsOverseasStandardService.listByIds(listIdsSub);
if(CollectionUtils.isEmpty(listLawsOverseasStandard)){
break;
}
for (LawsOverseasStandard lawsOverseasStandard : listLawsOverseasStandard) {
try {
LawsHomeNormalSearchVO obj = new LawsHomeNormalSearchVO();
obj.setId(lawsOverseasStandard.getId());
obj.setTitle(lawsOverseasStandard.getStandardNumber() + " " + lawsOverseasStandard.getStandardName());
obj.setResourceType(resourceType);
obj.setStandardTypeOrder("7");
switch (lawsOverseasStandard.getStandardState()){
case "5": obj.setStandardStateOrder("2");break;
case "6": obj.setStandardStateOrder("1");break;
case "7": obj.setStandardStateOrder("3");break;
default: obj.setStandardStateOrder("4");break;
}
obj.setImplementationDate(lawsOverseasStandard.getImplementationDate());
obj.setCreateTime(lawsOverseasStandard.getCreateTime());
obj.setReleaseDate(lawsOverseasStandard.getReleaseDate());
obj.setStandardClass(lawsOverseasStandard.getStandardClass());
obj.setApplicableVehicle(lawsOverseasStandard.getApplicableVehicle());
obj.setStandardState(lawsOverseasStandard.getStandardState());
// obj.setPushRangeFlag(2);
// obj.setReleaseStatus("1");
List<OSSFile> listFile = getOssFilesLawsOverseasStandard(lawsOverseasStandard);
updateES(opType, obj, listFile, lawsOverseasStandard.getId());
}catch (Exception e){
log.error(SYNC_ES_ERR,e.getMessage());
}
}
startIndex = startIndex + batchCount; // 下一批
}
}
@NotNull
private List<OSSFile> getOssFilesLawsOverseasStandard(LawsOverseasStandard lawsOverseasStandard) {
// 从过程稿件从上到下顺序检索;如果文档里有发布稿,只检索发布稿
@@ -15,7 +15,6 @@ import com.jero.modules.laws.standard.entity.LawsUpdateRecord;
import com.jero.modules.laws.standard.service.ILawsNodeRelationService;
import com.jero.modules.laws.standard.service.ILawsUpdateRecordService;
import com.jero.modules.personal.service.ILawsStandardCollectionService;
import com.jero.modules.personal.service.ILawsStandardSharingService;
import com.jero.modules.split.service.ISarFileSplitInfoService;
import com.jero.modules.tag.entity.LawsTag;
import com.jero.modules.tag.enums.TableNameEnum;
@@ -51,8 +50,6 @@ public class LawsDomesticController {
private ILawsStandardCollectionService lawsStandardCollectionService;
@Autowired
private ILawsUpdateRecordService lawsUpdateRecordService;
@Autowired
private ILawsStandardSharingService lawsStandardSharingService;
@Resource
private ISarFileSplitInfoService splitInfoService;
@@ -157,7 +154,6 @@ public class LawsDomesticController {
// processFbEntryChangeService.delCheck((String) parameterMap.get("ids"));
//删除标准时同步删除这个标准的收藏数据
lawsStandardCollectionService.deleteByStandardId((String) parameterMap.get("ids"));
lawsStandardSharingService.deleteByStandardId((String) parameterMap.get("ids"));
// 删除标准时同步删除比对和拆分的相关数据
splitInfoService.deleteByStandardId((String) parameterMap.get("ids"));
compareInfoService.deleteByStandardId((String) parameterMap.get("ids"));
@@ -21,7 +21,6 @@ import com.jero.modules.laws.standard.entity.LawsUpdateRecord;
import com.jero.modules.laws.standard.service.ILawsNodeRelationService;
import com.jero.modules.laws.standard.service.ILawsUpdateRecordService;
import com.jero.modules.personal.service.ILawsStandardCollectionService;
import com.jero.modules.personal.service.ILawsStandardSharingService;
import com.jero.modules.split.service.ISarFileSplitInfoService;
import com.jero.modules.sys.utils.UserUtils;
import com.jero.modules.tag.entity.LawsTag;
@@ -60,8 +59,6 @@ public class LawsEnterpriseController {
private ILawsStandardCollectionService lawsStandardCollectionService;
@Autowired
private ILawsUpdateRecordService lawsUpdateRecordService;
@Autowired
private ILawsStandardSharingService lawsStandardSharingService;
@Resource
private EnterpriseStandardAuthUserService esAuthUserService;
@@ -184,7 +181,6 @@ public class LawsEnterpriseController {
// esChangeService.delCheck((String) parameterMap.get("ids"));
//删除标准时同步删除这个标准的收藏数据
lawsStandardCollectionService.deleteByStandardId((String) parameterMap.get("ids"));
lawsStandardSharingService.deleteByStandardId((String) parameterMap.get("ids"));
// 删除标准时同步删除比对和拆分的相关数据
splitInfoService.deleteByStandardId((String) parameterMap.get("ids"));
compareInfoService.deleteByStandardId((String) parameterMap.get("ids"));
@@ -203,7 +199,6 @@ public class LawsEnterpriseController {
// esChangeService.delCheck((String) parameterMap.get("ids"));
// 删除标准时同步删除这个标准的收藏数据
lawsStandardCollectionService.deleteByStandardId((String) parameterMap.get("ids"));
lawsStandardSharingService.deleteByStandardId((String) parameterMap.get("ids"));
// 删除标准时同步删除比对和拆分的相关数据
splitInfoService.deleteByStandardId((String) parameterMap.get("ids"));
compareInfoService.deleteByStandardId((String) parameterMap.get("ids"));
@@ -1,239 +0,0 @@
package com.jero.modules.laws.standard.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import com.jero.common.api.vo.Result;
import com.jero.common.api.vo.ResultCommon;
import com.jero.common.aspect.annotation.AutoLog;
import com.jero.common.exception.JeroBootException;
import com.jero.common.util.MessageUtils;
import com.jero.modules.laws.common.constant.FieldCommon;
import com.jero.modules.laws.common.service.ILawsCommonService;
import com.jero.modules.laws.enterprise.service.EnterpriseStandardAuthUserService;
import com.jero.modules.laws.standard.entity.LawsUpdateRecord;
import com.jero.modules.laws.standard.service.ILawsNodeRelationService;
import com.jero.modules.laws.standard.service.ILawsUpdateRecordService;
import com.jero.modules.personal.service.ILawsStandardCollectionService;
import com.jero.modules.personal.service.ILawsStandardSharingService;
import com.jero.modules.sys.utils.UserUtils;
import com.jero.modules.tag.entity.LawsTag;
import com.jero.modules.tag.enums.TableNameEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* @Author: liao
* @Date: 2023/8/25 16:26
* @Description: 海外法规标准
*/
@ApiSupport(order = 405)
@Api(tags="海外法规标准")
@RestController
@RequestMapping("/laws/standard/overseas")
public class LawsOverseasController {
@Autowired
private ILawsCommonService lawsCommonService;
@Autowired
private ILawsNodeRelationService lawsNodeRelationService;
@Autowired
private ILawsStandardCollectionService lawsStandardCollectionService;
@Autowired
private ILawsUpdateRecordService lawsUpdateRecordService;
@Autowired
private ILawsStandardSharingService lawsStandardSharingService;
@Resource
private EnterpriseStandardAuthUserService authUserService;
private static final String MODULE_VALUE = TableNameEnum.FOREIGN_REGULATIONS.getValue();
@AutoLog(value = "海外法规标准-分页列表查询")
@ApiOperation(value="海外法规标准-分页列表查询", notes="海外法规标准-分页列表查询")
@PostMapping(value = "/getCommonPage")
@ApiOperationSupport(order = 1)
@RequiresPermissions("overseasStandard:search")
public Result<IPage<Map<String,Object>>> getCommonPage(@RequestBody @ApiParam("标签管理") Map<String,Object> parameterMap) {
parameterMap.put(FieldCommon.MODULE, MODULE_VALUE);
return Result.OK(lawsCommonService.getCommonPage(parameterMap));
}
@AutoLog(value = "海外法规标准-高级检索")
@ApiOperation(value="海外法规标准-高级检索", notes="海外法规标准-高级检索")
@PostMapping(value = "/getCommonPageNoPermissions")
@RequiresPermissions("dashboard:advancedSearch:search")
@ApiOperationSupport(order = 1)
public Result<IPage<Map<String,Object>>> getCommonPageNoPermissions(@RequestBody @ApiParam("标签管理") Map<String,Object> parameterMap) {
parameterMap.put(FieldCommon.MODULE, MODULE_VALUE);
parameterMap.put("home_search_key","1");
return Result.OK(lawsCommonService.getCommonPage(parameterMap));
}
@AutoLog(value = "海外法规标准-获取列表表头")
@ApiOperation(value="海外法规标准-获取列表表头", notes="海外法规标准-获取列表表头")
@GetMapping(value = "getCommonHeader")
@ApiOperationSupport(order = 2)
public Result<List<LawsTag>> getCommonHeader() {
return Result.OK(lawsCommonService.getCommonHeader(MODULE_VALUE));
}
@AutoLog(value = "海外法规标准-新增数据")
@ApiOperation(value="海外法规标准-新增数据", notes="海外法规标准-新增数据")
@PostMapping(value = "/commonAdd")
@ApiOperationSupport(order = 3)
@RequiresPermissions("overseasStandard:add")
public Result<String> commonAdd(@RequestBody @ApiParam("标签管理") Map<String,Object> parameterMap) {
parameterMap.put(FieldCommon.MODULE, MODULE_VALUE);
return Result.OK(lawsCommonService.commonAdd(parameterMap));
}
@AutoLog(value = "海外法规标准-编辑数据")
@ApiOperation(value="海外法规标准-编辑数据", notes="海外法规标准-编辑数据")
@PostMapping(value = "/commonEdit")
@ApiOperationSupport(order = 4)
@RequiresPermissions("overseasStandard:edit")
public Result<String> commonEdit(@RequestBody @ApiParam("标签管理") Map<String,Object> parameterMap) {
parameterMap.put(FieldCommon.MODULE, MODULE_VALUE);
return Result.OK(lawsCommonService.commonEdit(parameterMap));
}
@AutoLog(value = "海外法规标准-获取查询条件")
@ApiOperation(value="海外法规标准-获取查询条件", notes="海外法规标准-获取查询条件")
@GetMapping(value = "getQueryCondition")
@ApiOperationSupport(order = 5)
public Result<List<LawsTag>> getQueryCondition() {
return Result.OK(lawsCommonService.getQueryCondition(MODULE_VALUE));
}
@AutoLog(value = "海外法规标准-获取高级查询条件")
@ApiOperation(value="海外法规标准-获取高级查询条件", notes="海外法规标准-获取高级查询条件")
@GetMapping(value = "getAdvancedQueryCondition")
@ApiOperationSupport(order = 5)
public Result<List<LawsTag>> getAdvancedQueryCondition() {
return Result.OK(lawsCommonService.getAdvancedQueryCondition(MODULE_VALUE));
}
@AutoLog(value = "海外法规标准-获取表单模型")
@ApiOperation(value="海外法规标准-获取表单模型", notes="海外法规标准-获取表单模型")
@GetMapping(value = "getFormModel")
@ApiOperationSupport(order = 6)
public Result<Map<String,Object>> getFormModel(@RequestParam(name="type") @ApiParam("类型(1详情,2新增编辑)") String type) {
return Result.OK(lawsCommonService.getFormModel(MODULE_VALUE, type));
}
@AutoLog(value = "海外法规标准-根据id和模块标识获取信息")
@ApiOperation(value="海外法规标准-根据id和模块标识获取信息", notes="海外法规标准-根据id和模块标识获取信息")
@GetMapping(value = "getByIdAndModule")
@ApiOperationSupport(order = 7)
@RequiresPermissions("overseasStandard:search")
public Result<Map<String,Object>> getByIdAndModule(@RequestParam(name="id", required = false) @ApiParam("主键") String id,
@RequestParam(name="type") @ApiParam("类型(1详情,2新增编辑)") String type,
@RequestParam(name="standardNumber", required = false) @ApiParam("标准编号") String standardNumber) {
if (!authUserService.fbDetailPermission(id, standardNumber, UserUtils.getUserId())) {
throw new JeroBootException("暂无该外标查看权限");
}
lawsCommonService.addLookHistory(id, type, MODULE_VALUE, standardNumber);
return Result.OK(lawsCommonService.getByIdAndModule(id, MODULE_VALUE, type, standardNumber));
}
@AutoLog(value = "海外法规标准-根据ids删除信息")
@ApiOperation(value="海外法规标准-根据ids删除信息", notes="海外法规标准-根据ids删除信息")
@PostMapping(value = "deleteByIdsAndModule")
@ApiOperationSupport(order = 8)
@RequiresPermissions("overseasStandard:delete")
public Result<String> deleteByIdsAndModule(@RequestBody @ApiParam(name = "ids", value = "主键(多个用逗号分隔)") Map<String,Object> parameterMap) {
// 删除校验
// processFbEntryChangeService.delCheck((String) parameterMap.get("ids"));
//删除标准时同步删除这个标准的收藏数据
lawsStandardCollectionService.deleteByStandardId((String) parameterMap.get("ids"));
lawsStandardSharingService.deleteByStandardId((String) parameterMap.get("ids"));
return Result.OK(lawsCommonService.deleteByIdsAndModule((String) parameterMap.get("ids"), MODULE_VALUE));
}
@AutoLog(value = "海外法规标准-配置标准")
@ApiOperation(value="海外法规标准-配置标准", notes="海外法规标准-配置标准")
@GetMapping(value = "relatedStandard")
@ApiOperationSupport(order = 9)
@RequiresPermissions("overseasStandard:configStandard")
public Result<String> relatedStandard(@RequestParam(name="nodeCode") @ApiParam("体系编码") String nodeCode,
@RequestParam("ids") @ApiParam("主键(多个用逗号分隔)") String ids) {
lawsNodeRelationService.relatedStandard(nodeCode, ids);
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
}
@AutoLog(value = "海外法规标准-移除标准")
@ApiOperation(value="海外法规标准-移除标准", notes="海外法规标准-移除标准")
@GetMapping(value = "removeStandard")
@ApiOperationSupport(order = 10)
@RequiresPermissions("overseasStandard:removeStandard")
public Result<String> removeStandard(@RequestParam(name="nodeCode") @ApiParam("体系编码") String nodeCode,
@RequestParam("ids") @ApiParam("主键(多个用逗号分隔)") String ids) {
lawsNodeRelationService.removeStandard(nodeCode, ids);
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
}
@AutoLog(value = "海外法规标准-法规更新记录")
@ApiOperation(value="海外法规标准-法规更新记录", notes="海外法规标准-法规更新记录")
@GetMapping(value = "/getUpdateRecordList")
@ApiOperationSupport(order = 11)
@RequiresPermissions("overseasStandard:updateRecord")
public Result<List<LawsUpdateRecord>> getUpdateRecordList(@RequestParam("standardNumber") @ApiParam("标准编号") String standardNumber) {
LambdaQueryWrapper<LawsUpdateRecord> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(LawsUpdateRecord::getUniqueRelationFlag, standardNumber);
queryWrapper.orderByDesc(LawsUpdateRecord::getCreateTime);
return Result.OK(lawsUpdateRecordService.list(queryWrapper));
}
@AutoLog(value = "海外法规标准-导出")
@ApiOperation(value="海外法规标准-导出", notes="海外法规标准-导出")
@PostMapping("/exportData")
@ApiOperationSupport(order = 12)
@RequiresPermissions("overseasStandard:export")
public void exportData(HttpServletResponse response, @RequestBody(required = false) @ApiParam("标签管理") Map<String,Object> parameterMap) {
parameterMap.put(FieldCommon.MODULE, MODULE_VALUE);
lawsCommonService.commonExport(response, parameterMap, "海外标准", "海外标准");
}
@AutoLog(value = "海外法规标准-带文件导出")
@ApiOperation(value="海外法规标准-带文件导出", notes="海外法规标准-带文件导出")
@PostMapping("/exportDataWithFile")
@ApiOperationSupport(order = 13)
@RequiresPermissions("overseasStandard:exportFile")
public void exportDataWithFile(HttpServletResponse response, @RequestBody(required = false) @ApiParam("标签管理") Map<String,Object> parameterMap) {
parameterMap.put(FieldCommon.MODULE, MODULE_VALUE);
lawsCommonService.exportDataWithFile(response, parameterMap, "海外标准", "海外标准");
}
@AutoLog(value = "海外法规标准-模板下载")
@ApiOperation(value="海外法规标准-模板下载", notes="海外法规标准-模板下载")
@GetMapping("/templateDownload")
@ApiOperationSupport(order = 14)
@RequiresPermissions("overseasStandard:downTemplate")
public void templateDownload(HttpServletResponse response) {
lawsCommonService.templateDownload(response, TableNameEnum.FOREIGN_REGULATIONS.getTableName());
}
@AutoLog(value = "海外法规标准-导入")
@ApiOperation(value="海外法规标准-导入", notes="海外法规标准-导入")
@PostMapping("/importExcelWithData")
@ApiOperationSupport(order = 15)
@RequiresPermissions("overseasStandard:import")
public Result<?> importExcelWithData(@RequestParam("file") @ApiParam("文件") MultipartFile file) {
List<String> errorMessages = lawsCommonService.importExcelWithData(file, TableNameEnum.FOREIGN_REGULATIONS.getValue());
if (errorMessages.size() > 0) {
return Result.error(ResultCommon.IMPORT_ERROR, errorMessages);
}
return Result.OK();
}
}
@@ -5,11 +5,9 @@ import com.jero.common.constant.enums.YesOrNoEnum;
import com.jero.modules.activiti.process.common.enums.StandardStateEnum;
import com.jero.modules.laws.standard.entity.LawsDomesticStandard;
import com.jero.modules.laws.standard.entity.LawsEnterpriseStandard;
import com.jero.modules.laws.standard.entity.LawsOverseasStandard;
import com.jero.modules.laws.standard.entity.OutStandardStateEnum;
import com.jero.modules.laws.standard.service.ILawsDomesticStandardService;
import com.jero.modules.laws.standard.service.ILawsEnterpriseStandardService;
import com.jero.modules.laws.standard.service.ILawsOverseasStandardService;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
@@ -30,13 +28,9 @@ public class UpdateStandardStatusJob implements Job {
@Resource
private ILawsDomesticStandardService gbService;
@Resource
private ILawsOverseasStandardService fbService;
@Override
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
this.updateGbStandardState();
this.updateFbStandardState();
this.updateEsStandardState();
}
@@ -85,31 +79,4 @@ public class UpdateStandardStatusJob implements Job {
}
gbService.updateBatchById(needUpdateGbList);
}
private void updateFbStandardState(){
// 海外标准状态更新
List<LawsOverseasStandard> needUpdateFbList = new ArrayList<>();
LambdaQueryWrapper<LawsOverseasStandard> fbWrapper = new LambdaQueryWrapper<>();
fbWrapper.eq(LawsOverseasStandard::getDelFlag, YesOrNoEnum.NO.getInteger());
fbWrapper.isNotNull(LawsOverseasStandard::getReleaseDate);
fbWrapper.isNotNull(LawsOverseasStandard::getImplementationDate);
fbWrapper.eq(LawsOverseasStandard::getStandardState, OutStandardStateEnum.RELEASE.getStateValue()).or()
.eq(LawsOverseasStandard::getStandardState, OutStandardStateEnum.TRIAL_OPERATION.getStateValue());
List<LawsOverseasStandard> fbList = fbService.list(fbWrapper);
for (LawsOverseasStandard fb : fbList) {
// 介于创建时间和实施日期内的标准 状态更新为即将实施
if (fb.getCreateTime().getTime() <= System.currentTimeMillis() &&
fb.getImplementationDate().getTime() >= System.currentTimeMillis()) {
fb.setStandardState(OutStandardStateEnum.TRIAL_OPERATION.getStateValue());
needUpdateFbList.add(fb);
continue;
}
// 实施日期及之后的标准 状态更新为现行有效
if (fb.getImplementationDate().getTime() <= System.currentTimeMillis()) {
fb.setStandardState(OutStandardStateEnum.CURRENTLY_EFFECTIVE.getStateValue());
needUpdateFbList.add(fb);
}
}
fbService.updateBatchById(needUpdateFbList);
}
}
@@ -1,86 +0,0 @@
package com.jero.modules.laws.standard.service;
import com.jero.modules.laws.standard.entity.LawsOverseasStandard;
import com.baomidou.mybatisplus.extension.service.IService;
import javax.servlet.http.HttpServletRequest;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.List;
/**
* @Description: 海外标准
* @Author: jero-boot
* @Date: 2023-09-11
* @Version: V1.0
*/
public interface ILawsOverseasStandardService extends IService<LawsOverseasStandard> {
/**
* 分页查询
*
* @param lawsOverseasStandard
* @param pageNo
* @param pageSize
* @param req
* @return
*/
IPage<LawsOverseasStandard> queryPage(LawsOverseasStandard lawsOverseasStandard, Integer pageNo, Integer pageSize, HttpServletRequest req);
/**
* 列表查询
*
* @param lawsOverseasStandard
* @param req
* @return
*/
List<LawsOverseasStandard> queryList(LawsOverseasStandard lawsOverseasStandard, HttpServletRequest req);
/**
* 保存
*
* @param lawsOverseasStandard
* @return
*/
void add(LawsOverseasStandard lawsOverseasStandard);
/**
* 更新
*
* @param lawsOverseasStandard
* @return
*/
void editById(LawsOverseasStandard lawsOverseasStandard);
/**
* 通过id删除
*
* @param id
* @return
*/
void deleteById(String id);
/**
* 批量删除
*
* @param ids
* @return
*/
void deleteByIds(List<String> ids);
/**
* 通过id查询
*
* @param id
* @return
*/
LawsOverseasStandard queryById(String id);
/**
* 通过编号查查询
*/
LawsOverseasStandard queryByStandardNumber(String standardNumber);
/**
* 获取所有引进标准的Id
*/
List<String> getAllAuthControlFbId();
}
@@ -1,172 +0,0 @@
package com.jero.modules.laws.standard.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jero.common.constant.CommonConstant;
import com.jero.modules.laws.standard.entity.LawsNodeRelation;
import com.jero.modules.laws.standard.entity.LawsOverseasStandard;
import com.jero.modules.laws.standard.entity.LawsTreeNode;
import com.jero.modules.laws.standard.mapper.LawsOverseasStandardMapper;
import com.jero.modules.laws.standard.service.ILawsNodeRelationService;
import com.jero.modules.laws.standard.service.ILawsOverseasStandardService;
import com.jero.modules.laws.standard.service.ILawsTreeNodeService;
import com.jero.modules.personal.service.ILawsStandardCollectionService;
import com.jero.modules.tag.enums.TableNameEnum;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.jero.common.exception.JeroBootException;
import java.util.List;
import java.util.Date;
import java.util.stream.Collectors;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.common.system.query.QueryGenerator;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
/**
* @Description: 海外标准
* @Author: jero-boot
* @Date: 2023-09-11
* @Version: V1.0
*/
@Service
@Transactional(rollbackFor = JeroBootException.class)
public class LawsOverseasStandardServiceImpl extends ServiceImpl<LawsOverseasStandardMapper, LawsOverseasStandard> implements ILawsOverseasStandardService {
@Autowired
private ILawsStandardCollectionService lawsStandardCollectionService;
@Resource
private ILawsTreeNodeService lawsTreeNodeService;
@Resource
private ILawsNodeRelationService lawsNodeRelationService;
/**
* 分页查询
*
* @param lawsOverseasStandard
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@Override
public IPage<LawsOverseasStandard> queryPage(LawsOverseasStandard lawsOverseasStandard, Integer pageNo, Integer pageSize,
HttpServletRequest req) {
QueryWrapper<LawsOverseasStandard> queryWrapper = QueryGenerator.initQueryWrapper(lawsOverseasStandard, req.getParameterMap());
Page<LawsOverseasStandard> page = new Page<>(pageNo, pageSize);
return page(page, queryWrapper);
}
/**
* 列表查询
*
* @param lawsOverseasStandard
* @param req
* @return
*/
@Override
public List<LawsOverseasStandard> queryList(LawsOverseasStandard lawsOverseasStandard, HttpServletRequest req) {
return list(QueryGenerator.initQueryWrapper(lawsOverseasStandard, req.getParameterMap()));
}
/**
* 保存
*
* @param lawsOverseasStandard
* @return
*/
@Override
public void add(LawsOverseasStandard lawsOverseasStandard) {
Date now = new Date();
lawsOverseasStandard.setCreateTime(now);
lawsOverseasStandard.setUpdateTime(now);
save(lawsOverseasStandard);
}
/**
* 更新
*
* @param lawsOverseasStandard
* @return
*/
@Override
public void editById(LawsOverseasStandard lawsOverseasStandard) {
Date now = new Date();
lawsOverseasStandard.setUpdateTime(now);
saveOrUpdate(lawsOverseasStandard);
}
/**
* 通过id删除
*
* @param id
* @return
*/
@Override
public void deleteById(String id) {
//删除标准时同步删除这个标准的收藏数据
lawsStandardCollectionService.deleteByStandardId(id);
removeById(id);
}
/**
* 批量删除
*
* @param ids
* @return
*/
@Override
public void deleteByIds(List<String> ids) {
//删除标准时同步删除这个标准的收藏数据
lawsStandardCollectionService.deleteByStandardIds(ids);
removeByIds(ids);
}
/**
* 通过id查询
*
* @param id
* @return
*/
@Override
public LawsOverseasStandard queryById(String id) {
return getById(id);
}
@Override
public LawsOverseasStandard queryByStandardNumber(String standardNumber) {
if (StringUtils.isBlank(standardNumber)){
return null;
}
LambdaQueryWrapper<LawsOverseasStandard> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(LawsOverseasStandard::getStandardNumber, standardNumber);
wrapper.eq(LawsOverseasStandard::getDelFlag, CommonConstant.DEL_FLAG_0.toString());
wrapper.last("limit 1");
return getOne(wrapper);
}
@Override
public List<String> getAllAuthControlFbId() {
List<LawsOverseasStandard> list = this.list();
List<String> allFbIdList = list.stream().map(LawsOverseasStandard::getId).collect(Collectors.toList());
LambdaQueryWrapper<LawsTreeNode> treeNodeLambdaQueryWrapper = new LambdaQueryWrapper<>();
treeNodeLambdaQueryWrapper.eq(LawsTreeNode::getNodeName, "引进标准");
treeNodeLambdaQueryWrapper.eq(LawsTreeNode::getModuleCode, TableNameEnum.FOREIGN_REGULATIONS.getValue());
LawsTreeNode node = lawsTreeNodeService.getOne(treeNodeLambdaQueryWrapper);
// 获取引进标准的id
LambdaQueryWrapper<LawsNodeRelation> nodeRelationLambdaQueryWrapper = new LambdaQueryWrapper<>();
nodeRelationLambdaQueryWrapper.eq(LawsNodeRelation::getNodeId, node.getId());
List<LawsNodeRelation> fbList = lawsNodeRelationService.list(nodeRelationLambdaQueryWrapper);
List<String> fbIdList = fbList.stream().map(LawsNodeRelation::getUniqueRelationFlag).collect(Collectors.toList());
return fbIdList;
}
}
@@ -14,10 +14,8 @@ import com.jero.common.system.vo.LoginUser;
import com.jero.common.util.MessageUtils;
import com.jero.modules.laws.standard.entity.LawsDomesticStandard;
import com.jero.modules.laws.standard.entity.LawsEnterpriseStandard;
import com.jero.modules.laws.standard.entity.LawsOverseasStandard;
import com.jero.modules.laws.standard.service.ILawsDomesticStandardService;
import com.jero.modules.laws.standard.service.ILawsEnterpriseStandardService;
import com.jero.modules.laws.standard.service.ILawsOverseasStandardService;
import com.jero.modules.personal.entity.LawsStandardCollection;
import com.jero.modules.personal.service.ILawsStandardCollectionService;
import io.swagger.annotations.Api;
@@ -53,8 +51,6 @@ public class LawsStandardCollectionController extends JeroController<LawsStandar
@Autowired
private ILawsDomesticStandardService lawsDomesticStandardService; //国内标准
@Autowired
private ILawsOverseasStandardService lawsOverseasStandardService; //海外标准
@Autowired
private ILawsEnterpriseStandardService ILawsEnterpriseStandardService; //企业标准
/**
@@ -115,32 +111,6 @@ public class LawsStandardCollectionController extends JeroController<LawsStandar
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
}
/**
* 收藏
*/
@RequiresPermissions("overseasStandard:collection")
@AutoLog(value = "标准收藏-海外收藏")
@ApiOperation(value="标准收藏-海外收藏", notes="标准收藏-海外收藏")
@PostMapping(value = "/overseas/add")
@ApiOperationSupport(order = 4)
public Result<T> overseasAdd(@Validated @RequestBody LawsStandardCollection lawsStandardCollection) {
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
LawsOverseasStandard standard = lawsOverseasStandardService.queryById(lawsStandardCollection.getStandardId());
lawsStandardCollection.setStandardClass(standard.getStandardClass());
lawsStandardCollection.setStandardName(standard.getStandardName());
lawsStandardCollection.setCollectorId(sysUser.getId());
LambdaQueryWrapper<LawsStandardCollection> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(LawsStandardCollection::getStandardId, lawsStandardCollection.getStandardId());
wrapper.eq(LawsStandardCollection::getCollectorId, sysUser.getId());
int count = lawsStandardCollectionService.count(wrapper);
if (count > 0){
return Result.error(MessageUtils.getMessage(ResultCommon.CANNOT_DUPLICATE_FAVORITES));
}
lawsStandardCollection.setSource(CommonConstant.STANDARD_SOURCE_2);
lawsStandardCollectionService.add(lawsStandardCollection);
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
}
/**
* 取消收藏
*/
@@ -1,343 +0,0 @@
package com.jero.modules.personal.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import com.jero.common.api.dto.message.SendMessageDTO;
import com.jero.common.api.vo.Result;
import com.jero.common.api.vo.ResultCommon;
import com.jero.modules.common.service.SendMessageAPI;
import com.jero.common.aspect.annotation.AutoLog;
import com.jero.common.constant.CommonConstant;
import com.jero.common.exception.JeroBootException;
import com.jero.common.system.base.controller.JeroController;
import com.jero.common.system.vo.LoginUser;
import com.jero.common.util.MessageUtils;
import com.jero.modules.laws.common.constant.MessageTemplateCodeCommon;
import com.jero.modules.laws.common.util.CurrentUserUtil;
import com.jero.modules.laws.standard.entity.LawsDomesticStandard;
import com.jero.modules.laws.standard.entity.LawsEnterpriseStandard;
import com.jero.modules.laws.standard.entity.LawsNewsFeed;
import com.jero.modules.laws.standard.entity.LawsOverseasStandard;
import com.jero.modules.laws.standard.service.ILawsDomesticStandardService;
import com.jero.modules.laws.standard.service.ILawsEnterpriseStandardService;
import com.jero.modules.laws.standard.service.ILawsNewsFeedService;
import com.jero.modules.laws.standard.service.ILawsOverseasStandardService;
import com.jero.modules.personal.entity.LawsStandardSharing;
import com.jero.modules.personal.service.ILawsStandardSharingService;
import com.jero.modules.system.entity.SysUser;
import com.jero.modules.system.service.ISysUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.formula.functions.T;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.*;
/**
* @Description: 标准分享
* @Author: jero-boot
* @Date: 2023-09-07
* @Version: V1.0
*/
@Api(tags = "标准分享")
@ApiSupport(order = 204)
@RestController
@RequestMapping("/personal/lawsStandardSharing")
@Slf4j
public class LawsStandardSharingController extends JeroController<LawsStandardSharing, ILawsStandardSharingService> {
@Autowired
private ILawsStandardSharingService lawsStandardSharingService;
@Autowired
private ISysUserService sysUserService;
@Autowired
private ILawsDomesticStandardService lawsDomesticStandardService; //国内标准
@Autowired
private ILawsOverseasStandardService lawsOverseasStandardService; //海外标准
@Autowired
private ILawsEnterpriseStandardService ILawsEnterpriseStandardService; //企业标准
@Autowired
private ILawsNewsFeedService lawsNewsFeedService;
@Resource
private SendMessageAPI sendMessageAPI;
/**
* 分页列表查询
*/
@RequiresPermissions("personalCenter:sentShare:search")
@AutoLog(value = "标准分享-分页已发分享列表查询")
@ApiOperation(value = "标准分享-分页已发分享列表查询", notes = "标准分享-分页已发分享列表查询")
@GetMapping(value = "/issued/page")
@ApiOperationSupport(order = 1)
public Result<IPage<LawsStandardSharing>> issued(LawsStandardSharing lawsStandardSharing,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
lawsStandardSharing.setSharerId(sysUser.getId());
lawsStandardSharing.setRecipientId(null);
IPage<LawsStandardSharing> pageList = lawsStandardSharingService.queryPage(lawsStandardSharing, pageNo, pageSize, req);
return Result.OK(pageList);
}
/**
* 分页列表查询
*/
@RequiresPermissions("personalCenter:receivedShare:search")
@AutoLog(value = "标准分享-分页已收分享列表查询")
@ApiOperation(value = "标准分享-分页已收分享列表查询", notes = "标准分享-分页已收分享列表查询")
@GetMapping(value = "/received/page")
@ApiOperationSupport(order = 2)
public Result<IPage<LawsStandardSharing>> received(LawsStandardSharing lawsStandardSharing,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
lawsStandardSharing.setRecipientId(sysUser.getId());
lawsStandardSharing.setSharerId(null);
IPage<LawsStandardSharing> pageList = lawsStandardSharingService.queryPage(lawsStandardSharing, pageNo, pageSize, req);
return Result.OK(pageList);
}
/**
* 添加
*/
@AutoLog(value = "标准分享-国内分享")
@ApiOperation(value = "标准分享-国内分享", notes = "标准分享-国内分享")
@PostMapping(value = "/domestic/add")
@ApiOperationSupport(order = 3)
@RequiresPermissions("domesticStandard:share")
public Result<T> domesticAdd(@Validated @RequestBody LawsStandardSharing lawsStandardSharing) {
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
SysUser user = sysUserService.getById(sysUser.getId());
String recipientId = lawsStandardSharing.getRecipientId();
Date date = new Date();
List<LawsStandardSharing> sharings = new ArrayList<>();
List<String> recipientIdList = Arrays.asList(recipientId.split(","));
for (int i = 0; i < recipientIdList.size(); i++) {
LawsStandardSharing sharing = new LawsStandardSharing();
sharing.setSource(CommonConstant.STANDARD_SOURCE_1);
sharing.setStandardId(lawsStandardSharing.getStandardId());
LawsDomesticStandard standard = lawsDomesticStandardService.queryById(lawsStandardSharing.getStandardId());
sharing.setStandardName(standard.getStandardName());
sharing.setStandardNumber(lawsStandardSharing.getStandardNumber());
sharing.setSharerId(sysUser.getId());
sharing.setSharerName(user.calcNameWorkNo());
sharing.setRecipientId(recipientIdList.get(i));
SysUser userServiceById = sysUserService.getById(recipientIdList.get(i));
sharing.setRecipientName(userServiceById.calcNameWorkNo());
sharing.setSharingTime(date);
sharing.setShareDescription(lawsStandardSharing.getShareDescription());
sharing.setReadingStatus("1");
sharing.setDelFlag(CommonConstant.DEL_FLAG_0.toString());
sharings.add(sharing);
// 发送消息
sendMsg(sharing);
}
lawsStandardSharingService.saveBatch(sharings);
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
}
/**
* @Author: liao
* @Date: 2023/11/10 18:50
* @Description: 发送消息
**/
private void sendMsg(LawsStandardSharing lawsStandardSharing) {
SendMessageDTO sendMessageDTO = new SendMessageDTO();
sendMessageDTO.setTemplateCode(MessageTemplateCodeCommon.LAWS_STANDARD_SHARING);
sendMessageDTO.setToUserId(lawsStandardSharing.getRecipientId());
Map<String, String> map = new HashMap<>();
map.put("standardNumber", lawsStandardSharing.getStandardNumber());
map.put("standardName", lawsStandardSharing.getStandardName());
map.put("sender", CurrentUserUtil.getRealName());
sendMessageDTO.setMap(map);
sendMessageAPI.sendMessage(sendMessageDTO);
}
/**
* 添加
*/
@AutoLog(value = "标准分享-海外分享")
@ApiOperation(value = "标准分享-海外分享", notes = "标准分享-海外分享")
@PostMapping(value = "/overseas/add")
@ApiOperationSupport(order = 4)
@RequiresPermissions("overseasStandard:share")
public Result<T> overseasAdd(@Validated @RequestBody LawsStandardSharing lawsStandardSharing) {
// 发送消息
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
SysUser user = sysUserService.getById(sysUser.getId());
String recipientId = lawsStandardSharing.getRecipientId();
Date date = new Date();
List<LawsStandardSharing> sharings = new ArrayList<>();
List<String> recipientIdList = Arrays.asList(recipientId.split(","));
for (int i = 0; i < recipientIdList.size(); i++) {
LawsStandardSharing sharing = new LawsStandardSharing();
sharing.setSource(CommonConstant.STANDARD_SOURCE_2);
sharing.setStandardId(lawsStandardSharing.getStandardId());
LawsOverseasStandard standard = lawsOverseasStandardService.queryById(lawsStandardSharing.getStandardId());
sharing.setStandardName(standard.getStandardName());
sharing.setStandardNumber(lawsStandardSharing.getStandardNumber());
sharing.setSharerId(sysUser.getId());
sharing.setSharerName(user.calcNameWorkNo());
sharing.setRecipientId(recipientIdList.get(i));
SysUser userServiceById = sysUserService.getById(recipientIdList.get(i));
sharing.setRecipientName(userServiceById.calcNameWorkNo());
sharing.setSharingTime(date);
sharing.setShareDescription(lawsStandardSharing.getShareDescription());
sharing.setReadingStatus("1");
sharing.setDelFlag(CommonConstant.DEL_FLAG_0.toString());
sharings.add(sharing);
// 发送消息
sendMsg(sharing);
}
lawsStandardSharingService.saveBatch(sharings);
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
}
/**
* 添加
*/
@AutoLog(value = "标准分享-企标分享")
@ApiOperation(value = "标准分享-企标分享", notes = "标准分享-企标分享")
@PostMapping(value = "/enterprise/add")
@ApiOperationSupport(order = 5)
@RequiresPermissions("enterpriseStandard:share")
public Result<T> enterpriseAdd(@Validated @RequestBody LawsStandardSharing lawsStandardSharing) {
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
SysUser user = sysUserService.getById(sysUser.getId());
String recipientId = lawsStandardSharing.getRecipientId();
Date date = new Date();
List<LawsStandardSharing> sharings = new ArrayList<>();
List<String> recipientIdList = Arrays.asList(recipientId.split(","));
for (int i = 0; i < recipientIdList.size(); i++) {
LawsStandardSharing sharing = new LawsStandardSharing();
sharing.setSource(CommonConstant.STANDARD_SOURCE_3);
sharing.setStandardId(lawsStandardSharing.getStandardId());
LawsEnterpriseStandard standard = ILawsEnterpriseStandardService.getById(lawsStandardSharing.getStandardId());
sharing.setStandardName(standard.getStandardName());
sharing.setStandardNumber(lawsStandardSharing.getStandardNumber());
sharing.setSharerId(sysUser.getId());
sharing.setSharerName(user.calcNameWorkNo());
sharing.setRecipientId(recipientIdList.get(i));
SysUser userServiceById = sysUserService.getById(recipientIdList.get(i));
sharing.setRecipientName(userServiceById.calcNameWorkNo());
sharing.setSharingTime(date);
sharing.setShareDescription(lawsStandardSharing.getShareDescription());
sharing.setReadingStatus("1");
sharing.setDelFlag(CommonConstant.DEL_FLAG_0.toString());
sharings.add(sharing);
}
lawsStandardSharingService.saveBatch(sharings);
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
}
/**
* 添加
*/
@AutoLog(value = "标准分享-动态消息分享")
@ApiOperation(value = "标准分享-动态消息分享", notes = "标准分享-动态消息分享")
@PostMapping(value = "/dynamicMessages/add")
@ApiOperationSupport(order = 6)
@RequiresPermissions(value = { "dynamicMessage:share", "dynamicMessage:search" }, logical = Logical.AND)
public Result<T> dynamicMessages(@RequestBody LawsStandardSharing lawsStandardSharing) {
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
SysUser user = sysUserService.getById(sysUser.getId());
String recipientId = lawsStandardSharing.getRecipientId();
Date date = new Date();
LawsNewsFeed lawsNewsFeed = lawsNewsFeedService.getById(lawsStandardSharing.getStandardId());
lawsNewsFeedService.isHaveQueryAuth(lawsNewsFeed);
if (0 == lawsNewsFeed.getReleaseStatus()) {
throw new JeroBootException("未发布的消息不能进行分享");
}
List<LawsStandardSharing> sharings = new ArrayList<>();
List<String> recipientIdList = Arrays.asList(recipientId.split(","));
for (int i = 0; i < recipientIdList.size(); i++) {
LawsStandardSharing sharing = new LawsStandardSharing();
sharing.setStandardId(lawsStandardSharing.getStandardId());
sharing.setRubric(lawsNewsFeed.getDynamicHeading());
sharing.setSource(CommonConstant.STANDARD_SOURCE_4);
sharing.setSharerId(sysUser.getId());
sharing.setSharerName(user.calcNameWorkNo());
sharing.setRecipientId(recipientIdList.get(i));
SysUser userServiceById = sysUserService.getById(recipientIdList.get(i));
sharing.setRecipientName(userServiceById.calcNameWorkNo());
sharing.setSharingTime(date);
sharing.setShareDescription(lawsStandardSharing.getShareDescription());
sharing.setReadingStatus("1");
sharing.setDelFlag(CommonConstant.DEL_FLAG_0.toString());
sharings.add(sharing);
}
lawsStandardSharingService.saveBatch(sharings);
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
}
// TODO 接口名字和方法名按照业务重新起一下。通过接口名称能看出该接口的作用,前端同步修改
/**
* 批量删除(已发分享)
*/
@AutoLog(value = "标准分享-批量删除(已发分享)")
@ApiOperation(value = "标准分享-批量删除(已发分享)", notes = "标准分享-批量删除(已发分享)")
@PostMapping(value = "/deleteBatch")
@RequiresPermissions(value = "personalCenter:sentShare:batchDel")
@ApiOperationSupport(order = 7)
public Result<T> deleteBatch(@RequestBody Map<String, String> map) {
List<String> listIds = Arrays.asList(map.get("ids").split(","));
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
LambdaQueryWrapper<LawsStandardSharing> queryLawsStandardSharing = new LambdaQueryWrapper<>();
queryLawsStandardSharing.in(LawsStandardSharing::getId,listIds);
queryLawsStandardSharing.ne(LawsStandardSharing::getSharerId,sysUser.getId());
long l = lawsStandardSharingService.count(queryLawsStandardSharing);
if(l > 0){
throw new JeroBootException(ResultCommon.HORIZONTAL_TRANSGRESSION);
}
return judge(map);
}
// TODO 放到service里
@NotNull
private Result<T> judge(@RequestBody Map<String, String> map) {
if (!map.containsKey("ids") || StringUtils.isEmpty(map.get("ids"))) {
throw new JeroBootException(ResultCommon.PLEASE_SELECT_DATA);
}
this.lawsStandardSharingService.deleteByIds(Arrays.asList(map.get("ids").split(",")));
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
}
/**
* 批量删除(已收分享)
*/
@AutoLog(value = "标准分享-批量删除(已收分享)")
@ApiOperation(value = "标准分享-批量删除(已收分享)", notes = "标准分享-批量删除(已收分享)")
@PostMapping(value = "/batchDel")
@RequiresPermissions(value = "personalCenter:receivedShare:batchDel")
@ApiOperationSupport(order = 8)
public Result<T> batchDel(@RequestBody Map<String, String> map) {
List<String> listIds = Arrays.asList(map.get("ids").split(","));
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
LambdaQueryWrapper<LawsStandardSharing> queryLawsStandardSharing = new LambdaQueryWrapper<>();
queryLawsStandardSharing.in(LawsStandardSharing::getId,listIds);
queryLawsStandardSharing.ne(LawsStandardSharing::getRecipientId,sysUser.getId());
long l = lawsStandardSharingService.count(queryLawsStandardSharing);
if(l > 0){
throw new JeroBootException(ResultCommon.HORIZONTAL_TRANSGRESSION);
}
return judge(map);
}
}
@@ -1,38 +0,0 @@
package com.jero.modules.personal.service;
import com.jero.modules.personal.entity.LawsStandardSharing;
import com.baomidou.mybatisplus.extension.service.IService;
import javax.servlet.http.HttpServletRequest;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.List;
/**
* @Description: 标准分享
* @Author: jero-boot
* @Date: 2023-09-07
* @Version: V1.0
*/
public interface ILawsStandardSharingService extends IService<LawsStandardSharing> {
/**
* 分页查询
*/
IPage<LawsStandardSharing> queryPage(LawsStandardSharing lawsStandardSharing, Integer pageNo, Integer pageSize, HttpServletRequest req);
/**
* 保存
*/
void add(LawsStandardSharing lawsStandardSharing);
/**
* 批量删除
*/
void deleteByIds(List<String> ids);
/**
* 删除标准分享
*/
void deleteByStandardId(String id);
void deleteByStandardIds(List<String> ids);
}
@@ -7,9 +7,7 @@ import com.jero.common.system.vo.LoginUser;
import com.jero.modules.laws.standard.entity.LawsEnterpriseStandard;
import com.jero.modules.laws.standard.service.ILawsEnterpriseStandardService;
import com.jero.modules.laws.standard.entity.LawsDomesticStandard;
import com.jero.modules.laws.standard.entity.LawsOverseasStandard;
import com.jero.modules.laws.standard.service.ILawsDomesticStandardService;
import com.jero.modules.laws.standard.service.ILawsOverseasStandardService;
import com.jero.modules.personal.entity.LawsStandardCollection;
import com.jero.modules.personal.mapper.LawsStandardCollectionMapper;
import com.jero.modules.personal.service.ILawsStandardCollectionService;
@@ -42,8 +40,6 @@ public class LawsStandardCollectionServiceImpl extends ServiceImpl<LawsStandardC
@Autowired
private ILawsDomesticStandardService lawsDomesticStandardService; //国内标准
@Autowired
private ILawsOverseasStandardService lawsOverseasStandardService; //海外标准
@Autowired
private ILawsEnterpriseStandardService ILawsEnterpriseStandardService; //企业标准
@Autowired
private ISysDictService sysDictService;
@@ -79,17 +75,6 @@ public class LawsStandardCollectionServiceImpl extends ServiceImpl<LawsStandardC
collection.setStandardState(standard_state);
}
}
if (CommonConstant.STANDARD_SOURCE_2.equals(source)){
//查询海外标准数据,赋值给collection
LawsOverseasStandard standard = lawsOverseasStandardService.queryById(standardId);
if (standard != null){
collection.setNewModelImplementationDate(standard.getNewModelImplementationDate());
collection.setOnTheProductionDate(standard.getOnTheProductionDate());
collection.setReleaseDate(standard.getReleaseDate());
String standard_state = sysDictService.queryDictTextByKey("standard_state", standard.getStandardState());
collection.setStandardState(standard_state);
}
}
if (CommonConstant.STANDARD_SOURCE_3.equals(source)){
//查询企业标准数据,赋值给collection
LawsEnterpriseStandard standard = ILawsEnterpriseStandardService.getById(standardId);
@@ -1,110 +0,0 @@
package com.jero.modules.personal.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.jero.common.constant.CommonConstant;
import com.jero.common.system.vo.LoginUser;
import com.jero.modules.personal.entity.LawsStandardCollection;
import com.jero.modules.personal.entity.LawsStandardSharing;
import com.jero.modules.personal.mapper.LawsStandardSharingMapper;
import com.jero.modules.personal.service.ILawsStandardSharingService;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.jero.common.exception.JeroBootException;
import java.util.List;
import java.util.Date;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.common.system.query.QueryGenerator;
import javax.servlet.http.HttpServletRequest;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
/**
* @Description: 标准分享
* @Author: jero-boot
* @Date: 2023-09-07
* @Version: V1.0
*/
@Service
@Transactional(rollbackFor = JeroBootException.class)
public class LawsStandardSharingServiceImpl extends ServiceImpl<LawsStandardSharingMapper, LawsStandardSharing> implements ILawsStandardSharingService {
/**
* 分页查询
*/
@Override
public IPage<LawsStandardSharing> queryPage(LawsStandardSharing lawsStandardSharing, Integer pageNo, Integer pageSize,
HttpServletRequest req) {
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
LambdaQueryWrapper<LawsStandardSharing> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(lawsStandardSharing.getSource()), LawsStandardSharing::getSource, lawsStandardSharing.getSource());
wrapper.eq(StringUtils.isNotBlank(lawsStandardSharing.getSharerId()), LawsStandardSharing::getSharerId, sysUser.getId());
wrapper.eq(StringUtils.isNotBlank(lawsStandardSharing.getRecipientId()), LawsStandardSharing::getRecipientId, sysUser.getId());
wrapper.eq(LawsStandardSharing::getDelFlag, CommonConstant.DEL_FLAG_0.toString());
if (StringUtils.isNotBlank(lawsStandardSharing.getRubric())){
wrapper.and(i->i.like(LawsStandardSharing::getStandardNumber,lawsStandardSharing.getRubric()).or()
.like(LawsStandardSharing::getStandardName,lawsStandardSharing.getRubric()));
}
wrapper.orderByDesc(LawsStandardSharing::getSharingTime);
Page<LawsStandardSharing> page = new Page<>(pageNo, pageSize);
Page<LawsStandardSharing> sharingPage = page(page, wrapper);
this.assignment(sharingPage.getRecords());
return sharingPage;
}
private void assignment(List<LawsStandardSharing> records) {
for (LawsStandardSharing record : records) {
if (CommonConstant.STANDARD_SOURCE_4.equals(record.getSource())){
continue;
}
String standardNum = record.getStandardNumber();
String standardName = record.getStandardName();
record.setRubric(standardName + "" + standardNum + "");
}
}
/**
* 保存
*/
@Override
public void add(LawsStandardSharing lawsStandardSharing) {
Date now = new Date();
lawsStandardSharing.setCreateTime(now);
lawsStandardSharing.setUpdateTime(now);
save(lawsStandardSharing);
}
/**
* 批量删除
*/
@Override
public void deleteByIds(List<String> ids) {
LambdaUpdateWrapper<LawsStandardSharing> wrapper = new LambdaUpdateWrapper<>();
wrapper.in(LawsStandardSharing::getId, ids);
wrapper.set(LawsStandardSharing::getDelFlag, CommonConstant.DEL_FLAG_1.toString());
update(wrapper);
}
@Override
public void deleteByStandardId(String id) {
LambdaQueryWrapper<LawsStandardSharing> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(LawsStandardSharing::getStandardId, id);
remove(wrapper);
}
@Override
public void deleteByStandardIds(List<String> ids) {
if (ids.isEmpty()){
return;
}
LambdaQueryWrapper<LawsStandardSharing> wrapper = new LambdaQueryWrapper<>();
wrapper.in(LawsStandardSharing::getStandardId, ids);
remove(wrapper);
}
}
@@ -5,24 +5,18 @@ import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jero.common.api.vo.Result;
import com.jero.common.constant.CommonConstant;
import com.jero.common.exception.JeroBootException;
import com.jero.common.system.query.QueryGenerator;
import com.jero.common.api.vo.ResultCommon;
import com.jero.modules.laws.standard.entity.LawsDomesticStandard;
import com.jero.modules.laws.standard.entity.LawsOverseasStandard;
import com.jero.modules.laws.standard.service.ILawsDomesticStandardService;
import com.jero.modules.laws.standard.service.ILawsOverseasStandardService;
import com.jero.modules.projectLibrary.common.AssessCommon;
import com.jero.modules.projectLibrary.entity.LawsAssess;
import com.jero.modules.projectLibrary.service.ILawsAssessService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jero.modules.projectLibrary.vo.LawsAssessAddVo;
import com.jero.modules.split.entity.SarFileSplitInfoEO;
import com.jero.modules.system.vo.IdMapBody;
import lombok.extern.slf4j.Slf4j;
import com.jero.common.system.base.controller.JeroController;
@@ -51,12 +45,6 @@ import org.apache.poi.ss.formula.functions.T;
public class LawsAssessController extends JeroController<LawsAssess, ILawsAssessService> {
@Autowired
private ILawsAssessService lawsAssessService;
//国内标准
@Autowired
private ILawsDomesticStandardService lawsDomesticStandardService;
//海外标准
@Autowired
private ILawsOverseasStandardService lawsOverseasStandardService;
/**
* 分页列表查询
@@ -1,5 +1,4 @@
package com.jero.modules.projectLibrary.service.impl;
import com.google.common.collect.Lists;
import cn.hutool.core.collection.CollStreamUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -9,9 +8,7 @@ import com.jero.common.constant.CommonConstant;
import com.jero.common.system.api.ISysBaseAPI;
import com.jero.common.system.vo.DictModel;
import com.jero.modules.laws.standard.entity.LawsDomesticStandard;
import com.jero.modules.laws.standard.entity.LawsOverseasStandard;
import com.jero.modules.laws.standard.service.ILawsDomesticStandardService;
import com.jero.modules.laws.standard.service.ILawsOverseasStandardService;
import com.jero.modules.projectLibrary.common.AssessCommon;
import com.jero.modules.projectLibrary.entity.LawsAssess;
import com.jero.modules.projectLibrary.entity.LawsAssessResults;
@@ -51,8 +48,6 @@ public class LawsAssessResultsServiceImpl extends ServiceImpl<LawsAssessResultsM
private ILawsAssessService lawsAssessService;
@Autowired
private ILawsDomesticStandardService lawsDomesticStandardService; //国内标准
@Autowired
private ILawsOverseasStandardService lawsOverseasStandardService; //海外标准
@Resource
private ISysBaseAPI sysBaseAPI;
@@ -93,16 +88,6 @@ public class LawsAssessResultsServiceImpl extends ServiceImpl<LawsAssessResultsM
standardState = standardStateMap.get(standard.getStandardState());
}
}
if (CommonConstant.STANDARD_SOURCE_2.equals(source)){
//查询海外标准数据,赋值给collection
LawsOverseasStandard standard = lawsOverseasStandardService.queryById(standardId);
if (standard != null){
standardNumber = standard.getStandardNumber();
standardName = standard.getStandardName();
standardEnglishName = standard.getStandardEnglishName();
standardState = standardStateMap.get(standard.getStandardState());
}
}
Map<String, String[]> parameterMap = req.getParameterMap();
parameterMap.remove("assessId");
lawsAssessResults.setAssessId(null);
@@ -2,18 +2,14 @@ package com.jero.modules.projectLibrary.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.jero.common.api.vo.ResultCommon;
import com.jero.common.constant.CommonConstant;
import com.jero.common.system.api.ISysBaseAPI;
import com.jero.common.system.vo.DictModel;
import com.jero.modules.laws.standard.entity.LawsDomesticStandard;
import com.jero.modules.laws.standard.entity.LawsOverseasStandard;
import com.jero.modules.laws.standard.service.ILawsDomesticStandardService;
import com.jero.modules.laws.standard.service.ILawsOverseasStandardService;
import com.jero.modules.projectLibrary.common.AssessCommon;
import com.jero.modules.projectLibrary.entity.LawsAssess;
import com.jero.modules.projectLibrary.entity.LawsAssessResults;
import com.jero.modules.projectLibrary.entity.LawsEvaluationNotMet;
import com.jero.modules.projectLibrary.entity.LawsProjectLibrary;
import com.jero.modules.projectLibrary.mapper.LawsAssessMapper;
@@ -57,9 +53,6 @@ public class LawsAssessServiceImpl extends ServiceImpl<LawsAssessMapper, LawsAss
//国内标准
@Autowired
private ILawsDomesticStandardService lawsDomesticStandardService;
//海外标准
@Autowired
private ILawsOverseasStandardService lawsOverseasStandardService;
@Resource
private ISysBaseAPI sysBaseAPI;
@Resource
@@ -218,19 +211,6 @@ public class LawsAssessServiceImpl extends ServiceImpl<LawsAssessMapper, LawsAss
}
}
if (CommonConstant.STANDARD_SOURCE_2.equals(source)){
//查询海外标准数据,赋值给collection
LawsOverseasStandard standard = lawsOverseasStandardService.queryById(standardId);
if (standard != null){
assess.setStandardEnglishName(standard.getStandardEnglishName());
assess.setStandardState(standard.getStandardState());
assess.setApplicableVehicle(standard.getApplicableVehicle());
assess.setOnTheProductionDate(standard.getOnTheProductionDate());
assess.setNewModelImplementationDate(standard.getNewModelImplementationDate());
assess.setReleaseDate(standard.getReleaseDate());
assess.setResponsibleDepartment(standard.getResponsibleDepartment());
}
}
// 查询标准拆分表
LambdaQueryWrapper<SarFileSplitInfoEO> queryWrapper = new LambdaQueryWrapper<>();
@@ -300,29 +280,6 @@ public class LawsAssessServiceImpl extends ServiceImpl<LawsAssessMapper, LawsAss
lawsAssesses.add(lawsAssess);
continue;
}
LawsOverseasStandard lawsOverseasStandard = lawsOverseasStandardService.queryByStandardNumber(standardNumber);
if (lawsOverseasStandard != null){
String standardId = lawsOverseasStandard.getId();
if (allByProjectIdNotDeletedIdList.contains(standardId)){
//如果已存在跳过新增
continue;
}
if (allByProjectIdDeletedIdList.contains(standardId)){
//如果已删除则恢复未删除状态
lawsAssessMapper.changeDelFlag(projectId, standardId);
continue;
}
LawsAssess lawsAssess = new LawsAssess();
lawsAssess.setSource(CommonConstant.STANDARD_SOURCE_2);
lawsAssess.setProjectId(projectId);
lawsAssess.setStandardId(standardId);
LawsOverseasStandard standard = lawsOverseasStandardService.queryById(standardId);
lawsAssess.setStandardNumber(standard.getStandardNumber());
lawsAssess.setStandardName(standard.getStandardName());
lawsAssess.setProcessStatus(AssessCommon.NOT_EVALUATED);
lawsAssess.setDelFlag(CommonConstant.DEL_FLAG_0.toString());
lawsAssesses.add(lawsAssess);
}
}
this.saveBatch(lawsAssesses);
}
@@ -1,6 +1,5 @@
package com.jero.modules.projectLibrary.service.impl;
import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -8,14 +7,11 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.jero.common.api.vo.ResultCommon;
import com.jero.common.constant.CommonConstant;
import com.jero.common.system.vo.LoginUser;
import com.jero.modules.laws.common.constant.FieldCommon;
import com.jero.modules.laws.common.util.CurrentUserUtil;
import com.jero.modules.laws.standard.entity.LawsDomesticStandard;
import com.jero.modules.laws.standard.entity.LawsEnterpriseStandard;
import com.jero.modules.laws.standard.entity.LawsOverseasStandard;
import com.jero.modules.laws.standard.service.ILawsDomesticStandardService;
import com.jero.modules.laws.standard.service.ILawsEnterpriseStandardService;
import com.jero.modules.laws.standard.service.ILawsOverseasStandardService;
import com.jero.modules.projectLibrary.common.AssessCommon;
import com.jero.modules.projectLibrary.entity.LawsEvaluationNotMet;
import com.jero.modules.projectLibrary.mapper.LawsEvaluationNotMetMapper;
@@ -48,9 +44,6 @@ public class LawsEvaluationNotMetServiceImpl extends ServiceImpl<LawsEvaluationN
//国内标准
@Resource
private ILawsDomesticStandardService lawsDomesticStandardService;
//海外标准
@Resource
private ILawsOverseasStandardService lawsOverseasStandardService;
//企业标准
@Resource
private ILawsEnterpriseStandardService lawsEnterpriseStandardService;
@@ -140,13 +133,6 @@ public class LawsEvaluationNotMetServiceImpl extends ServiceImpl<LawsEvaluationN
standardId = lawsDomesticStandard.getId();
source = CommonConstant.STANDARD_SOURCE_1;
}
if (standardId == null){
LawsOverseasStandard lawsOverseasStandard = lawsOverseasStandardService.queryByStandardNumber(standardNumber);
if (lawsOverseasStandard != null){
standardId = lawsOverseasStandard.getId();
source = CommonConstant.STANDARD_SOURCE_2;
}
}
if (standardId == null){
LawsEnterpriseStandard lawsEnterpriseStandard = lawsEnterpriseStandardService.queryByStandardNumber(standardNumber);
if (lawsEnterpriseStandard != null) {
@@ -12,8 +12,6 @@ import com.jero.common.util.FileUtils;
import com.jero.common.util.ZipUtil;
import com.jero.modules.laws.common.util.CurrentUserUtil;
import com.jero.modules.laws.enterprise.service.EnterpriseStandardDeclareService;
import com.jero.modules.laws.standard.service.ILawsDomesticStandardService;
import com.jero.modules.laws.standard.service.ILawsOverseasStandardService;
import com.jero.modules.oss.service.IOSSFileService;
import com.jero.modules.projectLibrary.entity.LawsSpecialProjectLibrary;
import com.jero.modules.projectLibrary.mapper.LawsSpecialProjectLibraryMapper;
@@ -26,7 +24,6 @@ import org.apache.poi.ss.usermodel.Workbook;
import org.jeecgframework.poi.excel.ExcelExportUtil;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.enmus.ExcelType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -53,10 +50,6 @@ import java.util.stream.Collectors;
@Service
@Transactional(rollbackFor = JeroBootException.class)
public class LawsSpecialProjectLibraryServiceImpl extends ServiceImpl<LawsSpecialProjectLibraryMapper, LawsSpecialProjectLibrary> implements ILawsSpecialProjectLibraryService {
@Autowired
private ILawsDomesticStandardService lawsDomesticStandardService; //国内标准
@Autowired
private ILawsOverseasStandardService lawsOverseasStandardService; //海外标准
@Resource
private LawsSpecialProjectLibraryMapper specialProjectLibraryMapper;
@Resource