Commit 7d179e72 authored by R10's avatar R10

智写-立案调查

parent ecc8c0c3
...@@ -28,6 +28,8 @@ public enum AiDialoguesTypeEnum { ...@@ -28,6 +28,8 @@ public enum AiDialoguesTypeEnum {
MEETING_ASSISTANT("meeting_assistant","会议助手"), MEETING_ASSISTANT("meeting_assistant","会议助手"),
LEGISLATIVE_DOCUMENT_WRITING("legislative_document_writing","立案调查"),
; ;
private final String type; private final String type;
......
...@@ -30,7 +30,7 @@ public final class JsonUtils { ...@@ -30,7 +30,7 @@ public final class JsonUtils {
* 转换Java Bean 为 json * 转换Java Bean 为 json
*/ */
public static String serialize(Object o) { public static String serialize(Object o) {
if(o ==null){ if (o == null) {
return null; return null;
} }
return JSON.serialize(o); return JSON.serialize(o);
...@@ -165,30 +165,32 @@ public final class JsonUtils { ...@@ -165,30 +165,32 @@ public final class JsonUtils {
* @return 合并后的 JSONObject * @return 合并后的 JSONObject
*/ */
public static JSONObject deepMerge(JSONObject source, JSONObject target) { public static JSONObject deepMerge(JSONObject source, JSONObject target) {
for (String key : source.keySet()) { if (source != null) {
Object valueA = source.get(key); for (String key : source.keySet()) {
Object valueB = target.get(key); Object valueA = source.get(key);
Object valueB = target.get(key);
// 情况1:A的值是嵌套对象
if (valueA instanceof JSONObject) { // 情况1:A的值是嵌套对象
if (valueB instanceof JSONObject) { if (valueA instanceof JSONObject) {
// 递归合并嵌套对象 if (valueB instanceof JSONObject) {
deepMerge((JSONObject) valueA, (JSONObject) valueB); // 递归合并嵌套对象
} else { deepMerge((JSONObject) valueA, (JSONObject) valueB);
// B中不存在或不是对象,直接覆盖 } else {
target.put(key, cloneJson(valueA)); // B中不存在或不是对象,直接覆盖
target.put(key, cloneJson(valueA));
}
} }
} // 情况2:A的值是数组
// 情况2:A的值是数组 else if (valueA instanceof JSONArray) {
else if (valueA instanceof JSONArray) { target.put(key, cloneJson(valueA)); // 数组直接覆盖
target.put(key, cloneJson(valueA)); // 数组直接覆盖 }
} // 情况3:A的值是基本类型
// 情况3:A的值是基本类型 else {
else { if (isNotEmpty(valueA)) {
if (isNotEmpty(valueA)) { target.put(key, valueA); // 非空时覆盖
target.put(key, valueA); // 非空时覆盖 } else if (!target.containsKey(key)) {
} else if (!target.containsKey(key)) { target.put(key, valueA); // B中不存在时添加
target.put(key, valueA); // B中不存在时添加 }
} }
} }
} }
......
package cn.com.poc.law.convert;
import cn.com.poc.law.model.BizAiLegislativeDocumentWritingModel;
import cn.com.poc.law.entity.BizAiLegislativeDocumentWritingEntity;
import cn.com.poc.law.dto.BizAiLegislativeDocumentWritingDto;
public class BizAiLegislativeDocumentWritingConvert {
public static BizAiLegislativeDocumentWritingEntity modelToEntity(BizAiLegislativeDocumentWritingModel model){
BizAiLegislativeDocumentWritingEntity entity = new BizAiLegislativeDocumentWritingEntity();
entity.setLegislativeDocumentWritingId(model.getLegislativeDocumentWritingId());
entity.setLegislativeDocumentWritingDialoguesId(model.getLegislativeDocumentWritingDialoguesId());
entity.setLegislativeDocumentWritingDialoguesData(model.getLegislativeDocumentWritingDialoguesData());
entity.setIsDeleted(model.getIsDeleted());
entity.setCreator(model.getCreator());
entity.setCreatedTime(model.getCreatedTime());
entity.setModifier(model.getModifier());
entity.setModifiedTime(model.getModifiedTime());
entity.setSysVersion(model.getSysVersion());
return entity;
}
public static BizAiLegislativeDocumentWritingModel entityToModel(BizAiLegislativeDocumentWritingEntity entity){
BizAiLegislativeDocumentWritingModel model = new BizAiLegislativeDocumentWritingModel();
model.setLegislativeDocumentWritingId(entity.getLegislativeDocumentWritingId());
model.setLegislativeDocumentWritingDialoguesId(entity.getLegislativeDocumentWritingDialoguesId());
model.setLegislativeDocumentWritingDialoguesData(entity.getLegislativeDocumentWritingDialoguesData());
model.setIsDeleted(entity.getIsDeleted());
model.setCreator(entity.getCreator());
model.setCreatedTime(entity.getCreatedTime());
model.setModifier(entity.getModifier());
model.setModifiedTime(entity.getModifiedTime());
model.setSysVersion(entity.getSysVersion());
return model;
}
public static BizAiLegislativeDocumentWritingDto entityToDto(BizAiLegislativeDocumentWritingEntity entity){
BizAiLegislativeDocumentWritingDto dto = new BizAiLegislativeDocumentWritingDto();
dto.setLegislativeDocumentWritingId(entity.getLegislativeDocumentWritingId());
dto.setLegislativeDocumentWritingDialoguesId(entity.getLegislativeDocumentWritingDialoguesId());
dto.setLegislativeDocumentWritingDialoguesData(entity.getLegislativeDocumentWritingDialoguesData());
dto.setIsDeleted(entity.getIsDeleted());
dto.setCreator(entity.getCreator());
dto.setCreatedTime(entity.getCreatedTime());
dto.setModifier(entity.getModifier());
dto.setModifiedTime(entity.getModifiedTime());
dto.setSysVersion(entity.getSysVersion());
return dto;
}
public static BizAiLegislativeDocumentWritingEntity dtoToEntity(BizAiLegislativeDocumentWritingDto dto){
BizAiLegislativeDocumentWritingEntity entity = new BizAiLegislativeDocumentWritingEntity();
entity.setLegislativeDocumentWritingId(dto.getLegislativeDocumentWritingId());
entity.setLegislativeDocumentWritingDialoguesId(dto.getLegislativeDocumentWritingDialoguesId());
entity.setLegislativeDocumentWritingDialoguesData(dto.getLegislativeDocumentWritingDialoguesData());
entity.setIsDeleted(dto.getIsDeleted());
entity.setCreator(dto.getCreator());
entity.setCreatedTime(dto.getCreatedTime());
entity.setModifier(dto.getModifier());
entity.setModifiedTime(dto.getModifiedTime());
entity.setSysVersion(dto.getSysVersion());
return entity;
}
}
\ No newline at end of file
package cn.com.poc.law.dto;
public class BizAiLegislativeDocumentWritingDto {
private static final long serialVersionUID = 1L;
/** legislative_document_writing_id
*
*/
private java.lang.Integer legislativeDocumentWritingId;
public java.lang.Integer getLegislativeDocumentWritingId(){
return this.legislativeDocumentWritingId;
}
public void setLegislativeDocumentWritingId(java.lang.Integer legislativeDocumentWritingId){
this.legislativeDocumentWritingId = legislativeDocumentWritingId;
}
/** legislative_document_writing_dialogues_id
*对话id
*/
private java.lang.String legislativeDocumentWritingDialoguesId;
public java.lang.String getLegislativeDocumentWritingDialoguesId(){
return this.legislativeDocumentWritingDialoguesId;
}
public void setLegislativeDocumentWritingDialoguesId(java.lang.String legislativeDocumentWritingDialoguesId){
this.legislativeDocumentWritingDialoguesId = legislativeDocumentWritingDialoguesId;
}
/** legislative_document_writing_dialogues_data
*对话识别的实体数据
*/
private java.lang.String legislativeDocumentWritingDialoguesData;
public java.lang.String getLegislativeDocumentWritingDialoguesData(){
return this.legislativeDocumentWritingDialoguesData;
}
public void setLegislativeDocumentWritingDialoguesData(java.lang.String legislativeDocumentWritingDialoguesData){
this.legislativeDocumentWritingDialoguesData = legislativeDocumentWritingDialoguesData;
}
/** is_deleted
*是否删除 Y 是 N 否
*/
private java.lang.String isDeleted;
public java.lang.String getIsDeleted(){
return this.isDeleted;
}
public void setIsDeleted(java.lang.String isDeleted){
this.isDeleted = isDeleted;
}
/** CREATOR
*创建人
*/
private java.lang.String creator;
public java.lang.String getCreator(){
return this.creator;
}
public void setCreator(java.lang.String creator){
this.creator = creator;
}
/** CREATED_TIME
*创建时间
*/
private java.util.Date createdTime;
public java.util.Date getCreatedTime(){
return this.createdTime;
}
public void setCreatedTime(java.util.Date createdTime){
this.createdTime = createdTime;
}
/** MODIFIER
*修改人
*/
private java.lang.String modifier;
public java.lang.String getModifier(){
return this.modifier;
}
public void setModifier(java.lang.String modifier){
this.modifier = modifier;
}
/** MODIFIED_TIME
*修改时间
*/
private java.util.Date modifiedTime;
public java.util.Date getModifiedTime(){
return this.modifiedTime;
}
public void setModifiedTime(java.util.Date modifiedTime){
this.modifiedTime = modifiedTime;
}
/** SYS_VERSION
*乐观锁,版本号
*/
private java.lang.Integer sysVersion;
public java.lang.Integer getSysVersion(){
return this.sysVersion;
}
public void setSysVersion(java.lang.Integer sysVersion){
this.sysVersion = sysVersion;
}
}
\ No newline at end of file
...@@ -6,7 +6,6 @@ package cn.com.poc.law.entity; ...@@ -6,7 +6,6 @@ package cn.com.poc.law.entity;
* @Date:2025-08-01 10:43 * @Date:2025-08-01 10:43
*/ */
public class Agent { public class Agent {
private String hasAgentY; private String hasAgentY;
private String agentName; private String agentName;
private String agentUnit; private String agentUnit;
......
package cn.com.poc.law.entity;
public class BizAiLegislativeDocumentWritingEntity {
private static final long serialVersionUID = 1L;
/** legislative_document_writing_id
*
*/
private java.lang.Integer legislativeDocumentWritingId;
public java.lang.Integer getLegislativeDocumentWritingId(){
return this.legislativeDocumentWritingId;
}
public void setLegislativeDocumentWritingId(java.lang.Integer legislativeDocumentWritingId){
this.legislativeDocumentWritingId = legislativeDocumentWritingId;
}
/** legislative_document_writing_dialogues_id
*对话id
*/
private java.lang.String legislativeDocumentWritingDialoguesId;
public java.lang.String getLegislativeDocumentWritingDialoguesId(){
return this.legislativeDocumentWritingDialoguesId;
}
public void setLegislativeDocumentWritingDialoguesId(java.lang.String legislativeDocumentWritingDialoguesId){
this.legislativeDocumentWritingDialoguesId = legislativeDocumentWritingDialoguesId;
}
/** legislative_document_writing_dialogues_data
*对话识别的实体数据
*/
private java.lang.String legislativeDocumentWritingDialoguesData;
public java.lang.String getLegislativeDocumentWritingDialoguesData(){
return this.legislativeDocumentWritingDialoguesData;
}
public void setLegislativeDocumentWritingDialoguesData(java.lang.String legislativeDocumentWritingDialoguesData){
this.legislativeDocumentWritingDialoguesData = legislativeDocumentWritingDialoguesData;
}
/** is_deleted
*是否删除 Y 是 N 否
*/
private java.lang.String isDeleted;
public java.lang.String getIsDeleted(){
return this.isDeleted;
}
public void setIsDeleted(java.lang.String isDeleted){
this.isDeleted = isDeleted;
}
/** CREATOR
*创建人
*/
private java.lang.String creator;
public java.lang.String getCreator(){
return this.creator;
}
public void setCreator(java.lang.String creator){
this.creator = creator;
}
/** CREATED_TIME
*创建时间
*/
private java.util.Date createdTime;
public java.util.Date getCreatedTime(){
return this.createdTime;
}
public void setCreatedTime(java.util.Date createdTime){
this.createdTime = createdTime;
}
/** MODIFIER
*修改人
*/
private java.lang.String modifier;
public java.lang.String getModifier(){
return this.modifier;
}
public void setModifier(java.lang.String modifier){
this.modifier = modifier;
}
/** MODIFIED_TIME
*修改时间
*/
private java.util.Date modifiedTime;
public java.util.Date getModifiedTime(){
return this.modifiedTime;
}
public void setModifiedTime(java.util.Date modifiedTime){
this.modifiedTime = modifiedTime;
}
/** SYS_VERSION
*乐观锁,版本号
*/
private java.lang.Integer sysVersion;
public java.lang.Integer getSysVersion(){
return this.sysVersion;
}
public void setSysVersion(java.lang.Integer sysVersion){
this.sysVersion = sysVersion;
}
}
\ No newline at end of file
package cn.com.poc.law.entity.LegislativeDocument;
/**
* @Author:Roger Wu
* @name:CaseContactInfo
* @Date:2025-08-12 18:53
*/
public class CaseContactInfo {
String name;
String position;
String email;
String phone;
String mobilePhone;
String fax;
String remarks;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPosition() {
return position;
}
public void setPosition(String position) {
this.position = position;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getMobilePhone() {
return mobilePhone;
}
public void setMobilePhone(String mobilePhone) {
this.mobilePhone = mobilePhone;
}
public String getFax() {
return fax;
}
public void setFax(String fax) {
this.fax = fax;
}
public String getRemarks() {
return remarks;
}
public void setRemarks(String remarks) {
this.remarks = remarks;
}
}
package cn.com.poc.law.entity.LegislativeDocument;
/**
* @Author:Roger Wu
* @name:CaseInfo
* @Date:2025-08-12 18:50
*/
public class CaseInfo {
private String caseType;
private String caseStage;
private String caseSummary;
public String getCaseType() {
return caseType;
}
public void setCaseType(String caseType) {
this.caseType = caseType;
}
public String getCaseStage() {
return caseStage;
}
public void setCaseStage(String caseStage) {
this.caseStage = caseStage;
}
public String getCaseSummary() {
return caseSummary;
}
public void setCaseSummary(String caseSummary) {
this.caseSummary = caseSummary;
}
}
package cn.com.poc.law.entity.LegislativeDocument;
/**
* @Author:Roger Wu
* @name:ClientInfo
* @Date:2025-08-12 18:26
*/
public class ClientInfo {
String name;
String nameEn;
String clientType;
String industry;
String address;
String countryRegion;
String isOverseas;
String postalCode;
String website;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getNameEn() {
return nameEn;
}
public void setNameEn(String nameEn) {
this.nameEn = nameEn;
}
public String getClientType() {
return clientType;
}
public void setClientType(String clientType) {
this.clientType = clientType;
}
public String getIndustry() {
return industry;
}
public void setIndustry(String industry) {
this.industry = industry;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getCountryRegion() {
return countryRegion;
}
public void setCountryRegion(String countryRegion) {
this.countryRegion = countryRegion;
}
public String getIsOverseas() {
return isOverseas;
}
public void setIsOverseas(String isOverseas) {
this.isOverseas = isOverseas;
}
public String getPostalCode() {
return postalCode;
}
public void setPostalCode(String postalCode) {
this.postalCode = postalCode;
}
public String getWebsite() {
return website;
}
public void setWebsite(String website) {
this.website = website;
}
}
package cn.com.poc.law.entity.LegislativeDocument;
/**
* @Author:Roger Wu
* @name:ConflictInfo
* @Date:2025-08-12 18:52
*/
public class ConflictInfo {
String partyCategory;
String entityType;
String nameCn;
String nameEn;
String contactPerson;
String idCardNumber;
String phone;
public String getPartyCategory() {
return partyCategory;
}
public void setPartyCategory(String partyCategory) {
this.partyCategory = partyCategory;
}
public String getEntityType() {
return entityType;
}
public void setEntityType(String entityType) {
this.entityType = entityType;
}
public String getNameCn() {
return nameCn;
}
public void setNameCn(String nameCn) {
this.nameCn = nameCn;
}
public String getNameEn() {
return nameEn;
}
public void setNameEn(String nameEn) {
this.nameEn = nameEn;
}
public String getContactPerson() {
return contactPerson;
}
public void setContactPerson(String contactPerson) {
this.contactPerson = contactPerson;
}
public String getIdCardNumber() {
return idCardNumber;
}
public void setIdCardNumber(String idCardNumber) {
this.idCardNumber = idCardNumber;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
}
package cn.com.poc.law.entity.LegislativeDocument;
/**
* @Author:Roger Wu
* @name:LegislativeDocumentEntity
* @Date:2025-08-12 18:22
*/
public class LegislativeDocumentEntity {
CaseInfo caseInfo;
ConflictInfo conflictInfo;
RepresentativeInfo representativeInfo;
ClientInfo info;
CaseContactInfo caseContactInfo;
ClientInfo clientInfo;
String reply;
public ClientInfo getClientInfo() {
return clientInfo;
}
public void setClientInfo(ClientInfo clientInfo) {
this.clientInfo = clientInfo;
}
public String getReply() {
return reply;
}
public void setReply(String reply) {
this.reply = reply;
}
public ClientInfo getInfo() {
return info;
}
public void setInfo(ClientInfo info) {
this.info = info;
}
public CaseInfo getCaseInfo() {
return caseInfo;
}
public void setCaseInfo(CaseInfo caseInfo) {
this.caseInfo = caseInfo;
}
public ConflictInfo getConflictInfo() {
return conflictInfo;
}
public void setConflictInfo(ConflictInfo conflictInfo) {
this.conflictInfo = conflictInfo;
}
public RepresentativeInfo getRepresentativeInfo() {
return representativeInfo;
}
public void setRepresentativeInfo(RepresentativeInfo representativeInfo) {
this.representativeInfo = representativeInfo;
}
public CaseContactInfo getCaseContactInfo() {
return caseContactInfo;
}
public void setCaseContactInfo(CaseContactInfo caseContactInfo) {
this.caseContactInfo = caseContactInfo;
}
}
package cn.com.poc.law.entity.LegislativeDocument;
/**
* @Author:Roger Wu
* @name:RepresentativeInfo
* @Date:2025-08-12 18:28
*/
public class RepresentativeInfo {
String representativeType;
String title;
String name;
String phone;
String fax;
public String getRepresentativeType() {
return representativeType;
}
public void setRepresentativeType(String representativeType) {
this.representativeType = representativeType;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getFax() {
return fax;
}
public void setFax(String fax) {
this.fax = fax;
}
}
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.Version;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
/**
* Model class for biz_ai_legislative_document_writing
* 智能写作立案调查
*/
@Entity
@Table(name = "biz_ai_legislative_document_writing")
@DynamicInsert
@DynamicUpdate
public class BizAiLegislativeDocumentWritingModel extends BaseModelClass implements Serializable {
private static final long serialVersionUID = 1L;
/** legislative_document_writing_id
*
*/
private java.lang.Integer legislativeDocumentWritingId;
@Column(name = "legislative_document_writing_id",length = 10)
@Id @GeneratedValue(strategy = GenerationType.AUTO)
public java.lang.Integer getLegislativeDocumentWritingId(){
return this.legislativeDocumentWritingId;
}
public void setLegislativeDocumentWritingId(java.lang.Integer legislativeDocumentWritingId){
this.legislativeDocumentWritingId = legislativeDocumentWritingId;
super.addValidField("legislativeDocumentWritingId");
}
/** legislative_document_writing_dialogues_id
*对话id
*/
private java.lang.String legislativeDocumentWritingDialoguesId;
@Column(name = "legislative_document_writing_dialogues_id",length = 255)
public java.lang.String getLegislativeDocumentWritingDialoguesId(){
return this.legislativeDocumentWritingDialoguesId;
}
public void setLegislativeDocumentWritingDialoguesId(java.lang.String legislativeDocumentWritingDialoguesId){
this.legislativeDocumentWritingDialoguesId = legislativeDocumentWritingDialoguesId;
super.addValidField("legislativeDocumentWritingDialoguesId");
}
/** legislative_document_writing_dialogues_data
*对话识别的实体数据
*/
private java.lang.String legislativeDocumentWritingDialoguesData;
@Column(name = "legislative_document_writing_dialogues_data",length = 255)
public java.lang.String getLegislativeDocumentWritingDialoguesData(){
return this.legislativeDocumentWritingDialoguesData;
}
public void setLegislativeDocumentWritingDialoguesData(java.lang.String legislativeDocumentWritingDialoguesData){
this.legislativeDocumentWritingDialoguesData = legislativeDocumentWritingDialoguesData;
super.addValidField("legislativeDocumentWritingDialoguesData");
}
/** is_deleted
*是否删除 Y 是 N 否
*/
private java.lang.String isDeleted;
@Column(name = "is_deleted",length = 1)
public java.lang.String getIsDeleted(){
return this.isDeleted;
}
public void setIsDeleted(java.lang.String isDeleted){
this.isDeleted = isDeleted;
super.addValidField("isDeleted");
}
/** CREATOR
*创建人
*/
private java.lang.String creator;
@Column(name = "CREATOR",length = 50)
public java.lang.String getCreator(){
return this.creator;
}
public void setCreator(java.lang.String creator){
this.creator = creator;
super.addValidField("creator");
}
/** CREATED_TIME
*创建时间
*/
private java.util.Date createdTime;
@Column(name = "CREATED_TIME",length = 19)
public java.util.Date getCreatedTime(){
return this.createdTime;
}
public void setCreatedTime(java.util.Date createdTime){
this.createdTime = createdTime;
super.addValidField("createdTime");
}
/** MODIFIER
*修改人
*/
private java.lang.String modifier;
@Column(name = "MODIFIER",length = 50)
public java.lang.String getModifier(){
return this.modifier;
}
public void setModifier(java.lang.String modifier){
this.modifier = modifier;
super.addValidField("modifier");
}
/** MODIFIED_TIME
*修改时间
*/
private java.util.Date modifiedTime;
@Column(name = "MODIFIED_TIME",length = 19)
public java.util.Date getModifiedTime(){
return this.modifiedTime;
}
public void setModifiedTime(java.util.Date modifiedTime){
this.modifiedTime = modifiedTime;
super.addValidField("modifiedTime");
}
/** SYS_VERSION
*乐观锁,版本号
*/
private java.lang.Integer sysVersion;
@Column(name = "SYS_VERSION",length = 10)
@Version
public java.lang.Integer getSysVersion(){
return this.sysVersion;
}
public void setSysVersion(java.lang.Integer sysVersion){
this.sysVersion = sysVersion;
super.addValidField("sysVersion");
}
}
\ 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.BizAiLegislativeDocumentWritingModel;
public interface BizAiLegislativeDocumentWritingRepository extends Repository<BizAiLegislativeDocumentWritingModel,java.lang.Integer> {
}
\ No newline at end of file
package cn.com.poc.law.rest;
import cn.com.poc.law.dto.AiLawDialoguesDto;
import cn.com.poc.law.entity.LegislativeDocument.LegislativeDocumentEntity;
import cn.com.yict.framemax.core.rest.BaseRest;
import cn.com.yict.framemax.web.permission.Access;
import cn.com.yict.framemax.web.permission.Permission;
import org.springframework.web.bind.annotation.RequestBody;
@Permission(Access.Safety)
public interface BizAiLegislativeDocumentWritingRest extends BaseRest {
/**
* 立案调查保存
*
* @param dto
* @return
*/
LegislativeDocumentEntity legislativeApply(@RequestBody AiLawDialoguesDto dto) throws Exception;
}
\ No newline at end of file
package cn.com.poc.law.rest.impl;
import cn.com.poc.common.utils.BlContext;
import cn.com.poc.law.dto.AiLawDialoguesDto;
import cn.com.poc.law.entity.LegislativeDocument.LegislativeDocumentEntity;
import cn.com.poc.law.rest.BizAiLegislativeDocumentWritingRest;
import cn.com.poc.law.service.BizAiLegislativeDocumentWritingService;
import cn.com.poc.support.security.oauth.entity.UserBaseEntity;
import cn.com.yict.framemax.core.exception.BusinessException;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
@Component
public class BizAiLegislativeDocumentWritingRestImpl implements BizAiLegislativeDocumentWritingRest {
@Resource
private BizAiLegislativeDocumentWritingService service;
/**
* 立案调查保存
*
* @param dto
* @return
*/
@Override
public LegislativeDocumentEntity legislativeApply(AiLawDialoguesDto dto) throws Exception {
UserBaseEntity userBaseEntity = BlContext.getCurrentUserNotException();
if (userBaseEntity == null) {
throw new BusinessException("用户未登录");
}
return service.call(dto.getDialoguesId(), dto.getInput(), dto.getFileUrl(), userBaseEntity.getUserId());
}
}
\ No newline at end of file
package cn.com.poc.law.service;
import cn.com.poc.law.entity.LegislativeDocument.LegislativeDocumentEntity;
import cn.com.yict.framemax.core.service.BaseService;
import cn.com.poc.law.entity.BizAiLegislativeDocumentWritingEntity;
import cn.com.yict.framemax.data.model.PagingInfo;
import java.util.List;
public interface BizAiLegislativeDocumentWritingService extends BaseService {
BizAiLegislativeDocumentWritingEntity get(java.lang.Integer id) throws Exception;
List<BizAiLegislativeDocumentWritingEntity> findByExample(BizAiLegislativeDocumentWritingEntity example,PagingInfo pagingInfo) throws Exception;
BizAiLegislativeDocumentWritingEntity save(BizAiLegislativeDocumentWritingEntity entity) throws Exception;
BizAiLegislativeDocumentWritingEntity update(BizAiLegislativeDocumentWritingEntity entity) throws Exception;
void deletedById(java.lang.Integer id) throws Exception;
LegislativeDocumentEntity call(String dialoguesId, String input, String fileUrl, Long userId) throws Exception;
}
\ No newline at end of file
...@@ -13,6 +13,7 @@ import cn.com.poc.common.constant.CommonConstant; ...@@ -13,6 +13,7 @@ import cn.com.poc.common.constant.CommonConstant;
import cn.com.poc.common.utils.DocumentLoad; import cn.com.poc.common.utils.DocumentLoad;
import cn.com.poc.common.utils.JsonUtils; import cn.com.poc.common.utils.JsonUtils;
import cn.com.poc.common.utils.SSEUtil; import cn.com.poc.common.utils.SSEUtil;
import cn.com.poc.law.dto.TemplateDataDetailDto;
import cn.com.poc.law.entity.BizAiLawyerWritingTemplateDataEntity; import cn.com.poc.law.entity.BizAiLawyerWritingTemplateDataEntity;
import cn.com.poc.law.extractEntityStrategy.ExtractEntityStrategy; import cn.com.poc.law.extractEntityStrategy.ExtractEntityStrategy;
import cn.com.poc.law.extractEntityStrategy.LawyerExtractTypeConstants; import cn.com.poc.law.extractEntityStrategy.LawyerExtractTypeConstants;
...@@ -36,6 +37,12 @@ import cn.com.poc.thirdparty.resource.demand.ai.function.web_seach.WebSearchFunc ...@@ -36,6 +37,12 @@ import cn.com.poc.thirdparty.resource.demand.ai.function.web_seach.WebSearchFunc
import cn.com.poc.thirdparty.service.LLMService; import cn.com.poc.thirdparty.service.LLMService;
import cn.com.poc.writing.dto.AiWritingTitleGenerationDto; import cn.com.poc.writing.dto.AiWritingTitleGenerationDto;
import cn.com.yict.framemax.core.exception.BusinessException; import cn.com.yict.framemax.core.exception.BusinessException;
import cn.com.yict.framemax.core.utils.JSON;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.JSONPObject;
import com.alibaba.fastjson.serializer.JSONObjectCodec;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -46,6 +53,8 @@ import javax.annotation.Resource; ...@@ -46,6 +53,8 @@ import javax.annotation.Resource;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.lang.reflect.Field;
import java.lang.reflect.Type;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -225,18 +234,16 @@ public class AiLawServiceImpl implements AiLawService { ...@@ -225,18 +234,16 @@ public class AiLawServiceImpl implements AiLawService {
ExtractEntityStrategy extractEntityStrategy = LawyerTemplateExtractServiceBuilder.getService(LawyerExtractTypeConstants.LawyerExtractTypeEnum.get(templateCode)); ExtractEntityStrategy extractEntityStrategy = LawyerTemplateExtractServiceBuilder.getService(LawyerExtractTypeConstants.LawyerExtractTypeEnum.get(templateCode));
LegalTemplateDto legalTemplateDto = extractEntityStrategy.extractEntity(input + fileContent); LegalTemplateDto legalTemplateDto = extractEntityStrategy.extractEntity(input + fileContent);
LegalTemplateDto returnLegalTemplateDto = new LegalTemplateDto(); LegalTemplateDto returnLegalTemplateDto = legalTemplateDto;
if (!ifCover) { if (!ifCover) {
List<AgentApplicationDialoguesRecordQueryItem> dialogueRecordList = bizAgentApplicationDialoguesRecordService.getDialogueRecord(aiDialoguesEntity.getDialoguesId(), null); TemplateDataDetailDto templateDataDetail = bizAiLawyerWritingTemplateDataService.getTemplateDataDetail(dialoguesId, userId);
if (CollectionUtils.isNotEmpty(dialogueRecordList)) { LegalTemplateDto oldLegalTemplateDto = templateDataDetail.getLegalTemplateDto();
AgentApplicationDialoguesRecordQueryItem agentApplicationDialoguesRecordQueryItem = dialogueRecordList.get(0); JsonUtils.deepMerge(new JSONObject().getJSONObject(JsonUtils.serialize(legalTemplateDto)),new JSONObject().getJSONObject(JsonUtils.serialize(oldLegalTemplateDto)));
//TODO: legalTemplateDto returnLegalTemplateDto = oldLegalTemplateDto;
returnLegalTemplateDto = coverUtils(legalTemplateDto, agentApplicationDialoguesRecordQueryItem);
}
} }
long inputTimestamp = System.currentTimeMillis(); long inputTimestamp = System.currentTimeMillis();
//保存对话 // 保存对话
// 保存用户输入记录 // 保存用户输入记录
BizAgentApplicationDialoguesRecordEntity inputRecord = new BizAgentApplicationDialoguesRecordEntity(); BizAgentApplicationDialoguesRecordEntity inputRecord = new BizAgentApplicationDialoguesRecordEntity();
inputRecord.setMemberId(userId); inputRecord.setMemberId(userId);
...@@ -260,8 +267,7 @@ public class AiLawServiceImpl implements AiLawService { ...@@ -260,8 +267,7 @@ public class AiLawServiceImpl implements AiLawService {
//保存多一份数据id表 //保存多一份数据id表
BizAiLawyerWritingTemplateDataEntity bizAiLawyerWritingTemplateDataEntity = new BizAiLawyerWritingTemplateDataEntity(); BizAiLawyerWritingTemplateDataEntity bizAiLawyerWritingTemplateDataEntity = new BizAiLawyerWritingTemplateDataEntity();
bizAiLawyerWritingTemplateDataEntity.setBizAiLawyerWritingTemplateDialoguesId(dialoguesId); bizAiLawyerWritingTemplateDataEntity.setBizAiLawyerWritingTemplateDialoguesId(dialoguesId);
//TODO bizAiLawyerWritingTemplateDataEntity.setBizAiLawyerWritingTemplateData(JsonUtils.serialize(returnLegalTemplateDto));
bizAiLawyerWritingTemplateDataEntity.setBizAiLawyerWritingTemplateData(JsonUtils.serialize(legalTemplateDto));
bizAiLawyerWritingTemplateDataEntity.setBizAiLawyerWritingTemplateDialoguesRecordId(save.getId()); bizAiLawyerWritingTemplateDataEntity.setBizAiLawyerWritingTemplateDialoguesRecordId(save.getId());
bizAiLawyerWritingTemplateDataEntity.setBizAiLawyerWritingTemplateCode(templateCode); bizAiLawyerWritingTemplateDataEntity.setBizAiLawyerWritingTemplateCode(templateCode);
bizAiLawyerWritingTemplateDataService.save(bizAiLawyerWritingTemplateDataEntity); bizAiLawyerWritingTemplateDataService.save(bizAiLawyerWritingTemplateDataEntity);
...@@ -274,17 +280,11 @@ public class AiLawServiceImpl implements AiLawService { ...@@ -274,17 +280,11 @@ public class AiLawServiceImpl implements AiLawService {
return templateCallDto; return templateCallDto;
} }
private LegalTemplateDto coverUtils(LegalTemplateDto legalTemplateDto, AgentApplicationDialoguesRecordQueryItem agentApplicationDialoguesRecordQueryItem) { // private LegalTemplateDto coverUtils(String templateCode, LegalTemplateDto legalTemplateDto, LegalTemplateDto legalTemplateDto) throws IOException {
if (legalTemplateDto == null || agentApplicationDialoguesRecordQueryItem == null) { //
return legalTemplateDto; // BeanUtil.copyProperties(legalTemplateDto,oldLegalTemplateDto,CopyOptions.create().ignoreNullValue());
} // return oldLegalTemplateDto;
// legalTemplateDto. // }
return legalTemplateDto;
}
private List<Message> buildMessages(String dialogsId, Long userId, String input, String fileUrl, List<KnowledgeContentResult> knowledgeContentResults, ToolFunction toolFunction) throws Exception { private List<Message> buildMessages(String dialogsId, Long userId, String input, String fileUrl, List<KnowledgeContentResult> knowledgeContentResults, ToolFunction toolFunction) throws Exception {
......
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