编辑代码

import groovy.json.*
class HisPaymentPostBack{
    String hisPatientId
    String[] hisInputCodeList
    int paymentState
    String hisPaymentCode
}
def paramConvert(param){
    def jsonSlurper = new JsonSlurper()
    def object = jsonSlurper.parseText(param)
    def pePaymentState = 1
    if(object.sourceType == '3'){
        pePaymentState = -1
    }
    def hisPaymentPostBack = new HisPaymentPostBack(hisPatientId:object.patiMediaNum,hisInputCodeList:object.feeDetail.itemInputId,paymentState:pePaymentState,hisPaymentCode:object.cashId)
    return JsonOutput.toJson(hisPaymentPostBack)
}