Merge branch 'master' of https://gitee.com/darlk/ShengTangManage into xzj
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
package com.stdiet.custom.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.stdiet.custom.domain.SysCustomer;
|
||||
import com.stdiet.custom.dto.request.CustomerInvestigateRequest;
|
||||
|
||||
@ -74,4 +76,9 @@ public interface ISysCustomerService
|
||||
* @return
|
||||
*/
|
||||
boolean isCustomerExistByPhone(SysCustomer sysCustomer);
|
||||
|
||||
Map<String,Object> getPhysicalSignsById(Long id);
|
||||
|
||||
Map<String,Object> getPhysicalSignsByOutId(String id);
|
||||
|
||||
}
|
@ -4,6 +4,7 @@ import java.util.List;
|
||||
|
||||
import com.stdiet.custom.domain.SysOrder;
|
||||
import com.stdiet.custom.domain.SysRecipesPlan;
|
||||
import com.stdiet.custom.domain.SysRecipesPlanListInfo;
|
||||
import org.springframework.core.annotation.Order;
|
||||
|
||||
/**
|
||||
@ -90,5 +91,10 @@ public interface ISysRecipesPlanService
|
||||
*/
|
||||
List<SysRecipesPlan> selectPlanListByOrderId(SysRecipesPlan sysRecipesPlan);
|
||||
|
||||
public void myGenerateRecipesPlan(SysOrder sysOrder);
|
||||
List<SysRecipesPlan> selectPlanListByOutId(String outId);
|
||||
|
||||
Long getCusIdByOutId(String outId);
|
||||
|
||||
List<SysRecipesPlanListInfo> selectRecipesPlanListInfo(String outId);
|
||||
|
||||
}
|
@ -12,9 +12,12 @@ public interface ISysRecipesService {
|
||||
|
||||
public List<SysRecipes> selectSysRecipesByRecipesId(Long id);
|
||||
|
||||
public List<SysRecipesDailyDishes> selectDishesByMenuId(Long id);
|
||||
|
||||
public int updateDishesDetail(SysRecipesDailyDishes sysRecipesDaily);
|
||||
|
||||
public int addDishes(SysRecipesDailyDishes sysRecipesDaily);
|
||||
|
||||
public int deleteDishes(Long id);
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,13 @@
|
||||
package com.stdiet.custom.service;
|
||||
|
||||
import com.stdiet.custom.domain.SysRecipesPlanListInfo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface ISysWapServices {
|
||||
|
||||
List<SysRecipesPlanListInfo> getRecipesPlanListInfo(String outId);
|
||||
|
||||
Map<String, Object> getHealthyDataByOutId(String outId);
|
||||
}
|
@ -1,22 +1,22 @@
|
||||
package com.stdiet.custom.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.stdiet.common.core.domain.model.LoginUser;
|
||||
import com.stdiet.common.utils.DateUtils;
|
||||
import com.stdiet.common.utils.SecurityUtils;
|
||||
import com.stdiet.common.utils.StringUtils;
|
||||
import com.stdiet.common.utils.bean.ObjectUtils;
|
||||
import com.stdiet.common.utils.sign.AesUtils;
|
||||
import com.stdiet.custom.domain.SysCustomer;
|
||||
import com.stdiet.custom.domain.SysCustomerHealthy;
|
||||
import com.stdiet.custom.domain.SysCustomerPhysicalSigns;
|
||||
import com.stdiet.custom.dto.request.CustomerInvestigateRequest;
|
||||
import com.stdiet.custom.mapper.SysCustomerMapper;
|
||||
import com.stdiet.custom.mapper.SysCustomerPhysicalSignsMapper;
|
||||
import com.stdiet.custom.service.ISysCustomerService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.stdiet.custom.mapper.SysCustomerMapper;
|
||||
import com.stdiet.custom.domain.SysCustomer;
|
||||
import com.stdiet.custom.service.ISysCustomerService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 客户信息Service业务层处理
|
||||
*
|
||||
@ -25,14 +25,19 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
*/
|
||||
@Service
|
||||
@Transactional
|
||||
public class SysCustomerServiceImpl implements ISysCustomerService
|
||||
{
|
||||
public class SysCustomerServiceImpl implements ISysCustomerService {
|
||||
@Autowired
|
||||
private SysCustomerMapper sysCustomerMapper;
|
||||
|
||||
@Autowired
|
||||
private SysCustomerPhysicalSignsMapper sysCustomerPhysicalSignsMapper;
|
||||
|
||||
@Autowired
|
||||
private SysCustomerHealthyServiceImpl sysCustomerHealthyService;
|
||||
|
||||
@Autowired
|
||||
private SysCustomerPhysicalSignsServiceImpl sysCustomerPhysicalSignsService;
|
||||
|
||||
/**
|
||||
* 查询客户信息
|
||||
*
|
||||
@ -40,8 +45,7 @@ public class SysCustomerServiceImpl implements ISysCustomerService
|
||||
* @return 客户信息
|
||||
*/
|
||||
@Override
|
||||
public SysCustomer selectSysCustomerById(Long id)
|
||||
{
|
||||
public SysCustomer selectSysCustomerById(Long id) {
|
||||
return sysCustomerMapper.selectSysCustomerById(id);
|
||||
}
|
||||
|
||||
@ -52,8 +56,7 @@ public class SysCustomerServiceImpl implements ISysCustomerService
|
||||
* @return 客户信息
|
||||
*/
|
||||
@Override
|
||||
public List<SysCustomer> selectSysCustomerList(SysCustomer sysCustomer)
|
||||
{
|
||||
public List<SysCustomer> selectSysCustomerList(SysCustomer sysCustomer) {
|
||||
return sysCustomerMapper.selectSysCustomerList(sysCustomer);
|
||||
}
|
||||
|
||||
@ -64,8 +67,7 @@ public class SysCustomerServiceImpl implements ISysCustomerService
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSysCustomer(SysCustomer sysCustomer)
|
||||
{
|
||||
public int insertSysCustomer(SysCustomer sysCustomer) {
|
||||
sysCustomer.setCreateTime(DateUtils.getNowDate());
|
||||
return sysCustomerMapper.insertSysCustomer(sysCustomer);
|
||||
}
|
||||
@ -77,8 +79,7 @@ public class SysCustomerServiceImpl implements ISysCustomerService
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSysCustomer(SysCustomer sysCustomer)
|
||||
{
|
||||
public int updateSysCustomer(SysCustomer sysCustomer) {
|
||||
sysCustomer.setUpdateTime(DateUtils.getNowDate());
|
||||
return sysCustomerMapper.updateSysCustomer(sysCustomer);
|
||||
}
|
||||
@ -90,8 +91,7 @@ public class SysCustomerServiceImpl implements ISysCustomerService
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysCustomerByIds(Long[] ids)
|
||||
{
|
||||
public int deleteSysCustomerByIds(Long[] ids) {
|
||||
return sysCustomerMapper.deleteSysCustomerByIds(ids);
|
||||
}
|
||||
|
||||
@ -102,8 +102,7 @@ public class SysCustomerServiceImpl implements ISysCustomerService
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysCustomerById(Long id)
|
||||
{
|
||||
public int deleteSysCustomerById(Long id) {
|
||||
return sysCustomerMapper.deleteSysCustomerById(id);
|
||||
}
|
||||
|
||||
@ -113,26 +112,60 @@ public class SysCustomerServiceImpl implements ISysCustomerService
|
||||
* @param phone 手机号
|
||||
* @return 结果
|
||||
*/
|
||||
public SysCustomer getCustomerByPhone(String phone){
|
||||
public SysCustomer getCustomerByPhone(String phone) {
|
||||
return sysCustomerMapper.getCustomerByPhone(phone);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断客户手机号是否已存在
|
||||
*
|
||||
* @param sysCustomer
|
||||
* @return
|
||||
*/
|
||||
public boolean isCustomerExistByPhone(SysCustomer sysCustomer){
|
||||
if(sysCustomer.getId() != null){
|
||||
if(StringUtils.isNotEmpty(sysCustomer.getPhone())){
|
||||
public boolean isCustomerExistByPhone(SysCustomer sysCustomer) {
|
||||
if (sysCustomer.getId() != null) {
|
||||
if (StringUtils.isNotEmpty(sysCustomer.getPhone())) {
|
||||
SysCustomer phoneCustomer = getCustomerByPhone(sysCustomer.getPhone());
|
||||
return phoneCustomer != null && phoneCustomer.getId().intValue() != sysCustomer.getId().intValue();
|
||||
}
|
||||
}else{
|
||||
if(StringUtils.isNotEmpty(sysCustomer.getPhone())){
|
||||
} else {
|
||||
if (StringUtils.isNotEmpty(sysCustomer.getPhone())) {
|
||||
return getCustomerByPhone(sysCustomer.getPhone()) != null;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getPhysicalSignsById(Long id) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
String key = "customerHealthy";
|
||||
result.put("type", 0);
|
||||
//查询健康评估信息
|
||||
SysCustomerHealthy sysCustomerHealthy = sysCustomerHealthyService.selectSysCustomerHealthyByCustomerId(id);
|
||||
if (sysCustomerHealthy != null) {
|
||||
/* if (StringUtils.isNotEmpty(sysCustomerHealthy.getPhone())) {
|
||||
sysCustomerHealthy.setPhone(StringUtils.hiddenPhoneNumber(sysCustomerHealthy.getPhone()));
|
||||
}*/
|
||||
result.put(key, sysCustomerHealthy);
|
||||
} else {
|
||||
//查询体征信息
|
||||
SysCustomerPhysicalSigns sysCustomerPhysicalSigns = sysCustomerPhysicalSignsService.selectSysCustomerPhysicalSignsByCusId(id);
|
||||
if (sysCustomerPhysicalSigns != null) {
|
||||
/* if (StringUtils.isNotEmpty(sysCustomerPhysicalSigns.getPhone())) {
|
||||
sysCustomerPhysicalSigns.setPhone(StringUtils.hiddenPhoneNumber(sysCustomerPhysicalSigns.getPhone()));
|
||||
}*/
|
||||
result.put("type", 1);
|
||||
}
|
||||
result.put(key, sysCustomerPhysicalSigns);
|
||||
}
|
||||
//对ID进行加密
|
||||
result.put("enc_id", id != null ? AesUtils.encrypt(id + "", null) : "");
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getPhysicalSignsByOutId(String id) {
|
||||
return null;
|
||||
}
|
||||
}
|
@ -5,6 +5,7 @@ import com.stdiet.common.utils.SynchrolockUtil;
|
||||
import com.stdiet.custom.domain.SysOrder;
|
||||
import com.stdiet.custom.domain.SysOrderPause;
|
||||
import com.stdiet.custom.domain.SysRecipesPlan;
|
||||
import com.stdiet.custom.domain.SysRecipesPlanListInfo;
|
||||
import com.stdiet.custom.mapper.SysRecipesPlanMapper;
|
||||
import com.stdiet.custom.service.ISysOrderPauseService;
|
||||
import com.stdiet.custom.service.ISysOrderService;
|
||||
@ -286,7 +287,18 @@ public class SysRecipesPlanServiceImpl implements ISysRecipesPlanService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void myGenerateRecipesPlan(SysOrder sysOrder) {
|
||||
|
||||
public List<SysRecipesPlan> selectPlanListByOutId(String outId) {
|
||||
return sysRecipesPlanMapper.selectPlanListByOutId(outId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getCusIdByOutId(String outId) {
|
||||
return sysRecipesPlanMapper.getCusIdByOutId(outId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysRecipesPlanListInfo> selectRecipesPlanListInfo(String outId) {
|
||||
return sysRecipesPlanMapper.selectRecipesPlanListInfo(outId);
|
||||
}
|
||||
|
||||
}
|
@ -65,6 +65,11 @@ public class SysRecipesServiceImpl implements ISysRecipesService {
|
||||
return sysRecipesMapper.selectSysRecipesByRecipesId(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysRecipesDailyDishes> selectDishesByMenuId(Long id) {
|
||||
return sysRecipesMapper.selectDishesByMenuId(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateDishesDetail(SysRecipesDailyDishes sysRecipesDailyDishes) {
|
||||
return sysRecipesMapper.updateDishesDetail(sysRecipesDailyDishes);
|
||||
|
@ -0,0 +1,39 @@
|
||||
package com.stdiet.custom.service.impl;
|
||||
|
||||
import com.stdiet.common.utils.StringUtils;
|
||||
import com.stdiet.custom.domain.SysRecipesPlan;
|
||||
import com.stdiet.custom.domain.SysRecipesPlanListInfo;
|
||||
import com.stdiet.custom.service.ISysCustomerService;
|
||||
import com.stdiet.custom.service.ISysRecipesPlanService;
|
||||
import com.stdiet.custom.service.ISysWapServices;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
@Transactional
|
||||
public class SysWapServicesImp implements ISysWapServices {
|
||||
|
||||
@Autowired
|
||||
ISysCustomerService iSysCustomerService;
|
||||
|
||||
@Autowired
|
||||
ISysRecipesPlanService iSysRecipesPlanService;
|
||||
|
||||
@Override
|
||||
public List<SysRecipesPlanListInfo> getRecipesPlanListInfo(String outId) {
|
||||
return iSysRecipesPlanService.selectRecipesPlanListInfo(outId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getHealthyDataByOutId(String outId) {
|
||||
Long cusId = iSysRecipesPlanService.getCusIdByOutId(outId);
|
||||
if(cusId > 0) {
|
||||
return iSysCustomerService.getPhysicalSignsById(cusId);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user