Commit bd61062e authored by jennie chen's avatar jennie chen

1.配置【已发布的应用】发布至【应用广场】

2.获取【应用广场】的应用列表
3.收藏/取消收藏应用
parent 32665adf
package cn.com.poc.agent_application.aggregate;
public interface AgentApplicationMallService {
/**
* 收藏/取消收藏应用
*
* @param agentMallId 应用广场中的id
* */
void collectOrCancelAgentInMall(Integer agentMallId) throws Exception;
}
package cn.com.poc.agent_application.aggregate.impl;
import cn.com.poc.agent_application.aggregate.AgentApplicationMallService;
import cn.com.poc.agent_application.entity.BizAgentApplicationMallEntity;
import cn.com.poc.agent_application.entity.BizMemberAgentApplicationCollectEntity;
import cn.com.poc.agent_application.service.BizAgentApplicationMallService;
import cn.com.poc.agent_application.service.BizMemberAgentApplicationCollectService;
import cn.com.poc.common.constant.CommonConstant;
import cn.com.poc.common.utils.BlContext;
import cn.com.poc.support.security.oauth.entity.UserBaseEntity;
import cn.com.yict.framemax.core.exception.BusinessException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
@Service
public class AgentApplicationMallServiceImpl implements AgentApplicationMallService {
@Resource
private BizAgentApplicationMallService bizAgentApplicationMallService;
@Resource
private BizMemberAgentApplicationCollectService bizMemberAgentApplicationCollectService;
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
@Override
public void collectOrCancelAgentInMall(Integer agentMallId) throws Exception {
UserBaseEntity userBaseEntity = BlContext.getCurrentUserNotException();
if (userBaseEntity == null) {
throw new BusinessException("用户未登录");
}
// todo 先判断当前应用被收藏了吗
BizMemberAgentApplicationCollectEntity collectEntity = bizMemberAgentApplicationCollectService.getByAgentMallId(agentMallId);
BizAgentApplicationMallEntity mallEntity = bizAgentApplicationMallService.get(agentMallId);
if(mallEntity == null){
throw new BusinessException("应用不存在");
}
if(collectEntity == null || CommonConstant.IsDeleted.N.equals(collectEntity.getIsCollect())){ //如果没被收藏
// 收藏该应用
// 说明从来没收藏过
if(collectEntity == null){
// todo 在用户收藏表中添加数据
BizMemberAgentApplicationCollectEntity entity = new BizMemberAgentApplicationCollectEntity();
entity.setIsCollect(CommonConstant.IsDeleted.Y);
entity.setMemberId(userBaseEntity.getUserId().intValue());
entity.setAgentMallId(agentMallId);
bizMemberAgentApplicationCollectService.save(entity);
}else{ // 说明之前收藏过,则只需要做个修改
collectEntity.setIsCollect(CommonConstant.IsDeleted.Y);
bizMemberAgentApplicationCollectService.update(collectEntity);
}
// todo 在应用广场的应用中 添加收藏数
mallEntity.setCollectNumber(mallEntity.getCollectNumber() + 1);
}else {
// 取消收藏该应用
collectEntity.setIsCollect(CommonConstant.IsDeleted.N);
bizMemberAgentApplicationCollectService.update(collectEntity);
// todo 在应用广场的应用中 取消收藏数
mallEntity.setCollectNumber(mallEntity.getCollectNumber() - 1);
}
bizAgentApplicationMallService.update(mallEntity);
}
}
package cn.com.poc.agent_application.convert;
import cn.com.poc.agent_application.domain.AgentApplicationBaseInfo;
import cn.com.poc.agent_application.domain.AgentApplicationCommConfig;
import cn.com.poc.agent_application.domain.AgentApplicationCommModelConfig;
import cn.com.poc.agent_application.domain.AgentApplicationKnowledgeConfig;
import cn.com.poc.agent_application.dto.BizAgentApplicationPublishDto;
import cn.com.poc.agent_application.entity.BizAgentApplicationPublishEntity;
import cn.com.poc.agent_application.model.BizAgentApplicationMallModel;
import cn.com.poc.agent_application.entity.BizAgentApplicationMallEntity;
import cn.com.poc.agent_application.dto.BizAgentApplicationMallDto;
import cn.com.poc.agent_application.service.BizAgentApplicationPublishService;
import cn.com.poc.agent_application.service.impl.BizAgentApplicationPublishServiceImpl;
import cn.com.poc.common.utils.SpringUtils;
public class BizAgentApplicationMallConvert {
public static BizAgentApplicationMallEntity modelToEntity(BizAgentApplicationMallModel model){
BizAgentApplicationMallEntity entity = new BizAgentApplicationMallEntity();
entity.setId(model.getId());
entity.setAgentPublishId(model.getAgentPublishId());
entity.setAgentType(model.getAgentType());
entity.setCollectNumber(model.getCollectNumber());
entity.setClickNumber(model.getClickNumber());
entity.setIsCopy(model.getIsCopy());
return entity;
}
public static BizAgentApplicationMallModel entityToModel(BizAgentApplicationMallEntity entity){
BizAgentApplicationMallModel model = new BizAgentApplicationMallModel();
model.setId(entity.getId());
model.setAgentPublishId(entity.getAgentPublishId());
model.setAgentType(entity.getAgentType());
model.setCollectNumber(entity.getCollectNumber());
model.setClickNumber(entity.getClickNumber());
model.setIsCopy(entity.getIsCopy());
return model;
}
public static BizAgentApplicationMallDto entityToDto(BizAgentApplicationMallEntity entity) throws Exception {
BizAgentApplicationMallDto dto = new BizAgentApplicationMallDto();
BizAgentApplicationPublishService agentApplicationPublishService = SpringUtils.getBean(BizAgentApplicationPublishServiceImpl.class);
BizAgentApplicationPublishEntity publishEntity = agentApplicationPublishService.get(entity.getAgentPublishId());
AgentApplicationBaseInfo baseInfo = new AgentApplicationBaseInfo();
if(publishEntity != null){
baseInfo.setMemberId(publishEntity.getMemberId());
baseInfo.setAgentId(publishEntity.getAgentId());
baseInfo.setAgentTitle(publishEntity.getAgentTitle());
baseInfo.setAgentAvatar(publishEntity.getAgentAvatar());
baseInfo.setAgentDesc(publishEntity.getAgentDesc());
baseInfo.setAgentSystem(publishEntity.getAgentSystem());
baseInfo.setAgentPublishStatus(publishEntity.getAgentPublishStatus());
baseInfo.setPublishTime(publishEntity.getPublishTime());
}
AgentApplicationCommConfig commConfig = new AgentApplicationCommConfig();
if(publishEntity != null){
commConfig.setPreamble(publishEntity.getPreamble());
commConfig.setFeaturedQuestions(publishEntity.getFeaturedQuestions());
commConfig.setContinuousQuestionStatus(publishEntity.getContinuousQuestionStatus());
commConfig.setContinuousQuestionSystem(publishEntity.getContinuousQuestionSystem());
commConfig.setContinuousQuestionTurn(publishEntity.getContinuousQuestionTurn());
commConfig.setVariableStructure(publishEntity.getVariableStructure());
commConfig.setIsLongMemory(publishEntity.getIsLongMemory());
}
AgentApplicationKnowledgeConfig knowledgeConfig = new AgentApplicationKnowledgeConfig();
if(publishEntity != null){
knowledgeConfig.setKnowledgeIds(publishEntity.getKnowledgeIds());
}
AgentApplicationCommModelConfig commModelConfig = new AgentApplicationCommModelConfig();
if(publishEntity != null){
commModelConfig.setLargeModel(publishEntity.getLargeModel());
commModelConfig.setTopP(publishEntity.getTopP());
commModelConfig.setCommunicationTurn(publishEntity.getCommunicationTurn());
}
dto.setId(entity.getId());
dto.setAgentType(entity.getAgentType());
dto.setCollectNumber(entity.getCollectNumber());
dto.setClickNumber(entity.getClickNumber());
dto.setBaseInfo(baseInfo);
dto.setCommConfig(commConfig);
dto.setKnowledgeConfig(knowledgeConfig);
dto.setCommModelConfig(commModelConfig);
if(publishEntity != null){
dto.setUnitIds(publishEntity.getUnitIds());
}
dto.setIsCopy(entity.getIsCopy());
return dto;
}
public static BizAgentApplicationMallEntity dtoToEntity(BizAgentApplicationMallDto dto){
BizAgentApplicationMallEntity entity = new BizAgentApplicationMallEntity();
entity.setId(dto.getId());
entity.setAgentPublishId(dto.getAgentPublishId());
entity.setAgentType(dto.getAgentType());
entity.setCollectNumber(dto.getCollectNumber());
entity.setClickNumber(dto.getClickNumber());
entity.setIsCopy(dto.getIsCopy());
return entity;
}
}
\ No newline at end of file
package cn.com.poc.agent_application.convert;
import cn.com.poc.agent_application.model.BizMemberAgentApplicationCollectModel;
import cn.com.poc.agent_application.entity.BizMemberAgentApplicationCollectEntity;
import cn.com.poc.agent_application.dto.BizMemberAgentApplicationCollectDto;
public class BizMemberAgentApplicationCollectConvert {
public static BizMemberAgentApplicationCollectEntity modelToEntity(BizMemberAgentApplicationCollectModel model){
BizMemberAgentApplicationCollectEntity entity = new BizMemberAgentApplicationCollectEntity();
entity.setId(model.getId());
entity.setMemberId(model.getMemberId());
entity.setAgentMallId(model.getAgentMallId());
entity.setIsCollect(model.getIsCollect());
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 BizMemberAgentApplicationCollectModel entityToModel(BizMemberAgentApplicationCollectEntity entity){
BizMemberAgentApplicationCollectModel model = new BizMemberAgentApplicationCollectModel();
model.setId(entity.getId());
model.setMemberId(entity.getMemberId());
model.setAgentMallId(entity.getAgentMallId());
model.setIsCollect(entity.getIsCollect());
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 BizMemberAgentApplicationCollectDto entityToDto(BizMemberAgentApplicationCollectEntity entity){
BizMemberAgentApplicationCollectDto dto = new BizMemberAgentApplicationCollectDto();
dto.setId(entity.getId());
dto.setMemberId(entity.getMemberId());
dto.setAgentMallId(entity.getAgentMallId());
dto.setIsCollect(entity.getIsCollect());
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 BizMemberAgentApplicationCollectEntity dtoToEntity(BizMemberAgentApplicationCollectDto dto){
BizMemberAgentApplicationCollectEntity entity = new BizMemberAgentApplicationCollectEntity();
entity.setId(dto.getId());
entity.setMemberId(dto.getMemberId());
entity.setAgentMallId(dto.getAgentMallId());
entity.setIsCollect(dto.getIsCollect());
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.agent_application.dto;
public class BizAgentApplicationMallDto extends AgentApplicationInfoDto{
private static final long serialVersionUID = 1L;
/** id
*自增ID
*/
private java.lang.Integer id;
public java.lang.Integer getId(){
return this.id;
}
public void setId(java.lang.Integer id){
this.id = id;
}
/** agent_publish_id
*发布应用的ID
*/
private java.lang.Integer agentPublishId;
public java.lang.Integer getAgentPublishId(){
return this.agentPublishId;
}
public void setAgentPublishId(java.lang.Integer agentPublishId){
this.agentPublishId = agentPublishId;
}
/** agent_type
*应用类型
*/
private java.lang.String agentType;
public java.lang.String getAgentType(){
return this.agentType;
}
public void setAgentType(java.lang.String agentType){
this.agentType = agentType;
}
/** collect_number
*收藏人数
*/
private java.lang.Integer collectNumber;
public java.lang.Integer getCollectNumber(){
return this.collectNumber;
}
public void setCollectNumber(java.lang.Integer collectNumber){
this.collectNumber = collectNumber;
}
/** click_number
*点击次数
*/
private java.lang.Integer clickNumber;
public java.lang.Integer getClickNumber(){
return this.clickNumber;
}
public void setClickNumber(java.lang.Integer clickNumber){
this.clickNumber = clickNumber;
}
/** is_copy
*是否允许被复制 1、Y 是 2、N 否
*/
private java.lang.String isCopy;
public java.lang.String getIsCopy(){
return this.isCopy;
}
public void setIsCopy(java.lang.String isCopy){
this.isCopy = isCopy;
}
}
\ No newline at end of file
package cn.com.poc.agent_application.dto;
public class BizMemberAgentApplicationCollectDto {
private static final long serialVersionUID = 1L;
/** id
*主键ID
*/
private java.lang.Integer id;
public java.lang.Integer getId(){
return this.id;
}
public void setId(java.lang.Integer id){
this.id = id;
}
/** member_id
*收藏应用的用户ID
*/
private java.lang.Integer memberId;
public java.lang.Integer getMemberId(){
return this.memberId;
}
public void setMemberId(java.lang.Integer memberId){
this.memberId = memberId;
}
/** agent_mall_id
*应用广场的应用ID
*/
private java.lang.Integer agentMallId;
public java.lang.Integer getAgentMallId(){
return this.agentMallId;
}
public void setAgentMallId(java.lang.Integer agentMallId){
this.agentMallId = agentMallId;
}
/** is_collect
*是否收藏 1、Y 是 2、N 否
*/
private java.lang.String isCollect;
public java.lang.String getIsCollect(){
return this.isCollect;
}
public void setIsCollect(java.lang.String isCollect){
this.isCollect = isCollect;
}
/** is_deleted
*是否删除 1、Y 是 2、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.agent_application.entity;
import javax.persistence.Column;
public class BizAgentApplicationMallEntity {
private static final long serialVersionUID = 1L;
/** id
*自增ID
*/
private java.lang.Integer id;
public java.lang.Integer getId(){
return this.id;
}
public void setId(java.lang.Integer id){
this.id = id;
}
/** agent_publish_id
*发布应用的ID
*/
private java.lang.Integer agentPublishId;
public java.lang.Integer getAgentPublishId(){
return this.agentPublishId;
}
public void setAgentPublishId(java.lang.Integer agentPublishId){
this.agentPublishId = agentPublishId;
}
/** agent_type
*应用类型
*/
private java.lang.String agentType;
public java.lang.String getAgentType(){
return this.agentType;
}
public void setAgentType(java.lang.String agentType){
this.agentType = agentType;
}
/** collect_number
*收藏人数
*/
private java.lang.Integer collectNumber;
public java.lang.Integer getCollectNumber(){
return this.collectNumber;
}
public void setCollectNumber(java.lang.Integer collectNumber){
this.collectNumber = collectNumber;
}
/** click_number
*点击次数
*/
private java.lang.Integer clickNumber;
public java.lang.Integer getClickNumber(){
return this.clickNumber;
}
public void setClickNumber(java.lang.Integer clickNumber){
this.clickNumber = clickNumber;
}
/** is_copy
*是否允许被复制 1、Y 是 2、N 否
*/
private java.lang.String isCopy;
public java.lang.String getIsCopy(){
return this.isCopy;
}
public void setIsCopy(java.lang.String isCopy){
this.isCopy = isCopy;
}
/** is_deleted
*是否删除 1、Y 是 2、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.agent_application.entity;
public class BizMemberAgentApplicationCollectEntity {
private static final long serialVersionUID = 1L;
/** id
*主键ID
*/
private java.lang.Integer id;
public java.lang.Integer getId(){
return this.id;
}
public void setId(java.lang.Integer id){
this.id = id;
}
/** member_id
*收藏应用的用户ID
*/
private java.lang.Integer memberId;
public java.lang.Integer getMemberId(){
return this.memberId;
}
public void setMemberId(java.lang.Integer memberId){
this.memberId = memberId;
}
/** agent_mall_id
*应用广场的应用ID
*/
private java.lang.Integer agentMallId;
public java.lang.Integer getAgentMallId(){
return this.agentMallId;
}
public void setAgentMallId(java.lang.Integer agentMallId){
this.agentMallId = agentMallId;
}
/** is_collect
*是否收藏 1、Y 是 2、N 否
*/
private java.lang.String isCollect;
public java.lang.String getIsCollect(){
return this.isCollect;
}
public void setIsCollect(java.lang.String isCollect){
this.isCollect = isCollect;
}
/** is_deleted
*是否删除 1、Y 是 2、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.agent_application.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_agent_application_mall
* 应用广场
*/
@Entity
@Table(name = "biz_agent_application_mall")
@DynamicInsert
@DynamicUpdate
public class BizAgentApplicationMallModel extends BaseModelClass implements Serializable {
private static final long serialVersionUID = 1L;
/** id
*自增ID
*/
private java.lang.Integer id;
@Column(name = "id",length = 10)
@Id @GeneratedValue(strategy = GenerationType.AUTO)
public java.lang.Integer getId(){
return this.id;
}
public void setId(java.lang.Integer id){
this.id = id;
super.addValidField("id");
}
/** agent_publish_id
*发布应用的ID
*/
private java.lang.Integer agentPublishId;
@Column(name = "agent_publish_id",length = 10)
public java.lang.Integer getAgentPublishId(){
return this.agentPublishId;
}
public void setAgentPublishId(java.lang.Integer agentPublishId){
this.agentPublishId = agentPublishId;
super.addValidField("agentPublishId");
}
/** agent_type
*应用类型
*/
private java.lang.String agentType;
@Column(name = "agent_type",length = 200)
public java.lang.String getAgentType(){
return this.agentType;
}
public void setAgentType(java.lang.String agentType){
this.agentType = agentType;
super.addValidField("agentType");
}
/** collect_number
*收藏人数
*/
private java.lang.Integer collectNumber;
@Column(name = "collect_number",length = 10)
public java.lang.Integer getCollectNumber(){
return this.collectNumber;
}
public void setCollectNumber(java.lang.Integer collectNumber){
this.collectNumber = collectNumber;
super.addValidField("collectNumber");
}
/** click_number
*点击次数
*/
private java.lang.Integer clickNumber;
@Column(name = "click_number",length = 10)
public java.lang.Integer getClickNumber(){
return this.clickNumber;
}
public void setClickNumber(java.lang.Integer clickNumber){
this.clickNumber = clickNumber;
super.addValidField("clickNumber");
}
/** is_copy
*是否允许被复制 1、Y 是 2、N 否
*/
private java.lang.String isCopy;
@Column(name = "is_copy",length = 1)
public java.lang.String getIsCopy(){
return this.isCopy;
}
public void setIsCopy(java.lang.String isCopy){
this.isCopy = isCopy;
super.addValidField("isCopy");
}
/** is_deleted
*是否删除 1、Y 是 2、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.agent_application.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_member_agent_application_collect
* 用户收藏应用表
*/
@Entity
@Table(name = "biz_member_agent_application_collect")
@DynamicInsert
@DynamicUpdate
public class BizMemberAgentApplicationCollectModel extends BaseModelClass implements Serializable {
private static final long serialVersionUID = 1L;
/** id
*主键ID
*/
private java.lang.Integer id;
@Column(name = "id",length = 10)
@Id @GeneratedValue(strategy = GenerationType.AUTO)
public java.lang.Integer getId(){
return this.id;
}
public void setId(java.lang.Integer id){
this.id = id;
super.addValidField("id");
}
/** member_id
*收藏应用的用户ID
*/
private java.lang.Integer memberId;
@Column(name = "member_id",length = 10)
public java.lang.Integer getMemberId(){
return this.memberId;
}
public void setMemberId(java.lang.Integer memberId){
this.memberId = memberId;
super.addValidField("memberId");
}
/** agent_mall_id
*应用广场的应用ID
*/
private java.lang.Integer agentMallId;
@Column(name = "agent_mall_id",length = 10)
public java.lang.Integer getAgentMallId(){
return this.agentMallId;
}
public void setAgentMallId(java.lang.Integer agentMallId){
this.agentMallId = agentMallId;
super.addValidField("agentMallId");
}
/** is_collect
*是否删除 1、Y 是 2、N 否
*/
private java.lang.String isCollect;
@Column(name = "is_collect",length = 1)
public java.lang.String getIsCollect(){
return this.isCollect;
}
public void setIsCollect(java.lang.String isCollect){
this.isCollect = isCollect;
super.addValidField("isCollect");
}
/** is_deleted
*是否删除 1、Y 是 2、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.agent_application.repository;
import cn.com.yict.framemax.data.repository.Repository;
import cn.com.poc.agent_application.model.BizAgentApplicationMallModel;
public interface BizAgentApplicationMallRepository extends Repository<BizAgentApplicationMallModel,java.lang.Integer> {
}
\ No newline at end of file
package cn.com.poc.agent_application.repository;
import cn.com.yict.framemax.data.repository.Repository;
import cn.com.poc.agent_application.model.BizMemberAgentApplicationCollectModel;
public interface BizMemberAgentApplicationCollectRepository extends Repository<BizMemberAgentApplicationCollectModel,java.lang.Integer> {
}
\ No newline at end of file
package cn.com.poc.agent_application.rest;
import cn.com.yict.framemax.core.rest.BaseRest;
import cn.com.poc.agent_application.dto.BizAgentApplicationMallDto;
import cn.com.yict.framemax.data.model.PagingInfo;
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;
import org.springframework.web.bind.annotation.RequestParam;
@Permission(value = Access.Anonymous)
public interface BizAgentApplicationMallRest extends BaseRest {
/**
* 配置【已发布的应用】发布至【应用广场】
*
* @return
*/
BizAgentApplicationMallDto publishAgentToMall(@RequestBody BizAgentApplicationMallDto dto) throws Exception;
BizAgentApplicationMallDto getById(@RequestParam java.lang.Integer id) throws Exception;
List<BizAgentApplicationMallDto> getListByExample(@RequestBody BizAgentApplicationMallDto example,PagingInfo pagingInfo) throws Exception;
/**
* 获取【应用广场】的应用列表
* */
List<BizAgentApplicationMallDto> getList(PagingInfo pagingInfo) throws Exception;
BizAgentApplicationMallDto update(@RequestBody BizAgentApplicationMallDto dto) throws Exception;
void deletedById(@RequestParam java.lang.Integer id) throws Exception;
/**
* 收藏/取消收藏应用
*
* @param id 应用广场中的id
* */
void collectOrCancelAgentInMall(@RequestParam Integer id) throws Exception;
}
\ No newline at end of file
......@@ -3,22 +3,23 @@ package cn.com.poc.agent_application.rest;
import cn.com.yict.framemax.core.rest.BaseRest;
import cn.com.poc.agent_application.dto.BizAgentApplicationPublishDto;
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;
import org.springframework.web.bind.annotation.RequestParam;
@Permission(value = Access.Anonymous)
public interface BizAgentApplicationPublishRest extends BaseRest {
BizAgentApplicationPublishDto getById(java.lang.Integer id) throws Exception;
BizAgentApplicationPublishDto getById(@RequestParam java.lang.Integer id) throws Exception;
List<BizAgentApplicationPublishDto> getList(BizAgentApplicationPublishDto example,PagingInfo pagingInfo) throws Exception;
List<BizAgentApplicationPublishDto> getList(@RequestBody BizAgentApplicationPublishDto example,PagingInfo pagingInfo) throws Exception;
BizAgentApplicationPublishDto save(BizAgentApplicationPublishDto dto) throws Exception;
BizAgentApplicationPublishDto save(@RequestBody BizAgentApplicationPublishDto dto) throws Exception;
BizAgentApplicationPublishDto update(BizAgentApplicationPublishDto dto) throws Exception;
BizAgentApplicationPublishDto update(@RequestBody BizAgentApplicationPublishDto dto) throws Exception;
void deletedById(java.lang.Integer id) throws Exception;
void deletedById(@RequestParam java.lang.Integer id) throws Exception;
}
\ No newline at end of file
package cn.com.poc.agent_application.rest.impl;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
import cn.com.poc.agent_application.aggregate.AgentApplicationMallService;
import org.springframework.stereotype.Component;
import cn.com.poc.agent_application.rest.BizAgentApplicationMallRest;
import cn.com.poc.agent_application.service.BizAgentApplicationMallService;
import cn.com.poc.agent_application.dto.BizAgentApplicationMallDto;
import cn.com.poc.agent_application.entity.BizAgentApplicationMallEntity;
import cn.com.yict.framemax.data.model.PagingInfo;
import cn.com.poc.agent_application.convert.BizAgentApplicationMallConvert;
import org.springframework.util.Assert;
@Component
public class BizAgentApplicationMallRestImpl implements BizAgentApplicationMallRest {
@Resource
private AgentApplicationMallService agentApplicationMallService;
@Resource
private BizAgentApplicationMallService service;
@Override
public BizAgentApplicationMallDto publishAgentToMall(BizAgentApplicationMallDto dto) throws Exception {
Assert.notNull(dto);
Assert.notNull(dto.getAgentPublishId());
Assert.notNull(dto.getAgentType());
Assert.notNull(dto.getIsCopy());
return BizAgentApplicationMallConvert.entityToDto(service.save(BizAgentApplicationMallConvert.dtoToEntity(dto)));
}
public BizAgentApplicationMallDto getById(java.lang.Integer id) throws Exception{
Assert.notNull(id);
return BizAgentApplicationMallConvert.entityToDto(service.get(id));
}
@Override
public List<BizAgentApplicationMallDto> getListByExample(BizAgentApplicationMallDto example, PagingInfo pagingInfo) throws Exception {
return null;
}
public List<BizAgentApplicationMallDto> getList(PagingInfo pagingInfo) throws Exception{
List<BizAgentApplicationMallDto> resultList = new ArrayList<>();
List<BizAgentApplicationMallEntity> byExample = service.findByExample(pagingInfo);
for(BizAgentApplicationMallEntity entity : byExample){
resultList.add(BizAgentApplicationMallConvert.entityToDto(entity));
}
return resultList;
}
public BizAgentApplicationMallDto update(BizAgentApplicationMallDto dto) throws Exception{
Assert.notNull(dto);
BizAgentApplicationMallEntity entity = BizAgentApplicationMallConvert.dtoToEntity(dto);
return BizAgentApplicationMallConvert.entityToDto(service.update(entity));
}
public void deletedById(java.lang.Integer id) throws Exception{
Assert.notNull(id);
service.deletedById(id);
}
@Override
public void collectOrCancelAgentInMall(Integer id) throws Exception {
agentApplicationMallService.collectOrCancelAgentInMall(id);
}
}
\ No newline at end of file
......@@ -2,6 +2,8 @@ package cn.com.poc.agent_application.rest.impl;
import java.util.List;
import javax.annotation.Resource;
import cn.com.poc.agent_application.service.BizAgentApplicationMallService;
import org.springframework.stereotype.Component;
import cn.com.poc.agent_application.rest.BizAgentApplicationPublishRest;
import cn.com.poc.agent_application.service.BizAgentApplicationPublishService;
......@@ -14,10 +16,13 @@ import org.springframework.util.Assert;
@Component
public class BizAgentApplicationPublishRestImpl implements BizAgentApplicationPublishRest {
@Resource
private BizAgentApplicationMallService bizAgentApplicationMallService;
@Resource
private BizAgentApplicationPublishService service;
public BizAgentApplicationPublishDto getById(java.lang.Integer id) throws Exception{
Assert.notNull(id);
return BizAgentApplicationPublishConvert.entityToDto(service.get(id));
......
package cn.com.poc.agent_application.service;
import cn.com.yict.framemax.core.service.BaseService;
import cn.com.poc.agent_application.entity.BizAgentApplicationMallEntity;
import cn.com.yict.framemax.data.model.PagingInfo;
import java.util.List;
public interface BizAgentApplicationMallService extends BaseService {
BizAgentApplicationMallEntity get(java.lang.Integer id) throws Exception;
List<BizAgentApplicationMallEntity> findByExample(BizAgentApplicationMallEntity example,PagingInfo pagingInfo) throws Exception;
List<BizAgentApplicationMallEntity> findByExample(PagingInfo pagingInfo) throws Exception;
BizAgentApplicationMallEntity save(BizAgentApplicationMallEntity entity) throws Exception;
BizAgentApplicationMallEntity update(BizAgentApplicationMallEntity entity) throws Exception;
void deletedByAgentPublishId(java.lang.Integer agentPublishId) throws Exception;
void deletedById(java.lang.Integer id) throws Exception;
}
\ No newline at end of file
package cn.com.poc.agent_application.service;
import cn.com.yict.framemax.core.service.BaseService;
import cn.com.poc.agent_application.entity.BizMemberAgentApplicationCollectEntity;
import cn.com.yict.framemax.data.model.PagingInfo;
import java.util.List;
public interface BizMemberAgentApplicationCollectService extends BaseService {
BizMemberAgentApplicationCollectEntity get(java.lang.Integer id) throws Exception;
BizMemberAgentApplicationCollectEntity getByAgentMallId(java.lang.Integer id) throws Exception;
List<BizMemberAgentApplicationCollectEntity> findByExample(BizMemberAgentApplicationCollectEntity example,PagingInfo pagingInfo) throws Exception;
BizMemberAgentApplicationCollectEntity save(BizMemberAgentApplicationCollectEntity entity) throws Exception;
BizMemberAgentApplicationCollectEntity update(BizMemberAgentApplicationCollectEntity entity) throws Exception;
void deletedById(java.lang.Integer id) throws Exception;
}
\ No newline at end of file
package cn.com.poc.agent_application.service.impl;
import cn.com.yict.framemax.core.service.impl.BaseServiceImpl;
import cn.com.poc.agent_application.service.BizAgentApplicationMallService;
import cn.com.poc.agent_application.model.BizAgentApplicationMallModel;
import cn.com.poc.agent_application.entity.BizAgentApplicationMallEntity;
import cn.com.poc.agent_application.convert.BizAgentApplicationMallConvert;
import cn.com.poc.agent_application.repository.BizAgentApplicationMallRepository;
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 BizAgentApplicationMallServiceImpl extends BaseServiceImpl
implements BizAgentApplicationMallService {
@Resource
private BizAgentApplicationMallRepository repository;
public BizAgentApplicationMallEntity get(java.lang.Integer id) throws Exception{
Assert.notNull(id);
BizAgentApplicationMallModel model = this.repository.get(id);
if (model == null){
return null;
}
if ("Y".equals(model.getIsDeleted())){
return null;
}
return BizAgentApplicationMallConvert.modelToEntity(model);
}
public List<BizAgentApplicationMallEntity> findByExample(BizAgentApplicationMallEntity example,PagingInfo pagingInfo) throws Exception{
List<BizAgentApplicationMallEntity> result = new ArrayList<BizAgentApplicationMallEntity>();
BizAgentApplicationMallModel model = new BizAgentApplicationMallModel();
if (example != null){
model = BizAgentApplicationMallConvert.entityToModel(example);
}
model.setIsDeleted("N");
List<BizAgentApplicationMallModel> models = this.repository.findByExample(model,pagingInfo);
if (CollectionUtils.isNotEmpty(models)) {
result = models.stream().map(BizAgentApplicationMallConvert::modelToEntity).collect(Collectors.toList());
}
return result;
}
@Override
public List<BizAgentApplicationMallEntity> findByExample(PagingInfo pagingInfo) throws Exception {
List<BizAgentApplicationMallEntity> result = new ArrayList<BizAgentApplicationMallEntity>();
BizAgentApplicationMallModel model = new BizAgentApplicationMallModel();
model.setIsDeleted("N");
List<BizAgentApplicationMallModel> models = this.repository.findByExample(model,pagingInfo);
if (CollectionUtils.isNotEmpty(models)) {
result = models.stream().map(BizAgentApplicationMallConvert::modelToEntity).collect(Collectors.toList());
}
return result;
}
public BizAgentApplicationMallEntity save(BizAgentApplicationMallEntity entity) throws Exception{
Assert.notNull(entity);
entity.setId(null);
entity.setIsDeleted("N");
BizAgentApplicationMallModel model = BizAgentApplicationMallConvert.entityToModel(entity);
BizAgentApplicationMallModel saveModel = this.repository.save(model);
return BizAgentApplicationMallConvert.modelToEntity(saveModel);
}
public BizAgentApplicationMallEntity update(BizAgentApplicationMallEntity entity) throws Exception{
Assert.notNull(entity);
Assert.notNull(entity.getId(),"update pk can not be null");
BizAgentApplicationMallModel model = this.repository.get(entity.getId());
if (entity.getAgentPublishId() != null){
model.setAgentPublishId(entity.getAgentPublishId());
}
if (entity.getAgentType() != null){
model.setAgentType(entity.getAgentType());
}
if (entity.getCollectNumber() != null){
model.setCollectNumber(entity.getCollectNumber());
}
if(entity.getClickNumber() != null){
model.setClickNumber(entity.getClickNumber());
}
if (entity.getIsCopy() != null){
model.setIsCopy(entity.getIsCopy());
}
if (entity.getIsDeleted() != null) {
model.setIsDeleted(entity.getIsDeleted());
}
BizAgentApplicationMallModel saveModel = this.repository.save(model);
return BizAgentApplicationMallConvert.modelToEntity(saveModel);
}
@Override
public void deletedByAgentPublishId(Integer agentPublishId) throws Exception {
Assert.notNull(agentPublishId);
BizAgentApplicationMallModel model = new BizAgentApplicationMallModel();
model.setAgentPublishId(agentPublishId);
List<BizAgentApplicationMallModel> models = this.repository.findByExample(model);
if(!models.isEmpty()){
BizAgentApplicationMallModel mallModel = models.get(0);
if ("N".equals(mallModel.getIsDeleted())){
mallModel.setIsDeleted("Y");
this.repository.save(mallModel);
}
}
}
public void deletedById(java.lang.Integer id) throws Exception{
Assert.notNull(id);
BizAgentApplicationMallModel model = this.repository.get(id);
if (model != null){
if ("N".equals(model.getIsDeleted())){
model.setIsDeleted("Y");
this.repository.save(model);
}
}
}
}
\ No newline at end of file
......@@ -3,6 +3,7 @@ package cn.com.poc.agent_application.service.impl;
import cn.com.poc.agent_application.constant.AgentApplicationConstants;
import cn.com.poc.agent_application.query.PublishAgentApplicationQueryCondition;
import cn.com.poc.agent_application.query.PublishAgentApplicationQueryItem;
import cn.com.poc.agent_application.service.BizAgentApplicationMallService;
import cn.com.poc.common.constant.CommonConstant;
import cn.com.poc.common.utils.JsonUtils;
import cn.com.yict.framemax.core.exception.BusinessException;
......@@ -33,6 +34,9 @@ public class BizAgentApplicationPublishServiceImpl extends BaseServiceImpl
@Resource
private BizAgentApplicationPublishRepository repository;
@Resource
private BizAgentApplicationMallService bizAgentApplicationMallService;
public BizAgentApplicationPublishEntity get(java.lang.Integer id) throws Exception {
Assert.notNull(id);
BizAgentApplicationPublishModel model = this.repository.get(id);
......@@ -106,6 +110,7 @@ public class BizAgentApplicationPublishServiceImpl extends BaseServiceImpl
this.repository.save(model);
}
}
bizAgentApplicationMallService.deletedByAgentPublishId(id);
}
@Override
......
package cn.com.poc.agent_application.service.impl;
import cn.com.yict.framemax.core.service.impl.BaseServiceImpl;
import cn.com.poc.agent_application.service.BizMemberAgentApplicationCollectService;
import cn.com.poc.agent_application.model.BizMemberAgentApplicationCollectModel;
import cn.com.poc.agent_application.entity.BizMemberAgentApplicationCollectEntity;
import cn.com.poc.agent_application.convert.BizMemberAgentApplicationCollectConvert;
import cn.com.poc.agent_application.repository.BizMemberAgentApplicationCollectRepository;
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 BizMemberAgentApplicationCollectServiceImpl extends BaseServiceImpl
implements BizMemberAgentApplicationCollectService {
@Resource
private BizMemberAgentApplicationCollectRepository repository;
public BizMemberAgentApplicationCollectEntity get(java.lang.Integer id) throws Exception{
Assert.notNull(id);
BizMemberAgentApplicationCollectModel model = this.repository.get(id);
if (model == null){
return null;
}
if ("Y".equals(model.getIsDeleted())){
return null;
}
return BizMemberAgentApplicationCollectConvert.modelToEntity(model);
}
@Override
public BizMemberAgentApplicationCollectEntity getByAgentMallId(Integer id) throws Exception {
BizMemberAgentApplicationCollectModel model = new BizMemberAgentApplicationCollectModel();
model.setAgentMallId(id);
model.setIsDeleted("N");
List<BizMemberAgentApplicationCollectModel> models = this.repository.findByExample(model);
if(!models.isEmpty()){
return BizMemberAgentApplicationCollectConvert.modelToEntity(models.get(0));
}
return null;
}
public List<BizMemberAgentApplicationCollectEntity> findByExample(BizMemberAgentApplicationCollectEntity example,PagingInfo pagingInfo) throws Exception{
List<BizMemberAgentApplicationCollectEntity> result = new ArrayList<BizMemberAgentApplicationCollectEntity>();
BizMemberAgentApplicationCollectModel model = new BizMemberAgentApplicationCollectModel();
if (example != null){
model = BizMemberAgentApplicationCollectConvert.entityToModel(example);
}
model.setIsDeleted("N");
List<BizMemberAgentApplicationCollectModel> models = this.repository.findByExample(model,pagingInfo);
if (CollectionUtils.isNotEmpty(models)) {
result = models.stream().map(BizMemberAgentApplicationCollectConvert::modelToEntity).collect(Collectors.toList());
}
return result;
}
public BizMemberAgentApplicationCollectEntity save(BizMemberAgentApplicationCollectEntity entity) throws Exception{
Assert.notNull(entity);
entity.setId(null);
entity.setIsDeleted("N");
BizMemberAgentApplicationCollectModel model = BizMemberAgentApplicationCollectConvert.entityToModel(entity);
BizMemberAgentApplicationCollectModel saveModel = this.repository.save(model);
return BizMemberAgentApplicationCollectConvert.modelToEntity(saveModel);
}
public BizMemberAgentApplicationCollectEntity update(BizMemberAgentApplicationCollectEntity entity) throws Exception{
Assert.notNull(entity);
Assert.notNull(entity.getId(),"update pk can not be null");
BizMemberAgentApplicationCollectModel model = this.repository.get(entity.getId());
if (entity.getMemberId() != null){
model.setMemberId(entity.getMemberId());
}
if (entity.getAgentMallId() != null){
model.setAgentMallId(entity.getAgentMallId());
}
if(entity.getIsCollect() != null){
model.setIsCollect(entity.getIsCollect());
}
if (entity.getIsDeleted() != null){
model.setIsDeleted(entity.getIsDeleted());
}
BizMemberAgentApplicationCollectModel saveModel = this.repository.save(model);
return BizMemberAgentApplicationCollectConvert.modelToEntity(saveModel);
}
public void deletedById(java.lang.Integer id) throws Exception{
Assert.notNull(id);
BizMemberAgentApplicationCollectModel model = this.repository.get(id);
if (model != null){
if ("N".equals(model.getIsDeleted())){
model.setIsDeleted("Y");
this.repository.save(model);
}
}
}
}
\ 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