|
|
@ -24,18 +24,23 @@ import com.epmet.commons.tools.constant.FieldConstant; |
|
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.constant.UserConstant; |
|
|
|
import com.epmet.dao.CustomerStaffDao; |
|
|
|
import com.epmet.dao.StaffWechatDao; |
|
|
|
import com.epmet.dto.StaffWechatDTO; |
|
|
|
import com.epmet.dto.form.StaffWechatFormDTO; |
|
|
|
import com.epmet.entity.CustomerStaffEntity; |
|
|
|
import com.epmet.entity.StaffWechatEntity; |
|
|
|
import com.epmet.service.StaffWechatService; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.apache.logging.log4j.LogManager; |
|
|
|
import org.apache.logging.log4j.Logger; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
@ -48,7 +53,8 @@ import java.util.Map; |
|
|
|
@Service |
|
|
|
public class StaffWechatServiceImpl extends BaseServiceImpl<StaffWechatDao, StaffWechatEntity> implements StaffWechatService { |
|
|
|
private Logger logger = LogManager.getLogger(getClass()); |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private CustomerStaffDao customerStaffDao; |
|
|
|
@Override |
|
|
|
public PageData<StaffWechatDTO> page(Map<String, Object> params) { |
|
|
|
IPage<StaffWechatEntity> page = baseDao.selectPage( |
|
|
@ -119,6 +125,14 @@ public class StaffWechatServiceImpl extends BaseServiceImpl<StaffWechatDao, Staf |
|
|
|
logger.info(String.format("staff_Wechat记录已存在,userId[%s],wxOpenId[%s]", formDTO.getUserId(), formDTO.getWxOpenId())); |
|
|
|
this.update(staffWechatDTO); |
|
|
|
} |
|
|
|
//记录用户激活状态,激活时间
|
|
|
|
CustomerStaffEntity customerStaffEntity=customerStaffDao.selectByUserId(formDTO.getUserId()); |
|
|
|
if(null!=customerStaffEntity&&null==customerStaffEntity.getActiveTime()){ |
|
|
|
customerStaffEntity.setActiveTime(new Date()); |
|
|
|
//inactive未激活,active已激活
|
|
|
|
customerStaffEntity.setActiveFlag(UserConstant.ACTIVE); |
|
|
|
customerStaffDao.updateById(customerStaffEntity); |
|
|
|
} |
|
|
|
return new Result(); |
|
|
|
} |
|
|
|
|
|
|
|