|
@@ -16,6 +16,8 @@ import com.kxs.common.core.exception.GlobalCustomerException;
|
|
|
import com.kxs.common.core.util.AssertUtil;
|
|
import com.kxs.common.core.util.AssertUtil;
|
|
|
import com.kxs.common.core.util.R;
|
|
import com.kxs.common.core.util.R;
|
|
|
import com.kxs.common.security.util.SecurityUtils;
|
|
import com.kxs.common.security.util.SecurityUtils;
|
|
|
|
|
+import com.kxs.product.api.dto.admin.merchant.SysMerchantPageDTO;
|
|
|
|
|
+import com.kxs.product.api.dto.admin.merchant.SysMerchantUpdateDTO;
|
|
|
import com.kxs.product.api.dto.kxsapp.merchant.MachineRatioDTO;
|
|
import com.kxs.product.api.dto.kxsapp.merchant.MachineRatioDTO;
|
|
|
import com.kxs.product.api.dto.kxsapp.merchant.MerchantListDTO;
|
|
import com.kxs.product.api.dto.kxsapp.merchant.MerchantListDTO;
|
|
|
import com.kxs.product.api.dto.kxsapp.merchant.ToMerchantMakerDTO;
|
|
import com.kxs.product.api.dto.kxsapp.merchant.ToMerchantMakerDTO;
|
|
@@ -24,12 +26,14 @@ import com.kxs.product.api.model.KxsMachine;
|
|
|
import com.kxs.product.api.model.KxsMachineRatio;
|
|
import com.kxs.product.api.model.KxsMachineRatio;
|
|
|
import com.kxs.product.api.model.KxsMerchant;
|
|
import com.kxs.product.api.model.KxsMerchant;
|
|
|
import com.kxs.product.api.req.kxs.FeeSetReq;
|
|
import com.kxs.product.api.req.kxs.FeeSetReq;
|
|
|
|
|
+import com.kxs.product.api.vo.admin.merchant.SysMerchantPageVO;
|
|
|
import com.kxs.product.api.vo.kxsapp.merchant.MerchantDetailVO;
|
|
import com.kxs.product.api.vo.kxsapp.merchant.MerchantDetailVO;
|
|
|
import com.kxs.product.biz.constant.enums.ProductErrorTypeEnum;
|
|
import com.kxs.product.biz.constant.enums.ProductErrorTypeEnum;
|
|
|
import com.kxs.product.biz.mapper.KxsBrandMapper;
|
|
import com.kxs.product.biz.mapper.KxsBrandMapper;
|
|
|
import com.kxs.product.biz.mapper.KxsMachineMapper;
|
|
import com.kxs.product.biz.mapper.KxsMachineMapper;
|
|
|
import com.kxs.product.biz.mapper.KxsMachineRatioMapper;
|
|
import com.kxs.product.biz.mapper.KxsMachineRatioMapper;
|
|
|
import com.kxs.product.biz.mapper.KxsMerchantMapper;
|
|
import com.kxs.product.biz.mapper.KxsMerchantMapper;
|
|
|
|
|
+import com.kxs.product.biz.service.KxsMachineService;
|
|
|
import com.kxs.product.biz.service.KxsMerchantService;
|
|
import com.kxs.product.biz.service.KxsMerchantService;
|
|
|
import com.kxs.system.api.feign.RemoteOldService;
|
|
import com.kxs.system.api.feign.RemoteOldService;
|
|
|
import com.kxs.user.api.feign.RemoteKxsUserService;
|
|
import com.kxs.user.api.feign.RemoteKxsUserService;
|
|
@@ -43,6 +47,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
import java.time.LocalDate;
|
|
import java.time.LocalDate;
|
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
|
|
|
+import java.util.List;
|
|
|
import java.util.Optional;
|
|
import java.util.Optional;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -61,6 +66,8 @@ public class KxsMerchantServiceImpl extends ServiceImpl<KxsMerchantMapper, KxsMe
|
|
|
private final KxsMachineRatioMapper kxsMachineRatioMapper;
|
|
private final KxsMachineRatioMapper kxsMachineRatioMapper;
|
|
|
private final RemoteOldService remoteOldService;
|
|
private final RemoteOldService remoteOldService;
|
|
|
|
|
|
|
|
|
|
+ private final KxsMachineService kxsMachineService;
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -340,6 +347,44 @@ public class KxsMerchantServiceImpl extends ServiceImpl<KxsMerchantMapper, KxsMe
|
|
|
return R.ok();
|
|
return R.ok();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public List<SysMerchantPageVO> merchantPage(Page page, SysMerchantPageDTO param) {
|
|
|
|
|
+ List<SysMerchantPageVO> list = baseMapper.merchantPage(page, param);
|
|
|
|
|
+ if(page != null){
|
|
|
|
|
+ page.setRecords(list);
|
|
|
|
|
+ }
|
|
|
|
|
+ return list;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void merchantUpdate(SysMerchantUpdateDTO param) {
|
|
|
|
|
+ Integer id = param.getId();
|
|
|
|
|
+ KxsMerchant kxsMerchant = getById(id);
|
|
|
|
|
+ if(kxsMerchant != null){
|
|
|
|
|
+ kxsMerchant.setMerchantNo(param.getMerchantNo());
|
|
|
|
|
+ kxsMerchant.setMerchantName(param.getMerchantName());
|
|
|
|
|
+ kxsMerchant.setMerchantCard(param.getMerchantCard());
|
|
|
|
|
+ kxsMerchant.setMerchantPhone(param.getMerchantPhone());
|
|
|
|
|
+ this.updateById(kxsMerchant);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public SysMerchantPageVO getMerchantDetail(Integer id) {
|
|
|
|
|
+ KxsMerchant kxsMerchant = this.getById(id);
|
|
|
|
|
+ SysMerchantPageVO sysMerchantPageVO = new SysMerchantPageVO();
|
|
|
|
|
+ if(kxsMerchant != null){
|
|
|
|
|
+ BeanUtil.copyProperties(kxsMerchant,sysMerchantPageVO);
|
|
|
|
|
+ Integer machineId = kxsMerchant.getMachineId();
|
|
|
|
|
+ KxsMachine kxsMachine = kxsMachineService.getById(machineId);
|
|
|
|
|
+ if(kxsMachine != null){
|
|
|
|
|
+ sysMerchantPageVO.setPosSn(kxsMachine.getPosSn());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return sysMerchantPageVO;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|