Commit 765ee98a authored by R10's avatar R10

智写-问数-下载

parent ab9772d0
package cn.com.poc.law.convert;
import cn.com.poc.law.model.BizAiLawyerWritingTemplateDownloadModel;
import cn.com.poc.law.entity.BizAiLawyerWritingTemplateDownloadEntity;
import cn.com.poc.law.dto.BizAiLawyerWritingTemplateDownloadDto;
public class BizAiLawyerWritingTemplateDownloadConvert {
public static BizAiLawyerWritingTemplateDownloadEntity modelToEntity(BizAiLawyerWritingTemplateDownloadModel model){
BizAiLawyerWritingTemplateDownloadEntity entity = new BizAiLawyerWritingTemplateDownloadEntity();
entity.setId(model.getId());
entity.setTemplateCode(model.getTemplateCode());
entity.setType(model.getType());
entity.setName(model.getName());
entity.setOption(model.getOption());
entity.setEntityClass(model.getEntityClass());
return entity;
}
public static BizAiLawyerWritingTemplateDownloadModel entityToModel(BizAiLawyerWritingTemplateDownloadEntity entity){
BizAiLawyerWritingTemplateDownloadModel model = new BizAiLawyerWritingTemplateDownloadModel();
model.setId(entity.getId());
model.setTemplateCode(entity.getTemplateCode());
model.setType(entity.getType());
model.setName(entity.getName());
model.setOption(entity.getOption());
model.setEntityClass(entity.getEntityClass());
return model;
}
public static BizAiLawyerWritingTemplateDownloadDto entityToDto(BizAiLawyerWritingTemplateDownloadEntity entity){
BizAiLawyerWritingTemplateDownloadDto dto = new BizAiLawyerWritingTemplateDownloadDto();
dto.setId(entity.getId());
dto.setTemplateCode(entity.getTemplateCode());
dto.setType(entity.getType());
dto.setName(entity.getName());
dto.setOption(entity.getOption());
dto.setEntityClass(entity.getEntityClass());
return dto;
}
public static BizAiLawyerWritingTemplateDownloadEntity dtoToEntity(BizAiLawyerWritingTemplateDownloadDto dto){
BizAiLawyerWritingTemplateDownloadEntity entity = new BizAiLawyerWritingTemplateDownloadEntity();
entity.setId(dto.getId());
entity.setTemplateCode(dto.getTemplateCode());
entity.setType(dto.getType());
entity.setName(dto.getName());
entity.setOption(dto.getOption());
entity.setEntityClass(dto.getEntityClass());
return entity;
}
}
\ No newline at end of file
package cn.com.poc.law.dto;
public class BizAiLawyerWritingTemplateDownloadDto {
private static final long serialVersionUID = 1L;
/** id
*
*/
private java.lang.Long id;
public java.lang.Long getId(){
return this.id;
}
public void setId(java.lang.Long id){
this.id = id;
}
/** template_code
*
*/
private java.lang.String templateCode;
public java.lang.String getTemplateCode(){
return this.templateCode;
}
public void setTemplateCode(java.lang.String templateCode){
this.templateCode = templateCode;
}
/** type
*
*/
private java.lang.String type;
public java.lang.String getType(){
return this.type;
}
public void setType(java.lang.String type){
this.type = type;
}
/** name
*
*/
private java.lang.String name;
public java.lang.String getName(){
return this.name;
}
public void setName(java.lang.String name){
this.name = name;
}
/** option
*
*/
private java.lang.String option;
public java.lang.String getOption(){
return this.option;
}
public void setOption(java.lang.String option){
this.option = option;
}
/** entity_class
*
*/
private java.lang.String entityClass;
public java.lang.String getEntityClass(){
return this.entityClass;
}
public void setEntityClass(java.lang.String entityClass){
this.entityClass = entityClass;
}
}
\ No newline at end of file
package cn.com.poc.law.entity;
public class BizAiLawyerWritingTemplateDownloadEntity {
private static final long serialVersionUID = 1L;
/** id
*
*/
private java.lang.Long id;
public java.lang.Long getId(){
return this.id;
}
public void setId(java.lang.Long id){
this.id = id;
}
/** template_code
*
*/
private java.lang.String templateCode;
public java.lang.String getTemplateCode(){
return this.templateCode;
}
public void setTemplateCode(java.lang.String templateCode){
this.templateCode = templateCode;
}
/** type
*
*/
private java.lang.String type;
public java.lang.String getType(){
return this.type;
}
public void setType(java.lang.String type){
this.type = type;
}
/** name
*
*/
private java.lang.String name;
public java.lang.String getName(){
return this.name;
}
public void setName(java.lang.String name){
this.name = name;
}
/** option
/** name
*
*/
private java.lang.String value;
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
/** option
*
*/
private java.lang.String option;
public java.lang.String getOption(){
return this.option;
}
public void setOption(java.lang.String option){
this.option = option;
}
/** entity_class
*
*/
private java.lang.String entityClass;
public java.lang.String getEntityClass(){
return this.entityClass;
}
public void setEntityClass(java.lang.String entityClass){
this.entityClass = entityClass;
}
}
\ No newline at end of file
......@@ -7,11 +7,11 @@ package cn.com.poc.law.entity.legislativeDocument;
*/
public class LegislativeDocumentResult {
CaseInfo caseInfo;
ConflictInfo conflictInfo;
SupplementaryInfo supplementaryInfo;
CaseContactInfo caseContactInfo;
ClientInfo clientInfo;
CaseInfo caseInfo = new CaseInfo();
ConflictInfo conflictInfo = new ConflictInfo();
SupplementaryInfo supplementaryInfo = new SupplementaryInfo();
CaseContactInfo caseContactInfo = new CaseContactInfo();
ClientInfo clientInfo = new ClientInfo();
String reply;
public CaseInfo getCaseInfo() {
......
package cn.com.poc.law.extractEntityStrategy;
import cn.com.poc.law.extractEntityStrategy.extractEntityType.MotorVehicleDrivingComplaint;
import cn.com.poc.law.extractEntityStrategy.extractEntityType.MotorVehicleDrivingComplaintType;
import cn.com.yict.framemax.core.exception.BusinessException;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
......@@ -15,7 +15,7 @@ public class LawyerTemplateExtractServiceBuilder implements ApplicationContextAw
public ExtractEntityStrategy getService(LawyerExtractTypeConstants.LawyerExtractTypeEnum type) throws Exception {
if (LawyerExtractTypeConstants.LawyerExtractTypeEnum.motorVehicleDrivingComplaint.name().equals(type.name())) {
return applicationContext.getBean(MotorVehicleDrivingComplaint.class);
return applicationContext.getBean(MotorVehicleDrivingComplaintType.class);
}
throw new BusinessException("选择模板异常!");
}
......
package cn.com.poc.law.extractEntityStrategy;
/**
* @Author:Roger Wu
* @name:TestEntity
* @Date:2025-08-15 23:38
*/
public class TestEntity {
private String type;
private String name;
private String value;
private String optionValue;
private String entityClass;
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getOptionValue() {
return optionValue;
}
public void setOptionValue(String optionValue) {
this.optionValue = optionValue;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public String getEntityClass() {
return entityClass;
}
public void setEntityClass(String entityClass) {
this.entityClass = entityClass;
}
}
......@@ -22,6 +22,9 @@ public class JacksonDateArrayDeSerializer extends JsonDeserializer<String> {
public String deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException {
//[]
String date = p.getText();
if (!date.contains("-")) {
return date;
}
try {
// 解析为 Date 对象
return String.valueOf(dateFormat.parse(date).getTime());
......
package cn.com.poc.law.model;
import java.io.Serializable;
import cn.com.yict.framemax.data.model.BaseModelClass;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Id;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
/**
* Model class for biz_ai_lawyer_writing_template_download
* 法律文书模板导出
*/
@Entity
@Table(name = "biz_ai_lawyer_writing_template_download")
@DynamicInsert
@DynamicUpdate
public class BizAiLawyerWritingTemplateDownloadModel extends BaseModelClass implements Serializable {
private static final long serialVersionUID = 1L;
/** id
*
*/
private java.lang.Long id;
@Column(name = "id",length = 19)
@Id @GeneratedValue(strategy = GenerationType.AUTO)
public java.lang.Long getId(){
return this.id;
}
public void setId(java.lang.Long id){
this.id = id;
super.addValidField("id");
}
/** template_code
*
*/
private java.lang.String templateCode;
@Column(name = "template_code",length = 100)
public java.lang.String getTemplateCode(){
return this.templateCode;
}
public void setTemplateCode(java.lang.String templateCode){
this.templateCode = templateCode;
super.addValidField("templateCode");
}
/** type
*
*/
private java.lang.String type;
@Column(name = "type",length = 255)
public java.lang.String getType(){
return this.type;
}
public void setType(java.lang.String type){
this.type = type;
super.addValidField("type");
}
/** name
*
*/
private java.lang.String name;
@Column(name = "name",length = 100)
public java.lang.String getName(){
return this.name;
}
public void setName(java.lang.String name){
this.name = name;
super.addValidField("name");
}
/** option
*
*/
private java.lang.String option;
@Column(name = "option",length = 100)
public java.lang.String getOption(){
return this.option;
}
public void setOption(java.lang.String option){
this.option = option;
super.addValidField("option");
}
/** entity_class
*
*/
private java.lang.String entityClass;
@Column(name = "entity_class",length = 255)
public java.lang.String getEntityClass(){
return this.entityClass;
}
public void setEntityClass(java.lang.String entityClass){
this.entityClass = entityClass;
super.addValidField("entityClass");
}
}
\ No newline at end of file
package cn.com.poc.law.repository;
import cn.com.yict.framemax.data.repository.Repository;
import cn.com.poc.law.model.BizAiLawyerWritingTemplateDownloadModel;
public interface BizAiLawyerWritingTemplateDownloadRepository extends Repository<BizAiLawyerWritingTemplateDownloadModel,java.lang.Long> {
}
\ No newline at end of file
package cn.com.poc.law.rest;
import cn.com.yict.framemax.core.rest.BaseRest;
import cn.com.poc.law.dto.BizAiLawyerWritingTemplateDownloadDto;
import cn.com.yict.framemax.data.model.PagingInfo;
import java.util.Collection;
import java.util.List;
import cn.com.yict.framemax.web.permission.Access;
import cn.com.yict.framemax.web.permission.Permission;
import org.springframework.web.bind.annotation.RequestBody;
public interface BizAiLawyerWritingTemplateDownloadRest extends BaseRest {
BizAiLawyerWritingTemplateDownloadDto getById(java.lang.Long id) throws Exception;
List<BizAiLawyerWritingTemplateDownloadDto> getList(BizAiLawyerWritingTemplateDownloadDto example,PagingInfo pagingInfo) throws Exception;
BizAiLawyerWritingTemplateDownloadDto save(BizAiLawyerWritingTemplateDownloadDto dto) throws Exception;
BizAiLawyerWritingTemplateDownloadDto update(BizAiLawyerWritingTemplateDownloadDto dto) throws Exception;
void deletedById(java.lang.Long id) throws Exception;
}
\ No newline at end of file
package cn.com.poc.law.rest.impl;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Component;
import cn.com.poc.law.rest.BizAiLawyerWritingTemplateDownloadRest;
import cn.com.poc.law.service.BizAiLawyerWritingTemplateDownloadService;
import cn.com.poc.law.dto.BizAiLawyerWritingTemplateDownloadDto;
import cn.com.poc.law.entity.BizAiLawyerWritingTemplateDownloadEntity;
import cn.com.yict.framemax.data.model.PagingInfo;
import cn.com.poc.law.convert.BizAiLawyerWritingTemplateDownloadConvert;
import java.util.stream.Collectors;
import org.springframework.util.Assert;
@Component
public class BizAiLawyerWritingTemplateDownloadRestImpl implements BizAiLawyerWritingTemplateDownloadRest {
@Resource
private BizAiLawyerWritingTemplateDownloadService service;
public BizAiLawyerWritingTemplateDownloadDto getById(java.lang.Long id) throws Exception{
Assert.notNull(id);
return BizAiLawyerWritingTemplateDownloadConvert.entityToDto(service.get(id));
}
public List<BizAiLawyerWritingTemplateDownloadDto> getList(BizAiLawyerWritingTemplateDownloadDto dto,PagingInfo pagingInfo) throws Exception{
return service
.findByExample(BizAiLawyerWritingTemplateDownloadConvert.dtoToEntity(dto),pagingInfo)
.stream()
.map(BizAiLawyerWritingTemplateDownloadConvert::entityToDto)
.collect(Collectors.toList());
}
public BizAiLawyerWritingTemplateDownloadDto save(BizAiLawyerWritingTemplateDownloadDto dto) throws Exception{
Assert.notNull(dto);
BizAiLawyerWritingTemplateDownloadEntity entity = BizAiLawyerWritingTemplateDownloadConvert.dtoToEntity(dto);
return BizAiLawyerWritingTemplateDownloadConvert.entityToDto(service.save(entity));
}
public BizAiLawyerWritingTemplateDownloadDto update(BizAiLawyerWritingTemplateDownloadDto dto) throws Exception{
Assert.notNull(dto);
BizAiLawyerWritingTemplateDownloadEntity entity = BizAiLawyerWritingTemplateDownloadConvert.dtoToEntity(dto);
return BizAiLawyerWritingTemplateDownloadConvert.entityToDto(service.update(entity));
}
public void deletedById(java.lang.Long id) throws Exception{
Assert.notNull(id);
service.deletedById(id);
}
}
\ No newline at end of file
package cn.com.poc.law.service;
import cn.com.yict.framemax.core.service.BaseService;
import cn.com.poc.law.entity.BizAiLawyerWritingTemplateDownloadEntity;
import cn.com.yict.framemax.data.model.PagingInfo;
import java.util.Collection;
import java.util.List;
public interface BizAiLawyerWritingTemplateDownloadService extends BaseService {
BizAiLawyerWritingTemplateDownloadEntity get(java.lang.Long id) throws Exception;
List<BizAiLawyerWritingTemplateDownloadEntity> findByExample(BizAiLawyerWritingTemplateDownloadEntity example,PagingInfo pagingInfo) throws Exception;
BizAiLawyerWritingTemplateDownloadEntity save(BizAiLawyerWritingTemplateDownloadEntity entity) throws Exception;
BizAiLawyerWritingTemplateDownloadEntity update(BizAiLawyerWritingTemplateDownloadEntity entity) throws Exception;
void deletedById(java.lang.Long id) throws Exception;
}
\ No newline at end of file
......@@ -154,9 +154,12 @@ public class BizAiLawyerWritingTemplateDataServiceImpl extends BaseServiceImpl
}
ExtractEntityStrategy extractEntityStrategy = LawyerTemplateExtractServiceBuilder.getService(LawyerExtractTypeConstants.LawyerExtractTypeEnum.get(models.get(0).getBizAiLawyerWritingTemplateCode()));
JsonUtils.deSerialize(models.get(0).getBizAiLawyerWritingTemplateData(), LegalTemplateDto.class);
// return extractEntityStrategy.downloadFile();
return extractEntityStrategy.downloadFile(JsonUtils.deSerialize(models.get(0).getBizAiLawyerWritingTemplateData(), LegalTemplateDto.class));
}
}
@Override
public TemplateDataDetailDto getTemplateDataDetail(String dialoguesId, Long userId, boolean ifException) throws Exception {
BizAiDialoguesEntity bizAiDialoguesEntity = new BizAiDialoguesEntity();
......
package cn.com.poc.law.service.impl;
import cn.com.yict.framemax.core.service.impl.BaseServiceImpl;
import cn.com.poc.law.service.BizAiLawyerWritingTemplateDownloadService;
import cn.com.poc.law.model.BizAiLawyerWritingTemplateDownloadModel;
import cn.com.poc.law.entity.BizAiLawyerWritingTemplateDownloadEntity;
import cn.com.poc.law.convert.BizAiLawyerWritingTemplateDownloadConvert;
import cn.com.poc.law.repository.BizAiLawyerWritingTemplateDownloadRepository;
import cn.com.yict.framemax.data.model.PagingInfo;
import org.springframework.stereotype.Service;
import org.apache.commons.collections4.CollectionUtils;
import java.util.ArrayList;
import java.util.stream.Collectors;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.util.Assert;
@Service
public class BizAiLawyerWritingTemplateDownloadServiceImpl extends BaseServiceImpl
implements BizAiLawyerWritingTemplateDownloadService {
@Resource
private BizAiLawyerWritingTemplateDownloadRepository repository;
public BizAiLawyerWritingTemplateDownloadEntity get(java.lang.Long id) throws Exception{
Assert.notNull(id);
BizAiLawyerWritingTemplateDownloadModel model = this.repository.get(id);
if (model == null){
return null;
}
return BizAiLawyerWritingTemplateDownloadConvert.modelToEntity(model);
}
public List<BizAiLawyerWritingTemplateDownloadEntity> findByExample(BizAiLawyerWritingTemplateDownloadEntity example,PagingInfo pagingInfo) throws Exception{
List<BizAiLawyerWritingTemplateDownloadEntity> result = new ArrayList<BizAiLawyerWritingTemplateDownloadEntity>();
BizAiLawyerWritingTemplateDownloadModel model = new BizAiLawyerWritingTemplateDownloadModel();
if (example != null){
model = BizAiLawyerWritingTemplateDownloadConvert.entityToModel(example);
}
List<BizAiLawyerWritingTemplateDownloadModel> models = this.repository.findByExample(model,pagingInfo);
if (CollectionUtils.isNotEmpty(models)) {
result = models.stream().map(BizAiLawyerWritingTemplateDownloadConvert::modelToEntity).collect(Collectors.toList());
}
return result;
}
public BizAiLawyerWritingTemplateDownloadEntity save(BizAiLawyerWritingTemplateDownloadEntity entity) throws Exception{
Assert.notNull(entity);
entity.setId(null);
BizAiLawyerWritingTemplateDownloadModel model = BizAiLawyerWritingTemplateDownloadConvert.entityToModel(entity);
BizAiLawyerWritingTemplateDownloadModel saveModel = this.repository.save(model);
return BizAiLawyerWritingTemplateDownloadConvert.modelToEntity(saveModel);
}
public BizAiLawyerWritingTemplateDownloadEntity update(BizAiLawyerWritingTemplateDownloadEntity entity) throws Exception{
Assert.notNull(entity);
Assert.notNull(entity.getId(),"update pk can not be null");
BizAiLawyerWritingTemplateDownloadModel model = this.repository.get(entity.getId());
if (entity.getTemplateCode() != null){
model.setTemplateCode(entity.getTemplateCode());
}
if (entity.getType() != null){
model.setType(entity.getType());
}
if (entity.getName() != null){
model.setName(entity.getName());
}
if (entity.getOption() != null){
model.setOption(entity.getOption());
}
if (entity.getEntityClass() != null){
model.setEntityClass(entity.getEntityClass());
}
BizAiLawyerWritingTemplateDownloadModel saveModel = this.repository.save(model);
return BizAiLawyerWritingTemplateDownloadConvert.modelToEntity(saveModel);
}
public void deletedById(java.lang.Long id) throws Exception{
Assert.notNull(id);
BizAiLawyerWritingTemplateDownloadModel model = this.repository.get(id);
if (model != null){
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment