Commit 363d571a by yao.xiao

修改-加解密问题

parent 8b9a3f3c
......@@ -95,12 +95,11 @@ public class CustomerServiceImpl implements CustomerService{
String accountId = createAccountId(mobileNo);
List<AclCustomer> aclCustomerList = aclCustomerDALService.findByLogin(mobileNo);
if(aclCustomerList.isEmpty()){
DESTypeHandler jpaCryptoConverter = new DESTypeHandler();
AclCustomer aclCustomer = new AclCustomer();
aclCustomer.setRole(2);//1= Staff 2=Customer 3=Partner
aclCustomer.setAccountId(accountId);
aclCustomer.setLogin(mobileNo);
aclCustomer.setMobileNo(jpaCryptoConverter.encode(mobileNo));
aclCustomer.setMobileNo(mobileNo);
aclCustomer.setPassword(EncryptUtil.encrypt(requestVO.getPassword(),null));
aclCustomer.setEmail(requestVO.getEmail());
aclCustomer.setCusLevel(1);
......
......@@ -1134,12 +1134,11 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
}else {
//此人为第一次进来
//帮其经行注册
DESTypeHandler jpaCryptoConverter = new DESTypeHandler();
aclCustomer = new AclCustomer();
aclCustomer.setRole(2);//1= Staff 2=Customer 3=Partner
aclCustomer.setAccountId(createAccountId(mobileNo));
aclCustomer.setLogin(mobileNo);
aclCustomer.setMobileNo(jpaCryptoConverter.encode(mobileNo));
aclCustomer.setMobileNo(mobileNo);
aclCustomer.setCusLevel(1);
aclCustomer.setName(requestVO.getName());
aclCustomer.setIsActive(1);
......@@ -1211,11 +1210,10 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
private void saveCustomerInfo(Long customerId, OwnOpportunityBasicInformationSaveRequestVO requestVO) {
AclCustomer customer = aclCustomerDALService.findById(customerId);
DESTypeHandler jpaCryptoConverter = new DESTypeHandler();
String mobileNo = customer.getMobileNo();
String idNo = customer.getIdNo();
customer.setMobileNo(jpaCryptoConverter.encode(mobileNo));
customer.setIdNo(jpaCryptoConverter.encode(idNo));
customer.setMobileNo(mobileNo);
customer.setIdNo(idNo);
customer.setName(requestVO.getName());
customer.setBirthDate(CommonUtil.stringParseDate(requestVO.getBirthDate(),"yyyy-MM-dd"));
customer.setGender(requestVO.getGender());
......@@ -1590,11 +1588,11 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
scoreMonthAverage= getScoreAverage(totalStatistics.get("scoreMonth"),practitionerNum);
}
//计算此团队一周增加的商机数 ag_mkt_leads_assigneds
Integer opportunitiesNum = mktLeadsAssignedsDALService.countPractitionerIdsAndThisWeek(practitionerIds);
//计算年/季/月 首年保费(premium)/佣金(commission)/件数(pieces) 均取至指派表ag_mkt_leads_assigneds
//拿到商机跟踪,失败id
Long refusedId = optionCodeToId.get("refused");
//计算此团队一周增加的商机数 ag_mkt_leads_assigneds
Integer opportunitiesNum = mktLeadsAssignedsDALService.countPractitionerIdsAndThisWeek(practitionerIds,refusedId);
//计算年/季/月 首年保费(premium)/佣金(commission)/件数(pieces) 均取至指派表ag_mkt_leads_assigneds
HashMap<String,BigDecimal> performanceForecast = mktLeadsAssignedsDALService.performanceForecastForTeam(practitionerIds,refusedId);
List<MktLeadsGoals> leadsGoals = getYearTeamGoals(practitionerId);
......
......@@ -24,7 +24,7 @@ public interface MktLeadsAssignedsMapper {
List<MktLeadsAssigneds> findByPractitionerIdAndThisWeek(Long practitionerId);
Integer countPractitionerIdsAndThisWeek(List<Long> practitionerIds);
Integer countPractitionerIdsAndThisWeek(@Param("practitionerIds") List<Long> practitionerIds,@Param("refusedId") Long refusedId);
HashMap<String, BigDecimal> performanceForecastForTeam(@Param("practitionerIds") List<Long> practitionerIds,@Param("refusedId") Long refusedId);
......
......@@ -44,8 +44,7 @@ public class AclCustomerDALServiceImpl implements AclCustomerDALService {
@Override
public AclCustomer findByMobileNo(String mobileNo) {
DESTypeHandler jpaCryptoConverter = new DESTypeHandler();
return aclCustomerMapper.findByMobileNo(jpaCryptoConverter.encode(mobileNo));
return aclCustomerMapper.findByMobileNo(mobileNo);
}
}
......@@ -41,8 +41,8 @@ public class MktLeadsAssignedsDALServiceImpl implements MktLeadsAssignedsDALServ
}
@Override
public Integer countPractitionerIdsAndThisWeek(List<Long> practitionerIds) {
return mktLeadsAssignedsMapper.countPractitionerIdsAndThisWeek(practitionerIds);
public Integer countPractitionerIdsAndThisWeek(List<Long> practitionerIds,Long refusedId) {
return mktLeadsAssignedsMapper.countPractitionerIdsAndThisWeek(practitionerIds,refusedId);
}
@Override
......
......@@ -20,7 +20,7 @@ public interface MktLeadsAssignedsDALService {
/**
* 统计这些经纪人id本周一共新增多少商机
*/
Integer countPractitionerIdsAndThisWeek(List<Long> practitionerIds);
Integer countPractitionerIdsAndThisWeek(List<Long> practitionerIds,Long refusedId);
/**
* 计算年/季/月 首年保费(premium)/佣金(commission)/件数(pieces) 均取至指派表ag_mkt_leads_assigneds
......
......@@ -335,7 +335,7 @@
#{login,jdbcType=VARCHAR},
</if>
<if test="mobileNo != null">
#{mobileNo,jdbcType=VARCHAR},
#{mobileNo,jdbcType=VARCHAR,typeHandler=com.yd.util.deshandler.DESTypeHandler},
</if>
<if test="authenCode != null">
#{authenCode,jdbcType=VARCHAR},
......@@ -380,7 +380,7 @@
#{idTypeId,jdbcType=BIGINT},
</if>
<if test="idNo != null">
#{idNo,jdbcType=VARCHAR},
#{idNo,jdbcType=VARCHAR,typeHandler=com.yd.util.deshandler.DESTypeHandler},
</if>
<if test="gender != null">
#{gender,jdbcType=INTEGER},
......@@ -521,7 +521,7 @@
`login` = #{login,jdbcType=VARCHAR},
</if>
<if test="mobileNo != null">
mobile_no = #{mobileNo,jdbcType=VARCHAR},
mobile_no = #{mobileNo,jdbcType=VARCHAR,typeHandler=com.yd.util.deshandler.DESTypeHandler},
</if>
<if test="authenCode != null">
authen_code = #{authenCode,jdbcType=VARCHAR},
......@@ -566,7 +566,7 @@
id_type_id = #{idTypeId,jdbcType=BIGINT},
</if>
<if test="idNo != null">
id_no = #{idNo,jdbcType=VARCHAR},
id_no = #{idNo,jdbcType=VARCHAR,typeHandler=com.yd.util.deshandler.DESTypeHandler},
</if>
<if test="gender != null">
gender = #{gender,jdbcType=INTEGER},
......@@ -769,6 +769,6 @@
select
<include refid="Base_Column_List" />
from ag_acl_customer
where mobile_no = #{mobileNo,jdbcType=VARCHAR}
where mobile_no = #{mobileNo,jdbcType=VARCHAR,typeHandler=com.yd.util.deshandler.DESTypeHandler}
</select>
</mapper>
\ No newline at end of file
......@@ -245,14 +245,24 @@
</select>
<select id="countPractitionerIdsAndThisWeek" resultType="integer">
select
count(*)
from ag_mkt_leads_assigneds
count(a.id)
from
ag_mkt_leads_assigneds a
where
assigned_practitioner_id in
<foreach collection="list" item="practitionerId" index="index" open="(" close=")" separator=",">
a.assigned_practitioner_id in
<foreach collection="practitionerIds" item="practitionerId" index="index" open="(" close=")" separator=",">
#{practitionerId,jdbcType=BIGINT}
</foreach>
and YEARWEEK(date_format(created_at,'%Y-%m-%d')) = YEARWEEK(now())
and YEARWEEK(date_format(a.created_at,'%Y-%m-%d')) = YEARWEEK(now())
and not EXISTS (
select
t.leads_assigned_id
from
ag_mkt_leads_assigned_track t
where
t.md_drop_option_id = #{refusedId,jdbcType=BIGINT}
and a.id = t.leads_assigned_id
)
</select>
<select id="performanceForecastForTeam" resultType="hashmap">
select sum(case when date_format(time_to_close,'%Y-%m')=date_format(now(),'%Y-%m') then FYC end) totalFYCMonth,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment