CodeService.groovy
上传用户:steveyhw
上传日期:2019-05-13
资源大小:307k
文件大小:7k
源码类别:

PlugIns编程

开发平台:

Java

  1. class CodeService {
  2.     boolean transactional = true
  3.     def serviceMethod() {
  4.     }
  5.     private void initCodes(){
  6.         initSex()
  7.         initApplicatType()
  8.         initPositionType()
  9.         initPermitType()
  10.         initClanType()
  11.         initEducationType()
  12.         initProfessionType()
  13.         initWorkstate()
  14.         initHealthState()
  15.         initCustomerType()
  16.         initStaffType()
  17.         initDepartment()
  18.         initPosition()
  19.         initContratType()
  20.         initContratState()
  21.         initSignType()
  22.         initProductType()
  23.         initPowerLevel()
  24.     }
  25.     private void initSex() {
  26.         def ck = new Ckind(ckiName:'性别',ckiFlag:'SexType',ckiState:'',ckimemo:'')
  27.          ck.save()
  28.          ck.addToCodes(new Code(codName:'保密',codValue1:'',codValue2:'',codValue3:'',codValue4:''))
  29.           ck.addToCodes(new Code(codName:'F'))
  30.                 ck.addToCodes(new Code(codName:'M'))
  31.          ck.save()
  32.     }
  33.     private void initApplicatType() {
  34.          def ck = new Ckind(ckiName:'申请类别',ckiFlag:'ApplicatType',ckiState:'',ckimemo:'')
  35.          ck.save()
  36.          ck.addToCodes(new Code(codName:'申请离职'))
  37.          ck.addToCodes(new Code(codName:'申请职位'))
  38.          ck.addToCodes(new Code(codName:'申请调职'))
  39.          ck.save(flush:true)
  40.          ck.addToCodes(new Code(codName:'车费申请'))
  41.          ck.addToCodes(new Code(codName:'公干费用申请'))
  42.          ck.addToCodes(new Code(codName:'其他申请'))
  43.          ck.addToCodes(new Code(codName:'其他费用申请'))
  44.          ck.save(flush:true)
  45.     }
  46.     private void initPositionType() {
  47.          def ck = new Ckind(ckiName:'岗位',ckiFlag:'PositionType',ckiState:'',ckimemo:'')
  48.          ck.save()
  49.          ck.addToCodes(new Code(codName:'普通员工'))
  50.          ck.addToCodes(new Code(codName:'SALE MAN'))
  51.          ck.addToCodes(new Code(codName:'人事经理'))
  52.          ck.addToCodes(new Code(codName:'项目经理'))
  53.          ck.addToCodes(new Code(codName:'SALE MAN'))
  54.          ck.addToCodes(new Code(codName:'SALE MAN'))
  55.          ck.save()
  56.          
  57.     }
  58.     private void initPermitType() {
  59.          def ck = new Ckind(ckiName:'审核状态',ckiFlag:'PermitState',ckiState:'',ckimemo:'')
  60.          ck.save()
  61.          ck.addToCodes(new Code(codName:'等待审核',codValue1:'waitCheck'))
  62.          ck.addToCodes(new Code(codName:'审核通过',codValue1:'checkSuccess'))
  63.          ck.addToCodes(new Code(codName:'审核失败',codValue1:'checkFailure'))
  64.          ck.save()
  65.     }
  66.     private void initClanType() {
  67.          def ck = new Ckind(ckiName:'名族',ckiFlag:'ClanType',ckiState:'',ckimemo:'')
  68.          ck.save()
  69.          ck.addToCodes(new Code(codName:'汉族'))
  70.          ck.addToCodes(new Code(codName:'苗族'))
  71.          ck.addToCodes(new Code(codName:'藏族'))
  72.          ck.save()
  73.     }
  74.     private void initEducationType() {
  75.          def ck = new Ckind(ckiName:'学历',ckiFlag:'EducationType',ckiState:'',ckimemo:'')
  76.          ck.save()
  77.          ck.addToCodes(new Code(codName:'初中'))
  78.          ck.addToCodes(new Code(codName:'高中'))
  79.          ck.addToCodes(new Code(codName:'中专'))
  80.          ck.addToCodes(new Code(codName:'大专'))
  81.          ck.addToCodes(new Code(codName:'本科'))
  82.          ck.addToCodes(new Code(codName:'本科2'))
  83.          ck.addToCodes(new Code(codName:'硕士'))
  84.          ck.addToCodes(new Code(codName:'博士'))
  85.          ck.save()
  86.     }
  87.     private void initProfessionType() {
  88.          def ck = new Ckind(ckiName:'职业',ckiFlag:'ProfessionType',ckiState:'',ckimemo:'')
  89.          ck.save()
  90.          ck.addToCodes(new Code(codName:'学生'))
  91.          ck.addToCodes(new Code(codName:'教师'))
  92.          ck.addToCodes(new Code(codName:'商人'))
  93.          ck.addToCodes(new Code(codName:'军人'))
  94.          ck.addToCodes(new Code(codName:'农民'))
  95.          ck.save()
  96.     }
  97.     private void initWorkstate() {
  98.          def ck = new Ckind(ckiName:'在职状态',ckiFlag:'Workstate',ckiState:'',ckimemo:'')
  99.          ck.save()
  100.          ck.addToCodes(new Code(codName:'空闲在家'))
  101.          ck.addToCodes(new Code(codName:'在职'))
  102.          ck.addToCodes(new Code(codName:'离职'))
  103.          ck.save()
  104.     }
  105.     private void initHealthState() {
  106.          def ck = new Ckind(ckiName:'健康状况',ckiFlag:'HealthState',ckiState:'',ckimemo:'')
  107.          ck.save()
  108.          ck.addToCodes(new Code(codName:'BAD'))
  109.          ck.addToCodes(new Code(codName:'一般'))
  110.          ck.addToCodes(new Code(codName:'良好'))
  111.          ck.save()
  112.     }
  113.     private void initCustomerType() {
  114.          def ck = new Ckind(ckiName:'客户类型',ckiFlag:'CustomerType',ckiState:'',ckimemo:'')
  115.          ck.save()
  116.          ck.addToCodes(new Code(codName:'一般客户'))
  117.          ck.addToCodes(new Code(codName:'常来客户'))
  118.          ck.addToCodes(new Code(codName:'重要客户'))
  119.          ck.addToCodes(new Code(codName:'高级客户'))
  120.          ck.save()
  121.     }
  122.     private void initStaffType() {
  123.          def ck = new Ckind(ckiName:'员工类型',ckiFlag:'StaffType',ckiState:'',ckimemo:'')
  124.          ck.save()
  125.          ck.addToCodes(new Code(codName:'普通员工'))
  126.          ck.addToCodes(new Code(codName:'NEW MAN'))
  127.          ck.addToCodes(new Code(codName:'OLD MAN'))
  128.          ck.save()
  129.     }
  130.     private void initDepartment() {
  131.          def ck = new Ckind(ckiName:'部门',ckiFlag:'Department',ckiState:'',ckimemo:'')
  132.          ck.save()
  133.          ck.addToCodes(new Code(codName:'HR'))
  134.          ck.addToCodes(new Code(codName:'RD'))
  135.          ck.addToCodes(new Code(codName:'OFFICE'))
  136.          ck.save()
  137.     }
  138.     private void initPosition() {
  139.          def ck = new Ckind(ckiName:'职位',ckiFlag:'Position',ckiState:'',ckimemo:'')
  140.          ck.save()
  141.          ck.addToCodes(new Code(codName:'组长'))
  142.          ck.addToCodes(new Code(codName:'部门经理'))
  143.          ck.save()
  144.     }
  145.     private void initContratType() {
  146.          def ck = new Ckind(ckiName:'合同类型',ckiFlag:'ContratType',ckiState:'',ckimemo:'')
  147.          ck.save()
  148.          ck.addToCodes(new Code(codName:'临时合同'))
  149.          ck.addToCodes(new Code(codName:'试用合同'))
  150.          ck.addToCodes(new Code(codName:'正式合同'))
  151.          ck.save()
  152.     }
  153.     private void initContratState() {
  154.          def ck = new Ckind(ckiName:'合同状态',ckiFlag:'ContratState',ckiState:'',ckimemo:'')
  155.          ck.save()
  156.          ck.addToCodes(new Code(codName:'可用'))
  157.          ck.addToCodes(new Code(codName:'过期'))
  158.          ck.addToCodes(new Code(codName:'STOPED'))
  159.          ck.save()
  160.     }
  161.     private void initSignType() {
  162.          def ck = new Ckind(ckiName:'签到类型',ckiFlag:'SignType',ckiState:'',ckimemo:'')
  163.          ck.save()
  164.          ck.addToCodes(new Code(codName:'签到'))
  165.          ck.addToCodes(new Code(codName:'签走'))
  166.          ck.save()
  167.     }
  168.    private void initProductType() {
  169.          def ck = new Ckind(ckiName:'产品类型',ckiFlag:'ProductType',ckiState:'',ckimemo:'')
  170.          ck.save()
  171.          ck.addToCodes(new Code(codName:'GOOD PRODUCT'))
  172.          ck.save()
  173.          ck.addToCodes(new Code(codName:'BAD PRODUCT'))
  174.     }
  175.     private void initPowerLevel() {
  176.          def ck = new Ckind(ckiName:'权限等级',ckiFlag:'PowerLevel',ckiState:'',ckimemo:'')
  177.          ck.save()
  178.          ck.addToCodes(new Code(codName:'NO.1',codValue2:'1'))
  179.          ck.save()
  180.          ck.addToCodes(new Code(codName:'NO.2',codValue2:'2'))
  181.     }
  182. }