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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
package com.changhong.epc.tenant.controller.cost;
 
import java.util.List;
 
import javax.annotation.Resource;
 
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
 
import com.changhong.epc.bean.tenant.cost.CostFromMapping;
import com.changhong.epc.bean.tenant.cost.CostType;
import com.changhong.epc.bean.tenant.cost.extend.CostTypeExtend;
import com.changhong.epc.bean.tenant.master.MasterDefine;
import com.changhong.epc.constter.tenant.TenantUrlConst;
import com.changhong.epc.tenant.service.cost.CostFromMappingService;
import com.changhong.epc.tenant.service.cost.CostTypeService;
 
@RestController
public class CostTypeController implements TenantUrlConst {
    
    @Resource(name="costTypeService")
    private CostTypeService costTypeService;
    
    @Resource(name="costFromMappingServiceImpl")
    private CostFromMappingService costFromMappingService;
    /**
     * 费用类型查询
     * @param data
     * @return
     */
    
    @PostMapping(REST_TENANT_COSTTYPE_SEACH)
    public List<CostTypeExtend> selectCostType(@RequestBody CostFromMapping costFrom) {    
        return costTypeService.selectConstByTypeAll(costFrom.getType());
    }
    /**
     * 费用类型删除
     * @param data
     * @return
     */
    @PostMapping(REST_TENANT_COSTTYPE_DELETE)
    public int deleteCostType(@RequestBody CostType data){
        return costTypeService.deleteCostType(data);
        
    }
    /**
     * 费用类型添加
     * @param data
     * @return
     */
    @PostMapping(REST_TENANT_COSTTYPE_INSERT)
    public CostType insertCostType(@RequestBody CostTypeExtend  data){
        return costTypeService.insertCostType(data);
        
    }
    /**
     * 费用类型修改
     * @param data
     * @return
     */
    @PostMapping(REST_TENANT_COSTTYPE_UPDATE)
    public int updateCostType(@RequestBody CostTypeExtend  data){    
        //修改对应表单
        costFromMappingService.updateCost(data);
        return costTypeService.updateCostType(data);
        
    }
    
    /**
     * 费用类型分页查询
     * @param data
     * @return
     */
    @PostMapping(REST_TENANT_COSTTYPE_SEACHPAGE)
    public List<CostTypeExtend> seachePage(@RequestBody CostType data){    
        return costTypeService.seachePage(data);
        
    }
    
    /**
     * 拖拽修改关联Id
     */
    @PostMapping(REST_TENANT_COSTTYPE_MOVE)
    public int move(@RequestBody CostType data){
        return costTypeService.move(data);
    }
    
    /**
     * 单条查询费用类型
     */
    @PostMapping(REST_TENANT_COSTTYPE_ONE) 
    public CostType selectSingle(@RequestBody CostType cost){
        return costTypeService.selectSingle(cost);
    }
    
    /**
     * 模糊查询费用类型
     */
    @PostMapping(REST_TENANT_COSTTYPE_LIKE)
    public List<CostTypeExtend> selectlike(@RequestBody CostType nodeName){
        return costTypeService.selectlike(nodeName.getNodeName());
    }
 
 
}