|
|
@@ -14,11 +14,13 @@ import com.goafanti.common.dao.UserServiceFollowMapper;
|
|
|
import com.goafanti.common.dao.UserServiceMapper;
|
|
|
import com.goafanti.common.model.UserService;
|
|
|
import com.goafanti.common.utils.DateUtils;
|
|
|
+import com.goafanti.common.utils.StringUtils;
|
|
|
import com.goafanti.core.mybatis.BaseMybatisDao;
|
|
|
import com.goafanti.core.mybatis.page.Pagination;
|
|
|
import com.goafanti.core.shiro.token.TokenManager;
|
|
|
import com.goafanti.user.bo.InputListOrderUserService;
|
|
|
import com.goafanti.user.bo.InputUserServiceFollow;
|
|
|
+import com.goafanti.user.bo.OrderProject;
|
|
|
import com.goafanti.user.bo.OutOrderUserService;
|
|
|
import com.goafanti.user.bo.OutUserServiceFollow;
|
|
|
import com.goafanti.user.service.UserServiceService;
|
|
|
@@ -34,7 +36,7 @@ public class UserServiceServiceImpl extends BaseMybatisDao<UserServiceMapper> i
|
|
|
@Override
|
|
|
public int addUseService(InputUserServiceFollow us) {
|
|
|
us.setAid(TokenManager.getAdminId());
|
|
|
- if (us.getRenewal()==1) {
|
|
|
+ if (us.getRenewal()==6) {
|
|
|
us.setRenewalTime(DateUtils.StringToDate(us.getRenewalTimes(), AFTConstants.YYYYMMDD));
|
|
|
}
|
|
|
Date date=new Date();
|
|
|
@@ -62,15 +64,77 @@ public class UserServiceServiceImpl extends BaseMybatisDao<UserServiceMapper> i
|
|
|
@SuppressWarnings("unchecked")
|
|
|
@Override
|
|
|
public Pagination<OutOrderUserService> listOrderUseService(InputListOrderUserService i) {
|
|
|
+ Map<String, Object> map = setParams(i);
|
|
|
+ Pagination<OutOrderUserService> p=(Pagination<OutOrderUserService>) findPage("OrderUseServiceList", "OrderUseServiceCount", map, i.getPageNo(), i.getPageSize());
|
|
|
+ List<OutOrderUserService> list= (List<OutOrderUserService>) p.getList();
|
|
|
+ setOrderUserService(list);
|
|
|
+ return p;
|
|
|
+ }
|
|
|
+
|
|
|
+ private Map<String, Object> setParams(InputListOrderUserService i) {
|
|
|
Map<String, Object>map =new HashMap<String, Object>();
|
|
|
if(i.getUserName()!=null)map.put("userName", i.getUserName());
|
|
|
if(i.getDepId()!=null)map.put("depId", i.getDepId());
|
|
|
if(i.getStartFollowTimes()!=null)map.put("startFollowTimes", i.getStartFollowTimes());
|
|
|
- if(i.getEndFollowTimes()!=null)map.put("endFollowTimes", i.getEndFollowTimes());
|
|
|
+ if(i.getEndFollowTimes()!=null)map.put("endFollowTimes", i.getEndFollowTimes()+" 23:59:59");
|
|
|
if(i.getStartSignTimes()!=null)map.put("startSignTimes", i.getStartSignTimes());
|
|
|
- if(i.getEndSignTimes()!=null)map.put("endSignTimes", i.getEndSignTimes());
|
|
|
+ if(i.getEndSignTimes()!=null)map.put("endSignTimes", i.getEndSignTimes()+" 23:59:59");
|
|
|
+ if(i.getAddWechat()!=null)map.put("addWechat", i.getAddWechat());
|
|
|
if(i.getRenewal()!=null)map.put("renewal", i.getRenewal());
|
|
|
- return (Pagination<OutOrderUserService>) findPage("OrderUseServiceList", "OrderUseServiceCount", map, i.getPageNo(), i.getPageSize());
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
+ @SuppressWarnings("unchecked")
|
|
|
+ @Override
|
|
|
+ public List<OutOrderUserService> listOrderUseServiceGetList(InputListOrderUserService i) {
|
|
|
+ Map<String, Object> map = setParams(i);
|
|
|
+ if (i.getPageSize()==null) i.setPageSize(99999);
|
|
|
+ List<OutOrderUserService> list=(List<OutOrderUserService>) findList("OrderUseServiceList", map,i.getPageNo(), i.getPageSize());
|
|
|
+ setOrderUserService(list);
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
+ private void setOrderUserService(List<OutOrderUserService> list) {
|
|
|
+ for (OutOrderUserService ou: list) {
|
|
|
+ StringBuffer projects=new StringBuffer();
|
|
|
+ StringBuffer consultants=new StringBuffer();
|
|
|
+ StringBuffer declareBatchs=new StringBuffer();
|
|
|
+ StringBuffer certificationNos=new StringBuffer();
|
|
|
+ for (OrderProject o : ou.getList()) {
|
|
|
+ if (StringUtils.isNotBlank(o.getCommodityName())) {
|
|
|
+ projects.append(o.getCommodityName());
|
|
|
+ } else {
|
|
|
+ projects.append("无");
|
|
|
+ }
|
|
|
+ projects.append("/");
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(o.getReceiverName())) {
|
|
|
+ consultants.append(o.getReceiverName());
|
|
|
+ } else {
|
|
|
+ consultants.append("无");
|
|
|
+ }
|
|
|
+ consultants.append("/");
|
|
|
+
|
|
|
+ if (o.getDeclarationBatch() != null) {
|
|
|
+ declareBatchs.append(o.getDeclarationBatch());
|
|
|
+ } else {
|
|
|
+ declareBatchs.append("无");
|
|
|
+ }
|
|
|
+ declareBatchs.append("/");
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(o.getCertificateNumber())) {
|
|
|
+ certificationNos.append(o.getCertificateNumber());
|
|
|
+ } else {
|
|
|
+ certificationNos.append("无");
|
|
|
+ }
|
|
|
+ certificationNos.append("/");
|
|
|
+
|
|
|
+ }
|
|
|
+ if(projects.length()>1)ou.setProjects(projects.substring(0, projects.length()-1));
|
|
|
+ if(consultants.length()>1)ou.setConsultants(consultants.substring(0, consultants.length()-1));
|
|
|
+ if(declareBatchs.length()>1)ou.setDeclareBatchs(declareBatchs.substring(0, declareBatchs.length()-1));
|
|
|
+ if(certificationNos.length()>1)ou.setCertificationNos(certificationNos.substring(0, certificationNos.length()-1));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
}
|