add openid
This commit is contained in:
parent
cabf317f74
commit
2c514a177d
|
|
@ -142,6 +142,8 @@ public class CustInfo {
|
||||||
private String extendStr2;
|
private String extendStr2;
|
||||||
@ApiModelProperty("婚姻状态 0-保密 1-未婚 2-已婚")
|
@ApiModelProperty("婚姻状态 0-保密 1-未婚 2-已婚")
|
||||||
private Integer maritalStatus;
|
private Integer maritalStatus;
|
||||||
|
@ApiModelProperty("来源类型,参考SourceTypeEnum")
|
||||||
|
private Integer sourceType;
|
||||||
|
|
||||||
|
|
||||||
// public CustInfo setCustPhotoUrl(String custPhotoUrl) {
|
// public CustInfo setCustPhotoUrl(String custPhotoUrl) {
|
||||||
|
|
@ -414,6 +416,14 @@ public class CustInfo {
|
||||||
return this.maritalStatus;
|
return this.maritalStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Integer getSourceType() {
|
||||||
|
return sourceType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSourceType(Integer sourceType) {
|
||||||
|
this.sourceType = sourceType;
|
||||||
|
}
|
||||||
|
|
||||||
public CustInfo setId(final Long id) {
|
public CustInfo setId(final Long id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
return this;
|
return this;
|
||||||
|
|
|
||||||
|
|
@ -63,12 +63,11 @@ public class CustInfoController extends BaseController {
|
||||||
|
|
||||||
@ApiOperation("小程序查询人员详细资料")
|
@ApiOperation("小程序查询人员详细资料")
|
||||||
@PostMapping({"/queryCustInfoDetailForApp"})
|
@PostMapping({"/queryCustInfoDetailForApp"})
|
||||||
public AjaxResult queryCustInfoDetailForApp(@RequestHeader Map<String, String> headers,@RequestBody CustInfo custInfo) {
|
public AjaxResult queryCustInfoDetailForApp(@RequestHeader Map<String, String> headers, @RequestBody CustInfo custInfo) {
|
||||||
log.info("[人员资料]小程序查询人员详细资料_开始");
|
log.info("[人员资料]小程序查询人员详细资料_开始");
|
||||||
AjaxResult ar = new AjaxResult();
|
AjaxResult ar = new AjaxResult();
|
||||||
CustInfoVo result = this.custInfoService.queryCustInfoDetail(custInfo);
|
CustInfoVo result = this.custInfoService.queryCustInfoDetail(custInfo);
|
||||||
|
//System.out.println(sm4Decrypt("29G1AUHDmLvPe1tt0t12Dw==##encrypted"));
|
||||||
System.out.println(sm4Decrypt("29G1AUHDmLvPe1tt0t12Dw==##encrypted"));
|
|
||||||
result.setMobile(sm4Decrypt(result.getMobile()));
|
result.setMobile(sm4Decrypt(result.getMobile()));
|
||||||
result.setCustName(sm4Decrypt(result.getCustName()));
|
result.setCustName(sm4Decrypt(result.getCustName()));
|
||||||
ar.put("data", result);
|
ar.put("data", result);
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ import com.bonus.core.customer.dto.CustPayDTO;
|
||||||
import com.bonus.core.customer.vo.CustInfoVo;
|
import com.bonus.core.customer.vo.CustInfoVo;
|
||||||
import com.bonus.core.order.vo.MacOrdCurrWriteOffVO;
|
import com.bonus.core.order.vo.MacOrdCurrWriteOffVO;
|
||||||
import com.bonus.core.customer.vo.CustPayVO;
|
import com.bonus.core.customer.vo.CustPayVO;
|
||||||
|
import com.bonus.domain.CustCasual;
|
||||||
import com.bonus.domain.CustInfo;
|
import com.bonus.domain.CustInfo;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
@ -51,6 +52,11 @@ public interface CustInfoMapper extends BaseMapper<CustInfo> {
|
||||||
|
|
||||||
Long getOrgManagerCustIdByCustId(@Param("custId") Long custId);
|
Long getOrgManagerCustIdByCustId(@Param("custId") Long custId);
|
||||||
|
|
||||||
|
|
||||||
List<CustPayVO> getCustPayVO(@Param("custPayDTO") CustPayDTO custPayDTO);
|
List<CustPayVO> getCustPayVO(@Param("custPayDTO") CustPayDTO custPayDTO);
|
||||||
|
|
||||||
|
public CustCasual selectCustCasualByCustId(@Param("custId") Long custId, @Param("sourceType") Integer sourceType, @Param("ifDel") Integer ifDel);
|
||||||
|
|
||||||
|
int addCustCasual(CustCasual custCasual);
|
||||||
|
|
||||||
|
int updateCustCasual(CustCasual custCasual);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.text.CharSequenceUtil;
|
import cn.hutool.core.text.CharSequenceUtil;
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.text.CharSequenceUtil;
|
import cn.hutool.core.text.CharSequenceUtil;
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
|
|
@ -52,12 +53,15 @@ import com.bonus.core.customer.vo.OrgBasicInfoVO;
|
||||||
import com.bonus.core.device.door.api.DcPushUserDataServiceApi;
|
import com.bonus.core.device.door.api.DcPushUserDataServiceApi;
|
||||||
import com.bonus.core.customer.vo.CustPayVO;
|
import com.bonus.core.customer.vo.CustPayVO;
|
||||||
import com.bonus.core.order.mq.MqUtil;
|
import com.bonus.core.order.mq.MqUtil;
|
||||||
|
import com.bonus.domain.CustCasual;
|
||||||
|
import com.bonus.domain.CustInfoAppIdLoginVO;
|
||||||
import com.bonus.domain.SmsCodeVerifyDTO;
|
import com.bonus.domain.SmsCodeVerifyDTO;
|
||||||
import com.bonus.domain.CustInfo;
|
import com.bonus.domain.CustInfo;
|
||||||
import com.bonus.i18n.I18n;
|
import com.bonus.i18n.I18n;
|
||||||
import com.bonus.utils.AesEncryptUtil;
|
import com.bonus.utils.AesEncryptUtil;
|
||||||
import com.bonus.utils.LeBeanUtil;
|
import com.bonus.utils.LeBeanUtil;
|
||||||
import com.bonus.core.common.encrypt.SM4EncryptUtils;
|
import com.bonus.core.common.encrypt.SM4EncryptUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
@ -164,10 +168,40 @@ public class CustInfoServiceImpl extends ServiceImpl<CustInfoMapper, CustInfo> i
|
||||||
}
|
}
|
||||||
|
|
||||||
protected CustInfoVo getNormalCustInfoDetail(CustInfo custInfo) {
|
protected CustInfoVo getNormalCustInfoDetail(CustInfo custInfo) {
|
||||||
custInfo.setCustState(PersonalStatusEnum.NORMAL.getKey());
|
Integer sourceType = custInfo.getSourceType();
|
||||||
return custInfoMapper.queryCustInfoDetail(custInfo);
|
custInfo.setCustState(PersonalStatusEnum.NORMAL.getKey());
|
||||||
|
CustInfoVo custInfoVo = custInfoMapper.queryCustInfoDetail(custInfo);
|
||||||
|
return addOrUpdateCustCasual(custInfoVo, sourceType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CustInfoVo addOrUpdateCustCasual(CustInfoVo custInfoVo, Integer sourceType) {
|
||||||
|
Long custId = custInfoVo.getCustId();
|
||||||
|
CustCasual custCasual = this.custInfoMapper.selectCustCasualByCustId(custId, sourceType, DelFlagEnum.DEL_FALSE.key());
|
||||||
|
String openid;
|
||||||
|
if (Objects.isNull(custCasual)) {
|
||||||
|
CustCasual insertCasual = new CustCasual();
|
||||||
|
openid = IdUtil.simpleUUID();
|
||||||
|
insertCasual.setCasualId(Id.next());
|
||||||
|
insertCasual.setCasualName(SM4EncryptUtils.sm4Decrypt(custInfoVo.getCustName()));
|
||||||
|
insertCasual.setCustId(custInfoVo.getCustId());
|
||||||
|
insertCasual.setMobile(SM4EncryptUtils.sm4Decrypt(custInfoVo.getMobile()));
|
||||||
|
insertCasual.setOpenid(openid);
|
||||||
|
insertCasual.setSourceType(sourceType);
|
||||||
|
this.custInfoMapper.addCustCasual(insertCasual);
|
||||||
|
} else {
|
||||||
|
openid = custCasual.getOpenid();
|
||||||
|
if (StringUtils.isBlank(openid)) {
|
||||||
|
openid = IdUtil.simpleUUID();
|
||||||
|
this.custInfoMapper.updateCustCasual(custCasual);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
custInfoVo.setOpenid(openid);
|
||||||
|
custInfoVo.setCustName(SM4EncryptUtils.sm4Decrypt(custInfoVo.getCustName()));
|
||||||
|
custInfoVo.setMobile(SM4EncryptUtils.sm4Decrypt(custInfoVo.getMobile()));
|
||||||
|
return custInfoVo;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -95,12 +95,14 @@
|
||||||
ci.extend_date,
|
ci.extend_date,
|
||||||
ci.extend_date_time,
|
ci.extend_date_time,
|
||||||
ci.extend_str1,
|
ci.extend_str1,
|
||||||
ci.extend_str2
|
ci.extend_str2,
|
||||||
|
cc.openid
|
||||||
from cust_info ci
|
from cust_info ci
|
||||||
left join cust_diet_like cd on ci.cust_id = cd.cust_id and cd.if_del = 2
|
left join cust_diet_like cd on ci.cust_id = cd.cust_id and cd.if_del = 2
|
||||||
left join acc_info ai on ci.cust_id = ai.cust_id
|
left join acc_info ai on ci.cust_id = ai.cust_id
|
||||||
LEFT JOIN cust_place place ON ci.place_id = place.place_id
|
LEFT JOIN cust_place place ON ci.place_id = place.place_id
|
||||||
LEFT JOIN cust_cost_center A ON A.cost_center_id = ci.cost_center_id
|
LEFT JOIN cust_cost_center A ON A.cost_center_id = ci.cost_center_id
|
||||||
|
LEFT JOIN cust_casual cc on ci.cust_id = cc.cust_id
|
||||||
where ci.cust_id = #{info.custId}
|
where ci.cust_id = #{info.custId}
|
||||||
and ci.cust_state = #{info.custState}
|
and ci.cust_state = #{info.custState}
|
||||||
</select>
|
</select>
|
||||||
|
|
@ -229,6 +231,20 @@
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectCustCasualByCustId" resultType="com.bonus.domain.CustCasual">
|
||||||
|
select casual_id, openid from cust_casual where cust_id = #{custId} and source_type = #{sourceType} and if_del = 2
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="addCustCasual">
|
||||||
|
insert into cust_casual (casual_id, casual_name, cust_id, mobile, openid, source_type)
|
||||||
|
values (#{casualId}, #{casualName}, #{custId}, #{mobile}, #{openid}, #{sourceType})
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateCustCasual">
|
||||||
|
update cust_casual
|
||||||
|
set openid = #{openId}
|
||||||
|
where casual_id = #{casualId}
|
||||||
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Reference in New Issue