缴费冲正

 

var backPayForm = new Ext.FormPanel({
    url : 'backCustfee.action',
    labelAlign : 'right',
    labelWidth : 80,
    bodyStyle : 'padding:5px',
    border : false,
    baseCls : 'x-plain',
    defaultType : 'textfield',
    defaults : {anchor:'95%'},
    items : [
       {xtype : 'hidden',name : 'custfee.custfeeId',id:'custfeeId'},
       {xtype : 'textfield',fieldLabel : '抄表年月',name : 'custfee.copyMonth',disabled:true},
       {fieldLabel: '用户名称',name :'custfee.customerName',disabled:true},
       {fieldLabel: '本月电费',name :'custfee.thisMonthRate'}
      ],
    buttonAlign : 'center',
    minButtonWidth : 60,
    buttons : [{
        text:'缴费冲正',
        handler : function(){
            if(backPayForm.getForm().isValid()){
                Ext.Msg.confirm('操作提示','确认冲正?',function(btn){
                    if('yes' == btn){
                        backPayForm.getForm().submit({
                            success: function(form){
                                Ext.Msg.show({
                                    title : '成功提示',
                                    msg : '[' + form.findField('custfee.customerName').getValue() + '] 成功冲正!',
                                    icon : Ext.Msg.INFO,
                                    buttons : Ext.Msg.OK,
                                    fn:function(){
                                        window_back_pay.hide();
                                        var record = grid_custfeeLog.getSelectionModel().getSelected();
                                        record.set('paySign',0);
                                        record.set('thisMonthRate',form.findField('custfee.thisMonthRate').getValue());
                                        grid_custfeeLog.fireEvent('rowclick',grid_custfeeLog,grid_custfeeLog.getStore().indexOf(record));
                                    }
                                });
                            },
                            failure : function(form,action){
                                Ext.Msg.show({
                                    title : '错误提示',
                                    msg : '[' + form.findField('custfee.customerName').getValue() + '] 冲正失败!',
                                    icon : Ext.Msg.ERROR,
                                    buttons : Ext.Msg.OK
                                });
                            }
                        });
                    }
                });
            }
        }
    },{
        text : '取消',
        handler:function(){
            window_back_pay.hide();
        }
    }]
});

 

 

   XML 配置

 

 

		<action name="backCustfee" class="custfeeAction" method="back">
			<result type="json">
				<param name="includeProperties">success</param>
			</result>
		</action>

 

custfeeAction

 

	public String back() throws Exception {
		// custfee.setCustfeeId(Integer.valueOf(custfeeId));
		// custfee.setThisMonthRate(thisMonthRate);
			success = custfeeService.returnPay(custfee);
		return SUCCESS;
	}

 custfeeService

 

public boolean returnPay(Custfee custfee) {
		
		/*************** 缴费冲正操作 *************************/
		String thisMonthRate = "";
		if (null != custfee) {
			thisMonthRate = custfee.getThisMonthRate();
		}
		
		custfee = custfeeDao.findById(custfee.getCustfeeId());
		custfee.setPaySign("0");
		custfee.setPayData(" ");
		custfee.setThisMonthRate(thisMonthRate);
		Integer flag = custfeeDao.update(custfee);
		
		
		/*************** 记录缴费操作日志 *************************/
		if (null != custfee && !"".equals(custfee)) {
			PayLog payLog = new PayLog();
			payLog.setCustomerId(custfee.getCustomerId());
			payLog.setCustomerName(custfee.getCustomerName());
			payLog.setLogType("缴费冲正");
			payLog.setMoney(custfee.getThisMonthRate());
			payLog.setOperator("loshua");
			payLog.setModifytime(DateTime.getNowDateTime());
			
			 payLogDao.saveLog(payLog);
		}
		return flag == null ? false : true;
	}

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值