CustomerService

待回访业务逻辑


package com.casking.ccss.modules.cs.service;


import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


import com.casking.ccss.common.persistence.Page;
import com.casking.ccss.common.service.CrudService;
import com.casking.ccss.modules.cs.dao.CustomerDao;
import com.casking.ccss.modules.cs.entity.CustomerInfo;


/**
 * 顾客服务业务类
 * 
 * @author samwu
 *
 */
@Service
@Transactional(readOnly = true)
public class CustomerService extends CrudService<CustomerDao, CustomerInfo> {
@Autowired
private CustomerDao cp;


// 分页查询
public Page<CustomerInfo> findPage(Page<CustomerInfo> page, CustomerInfo ci) {
System.out.println("待回访:>>>>>>>>>>>>>>待回访页面");
return super.findPage(page, ci);
}


/** 回访弹窗查询患者信息 */
public CustomerInfo find(CustomerInfo ci) {
return cp.findVisit(ci);
}


/** 更新回访状态 */
public void updateState(CustomerInfo ci) {
cp.updateState(ci);
}


public void save(CustomerInfo info) {
super.save(info);


}


public void insertBatch(List<CustomerInfo> batchList) {
cp.insertBatch(batchList);
}


/** 查询回访状态 */
public CustomerInfo findVisitState(CustomerInfo ci) {
return cp.findVisitState(ci);
}


/** 查询新增记录数 */
public Integer findCount(CustomerInfo ci) {
return cp.findCount(ci);
}


/** 更新已回访页面的回访状态 */
public void upAllState(CustomerInfo ci) {
cp.upAllState(ci);
}


/** 任务类型二级菜单操作 */
public Map<String, Object> findTask(String idKey) throws Exception {
CustomerInfo ci = new CustomerInfo();
Map<String, Object> josnMap = new HashMap<String, Object>();
ci.setTaskType(idKey);
ArrayList<CustomerInfo> tasks = cp.findTask(ci);
List<HashMap<String, String>> list = new ArrayList<HashMap<String, String>>();
if (tasks.size() > 0) {
for (CustomerInfo info : tasks) {
System.out.println("info:" + info);
Map<String, String> taskMap = new HashMap<String, String>();
taskMap.put("taskType", info.getTaskType());
taskMap.put("taskName", info.getTaskName());
list.add((HashMap<String, String>) taskMap);
}
} else {
Map<String, String> taskMap = new HashMap<String, String>();
taskMap.put("taskType", "all");
taskMap.put("taskName", null);
list.add((HashMap<String, String>) taskMap);
}
josnMap.put("tasks", list);
return josnMap;


}


/** 就诊类型三级菜单操作 */
public Map<String, Object> findDiagnoseType(String idKey) throws Exception {
CustomerInfo ci = new CustomerInfo();
Map<String, Object> josnMap1 = new HashMap<String, Object>();
ci.setDiagnoseType(idKey);
ArrayList<CustomerInfo> diagnose = cp.findDiagnoseType(ci);
List<HashMap<String, String>> list1 = new ArrayList<HashMap<String, String>>();
if (diagnose.size() > 0) {
for (CustomerInfo info : diagnose) {
System.out.println("info:" + info);
Map<String, String> diagnoseMap = new HashMap<String, String>();
diagnoseMap.put("diagnoseType", info.getDiagnoseType());
diagnoseMap.put("office", info.getOffice());
list1.add((HashMap<String, String>) diagnoseMap);
}
} else {
Map<String, String> diagnoseMap = new HashMap<String, String>();
diagnoseMap.put("diagnoseType", "all");
diagnoseMap.put("office", null);
list1.add((HashMap<String, String>) diagnoseMap);
}
josnMap1.put("diagnose", list1);
return josnMap1;


}


}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值