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());
|
}
|
|
|
}
|