package cn.autoform.web.service.formsetting;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Service;
|
|
import cn.autoform.db.entity.CustomButtonEntity;
|
import cn.autoform.db.entity.FormsettingEntity;
|
import cn.autoform.web.mapper.formsetting.FormsettingMapper;
|
|
@Service
|
public class FormsettingService {
|
|
@Autowired
|
FormsettingMapper formsettingMapper = null;
|
|
public FormsettingEntity getFormsettingInfo(CustomButtonEntity entity) {
|
return formsettingMapper.getFormsettingInfo(entity);
|
}
|
|
public int createFormsetting(FormsettingEntity entity) {
|
return formsettingMapper.createFormsetting(entity);
|
}
|
|
public int updateFormsetting(FormsettingEntity entity){
|
return formsettingMapper.updateFormsetting(entity);
|
}
|
|
public int copyFormsetting(String sourceFormId, String sourceTenantId, String targetFormId, String targetTenantId) {
|
CustomButtonEntity customButtonEntity = new CustomButtonEntity();
|
customButtonEntity.setFormID(sourceFormId);
|
customButtonEntity.setTenantID(sourceTenantId);
|
FormsettingEntity formsettingEntity = formsettingMapper.getFormsettingInfo(customButtonEntity);
|
if(formsettingEntity == null){
|
return 0;
|
}
|
formsettingEntity.setFormID(targetFormId);
|
formsettingEntity.setTenantID(targetTenantId);
|
return formsettingMapper.createFormsetting(formsettingEntity);
|
}
|
}
|