|
@ -17,17 +17,20 @@ |
|
|
|
|
|
|
|
|
package com.epmet.service.evaluationindex.screen.impl; |
|
|
package com.epmet.service.evaluationindex.screen.impl; |
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
|
|
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
|
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
|
|
import com.epmet.constant.CompareConstant; |
|
|
import com.epmet.constant.CompareConstant; |
|
|
import com.epmet.constant.DataSourceConstant; |
|
|
import com.epmet.constant.DataSourceConstant; |
|
|
import com.epmet.constant.IndexCalConstant; |
|
|
import com.epmet.constant.IndexCalConstant; |
|
|
import com.epmet.dao.evaluationindex.screen.*; |
|
|
import com.epmet.dao.evaluationindex.screen.*; |
|
|
|
|
|
import com.epmet.dto.indexcollect.form.CustomerBizOrgFormDTO; |
|
|
import com.epmet.dto.screencoll.form.*; |
|
|
import com.epmet.dto.screencoll.form.*; |
|
|
|
|
|
import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity; |
|
|
|
|
|
import com.epmet.entity.evaluationindex.screen.ScreenCustomerBizOrgEntity; |
|
|
import com.epmet.entity.evaluationindex.screen.ScreenEventImgDataEntity; |
|
|
import com.epmet.entity.evaluationindex.screen.ScreenEventImgDataEntity; |
|
|
import com.epmet.entity.evaluationindex.screen.ScreenUserJoinEntity; |
|
|
import com.epmet.entity.evaluationindex.screen.ScreenUserJoinEntity; |
|
|
import com.epmet.service.evaluationindex.screen.ShiBeiScreenCollService; |
|
|
import com.epmet.service.evaluationindex.screen.ShiBeiScreenCollService; |
|
@ -40,7 +43,6 @@ import org.springframework.util.CollectionUtils; |
|
|
import java.math.BigDecimal; |
|
|
import java.math.BigDecimal; |
|
|
import java.util.ArrayList; |
|
|
import java.util.ArrayList; |
|
|
import java.util.Calendar; |
|
|
import java.util.Calendar; |
|
|
import java.util.Collection; |
|
|
|
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
import java.util.stream.Collectors; |
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
@ -81,6 +83,8 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { |
|
|
@Autowired |
|
|
@Autowired |
|
|
private ScreenCustomerAgencyDao screenCustomerAgencyDao; |
|
|
private ScreenCustomerAgencyDao screenCustomerAgencyDao; |
|
|
@Autowired |
|
|
@Autowired |
|
|
|
|
|
private ScreenCustomerBizOrgDao screenCustomerBizOrgDao; |
|
|
|
|
|
@Autowired |
|
|
private ScreenUserTotalDataDao screenUserTotalDataDao; |
|
|
private ScreenUserTotalDataDao screenUserTotalDataDao; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private ScreenUserJoinDao screenUserJoinDao; |
|
|
private ScreenUserJoinDao screenUserJoinDao; |
|
@ -396,8 +400,31 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) |
|
|
|
|
|
@Override |
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
|
|
public Integer initBizOrg(CustomerBizOrgFormDTO formDTO) { |
|
|
|
|
|
ValidatorUtils.validateEntity(formDTO); |
|
|
|
|
|
List<ScreenCustomerAgencyEntity> entityList = screenCustomerAgencyDao.selectListAgencyInfo(formDTO.getCustomerId()); |
|
|
|
|
|
List<ScreenCustomerBizOrgEntity> list = new ArrayList<>(); |
|
|
|
|
|
if (CollectionUtils.isEmpty(entityList)) { |
|
|
|
|
|
return 0; |
|
|
|
|
|
} |
|
|
|
|
|
entityList.forEach(o -> { |
|
|
|
|
|
ScreenCustomerBizOrgEntity entity = new ScreenCustomerBizOrgEntity(); |
|
|
|
|
|
entity.setCustomerId(o.getCustomerId()); |
|
|
|
|
|
entity.setOrgId(o.getAgencyId()); |
|
|
|
|
|
entity.setBizType(formDTO.getBizType()); |
|
|
|
|
|
list.add(entity); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
screenCustomerBizOrgDao.deleteByBizType(formDTO); |
|
|
|
|
|
return screenCustomerBizOrgDao.batchInsert(list); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 获取当前日期的前一个月的日期 |
|
|
* 获取当前日期的前一个月的日期 |
|
|
|
|
|
* |
|
|
* @param |
|
|
* @param |
|
|
* @return java.lang.String[] |
|
|
* @return java.lang.String[] |
|
|
* @Author zhangyong |
|
|
* @Author zhangyong |
|
@ -411,7 +438,8 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { |
|
|
int year = calendar.get(Calendar.YEAR); |
|
|
int year = calendar.get(Calendar.YEAR); |
|
|
int month = calendar.get(Calendar.MONTH) + NumConstant.ONE; |
|
|
int month = calendar.get(Calendar.MONTH) + NumConstant.ONE; |
|
|
date[NumConstant.ZERO] = String.valueOf(year); |
|
|
date[NumConstant.ZERO] = String.valueOf(year); |
|
|
date[NumConstant.ONE] = String.valueOf(month);; |
|
|
date[NumConstant.ONE] = String.valueOf(month); |
|
|
|
|
|
; |
|
|
if (NumConstant.TEN >= month) { |
|
|
if (NumConstant.TEN >= month) { |
|
|
date[NumConstant.ONE] = NumConstant.ZERO_STR + month; |
|
|
date[NumConstant.ONE] = NumConstant.ZERO_STR + month; |
|
|
} |
|
|
} |
|
|