|
|
|
@@ -2,7 +2,9 @@ package com.iformall.service.impl; |
|
|
|
|
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import com.iformall.domain.po.WxAppinfo; |
|
|
|
import com.iformall.domain.po.WxWeappExtSet; |
|
|
|
import com.iformall.mapper.WxAppinfoMapper; |
|
|
|
import com.iformall.mapper.WxWeappExtSetMapper; |
|
|
|
import com.iformall.service.WxWeappExtSetService; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
@@ -14,6 +16,9 @@ import java.util.List; |
|
|
|
|
|
|
|
@Service |
|
|
|
public class WxWeappExtSetServiceImpl implements WxWeappExtSetService { |
|
|
|
|
|
|
|
@Autowired |
|
|
|
WxAppinfoMapper appinfoMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
WxWeappExtSetMapper wxWeappExtSetMapper; |
|
|
|
@@ -44,11 +49,15 @@ public class WxWeappExtSetServiceImpl implements WxWeappExtSetService { |
|
|
|
Date curDate = new Date(); |
|
|
|
if (record.getId() == null) { |
|
|
|
//record.setId(UUID.randomUUID().toString().replaceAll("-", "")); |
|
|
|
final IdWorker idWorker = IdWorker.get(); |
|
|
|
record.setId(idWorker.nextId()); |
|
|
|
record.setCreateDate(curDate); |
|
|
|
record.setUpdateDate(curDate); |
|
|
|
wxWeappExtSetMapper.insertSelective(record); |
|
|
|
WxAppinfo appinfo = appinfoMapper.findByAppId(record.getAppId()); |
|
|
|
if(appinfo != null) { |
|
|
|
final IdWorker idWorker = IdWorker.get(); |
|
|
|
record.setId(idWorker.nextId()); |
|
|
|
record.setType(appinfo.getType()); |
|
|
|
record.setCreateDate(curDate); |
|
|
|
record.setUpdateDate(curDate); |
|
|
|
wxWeappExtSetMapper.insertSelective(record); |
|
|
|
} |
|
|
|
} else { |
|
|
|
record.setUpdateDate(curDate); |
|
|
|
wxWeappExtSetMapper.updateByPrimaryKeySelective(record); |
|
|
|
|