zm
2020-05-18 a18bfacbf56b401f6e0fdae8710fbca4df8cff77
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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);
    }
}