diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/domain/http/Channel.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/domain/http/Channel.java index 08107dc8..dc2c62f3 100644 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/domain/http/Channel.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/domain/http/Channel.java @@ -26,8 +26,8 @@ public class Channel extends BaseEntity @Excel(name = "渠道签名") private String channelSign; - /** 渠道名称 */ - @Excel(name = "渠道名称") + /** 渠道类型 1H5 2连登 3半流程 4全流程*/ + @Excel(name = "渠道类型") private String channelType; /** 扣量比 */ diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/domain/http/Customer.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/domain/http/Customer.java index 477015a9..8437cf4b 100644 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/domain/http/Customer.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/domain/http/Customer.java @@ -122,4 +122,5 @@ public class Customer extends BaseEntity @Excel(name = "芝麻分") private Integer zhiMa; + } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/ChannelController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/ChannelController.java index 6769bd84..79ac62d9 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/ChannelController.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/ChannelController.java @@ -57,7 +57,7 @@ public class ChannelController extends BaseController */ @RequiresPermissions("system:channel:query") @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable("id") Long id) + public AjaxResult getInfo(@PathVariable("id") Integer id) { return success(channelService.selectChannelById(id)); } @@ -67,7 +67,7 @@ public class ChannelController extends BaseController */ @RequiresPermissions("system:channel:add") @Log(title = "渠道配置", businessType = BusinessType.INSERT) - @PostMapping + @RequestMapping(value = "/add", method = RequestMethod.POST) public AjaxResult add(@RequestBody Channel channel) { return toAjax(channelService.insertChannel(channel)); @@ -78,7 +78,7 @@ public class ChannelController extends BaseController */ @RequiresPermissions("system:channel:edit") @Log(title = "渠道配置", businessType = BusinessType.UPDATE) - @PutMapping + @RequestMapping(value = "/edit", method = RequestMethod.POST) public AjaxResult edit(@RequestBody Channel channel) { return toAjax(channelService.updateChannel(channel)); diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/CustomerController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/CustomerController.java index 634ea27a..41918e09 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/CustomerController.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/CustomerController.java @@ -6,6 +6,7 @@ import javax.servlet.http.HttpServletResponse; import com.ruoyi.common.core.constant.SecurityConstants; import com.ruoyi.common.core.domain.R; +import com.ruoyi.system.service.IMerchantService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import com.ruoyi.common.log.annotation.Log; @@ -31,6 +32,9 @@ public class CustomerController extends BaseController @Autowired private ICustomerService customerService; + @Autowired + private IMerchantService merchantService; + /** * 查询客户信息列表 */ @@ -105,7 +109,7 @@ public class CustomerController extends BaseController */ @RequiresPermissions("system:customer:add") @Log(title = "客户信息", businessType = BusinessType.INSERT) - @PostMapping + @RequestMapping(value = "/add", method = RequestMethod.POST) public AjaxResult add(@RequestBody Customer customer) { return toAjax(customerService.insertCustomer(customer)); @@ -116,7 +120,7 @@ public class CustomerController extends BaseController */ @RequiresPermissions("system:customer:edit") @Log(title = "客户信息", businessType = BusinessType.UPDATE) - @PutMapping + @RequestMapping(value = "/edit", method = RequestMethod.POST) public AjaxResult edit(@RequestBody Customer customer) { return toAjax(customerService.updateCustomer(customer)); @@ -161,4 +165,14 @@ public class CustomerController extends BaseController } + + /** + * 获取商户下渠道列表 + * @return + */ + @RequestMapping(value = "/getAllMerchantList", method = RequestMethod.GET) + public AjaxResult getAllMerchantList() + { + return success(merchantService.findAllMerchantList()); + } } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/MerchantController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/MerchantController.java index 592f1320..85908f20 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/MerchantController.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/MerchantController.java @@ -96,7 +96,7 @@ public class MerchantController extends BaseController */ @RequiresPermissions("system:merchant:add") @Log(title = "商户", businessType = BusinessType.INSERT) - @PostMapping + @RequestMapping(value = "/add", method = RequestMethod.POST) public AjaxResult add(@RequestBody Merchant merchant) { return toAjax(merchantService.insertMerchant(merchant)); @@ -107,7 +107,7 @@ public class MerchantController extends BaseController */ @RequiresPermissions("system:merchant:edit") @Log(title = "商户", businessType = BusinessType.UPDATE) - @PutMapping + @RequestMapping(value = "/edit", method = RequestMethod.POST) public AjaxResult edit(@RequestBody Merchant merchant) { return toAjax(merchantService.updateMerchant(merchant)); diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ChannelMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ChannelMapper.java index 23c34960..07f07ef8 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ChannelMapper.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ChannelMapper.java @@ -19,7 +19,7 @@ public interface ChannelMapper extends BaseMapper * @param id 渠道配置主键 * @return 渠道配置 */ - public Channel selectChannelById(Long id); + public Channel selectChannelById(Integer id); /** * 查询渠道配置列表 @@ -35,7 +35,7 @@ public interface ChannelMapper extends BaseMapper * @param channel 渠道配置 * @return 结果 */ - public Long insertChannel(Channel channel); + public int insertChannel(Channel channel); /** * 修改渠道配置 diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/MerchantMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/MerchantMapper.java index 990308fe..f7296b0d 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/MerchantMapper.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/MerchantMapper.java @@ -61,4 +61,11 @@ public interface MerchantMapper extends BaseMapper * @return 结果 */ public int deleteMerchantByIds(Long[] ids); -} + + /** + * 获取商户列表 + * @return + */ + public List findAllMerchantList(); + + } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/IChannelService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/IChannelService.java index 291f8e4a..b25a077f 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/IChannelService.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/IChannelService.java @@ -18,7 +18,7 @@ public interface IChannelService * @param id 渠道配置主键 * @return 渠道配置 */ - public Channel selectChannelById(Long id); + public Channel selectChannelById(Integer id); /** * 查询渠道配置列表 @@ -34,7 +34,7 @@ public interface IChannelService * @param channel 渠道配置 * @return 结果 */ - public Long insertChannel(Channel channel); + public int insertChannel(Channel channel); /** * 修改渠道配置 diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/IMerchantService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/IMerchantService.java index 31d98a65..f38f5b01 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/IMerchantService.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/IMerchantService.java @@ -78,4 +78,10 @@ public interface IMerchantService extends IService * @return */ AjaxResult getMatchMerchantList(HttpServletRequest request); + /** + * 获取所有的商户列表 + * @return + */ + public List findAllMerchantList(); + } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ChannelServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ChannelServiceImpl.java index 02cf0adb..0304394e 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ChannelServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ChannelServiceImpl.java @@ -38,7 +38,7 @@ public class ChannelServiceImpl implements IChannelService * @return 渠道配置 */ @Override - public Channel selectChannelById(Long id) + public Channel selectChannelById(Integer id) { return channelMapper.selectChannelById(id); } @@ -63,13 +63,14 @@ public class ChannelServiceImpl implements IChannelService */ @Override @Transactional(rollbackFor = Exception.class) - public Long insertChannel(Channel channel) + public int insertChannel(Channel channel) { if (StringUtils.isEmpty(channel.getChannelSign())) { channel.setChannelSign(RandomStringUtils.random(16, true, false)); } channel.setCreateTime(DateUtils.getNowDate()); - Long i = channelMapper.insertChannel(channel); + channel.setUpdateTime(DateUtils.getNowDate()); + int i = channelMapper.insertChannel(channel); //新增插入缓存 Channel channelById = channelMapper.selectChannelById(i); redisService.setCacheObject(CacheConstants.CHANNEL_ID+i,channelById); diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/MerchantServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/MerchantServiceImpl.java index e1a18180..2702589f 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/MerchantServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/MerchantServiceImpl.java @@ -130,6 +130,10 @@ public class MerchantServiceImpl extends ServiceImpl i return R.ok(merchants); } + public List findAllMerchantList(){ + return merchantMapper.findAllMerchantList(); + } + @Override public AjaxResult getMatchMerchantList(HttpServletRequest request) { String authorization = request.getHeader("Authorization"); diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/ChannelMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/ChannelMapper.xml index 36507402..f693439b 100644 --- a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/ChannelMapper.xml +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/ChannelMapper.xml @@ -8,6 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -19,7 +20,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select id, channel_name, channel_sign, score, html_name, html_location, ips, period, create_time, update_time, remark from channel + select id, channel_name, channel_sign,channel_type, score, html_name, html_location, ips, period, create_time, update_time, remark from channel select id, channel_name, channel_sign from channel @@ -29,6 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and channel_name like concat('%', #{channelName}, '%') and channel_sign = #{channelSign} + and channel_type = #{channelType} and score = #{score} and html_name like concat('%', #{htmlName}, '%') and html_location = #{htmlLocation} @@ -37,7 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - where id = #{id} @@ -47,6 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" channel_name, channel_sign, + channel_type, score, html_name, html_location, @@ -59,6 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{channelName}, #{channelSign}, + #{channelType}, #{score}, #{htmlName}, #{htmlLocation}, @@ -75,6 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" channel_name = #{channelName}, channel_sign = #{channelSign}, + channel_type = #{channelType}, score = #{score}, html_name = #{htmlName}, html_location = #{htmlLocation}, diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/CustomerMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/CustomerMapper.xml index bf072ced..1552efda 100644 --- a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/CustomerMapper.xml +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/CustomerMapper.xml @@ -1,11 +1,12 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + + @@ -19,48 +20,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + - select id, age, sex, name, acturl_name, phone, phone_md5, is_auth, city, city_code, first_login_time, last_login_time, last_login_ip, status, social_security_no, social_security_low, social_security_high, car_no, car_have, guarantee_slip_low, guarantee_slip_centre, guarantee_slip_high, education_middle, education_high_school, education_polytechnic, education_junior_college, education_undergraduate_course, education_postgraduate, accumulation_fund_low, accumulation_fund_high, hourse_no, hourse_full_payment, hourse_mortgaging, office_worker, civil_servant, private_property_owners, self_employed_person, other_occupations, hua_bei_low, hua_bei_middle, hua_bei_high, bai_tiao_low, bai_tiao_middle, bai_tiao_high, zhi_ma, create_time, update_time from customer + select id, channel_id, age, sex, name, acturl_name, phone, phone_md5, is_auth, city, city_code, first_login_time, last_login_time, last_login_ip, status, social_security, car, guarantee_slip, education, accumulation_fund, hourse, career, hua_bei, bai_tiao, zhi_ma, create_time, update_time from customer - + @@ -275,4 +282,8 @@ #{id} + + \ No newline at end of file