Commit c6e89626 authored by 赵啸非's avatar 赵啸非

添加目录字段

parent 1878a685
......@@ -15,52 +15,55 @@ import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
*
* 子证配置
*
* @author zxfei
* @date 2024-07-27
*/
* 子证配置
*
* @author zxfei
* @date 2024-07-27
*/
@RestController
@RequestMapping("certificate/document")
public class CertificateDocumentController extends BaseCRUDJsonBodyMappingController<CertificateDocumentService,CertificateDocumentEntity,Long> {
public class CertificateDocumentController extends BaseCRUDJsonBodyMappingController<CertificateDocumentService, CertificateDocumentEntity, Long> {
@Autowired
private CertificateChildService certificateChildService;
public CertificateDocumentController(){
super.setModuleDesc( "子证配置");
public CertificateDocumentController() {
super.setModuleDesc("子证配置");
}
@Override
protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "status", StatusEnum.getEnumMap());
this.addDict(model, "status", StatusEnum.getEnumMap());
super.init(model, context);
}
@Override
protected void doListBefore(CertificateDocumentEntity query, Map<String, Object> model, Context context) throws AppException {
if(!ObjectUtils.isEmpty(query.getCatalogId())){
if (!ObjectUtils.isEmpty(query.getCatalogId())) {
List<Long> documentIdList = certificateChildService.find(new CertificateChildQuery().catalogId(query.getCatalogId())).stream()
.map(CertificateChildEntity::getDocumentId).collect(Collectors.toList());
query.setIdList(documentIdList);
if (!ObjectUtils.isEmpty(documentIdList)) {
query.setIdList(documentIdList);
} else {
query.setIdList(Arrays.asList(-1L));
}
}
super.doListBefore(query, model, context);
}
@Override
protected void doListAfter(CertificateDocumentEntity query, List<CertificateDocumentEntity> list, Context context) throws AppException {
list.forEach(item->{
item.setFormContent("");
});
list.forEach(item -> {
item.setFormContent("");
});
super.doListAfter(query, list, context);
}
......
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