Commit d2efd970 by yao.xiao

修改-经纪人添加自己的商机,打上标签

parent 09394238
......@@ -1251,6 +1251,8 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
//校验商机号码,手机号码对应的customer是否存在
String mobileNo = requestVO.getMobileNo();
AclCustomer aclCustomer = aclCustomerDALService.findByMobileNo(mobileNo);
Long mdMkCampaignId = systemConfigService.getMdMkCampaignId("leadaddedbypractioner");
//判断是否通过手机号码找到客户
if (aclCustomer!=null){
MktLeadsAssigneds mktLeadsAssigneds = new MktLeadsAssigneds();
......@@ -1284,6 +1286,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
aclCustomer.setUpdatedAt(new Date());
aclCustomer.setUpdatedBy(-1L);
aclCustomer.setChannelReferralRateId(3L);
aclCustomer.setMktCampaign(String.valueOf(mdMkCampaignId));
aclCustomerDALService.save(aclCustomer);
}
customerId = aclCustomer.getId();
......@@ -1292,6 +1295,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
if (pool == null){
//线索池为空时,保存线索池
pool = new MktLeadsPool();
pool.setMktCampaign(String.valueOf(mdMkCampaignId));
pool.setCustomerId(customerId);
pool.setHasAssigned(1);
pool.setSourceFrom(requestVO.getSourceFrom());
......
......@@ -14,4 +14,6 @@ public interface MdMkCampaignMapper {
int updateByPrimaryKeySelective(MdMkCampaign record);
int updateByPrimaryKey(MdMkCampaign record);
MdMkCampaign selectByCampaignCode(String campaignCode);
}
\ No newline at end of file
......@@ -4,4 +4,6 @@ import com.yd.dal.entity.meta.MdMkCampaign;
public interface MdMkCampaignDALService {
MdMkCampaign findByMktCampaignId(Long mktCampaignId);
MdMkCampaign findByCampaignCode(String campaignCode);
}
......@@ -16,4 +16,9 @@ public class MdMkCampaignDALServiceImpl implements MdMkCampaignDALService {
public MdMkCampaign findByMktCampaignId(Long mktCampaignId) {
return mdMkCampaignMapper.selectByPrimaryKey(mktCampaignId);
}
@Override
public MdMkCampaign findByCampaignCode(String campaignCode) {
return mdMkCampaignMapper.selectByCampaignCode(campaignCode);
}
}
package com.yd.rmi.cache;
import com.yd.dal.entity.meta.MdCode;
import com.yd.dal.entity.meta.MdMkCampaign;
import com.yd.dal.service.meta.MdCodeDALService;
import com.yd.dal.service.meta.MdMkCampaignDALService;
import com.yd.rmi.ali.ossinterf.service.AliOssInterfService;
import com.yd.util.CommonUtil;
import net.sf.ehcache.Cache;
......@@ -13,6 +15,7 @@ import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
@Service("systemConfigService")
@org.springframework.core.annotation.Order(1)
......@@ -201,4 +204,20 @@ public class SystemConfigService implements CommandLineRunner{
SystemConstants.COMMON_SO_TIMEOUT = Integer.parseInt(getSingleConfigValue("COMMON_SO_TIMEOUT"));
aliOssInterfService.initAttribute();
}
@Autowired
private MdMkCampaignDALService mdMkCampaignDALService;
public Long getMdMkCampaignId(String campaignCode) {
Long configValue = null;
Element element = systemConfigCache.get("campaignCode:"+campaignCode);
if(element != null && element.getObjectValue() != null){
configValue = (Long)element.getObjectValue();
}else{
MdMkCampaign mkCampaign = mdMkCampaignDALService.findByCampaignCode(campaignCode);
configValue = Optional.ofNullable(mkCampaign).map(c -> c.getId()).orElse(null);
element = new Element("campaignCode:"+campaignCode,configValue);
systemConfigCache.put(element);
}
return configValue;
}
}
......@@ -166,4 +166,10 @@
created_by = #{createdBy,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
<select id="selectByCampaignCode" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ag_md_mk_campaign
where code = #{campaignCode,jdbcType=VARCHAR}
</select>
</mapper>
\ No newline at end of file
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