| @@ -20,6 +20,7 @@ import com.iformall.domain.po.WxFinanceReceivePayway; | |||||
| import com.iformall.domain.po.WxFinanceReceiveSetoff; | import com.iformall.domain.po.WxFinanceReceiveSetoff; | ||||
| import com.iformall.domain.po.WxFlowModel; | import com.iformall.domain.po.WxFlowModel; | ||||
| import com.iformall.domain.po.base.BaseEntity; | import com.iformall.domain.po.base.BaseEntity; | ||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.domain.vo.FinanceBillSetoffSum; | import com.iformall.domain.vo.FinanceBillSetoffSum; | ||||
| import com.iformall.domain.vo.WxFinanceReceiveBillSum; | import com.iformall.domain.vo.WxFinanceReceiveBillSum; | ||||
| import com.iformall.domain.vo.WxFinanceReceiveCountVo; | import com.iformall.domain.vo.WxFinanceReceiveCountVo; | ||||
| @@ -309,7 +310,7 @@ public class WxFinanceController extends BaseController { | |||||
| if (null == record.getBills() || null == record.getPayWays()) { | if (null == record.getBills() || null == record.getPayWays()) { | ||||
| return new ResultData(Result.ERROR,"请选择账单和支付方式"); | return new ResultData(Result.ERROR,"请选择账单和支付方式"); | ||||
| } | } | ||||
| if (!this.isValidPayTime(record.getReceiveDate())) { | |||||
| if (!this.isValidPayTime(record.getReceiveDate(),record)) { | |||||
| return new ResultData(Result.ERROR,"支付时间请在结账截止时间之后"); | return new ResultData(Result.ERROR,"支付时间请在结账截止时间之后"); | ||||
| } | } | ||||
| Map map = wxFinanceService.createReceive(record,this.getUser()); | Map map = wxFinanceService.createReceive(record,this.getUser()); | ||||
| @@ -326,7 +327,7 @@ public class WxFinanceController extends BaseController { | |||||
| if (null == record.getReceiveDate()) { | if (null == record.getReceiveDate()) { | ||||
| return new ResultData(Result.ERROR,"请选择支付时间"); | return new ResultData(Result.ERROR,"请选择支付时间"); | ||||
| } | } | ||||
| if (!this.isValidPayTime(record.getReceiveDate())) { | |||||
| if (!this.isValidPayTime(record.getReceiveDate(),record)) { | |||||
| return new ResultData(Result.ERROR,"支付时间请在结账截止时间之后"); | return new ResultData(Result.ERROR,"支付时间请在结账截止时间之后"); | ||||
| } | } | ||||
| wxFinanceService.updateReceive(record,this.getUser()); | wxFinanceService.updateReceive(record,this.getUser()); | ||||
| @@ -372,7 +373,7 @@ public class WxFinanceController extends BaseController { | |||||
| if (null == record.getBills() || null == record.getPayWays()) { | if (null == record.getBills() || null == record.getPayWays()) { | ||||
| return new ResultData(Result.ERROR,"请选择账单和支付方式"); | return new ResultData(Result.ERROR,"请选择账单和支付方式"); | ||||
| } | } | ||||
| if (!this.isValidPayTime(record.getReceiveDate())) { | |||||
| if (!this.isValidPayTime(record.getReceiveDate(),record)) { | |||||
| return new ResultData(Result.ERROR,"支付时间请在结账截止时间之后"); | return new ResultData(Result.ERROR,"支付时间请在结账截止时间之后"); | ||||
| } | } | ||||
| Map map = wxFinanceService.createPay(record,this.getUser()); | Map map = wxFinanceService.createPay(record,this.getUser()); | ||||
| @@ -846,17 +847,16 @@ public class WxFinanceController extends BaseController { | |||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| private boolean isValidPayTime(Date date) { | |||||
| // SysConfig sysconfig = wxFinanceService.getFinishEndTime(this.getTenantInfo()); | |||||
| // String fdatestr = sysconfig.getConfigItemValue(); | |||||
| // if (StringUtils.isBlank(fdatestr)) { | |||||
| // return true; | |||||
| // } | |||||
| // Date fdate = DateUtils.stringToDate(fdatestr, DateUtils.DATE_TIME_PATTERN); | |||||
| // if (date.after(fdate)) { | |||||
| // return true; | |||||
| // } | |||||
| return false; | |||||
| private boolean isValidPayTime(Date date,TenantEntity tenantEntity) { | |||||
| WxFinanceCheckOut periodFindq = new WxFinanceCheckOut(); | |||||
| periodFindq.updateTenantInfo(tenantEntity); | |||||
| periodFindq.setStartDate(date); | |||||
| periodFindq.setEndDate(date); | |||||
| List<WxFinanceCheckOut> list = wxFinanceService.getCheckOutList(periodFindq); | |||||
| if (null != list && list.size() > 0 ) { | |||||
| return false; | |||||
| } | |||||
| return true; | |||||
| } | } | ||||