Commit 363d571a by yao.xiao

修改-加解密问题

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