|
@@ -2,6 +2,7 @@ package com.txz.cif.service.impl;
|
|
|
|
|
|
import cn.hutool.core.date.DateTime;
|
|
import cn.hutool.core.date.DateTime;
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
|
+import com.txz.cif.dao.MidChannelMethodMapper;
|
|
import com.txz.cif.dao.PaymentChannelMapper;
|
|
import com.txz.cif.dao.PaymentChannelMapper;
|
|
import com.txz.cif.model.MidChannelMethod;
|
|
import com.txz.cif.model.MidChannelMethod;
|
|
import com.txz.cif.model.PaymentChannel;
|
|
import com.txz.cif.model.PaymentChannel;
|
|
@@ -12,6 +13,9 @@ import com.txz.cif.core.AbstractService;
|
|
import com.txz.cif.service.PaymentMethodService;
|
|
import com.txz.cif.service.PaymentMethodService;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
+import org.springframework.util.ObjectUtils;
|
|
|
|
+import tk.mybatis.mapper.entity.Condition;
|
|
|
|
+import tk.mybatis.mapper.entity.Example;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
@@ -27,12 +31,16 @@ public class PaymentChannelServiceImpl extends AbstractService<PaymentChannel> i
|
|
@Resource
|
|
@Resource
|
|
private PaymentChannelMapper cPaymentChannelMapper;
|
|
private PaymentChannelMapper cPaymentChannelMapper;
|
|
|
|
|
|
-
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ private MidChannelMethodMapper midChannelMethodMapper;
|
|
@Resource
|
|
@Resource
|
|
private PaymentMethodService paymentMethodService;
|
|
private PaymentMethodService paymentMethodService;
|
|
|
|
|
|
@Resource
|
|
@Resource
|
|
private MidChannelMethodService midChannelMethodService;
|
|
private MidChannelMethodService midChannelMethodService;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public int add(PaymentChannel model) {
|
|
public int add(PaymentChannel model) {
|
|
|
|
|
|
@@ -50,6 +58,31 @@ public class PaymentChannelServiceImpl extends AbstractService<PaymentChannel> i
|
|
return midChannelMethodService.save(midChannelMethodList);
|
|
return midChannelMethodService.save(midChannelMethodList);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public int modify(PaymentChannel model) {
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ model.setCreateUser("opt");
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //联动删除
|
|
|
|
+ if(!ObjectUtils.isEmpty(model.getIsValid())) {
|
|
|
|
+
|
|
|
|
+ Example example = new Example(MidChannelMethod.class);
|
|
|
|
+ example.createCriteria().andEqualTo("channelId",model.getId());
|
|
|
|
+ MidChannelMethod midChannelMethod = new MidChannelMethod();
|
|
|
|
+ midChannelMethod.setIsValid(model.getIsValid());
|
|
|
|
+ midChannelMethodMapper.updateByConditionSelective(midChannelMethod,example);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ return cPaymentChannelMapper.updateByPrimaryKeySelective(model);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
private List<MidChannelMethod> createMidChannelMethodList(Long paymentChannelId,DateTime date){
|
|
private List<MidChannelMethod> createMidChannelMethodList(Long paymentChannelId,DateTime date){
|
|
List<MidChannelMethod> midChannelMethodList = new ArrayList<>();
|
|
List<MidChannelMethod> midChannelMethodList = new ArrayList<>();
|
|
MidChannelMethod midChannelMethod = new MidChannelMethod();
|
|
MidChannelMethod midChannelMethod = new MidChannelMethod();
|