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
package com.changhong.epc.admin.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.admin.service.cost.CostFromTemplateService;
import com.changhong.epc.admin.service.cost.CostGroupTypeService;
import com.changhong.epc.bean.admin.CostGroupType;
import com.changhong.epc.bean.admin.extend.CostGroupTypeExtend;
import com.changhong.epc.constter.admin.AdminUrlConst;
import com.iemsoft.framework.cloud.core.tools.JSONTool;
 
@RestController
public class CostGroupTypeController implements AdminUrlConst {
    
    @Resource(name = "costGroupTypeServiceImpl")
    private CostGroupTypeService costGroupTypeService;
    @Resource(name = "costFromTemplateServiceImpl")
    private CostFromTemplateService costFromTemplateService;
    
    /**
     * 查询费用组费用类型
     * 
     */
    @PostMapping(REST_ADMIN_COSTGROUPTYPE_SELECTCOSTTREE)
    public List<CostGroupTypeExtend> SelectCostTree(@RequestBody CostGroupType costGroupType){
        return costGroupTypeService.selectTree(costGroupType);
    }
    
    /**
     * 添加费用组费用类型
     * 
     */
    @PostMapping(REST_ADMIN_COSTGROUPTYPE_ADDCOSTTYPE)
    public CostGroupType addCostType( @RequestBody CostGroupTypeExtend costGroupType) {
        return costGroupTypeService.addCostType(costGroupType);
    }
    
 
    /**
     * 修改费用组费用类型
     * 
     */
    @PostMapping( REST_ADMIN_COSTGROUPTYPE_UPDATECOSTTYPE)
    public int updateCostType(@RequestBody CostGroupTypeExtend costGroupType) {
        // System.err.println(JSONTool.toJson(costGroupType));
        // System.out.println("2");
        costFromTemplateService.updateCost(costGroupType);
        return costGroupTypeService.updateCostType(costGroupType);
    }
 
    /**
     * 删除费用组费用类型
     * 
     */
    @PostMapping( REST_ADMIN_COSTGROUPTYPE_EDLETECOSTTYPE)
    public int deleteCostType(@RequestBody CostGroupType costGroupType) {
        return costGroupTypeService.deleteCostType(costGroupType);
    }
    
    
    /**
     * 分页查询父类与所有子类 
     * 
     */
    @PostMapping( REST_ADMIN_COSTGROUPTYPE_SELECTTREEPAGE)
    public List<CostGroupTypeExtend> selectTreePage(@RequestBody CostGroupType costGroupType) {
        return costGroupTypeService.selectTreePage(costGroupType);
    }
    
    /**
     * 查询子类与其父类
     * 
     */
    @PostMapping( REST_ADMIN_COSTGROUPTYPE_SELECTCOSTTYPEONE)
    public CostGroupTypeExtend selectTreeOne(@RequestBody CostGroupType costGroupType) {
        return costGroupTypeService.selectTreeOne(costGroupType);
    }
 
}