Commit 8d041768 authored by jiawei's avatar jiawei

Merge branch 'dev' of http://111.203.232.171:8888/lee/chnmuseum-party

 Conflicts:
	src/main/java/cn/wisenergy/chnmuseum/party/web/controller/VideoContentCatController.java
parents dae93097 12441ee8
......@@ -32,8 +32,6 @@ public final class RSAUtils {
/**
* 生成公、私钥
* 根据需要返回String或byte[]类型
*
* @return
*/
public static ArrayList<String> createRSAKeys() {
ArrayList<String> array = new ArrayList<>();
......@@ -194,4 +192,11 @@ public final class RSAUtils {
return decryptedString;
}
public static void main(String[] args) {
String privateKey = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCiaQf54L5y1de3xwv0Fegovl42ayg4HgoNxjVhGf1tsgcPZdM1zj0ENzEWu3vuTn3ZXO2xsLDUH+iMUa8d07n+tZ3iutpT4Z6TRBlMyvCVv/AuvAip9d2wR4fumATYjkfiZzX964OjF66KZVyNhqnI4rrw7C4ShCW+QNVhFTbCJbT1WrDl+O4D4EpEMJx4azuaflt6UqcKy9hGZm9q03XjannDWcAuMTSVisBFDwdyQfjom+ybHrzjz9neYPC3bfDGnZj/Vw/dkSVnTuCsp1Vob85xgAWEiZU1eLShFxrLG2U9pqMYzeAOkOFoSaQi5Mtn1JSM5dBBzpQiBEi8r4qtAgMBAAECggEAbrQpO6p2JtCcuihzfW1xUlRw46cnQxk2wSzaNdYBaURwi45c6dAqxzTXwScK0uWt4vv1Canm3rDhUsRbGXm4zmX9uQ6kw4iHDtrcY/vxAiJTFYgWX8O32PDpNzloFDTnyuuPYgWnNQRvdOair9Wa5dOmmZJj1Ts+fvCygfpz2OHEkPr1DmFAiCiucG+cQjF/79GmLvooS24hFGJfGbQzlPDP01FWPtgObHQ0+M1OtxNsDdFyX+6ZZhk+XoyGWRXmCROnEKcllugEOjCEpV9rYqH7M5JqXltcnJ69x51PWtQwAB7qFXJ7z19ZBee/GFHPi2vlOFy+g0+S5IE6BsLQAQKBgQDXcWqgGPeYrVJmMOzS4img7I1MkONyzUGy3gMX7DIuvAwxcTPE2/393zRgmYu+esbztjLTMDEPYBuDO8/07SuYYUi41EhofSO8cHCuYcXXtFJ+Ea2GSf3wEtSb/Ul6JTofa3YCSG1rMxDO1hcK7RJdVlPNHWh0ejj4A5tTQ+iEhQKBgQDA+98o9B70pHA8sBEZ/TzS+Esn2RyMmRoHUaEHkB+8GTkHYVzCA3KWaU1hPvArmcK0UZmCwyEQDgziyQORlIzNlQv7Gbzr+OwnfBEu3b7rWoxFnVw6XVrk/3VdvPRfaMs0d4OkLniQWpxy0OjZwo/RSxxfzQC2L6oFcqZmY4X6CQKBgQCljDIpmWXQfQZ/HgMsvLrOPFcLSZ5s3copHq3z2PxqqvcXmuvzzjPqu3Ps8q/OC1wLc6q0WyinrusVOYW/p+tC6SZPWFfXaqlmKGR9qwWyjY6B7yWOthaaPm3++29Vm3uBHzsL4AmsQQ4eUaZdL/RXonk8eOeF8VELSwI0xk7KXQKBgEHYbo8RpFJCnQ0H4f3lGtC86R/Cg2wxfOEMaA4ljb5nOL8c6EJGXN2XNlC84cNupjFSOjeUjn5k3N6wSWhtsBEhDsJxSLWW7DSYr2A3RsIU1hGWnHZJjg7eXtRJ+XNoVRUkxiTJulc+o2zFfP131gxKPXcuglSnNLLBKKd8w6TJAoGBAJmQ2lDqIEEaZJiP4KUdPWFcM+4Q4miSYdpIWrTKRjl0kutBE0207FpQarTw084lzyVfwrZazA45JPUeL9m7UogYdPbo4P641PVchDoecrqXAWdaRXoJ43/DzZa/XPEnnmVmNyIBFmb0BRxxhMZHmm0dU5FYPM4wFTiMJv4HbHKT";
String encryptedBase64 = "WA+vH4XzJTqIAK05TcVXOnhcY9Qt+nkfw0js/e6Mbt0OvvhdNYYi8sYLwqQz9LXFLfom4rkyp4P8INLV+A/ZfJF+kG2B9w9TCZsBQCYIQzmCo9zwwPsachRkeGi6puUsr/bA5HXrvDp19yS7q6NAVUtYZG/pMB2BSXkZXfJM3nrLEJLJvRSCMYHx46KOWMSUwpqCqQPWkDoNaicX16yAaD7zEHzQs/xJJLT2W3I5DaBlcnEKf/sewaAigKRa3KSNxSh69pnM6ROw1txS5h54SzAGhGGsD+2E2TjyFB9erjPszbH2yIlN2K6L7cBJWnWHKBRW2ZfrHMWZpkzbO5YWtw==";
final String decrypt = RSAUtils.decrypt(encryptedBase64, privateKey);
System.out.println(decrypt);
}
}
package cn.wisenergy.chnmuseum.party.model;
import cn.wisenergy.chnmuseum.party.common.validator.groups.Update;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......@@ -54,12 +55,19 @@ public class TBoxOperation implements Serializable {
@ApiModelProperty(hidden = true)
@TableField("public_key")
@JSONField(serialize = false)
private String publicKey;
@ApiModelProperty("机顶盒密钥")
@ApiModelProperty(hidden = true)
@TableField("private_key")
@JSONField(serialize = false)
private String privateKey;
@ApiModelProperty(hidden = true)
@TableField("request_count")
@JSONField(serialize = false)
private Integer requestCount;
@ApiModelProperty("创建时间")
@TableField(value = "create_time", fill = FieldFill.INSERT)
private LocalDateTime createTime;
......
......@@ -4,11 +4,13 @@ import cn.wisenergy.chnmuseum.party.common.enums.AuditOperationEnum;
import cn.wisenergy.chnmuseum.party.common.enums.AuditStatusEnum;
import cn.wisenergy.chnmuseum.party.common.enums.AuditTypeEnum;
import cn.wisenergy.chnmuseum.party.common.mvc.InterfaceException;
import cn.wisenergy.chnmuseum.party.mapper.AssetMapper;
import cn.wisenergy.chnmuseum.party.mapper.AuditMapper;
import cn.wisenergy.chnmuseum.party.model.*;
import cn.wisenergy.chnmuseum.party.service.*;
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.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -21,6 +23,8 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* <pre>
......@@ -37,6 +41,9 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
@Resource
private AuditMapper auditMapper;
@Resource
private AssetMapper assetMapper;
@Resource
private TUserServiceImpl userService;
......@@ -246,20 +253,43 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
update = this.videoContentService.updateById(videoContent);
break;
case REMOVE:
this.auditMapper.delete(Wrappers.<Audit>lambdaUpdate().eq(Audit::getRefItemId, videoContentId));
final LambdaQueryWrapper<ExhibitionBoard> queryWrapper = Wrappers.<ExhibitionBoard>lambdaQuery().eq(ExhibitionBoard::getVideoContentId, videoContentId);
queryWrapper.select(ExhibitionBoard::getId);
final List<String> ExhibitionBoardIdList = this.exhibitionBoardService.listObjs(queryWrapper, Object::toString);
this.exhibitionBoardService.removeByIds(ExhibitionBoardIdList);
final LambdaQueryWrapper<ExhibitionBoard> queryWrapper = Wrappers.<ExhibitionBoard>lambdaQuery().eq(ExhibitionBoard::getVideoContentId, videoContentId).select(ExhibitionBoard::getId);
final List<String> exhibitionBoardIdList = this.exhibitionBoardService.listObjs(queryWrapper, Object::toString);
if (exhibitionBoardIdList != null && !exhibitionBoardIdList.isEmpty()) {
this.exhibitionBoardService.removeByIds(exhibitionBoardIdList);
this.auditMapper.delete(Wrappers.<Audit>lambdaUpdate().in(Audit::getRefItemId, exhibitionBoardIdList));
this.assetMapper.delete(Wrappers.<Asset>lambdaUpdate().in(Asset::getRefItemId, exhibitionBoardIdList));
final LambdaQueryWrapper<LearningContentBoard> learningContentBoardLambdaQueryWrapper = Wrappers.<LearningContentBoard>lambdaQuery().in(LearningContentBoard::getExhibitionBoardCatId, exhibitionBoardIdList);
final List<LearningContentBoard> learningContentBoardList = this.learningContentBoardService.list(learningContentBoardLambdaQueryWrapper);
if (learningContentBoardList != null && !learningContentBoardList.isEmpty()) {
final Map<String, List<String>> collect = learningContentBoardList.stream().collect(Collectors.groupingBy(LearningContentBoard::getLearningContentId, Collectors.mapping(LearningContentBoard::getExhibitionBoardId, Collectors.toList())));
collect.forEach((k, v) -> {
if (v.size() == 1) {
this.learningContentService.removeById(k);
this.learningContentBoardService.remove(Wrappers.<LearningContentBoard>lambdaUpdate().eq(LearningContentBoard::getLearningContentId, k));
this.learningContentBoardCatService.remove(Wrappers.<LearningContentBoardCat>lambdaUpdate().eq(LearningContentBoardCat::getLearningContentId, k));
this.learningContentCopyrightOwnerService.remove(Wrappers.<LearningContentCopyrightOwner>lambdaUpdate().eq(LearningContentCopyrightOwner::getLearningContentId, k));
}
});
LambdaUpdateWrapper<LearningContentBoard> deleteWrapper1 = Wrappers.<LearningContentBoard>lambdaUpdate().in(LearningContentBoard::getExhibitionBoardId, exhibitionBoardIdList);
this.learningContentBoardService.remove(deleteWrapper1);
}
}
this.auditMapper.delete(Wrappers.<Audit>lambdaUpdate().in(Audit::getRefItemId, videoContentId));
this.assetMapper.delete(Wrappers.<Asset>lambdaUpdate().in(Asset::getRefItemId, videoContentId));
update = this.videoContentService.removeById(videoContentId);
break;
case ADD:
videoContent.setPublished(true);
update = this.videoContentService.updateById(videoContent);;
update = this.videoContentService.updateById(videoContent);
;
break;
case EDIT:
videoContent.setPublished(true);
update = this.videoContentService.updateById(videoContent);;
update = this.videoContentService.updateById(videoContent);
;
break;
default:
}
......@@ -292,19 +322,32 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
update = this.exhibitionBoardService.updateById(exhibitionBoard);
break;
case REMOVE:
final LambdaQueryWrapper<LearningContentBoard> learningContentBoardLambdaQueryWrapper = Wrappers.<LearningContentBoard>lambdaQuery().eq(LearningContentBoard::getExhibitionBoardCatId, exhibitionBoardId);
final List<LearningContentBoard> learningContentBoardList = this.learningContentBoardService.list(learningContentBoardLambdaQueryWrapper);
if (learningContentBoardList != null && !learningContentBoardList.isEmpty()) {
final Map<String, List<String>> collect = learningContentBoardList.stream().collect(Collectors.groupingBy(LearningContentBoard::getLearningContentId, Collectors.mapping(LearningContentBoard::getExhibitionBoardId, Collectors.toList())));
collect.forEach((k, v) -> {
if (v.size() == 1) {
this.learningContentService.removeById(k);
this.learningContentBoardService.remove(Wrappers.<LearningContentBoard>lambdaUpdate().eq(LearningContentBoard::getLearningContentId, k));
this.learningContentBoardCatService.remove(Wrappers.<LearningContentBoardCat>lambdaUpdate().eq(LearningContentBoardCat::getLearningContentId, k));
this.learningContentCopyrightOwnerService.remove(Wrappers.<LearningContentCopyrightOwner>lambdaUpdate().eq(LearningContentCopyrightOwner::getLearningContentId, k));
}
});
LambdaUpdateWrapper<LearningContentBoard> learningContentBoardLambdaUpdateWrapper = Wrappers.<LearningContentBoard>lambdaUpdate().eq(LearningContentBoard::getExhibitionBoardId, exhibitionBoardId);
this.learningContentBoardService.remove(learningContentBoardLambdaUpdateWrapper);
}
this.auditMapper.delete(Wrappers.<Audit>lambdaUpdate().eq(Audit::getRefItemId, exhibitionBoardId));
this.learningContentBoardService.remove(Wrappers.<LearningContentBoard>lambdaUpdate().eq(LearningContentBoard::getExhibitionBoardId, exhibitionBoard.getId()));
this.assetMapper.delete(Wrappers.<Asset>lambdaUpdate().eq(Asset::getRefItemId, exhibitionBoardId));
update = this.exhibitionBoardService.removeById(exhibitionBoardId);
break;
case ADD:
exhibitionBoard.setPublished(true);
update = this.exhibitionBoardService.updateById(exhibitionBoard);;
update = this.exhibitionBoardService.updateById(exhibitionBoard);
break;
case EDIT:
exhibitionBoard.setPublished(true);
update = this.exhibitionBoardService.updateById(exhibitionBoard);;
update = this.exhibitionBoardService.updateById(exhibitionBoard);
break;
default:
}
......
......@@ -153,7 +153,7 @@ public class AssetController extends BaseController {
final List<TBoxOperation> tBoxOperationList = assetService.listBoxByOrgan();
final Map<String, InputStream> map = new LinkedHashMap<>(tBoxOperationList.size());
for (TBoxOperation tBoxOperation : tBoxOperationList) {
map.put(tBoxOperation.getOrganName() + "_" + tBoxOperation.getMac() + ".cipher", IoUtil.toStream(RSAUtils.encrypt(VideoEncryptUtil.cipher, tBoxOperation.getPublicKey()), StandardCharsets.UTF_8));
map.put(tBoxOperation.getOrganName() + "-" + tBoxOperation.getMac() + ".cipher", IoUtil.toStream(RSAUtils.encrypt(VideoEncryptUtil.cipher, tBoxOperation.getPublicKey()), StandardCharsets.UTF_8));
}
ServletOutputStream outputStream = response.getOutputStream();
String[] paths = map.keySet().toArray(new String[0]);
......
......@@ -117,20 +117,38 @@ public class ChinaMobileRestApiController extends BaseController {
@RequiresAuthentication //@RequiresPermissions("equitment:key")
public Map<String, Object> getBoxPrivateKey(@RequestParam(value = "mac") String mac) {
try {
final LambdaQueryWrapper<TBoxOperation> queryWrapper = Wrappers.<TBoxOperation>lambdaQuery().eq(TBoxOperation::getMac, mac.trim().toUpperCase());
String macAddress = mac.trim().toUpperCase();
final LambdaQueryWrapper<TBoxOperation> queryWrapper = Wrappers.<TBoxOperation>lambdaQuery().eq(TBoxOperation::getMac, macAddress);
final TBoxOperation tBoxOperation = this.boxOperationService.getOne(queryWrapper);
if (tBoxOperation != null) {
final String organId = tBoxOperation.getOrganId();
final TUser tUser = getcurUser();
if (tUser != null && organId.equals(tUser.getOrgId())) {
final String countStr = this.stringRedisTemplate.opsForValue().get(macAddress + "_count");
if (StringUtils.isNotBlank(countStr)) {
final long count = Long.parseLong(countStr);
if (count > 1) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("key", "");
return getFailResult("400", "已经获取过一次,无法再次获取", jsonObject);
}
} else if (tBoxOperation.getRequestCount() > 1) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("key", "");
return getFailResult("400", "已经获取过一次,无法再次获取", jsonObject);
}
this.stringRedisTemplate.opsForValue().increment(macAddress + "_count");
tBoxOperation.setRequestCount(tBoxOperation.getRequestCount() + 1);
this.boxOperationService.updateById(tBoxOperation);
JSONObject jsonObject = new JSONObject();
jsonObject.put("key", tBoxOperation.getPrivateKey());
return getResult(jsonObject);
} else {
return getFailResult("400", "您无权获取本单位机顶盒密钥");
return getFailResult("400", "您无权获取机顶盒密钥");
}
}
return getFailResult("500", "未查询到相关机顶盒信息");
return getFailResult("400", "系统未查询到此机顶盒相关信息");
} catch (Exception e) {
e.printStackTrace();
}
......@@ -186,8 +204,8 @@ public class ChinaMobileRestApiController extends BaseController {
return resultMap;
}
//解密
mac=AESUtils.aesDecrypt(mac);
password= AESUtils.aesDecrypt(password);
mac = AESUtils.aesDecrypt(mac);
password = AESUtils.aesDecrypt(password);
if (!mac.equals(operation.getMac())) {
resultMap.put("resultCode", "400");
......@@ -354,11 +372,11 @@ public class ChinaMobileRestApiController extends BaseController {
resultMap.put("data", list);
return resultMap;
} catch (Exception e) {
resultMap.put("resultCode", "500");
resultMap.put("resultCode", "400");
resultMap.put("message", "该展板已下架");
resultMap.put("data", "");
}
return getFailResult("该展板已下架");
return getFailResult("400", "该展板已下架");
}
@ApiImplicitParams(value = {
......
......@@ -67,6 +67,10 @@ public class CopyrightOwnerController extends BaseController {
private LearningContentBoardService learningContentBoardService;
@Resource
private LearningContentBoardCatService learningContentBoardCatService;
@Resource
private AuditService auditService;
@Resource
private AssetService assetService;
@PostMapping("/save")
@RequiresAuthentication //@RequiresPermissions("copyright:owner:save")
......@@ -287,25 +291,73 @@ public class CopyrightOwnerController extends BaseController {
public Map<String, Object> deleteCopyrightOwner(@PathVariable("id") String id) {
this.copyrightOwnerService.removeById(id);
final LambdaUpdateWrapper<VideoContent> updateWrapper = Wrappers.<VideoContent>lambdaUpdate().eq(VideoContent::getVideoContentCopyrightOwnerId, id);
updateWrapper.set(VideoContent::getDeleted, true);
this.videoContentService.update(updateWrapper);
LambdaUpdateWrapper<CopyrightOwnerBoardCat> copyrightOwnerBoardCatLambdaUpdateWrapper = Wrappers.<CopyrightOwnerBoardCat>lambdaUpdate().eq(CopyrightOwnerBoardCat::getCopyrightOwnerId, id);
this.copyrightOwnerBoardCatService.remove(copyrightOwnerBoardCatLambdaUpdateWrapper);
final LambdaUpdateWrapper<ExhibitionBoard> updateWrapper1 = Wrappers.<ExhibitionBoard>lambdaUpdate().eq(ExhibitionBoard::getBoardCopyrightOwnerId, id);
updateWrapper1.set(ExhibitionBoard::getDeleted, true);
this.exhibitionBoardService.update(updateWrapper1);
LambdaUpdateWrapper<CopyrightOwnerVideoContentCat> copyrightOwnerVideoContentCatLambdaUpdateWrapper = Wrappers.<CopyrightOwnerVideoContentCat>lambdaUpdate().eq(CopyrightOwnerVideoContentCat::getCopyrightOwnerId, id);
this.copyrightOwnerVideoContentCatService.remove(copyrightOwnerVideoContentCatLambdaUpdateWrapper);
LambdaUpdateWrapper<CopyrightOwnerBoardCat> deleteWrapper = Wrappers.<CopyrightOwnerBoardCat>lambdaUpdate().eq(CopyrightOwnerBoardCat::getCopyrightOwnerId, id);
this.copyrightOwnerBoardCatService.remove(deleteWrapper);
final LambdaQueryWrapper<VideoContent> videoContentLambdaQueryWrapper = Wrappers.<VideoContent>lambdaQuery().eq(VideoContent::getVideoContentCopyrightOwnerId, id).select(VideoContent::getId);
final List<String> videoContentIdList = this.videoContentService.listObjs(videoContentLambdaQueryWrapper, Object::toString);
if (videoContentIdList != null && !videoContentIdList.isEmpty()) {
this.videoContentService.removeByIds(videoContentIdList);
this.auditService.remove(Wrappers.<Audit>lambdaUpdate().in(Audit::getRefItemId, videoContentIdList));
this.assetService.remove(Wrappers.<Asset>lambdaUpdate().in(Asset::getRefItemId, videoContentIdList));
LambdaUpdateWrapper<CopyrightOwnerVideoContentCat> deleteWrapper1 = Wrappers.<CopyrightOwnerVideoContentCat>lambdaUpdate().eq(CopyrightOwnerVideoContentCat::getCopyrightOwnerId, id);
this.copyrightOwnerVideoContentCatService.remove(deleteWrapper1);
final LambdaQueryWrapper<ExhibitionBoard> exhibitionBoardLambdaQueryWrapper = Wrappers.<ExhibitionBoard>lambdaQuery().in(ExhibitionBoard::getVideoContentId, videoContentIdList).select(ExhibitionBoard::getId);
final List<String> ExhibitionBoardIdList = this.exhibitionBoardService.listObjs(exhibitionBoardLambdaQueryWrapper, Object::toString);
if (ExhibitionBoardIdList != null && !ExhibitionBoardIdList.isEmpty()) {
this.exhibitionBoardService.removeByIds(ExhibitionBoardIdList);
this.auditService.remove(Wrappers.<Audit>lambdaUpdate().in(Audit::getRefItemId, ExhibitionBoardIdList));
this.assetService.remove(Wrappers.<Asset>lambdaUpdate().in(Asset::getRefItemId, ExhibitionBoardIdList));
final LambdaQueryWrapper<LearningContentBoard> learningContentBoardLambdaQueryWrapper = Wrappers.<LearningContentBoard>lambdaQuery().in(LearningContentBoard::getExhibitionBoardCatId, ExhibitionBoardIdList);
final List<LearningContentBoard> learningContentBoardList = this.learningContentBoardService.list(learningContentBoardLambdaQueryWrapper);
if (learningContentBoardList != null && !learningContentBoardList.isEmpty()) {
final Map<String, List<String>> collect = learningContentBoardList.stream().collect(Collectors.groupingBy(LearningContentBoard::getLearningContentId, Collectors.mapping(LearningContentBoard::getExhibitionBoardId, Collectors.toList())));
collect.forEach((k, v) -> {
if (v.size() == 1) {
this.learningContentService.removeById(k);
this.learningContentBoardService.remove(Wrappers.<LearningContentBoard>lambdaUpdate().eq(LearningContentBoard::getLearningContentId, k));
this.learningContentBoardCatService.remove(Wrappers.<LearningContentBoardCat>lambdaUpdate().eq(LearningContentBoardCat::getLearningContentId, k));
this.learningContentCopyrightOwnerService.remove(Wrappers.<LearningContentCopyrightOwner>lambdaUpdate().eq(LearningContentCopyrightOwner::getLearningContentId, k));
}
});
LambdaUpdateWrapper<LearningContentBoard> deleteWrapper1 = Wrappers.<LearningContentBoard>lambdaUpdate().in(LearningContentBoard::getExhibitionBoardId, ExhibitionBoardIdList);
this.learningContentBoardService.remove(deleteWrapper1);
}
}
}
final LambdaQueryWrapper<ExhibitionBoard> exhibitionBoardLambdaQueryWrapper = Wrappers.<ExhibitionBoard>lambdaQuery().eq(ExhibitionBoard::getBoardCopyrightOwnerId, id).select(ExhibitionBoard::getId);
final List<String> exhibitionBoardIdList = this.exhibitionBoardService.listObjs(exhibitionBoardLambdaQueryWrapper, Object::toString);
if (exhibitionBoardIdList != null && !exhibitionBoardIdList.isEmpty()) {
this.exhibitionBoardService.removeByIds(exhibitionBoardIdList);
this.auditService.remove(Wrappers.<Audit>lambdaUpdate().in(Audit::getRefItemId, exhibitionBoardIdList));
this.assetService.remove(Wrappers.<Asset>lambdaUpdate().in(Asset::getRefItemId, exhibitionBoardIdList));
final LambdaQueryWrapper<LearningContentBoard> learningContentBoardLambdaQueryWrapper = Wrappers.<LearningContentBoard>lambdaQuery().in(LearningContentBoard::getExhibitionBoardCatId, exhibitionBoardIdList);
final List<LearningContentBoard> learningContentBoardList = this.learningContentBoardService.list(learningContentBoardLambdaQueryWrapper);
if (learningContentBoardList != null && !learningContentBoardList.isEmpty()) {
final Map<String, List<String>> collect = learningContentBoardList.stream().collect(Collectors.groupingBy(LearningContentBoard::getLearningContentId, Collectors.mapping(LearningContentBoard::getExhibitionBoardId, Collectors.toList())));
collect.forEach((k, v) -> {
if (v.size() == 1) {
this.learningContentService.removeById(k);
this.learningContentBoardService.remove(Wrappers.<LearningContentBoard>lambdaUpdate().eq(LearningContentBoard::getLearningContentId, k));
this.learningContentBoardCatService.remove(Wrappers.<LearningContentBoardCat>lambdaUpdate().eq(LearningContentBoardCat::getLearningContentId, k));
this.learningContentCopyrightOwnerService.remove(Wrappers.<LearningContentCopyrightOwner>lambdaUpdate().eq(LearningContentCopyrightOwner::getLearningContentId, k));
}
});
LambdaUpdateWrapper<LearningContentBoard> learningContentBoardLambdaUpdateWrapper = Wrappers.<LearningContentBoard>lambdaUpdate().in(LearningContentBoard::getExhibitionBoardId, exhibitionBoardIdList);
this.learningContentBoardService.remove(learningContentBoardLambdaUpdateWrapper);
}
}
final LambdaQueryWrapper<LearningContentCopyrightOwner> learningContentCopyrightOwnerLambdaQueryWrapper = Wrappers.<LearningContentCopyrightOwner>lambdaQuery().eq(LearningContentCopyrightOwner::getCopyrightOwnerId, id);
final List<LearningContentCopyrightOwner> learningContentCopyrightOwnerList = this.learningContentCopyrightOwnerService.list(learningContentCopyrightOwnerLambdaQueryWrapper);
if (learningContentCopyrightOwnerList != null && !learningContentCopyrightOwnerList.isEmpty()) {
final Map<String, List<String>> collect = learningContentCopyrightOwnerList.stream().collect(Collectors.groupingBy(LearningContentCopyrightOwner::getLearningContentId, Collectors.mapping(LearningContentCopyrightOwner::getCopyrightOwnerId, Collectors.toList())));
collect.forEach((k , v) -> {
collect.forEach((k, v) -> {
if (v.size() == 1) {
this.learningContentService.removeById(k);
this.learningContentBoardService.remove(Wrappers.<LearningContentBoard>lambdaUpdate().eq(LearningContentBoard::getLearningContentId, k));
......@@ -313,9 +365,8 @@ public class CopyrightOwnerController extends BaseController {
this.learningContentCopyrightOwnerService.remove(Wrappers.<LearningContentCopyrightOwner>lambdaUpdate().eq(LearningContentCopyrightOwner::getLearningContentId, k));
}
});
LambdaUpdateWrapper<LearningContentCopyrightOwner> deleteWrapper2 = Wrappers.<LearningContentCopyrightOwner>lambdaUpdate().eq(LearningContentCopyrightOwner::getCopyrightOwnerId, id);
this.learningContentCopyrightOwnerService.remove(deleteWrapper2);
LambdaUpdateWrapper<LearningContentCopyrightOwner> learningContentCopyrightOwnerLambdaUpdateWrapper = Wrappers.<LearningContentCopyrightOwner>lambdaUpdate().eq(LearningContentCopyrightOwner::getCopyrightOwnerId, id);
this.learningContentCopyrightOwnerService.remove(learningContentCopyrightOwnerLambdaUpdateWrapper);
}
return getSuccessResult();
......
......@@ -65,6 +65,8 @@ public class ExhibitionBoardCatController extends BaseController {
private LearningContentCopyrightOwnerService learningContentCopyrightOwnerService;
@Resource
private AuditService auditService;
@Resource
private AssetService assetService;
@PostMapping("/save")
@RequiresAuthentication //@RequiresPermissions("exhibition:board:cat:save")
......@@ -204,20 +206,32 @@ public class ExhibitionBoardCatController extends BaseController {
public Map<String, Object> deleteExhibitionBoardCat(@PathVariable("id") String id) {
this.exhibitionBoardCatService.removeById(id);
final LambdaQueryWrapper<ExhibitionBoard> lambdaQueryWrapper = Wrappers.<ExhibitionBoard>lambdaQuery().eq(ExhibitionBoard::getExhibitionBoardCatId, id).select(ExhibitionBoard::getId);
final List<String> exhibitionBoardIdList = this.exhibitionBoardService.listObjs(lambdaQueryWrapper, Object::toString);
LambdaUpdateWrapper<CopyrightOwnerBoardCat> copyrightOwnerBoardCatLambdaUpdateWrapper = Wrappers.<CopyrightOwnerBoardCat>lambdaUpdate().eq(CopyrightOwnerBoardCat::getBoardCatId, id);
this.copyrightOwnerBoardCatService.remove(copyrightOwnerBoardCatLambdaUpdateWrapper);
final LambdaQueryWrapper<ExhibitionBoard> exhibitionBoardLambdaQueryWrapper = Wrappers.<ExhibitionBoard>lambdaQuery().eq(ExhibitionBoard::getExhibitionBoardCatId, id).select(ExhibitionBoard::getId);
final List<String> exhibitionBoardIdList = this.exhibitionBoardService.listObjs(exhibitionBoardLambdaQueryWrapper, Object::toString);
if (exhibitionBoardIdList != null && !exhibitionBoardIdList.isEmpty()) {
final LambdaUpdateWrapper<ExhibitionBoard> updateWrapper = Wrappers.<ExhibitionBoard>lambdaUpdate().eq(ExhibitionBoard::getExhibitionBoardCatId, id);
updateWrapper.set(ExhibitionBoard::getDeleted, true);
this.exhibitionBoardService.update(updateWrapper);
this.exhibitionBoardService.removeByIds(exhibitionBoardIdList);
this.auditService.remove(Wrappers.<Audit>lambdaUpdate().in(Audit::getRefItemId, exhibitionBoardIdList));
this.assetService.remove(Wrappers.<Asset>lambdaUpdate().in(Asset::getRefItemId, exhibitionBoardIdList));
LambdaUpdateWrapper<LearningContentBoard> deleteWrapper3 = Wrappers.<LearningContentBoard>lambdaUpdate().in(LearningContentBoard::getExhibitionBoardId, exhibitionBoardIdList);
this.learningContentBoardService.remove(deleteWrapper3);
final LambdaQueryWrapper<LearningContentBoard> learningContentBoardLambdaQueryWrapper = Wrappers.<LearningContentBoard>lambdaQuery().in(LearningContentBoard::getExhibitionBoardCatId, exhibitionBoardIdList);
final List<LearningContentBoard> learningContentBoardList = this.learningContentBoardService.list(learningContentBoardLambdaQueryWrapper);
if (learningContentBoardList != null && !learningContentBoardList.isEmpty()) {
final Map<String, List<String>> collect = learningContentBoardList.stream().collect(Collectors.groupingBy(LearningContentBoard::getLearningContentId, Collectors.mapping(LearningContentBoard::getExhibitionBoardId, Collectors.toList())));
collect.forEach((k, v) -> {
if (v.size() == 1) {
this.learningContentService.removeById(k);
this.learningContentBoardService.remove(Wrappers.<LearningContentBoard>lambdaUpdate().eq(LearningContentBoard::getLearningContentId, k));
this.learningContentBoardCatService.remove(Wrappers.<LearningContentBoardCat>lambdaUpdate().eq(LearningContentBoardCat::getLearningContentId, k));
this.learningContentCopyrightOwnerService.remove(Wrappers.<LearningContentCopyrightOwner>lambdaUpdate().eq(LearningContentCopyrightOwner::getLearningContentId, k));
}
});
LambdaUpdateWrapper<LearningContentBoard> learningContentBoardLambdaUpdateWrapper = Wrappers.<LearningContentBoard>lambdaUpdate().in(LearningContentBoard::getExhibitionBoardId, exhibitionBoardIdList);
this.learningContentBoardService.remove(learningContentBoardLambdaUpdateWrapper);
}
}
LambdaUpdateWrapper<CopyrightOwnerBoardCat> deleteWrapper = Wrappers.<CopyrightOwnerBoardCat>lambdaUpdate().eq(CopyrightOwnerBoardCat::getBoardCatId, id);
this.copyrightOwnerBoardCatService.remove(deleteWrapper);
final LambdaQueryWrapper<LearningContentBoardCat> learningContentBoardCatLambdaQueryWrapper = Wrappers.<LearningContentBoardCat>lambdaQuery().eq(LearningContentBoardCat::getExhibitionBoardCatId, id);
final List<LearningContentBoardCat> learningContentBoardCatList = this.learningContentBoardCatService.list(learningContentBoardCatLambdaQueryWrapper);
......@@ -232,13 +246,10 @@ public class ExhibitionBoardCatController extends BaseController {
}
});
LambdaUpdateWrapper<LearningContentBoardCat> deleteWrapper1 = Wrappers.<LearningContentBoardCat>lambdaUpdate().eq(LearningContentBoardCat::getExhibitionBoardCatId, id);
this.learningContentBoardCatService.remove(deleteWrapper1);
LambdaUpdateWrapper<LearningContentBoardCat> learningContentBoardCatLambdaUpdateWrapper = Wrappers.<LearningContentBoardCat>lambdaUpdate().eq(LearningContentBoardCat::getExhibitionBoardCatId, id);
this.learningContentBoardCatService.remove(learningContentBoardCatLambdaUpdateWrapper);
}
LambdaUpdateWrapper<LearningContentBoard> deleteWrapper2 = Wrappers.<LearningContentBoard>lambdaUpdate().eq(LearningContentBoard::getExhibitionBoardCatId, id);
this.learningContentBoardService.remove(deleteWrapper2);
// final LambdaUpdateWrapper<VideoContent> updateWrapper = Wrappers.<VideoContent>lambdaUpdate().eq(VideoContent::getVideoContentCopyrightOwnerId, id);
// updateWrapper.set(VideoContent::getDeleted, true);
// this.videoContentService.update(updateWrapper);
......
......@@ -129,6 +129,7 @@ public class FileUploadController extends BaseController {
}
String extName = FilenameUtils.getExtension(originalFilename);
String baseName = FilenameUtils.getBaseName(originalFilename);
String finalExtName = extName;
boolean anyMatch = Arrays.stream(DATUM_TYPE).anyMatch(s -> Objects.equals(s, finalExtName.toUpperCase()));
if (anyMatch) {
......@@ -142,15 +143,39 @@ public class FileUploadController extends BaseController {
.fileCat(FileCatEnum.EXHIBITION_BOARD_DATUM.name())
.build();
String fileUrl = null;
String language = null;
final Set<MetaData> metaDataSet = new HashSet<>();
metaDataSet.add(new MetaData("fileName", originalFilename));
if (originalFilename.contains("汉语")) {
metaDataSet.add(new MetaData("language", LanguageEnum.ZH.name()));
language = LanguageEnum.ZH.name();
} else if (originalFilename.contains("英语")) {
metaDataSet.add(new MetaData("language", LanguageEnum.EN.name()));
language = LanguageEnum.EN.name();
} else if (originalFilename.contains("蒙语")) {
metaDataSet.add(new MetaData("language", LanguageEnum.MN.name()));
language = LanguageEnum.MN.name();
} else if (originalFilename.contains("藏语")) {
metaDataSet.add(new MetaData("language", LanguageEnum.BO.name()));
language = LanguageEnum.BO.name();
} else if (originalFilename.contains("维吾尔语")) {
metaDataSet.add(new MetaData("language", LanguageEnum.UYG.name()));
language = LanguageEnum.UYG.name();
}
String fileUrl = null;
String fileUrlCrypto = null;
if (Arrays.stream(VIDEO_TYPE).anyMatch(s -> Objects.equals(s, finalExtName.toUpperCase()))) {
metaDataSet.add(new MetaData("fileType", FileTypeEnum.VIDEO.name()));
handleResult.setFileType(FileTypeEnum.VIDEO.name());
asset.setFileType(FileTypeEnum.VIDEO.name());
fileUrl = FastDFSUtils.uploadVideo(file.getInputStream(), file.getSize(), originalFilename, metaDataSet);
final Set<MetaData> fileMetaData = FastDFSUtils.getFileMetaData(fileUrl);
final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
IOUtils.copy(file.getInputStream(), byteArrayOutputStream);
fileUrl = FastDFSUtils.uploadVideo(new ByteArrayInputStream(byteArrayOutputStream.toByteArray()), file.getSize(), originalFilename, metaDataSet);
metaDataSet.add(new MetaData("fileName", baseName + ".chnmuseum"));
fileUrlCrypto = FastDFSUtils.uploadVideo(VideoEncryptUtil.encrypt(new ByteArrayInputStream(byteArrayOutputStream.toByteArray()), VideoEncryptUtil.cipher), file.getSize(), baseName + ".chnmuseum", metaDataSet);
final Set<MetaData> fileMetaData = FastDFSUtils.getFileMetaData(fileUrlCrypto);
String md5 = fileMetaData.stream().filter(x -> "MD5".equals(x.getName())).map(MetaData::getValue).findFirst().get();
asset.setMd5(md5);
} else if (Arrays.stream(AUDIO_TYPE).anyMatch(s -> Objects.equals(s, finalExtName.toUpperCase()))) {
......@@ -170,24 +195,6 @@ public class FileUploadController extends BaseController {
asset.setFileType(FileTypeEnum.DOCUMENT.name());
fileUrl = FastDFSUtils.uploadFile(file.getInputStream(), file.getSize(), originalFilename, metaDataSet);
}
String language = null;
if (originalFilename.contains("汉语")) {
metaDataSet.add(new MetaData("language", LanguageEnum.ZH.name()));
language = LanguageEnum.ZH.name();
} else if (originalFilename.contains("英语")) {
metaDataSet.add(new MetaData("language", LanguageEnum.EN.name()));
language = LanguageEnum.EN.name();
} else if (originalFilename.contains("蒙语")) {
metaDataSet.add(new MetaData("language", LanguageEnum.MN.name()));
language = LanguageEnum.MN.name();
} else if (originalFilename.contains("藏语")) {
metaDataSet.add(new MetaData("language", LanguageEnum.BO.name()));
language = LanguageEnum.BO.name();
} else if (originalFilename.contains("维吾尔语")) {
metaDataSet.add(new MetaData("language", LanguageEnum.UYG.name()));
language = LanguageEnum.UYG.name();
}
final FileInfo fileInfo = FastDFSUtils.getFileInfo(fileUrl);
final int crc32 = fileInfo.getCrc32();
final Asset one = this.assetService.getOne(Wrappers.<Asset>lambdaQuery().eq(Asset::getCrc32, (long) crc32).last(" limit 1"));
......@@ -195,14 +202,22 @@ public class FileUploadController extends BaseController {
final LocalDateTime createTime = TimeUtils.getDateTimeOfTimestamp(fileInfo.getCreateTime() * 1000);
asset.setFileSize(fileInfo.getFileSize());
asset.setFileUrl(fileUrl);
asset.setFileUrlCrypto(fileUrlCrypto);
asset.setFileCat(FileCatEnum.EXHIBITION_BOARD_DATUM.name());
asset.setLanguage(language);
if (Arrays.stream(VIDEO_TYPE).anyMatch(s -> Objects.equals(s, finalExtName.toUpperCase()))) {
asset.setCrc32((long) crc32);
}
asset.setCreateTime(createTime);
asset.setUpdateTime(createTime);
if (one != null) {
try {
FastDFSUtils.deleteFile(fileUrl);
FastDFSUtils.deleteFile(fileUrlCrypto);
} catch (Throwable ignored) {
}
asset.setFileUrl(one.getFileUrl());
asset.setFileUrlCrypto(one.getFileUrlCrypto());
}
this.assetService.save(asset);
datumUrlList.add(asset);
......@@ -829,7 +844,7 @@ public class FileUploadController extends BaseController {
FastDFSUtils.deleteFile(fileUrl);
FastDFSUtils.deleteFile(fileUrlCrypto);
asset.setFileUrl(one.getFileUrl());
asset.setFileUrlCrypto(one.getFileUrl());
asset.setFileUrlCrypto(one.getFileUrlCrypto());
}
this.assetService.save(asset);
fileList.add(asset);
......
......@@ -49,9 +49,6 @@ public class VideoContentCatController extends BaseController {
private VideoContentCatService videoContentCatService;
@Resource
private VideoContentService videoContentService;
@Resource
private VideoContentTmpService videoContentTmpService;
@Resource
private CopyrightOwnerService copyrightOwnerService;
@Resource
......@@ -66,9 +63,8 @@ public class VideoContentCatController extends BaseController {
private LearningContentService learningContentService;
@Resource
private AuditService auditService;
@Resource
private ExhibitionBoardService exhibitionBoardService;
private AssetService assetService;
@PostMapping(value = "/save")
@RequiresAuthentication //@RequiresPermissions("video:content:cat:save")
......@@ -184,21 +180,24 @@ public class VideoContentCatController extends BaseController {
public Map<String, Object> deleteVideoContentCat(@PathVariable("id") String id) {
this.videoContentCatService.removeById(id);
final LambdaUpdateWrapper<CopyrightOwnerVideoContentCat> updateWrapper1 = Wrappers.<CopyrightOwnerVideoContentCat>lambdaUpdate().eq(CopyrightOwnerVideoContentCat::getVideoContentCatId, id);
this.copyrightOwnerVideoContentCatService.remove(updateWrapper1);
final LambdaQueryWrapper<VideoContent> lambdaQueryWrapper = Wrappers.<VideoContent>lambdaQuery().eq(VideoContent::getVideoContentCatId, id).select(VideoContent::getId);
final List<String> videoContentIdList = this.videoContentService.listObjs(lambdaQueryWrapper, Object::toString);
if (videoContentIdList != null && !videoContentIdList.isEmpty()) {
final LambdaUpdateWrapper<VideoContent> updateWrapper = Wrappers.<VideoContent>lambdaUpdate().eq(VideoContent::getVideoContentCatId, id);
updateWrapper.set(VideoContent::getDeleted, true);
this.videoContentService.update(updateWrapper);
this.videoContentService.removeByIds(videoContentIdList);
this.auditService.remove(Wrappers.<Audit>lambdaUpdate().in(Audit::getRefItemId, videoContentIdList));
this.assetService.remove(Wrappers.<Asset>lambdaUpdate().in(Asset::getRefItemId, videoContentIdList));
final LambdaQueryWrapper<ExhibitionBoard> queryWrapper = Wrappers.<ExhibitionBoard>lambdaQuery().in(ExhibitionBoard::getVideoContentId, videoContentIdList).select(ExhibitionBoard::getId);
final List<String> ExhibitionBoardIdList = this.exhibitionBoardService.listObjs(queryWrapper, Object::toString);
if (ExhibitionBoardIdList != null && !ExhibitionBoardIdList.isEmpty()) {
this.exhibitionBoardService.removeByIds(ExhibitionBoardIdList);
this.auditService.remove(Wrappers.<Audit>lambdaUpdate().in(Audit::getRefItemId, ExhibitionBoardIdList));
final List<String> exhibitionBoardIdList = this.exhibitionBoardService.listObjs(queryWrapper, Object::toString);
if (exhibitionBoardIdList != null && !exhibitionBoardIdList.isEmpty()) {
this.exhibitionBoardService.removeByIds(exhibitionBoardIdList);
this.auditService.remove(Wrappers.<Audit>lambdaUpdate().in(Audit::getRefItemId, exhibitionBoardIdList));
this.assetService.remove(Wrappers.<Asset>lambdaUpdate().in(Asset::getRefItemId, exhibitionBoardIdList));
final LambdaQueryWrapper<LearningContentBoard> learningContentBoardLambdaQueryWrapper = Wrappers.<LearningContentBoard>lambdaQuery().in(LearningContentBoard::getExhibitionBoardCatId, ExhibitionBoardIdList);
final LambdaQueryWrapper<LearningContentBoard> learningContentBoardLambdaQueryWrapper = Wrappers.<LearningContentBoard>lambdaQuery().in(LearningContentBoard::getExhibitionBoardCatId, exhibitionBoardIdList);
final List<LearningContentBoard> learningContentBoardList = this.learningContentBoardService.list(learningContentBoardLambdaQueryWrapper);
if (learningContentBoardList != null && !learningContentBoardList.isEmpty()) {
final Map<String, List<String>> collect = learningContentBoardList.stream().collect(Collectors.groupingBy(LearningContentBoard::getLearningContentId, Collectors.mapping(LearningContentBoard::getExhibitionBoardId, Collectors.toList())));
......@@ -211,23 +210,12 @@ public class VideoContentCatController extends BaseController {
}
});
LambdaUpdateWrapper<LearningContentBoard> deleteWrapper1 = Wrappers.<LearningContentBoard>lambdaUpdate().in(LearningContentBoard::getExhibitionBoardId, ExhibitionBoardIdList);
LambdaUpdateWrapper<LearningContentBoard> deleteWrapper1 = Wrappers.<LearningContentBoard>lambdaUpdate().in(LearningContentBoard::getExhibitionBoardId, exhibitionBoardIdList);
this.learningContentBoardService.remove(deleteWrapper1);
}
}
}
final LambdaUpdateWrapper<CopyrightOwnerVideoContentCat> updateWrapper1 = Wrappers.<CopyrightOwnerVideoContentCat>lambdaUpdate().eq(CopyrightOwnerVideoContentCat::getVideoContentCatId, id);
this.copyrightOwnerVideoContentCatService.remove(updateWrapper1);
final LambdaQueryWrapper<VideoContent> lambdaQueryWrapper = Wrappers.<VideoContent>lambdaQuery().eq(VideoContent::getVideoContentCatId, id).select(VideoContent::getId);
final List<String> videoContentIdList = this.videoContentService.listObjs(lambdaQueryWrapper, Object::toString);
this.videoContentTmpService.removeByIds(videoContentIdList);
final LambdaQueryWrapper<ExhibitionBoard> queryWrapper = Wrappers.<ExhibitionBoard>lambdaQuery().in(ExhibitionBoard::getVideoContentId, videoContentIdList).select(ExhibitionBoard::getId);
final List<String> ExhibitionBoardIdList = this.exhibitionBoardService.listObjs(queryWrapper, Object::toString);
this.exhibitionBoardService.removeByIds(ExhibitionBoardIdList);
// final LambdaQueryWrapper<CopyrightOwnerVideoContentCat> eq = Wrappers.<CopyrightOwnerVideoContentCat>lambdaQuery().eq(CopyrightOwnerVideoContentCat::getVideoContentCatId, id);
// final List<CopyrightOwnerVideoContentCat> list = this.copyrightOwnerVideoContentCatService.list(eq);
// final List<String> collect = list.stream().map(CopyrightOwnerVideoContentCat::getCopyrightOwnerId).distinct().collect(Collectors.toList());
......
......@@ -148,6 +148,19 @@ public class BaseController implements Serializable {
return map;
}
/**
* 返回失败
*
* @return map
*/
protected Map<String, Object> getFailResult(String code, String msg, Object obj) {
Map<String, Object> map = new LinkedHashMap<>();
map.put(RESULT_INFO_ENUM.RESULT_CODE.getKey(), code);
map.put(RESULT_INFO_ENUM.RESULT_MSG.getKey(), msg);
map.put(RESULT_INFO_ENUM.RESULT_BODY.getKey(), obj);
return map;
}
/**
* JSON 过滤相关字段
*
......
......@@ -9,8 +9,9 @@
<result column="mac" property="mac"/>
<result column="status" property="status"/>
<result column="area_id" property="areaId"/>
<result column="public_key" property="publicKey" />
<result column="private_key" property="privateKey" />
<result column="public_key" property="publicKey"/>
<result column="private_key" property="privateKey"/>
<result column="request_count" property="requestCount"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="organ_name" property="organName"/>
......@@ -22,7 +23,7 @@
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, organ_id, mac, status, area_id, public_key, private_key, create_time, update_time
id, organ_id, mac, status, area_id, public_key, private_key, request_count, create_time, update_time
</sql>
<select id="getList" resultMap="BaseResultMap">
......@@ -40,7 +41,8 @@
</select>
<select id="selectBoxPage" resultMap="BaseResultMap">
select b.id,b.organ_id,b.mac,b.status,b.area_id,b.private_key,b.create_time,b.update_time,u.user_name organ_name,a.full_name area_name,u.permanent permanent,
select b.id,b.organ_id,b.mac,b.status,b.area_id,b.create_time,b.update_time,u.user_name organ_name,a.full_name
area_name,u.permanent permanent,
u.effective_date effective_date,u.exired_date exired_date
from t_box_operation b
left join t_organ o on b.organ_id = o.id
......@@ -63,7 +65,7 @@
</select>
<select id="selectPageList" resultMap="BaseResultMap">
SELECT b.id,b.organ_id,b.mac,b.status,b.area_id,b.private_key,b.create_time,b.update_time,u.user_name organ_name
SELECT b.id,b.organ_id,b.mac,b.status,b.area_id,b.create_time,b.update_time,u.user_name organ_name
FROM t_box_operation b
left join t_organ r on r.id = b.organ_id
left join t_user u on u.org_id = b.organ_id and u.type = '3'
......
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