my first demo

weixin_41871182發表於2020-10-16

first demo
java

package ctyun.finance.rest;

import ch.qos.logback.classic.Logger;
import ctyun.finance.biz.CostOutsourcingExpensesProductPcntCalculationBiz;
import ctyun.finance.entity.CostOutsourcingExpensesProductPcntCalculation;
import ctyun.finance.util.CommonUtil;
import ctyun.security.common.msg.ObjectRestResponse;
import ctyun.security.common.msg.TableResultResponse;
import ctyun.security.common.rest.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@Slf4j
@Controller
@Api(tags = "成本分攤佔比頁面")
@RequestMapping("costOutsourcingExpensesProductPcntCalculation")
public class CostOutsourcingExpensesProductPcntCalculationController extends BaseController<CostOutsourcingExpensesProductPcntCalculationBiz, CostOutsourcingExpensesProductPcntCalculation> {
    @Autowired
    CostOutsourcingExpensesProductPcntCalculationBiz costOutsourcingExpensesProductPcntCalculationBiz;

    @GetMapping("personnelOut/cost/type")
    @ApiOperation(value = "人員外包費成本分攤佔比")
    @ApiImplicitParams(
            @ApiImplicitParam(name = "monthID", value = "月份", paramType = "query")
    )
    public TableResultResponse<Map<String, List> > getCostPerson(@RequestParam String monthId) {

        TableResultResponse<Map<String, List>> tableResultResponse = new TableResultResponse<>();
        try {
        CostOutsourcingExpensesProductPcntCalculation costCalcu = new CostOutsourcingExpensesProductPcntCalculation();
        costCalcu.setMonthId(monthId);
        tableResultResponse= costOutsourcingExpensesProductPcntCalculationBiz.getCostPerson(costCalcu);
        }catch (Exception e){
            log.error("財務模組:人員外包費成本分攤佔比異常:",e);
            tableResultResponse.setStatus(900);
            tableResultResponse.setMessage("連線異常");
        }
        return  tableResultResponse;
    }
}