package com.mortals.xhx.module.basics.web;

import com.mortals.framework.model.Context;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.key.Constant;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.mortals.framework.web.BaseCRUDJsonMappingController;
import com.mortals.xhx.module.basics.model.BasicsDatumEntity;
import com.mortals.xhx.module.basics.service.BasicsDatumService;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;


/**
* <p>Title: 一件事材料关联集合</p>
* <p>Description: BasicsDatumController  </p>
* <p>Copyright: Copyright &reg;  </p>
* <p>Company: </p>
* @author zxfei
* @version 1.0.0
*/
@RestController
@RequestMapping("basics/datum")
public class BasicsDatumController extends BaseCRUDJsonMappingController<BasicsDatumService,BasicsDatumForm,BasicsDatumEntity,Long> {

    public BasicsDatumController(){
        super.setFormClass(BasicsDatumForm.class);
        super.setModuleDesc("一件事材料关联集合");
    }

    @Autowired
    private ParamService paramService;

    @Override
    protected void init(HttpServletRequest request, HttpServletResponse response, BasicsDatumForm form, Map<String, Object> model, Context context) {

        this.addDict(model,"iszzsb", YesNoEnum.getEnumMap());
        this.addDict(model, "materialType", paramService.getParamByFirstOrganize(Constant.Param_materialType));
        this.addDict(model, "electronicgs", paramService.getParamByFirstOrganize(Constant.Param_electronicgs));
        this.addDict(model, "materialSourceSm", paramService.getParamByFirstOrganize(Constant.Param_materialSourceSm));
        this.addDict(model, "paperGg", paramService.getParamByFirstOrganize(Constant.Param_paperGg));
        this.addDict(model, "jianmMs", paramService.getParamByFirstOrganize(Constant.Param_jianmMs));
        this.addDict(model, "sealWay", paramService.getParamByFirstOrganize(Constant.Param_sealWay));
    }

}