分页查询人员及生物识别特征
This commit is contained in:
parent
9b5715bd4e
commit
d7e5ffa191
|
|
@ -2,9 +2,11 @@ package com.bonus.core.common.base;
|
|||
|
||||
import cn.hutool.core.text.CharSequenceUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.core.common.converter.GsonLocalDateAdapter;
|
||||
import com.bonus.core.common.converter.GsonLocalDateTimeAdapter;
|
||||
import com.bonus.core.common.utils.HeaderFetchUtil;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import org.slf4j.Logger;
|
||||
|
|
@ -13,6 +15,7 @@ import org.slf4j.LoggerFactory;
|
|||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class BaseController {
|
||||
|
|
@ -84,4 +87,24 @@ public class BaseController {
|
|||
String value = HeaderFetchUtil.getValueFromHeadersIgnoreCase(headers, "applet-type");
|
||||
return CharSequenceUtil.isNotBlank(value) ? Integer.valueOf(value) : null;
|
||||
}
|
||||
|
||||
protected TableDataInfo getDataTable(List<?> list) {
|
||||
TableDataInfo rspData = new TableDataInfo();
|
||||
rspData.setCode(200);
|
||||
rspData.setRows(list);
|
||||
rspData.setMsg("查询成功");
|
||||
rspData.setTotal((new PageInfo(list)).getTotal());
|
||||
return rspData;
|
||||
}
|
||||
|
||||
protected TableDataInfo getDataTableError(List<?> list) {
|
||||
TableDataInfo rspData = new TableDataInfo();
|
||||
rspData.setCode(500);
|
||||
rspData.setRows(list);
|
||||
rspData.setMsg("系统错误,请联系管理员");
|
||||
rspData.setTotal((new PageInfo(list)).getTotal());
|
||||
return rspData;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ package com.bonus.core.customer.business;
|
|||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.bonus.core.common.constant.LeMqConstant;
|
||||
import com.bonus.core.customer.dto.CustInfoModel;
|
||||
import com.bonus.core.customer.dto.CustInfoParam;
|
||||
import com.bonus.core.customer.vo.PageCustInfoPhotoVO;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -24,4 +26,7 @@ public class CustInfoBurialPointBusiness implements CustomBusiness {
|
|||
|
||||
public void didNotifyOtherModules(Long custId, LeMqConstant.DataChangeType dataChangeType) {
|
||||
}
|
||||
|
||||
public void willQueryCustInfoByPage(CustInfoParam infoParam, List<PageCustInfoPhotoVO> result) {
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,24 +1,24 @@
|
|||
package com.bonus.core.customer.controller;
|
||||
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.core.common.base.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.constant.SourceTypeEnum;
|
||||
import com.bonus.core.customer.dto.CustBindMobileDTO;
|
||||
import com.bonus.core.customer.dto.CustQueryDTO;
|
||||
import com.bonus.core.customer.dto.*;
|
||||
import com.bonus.core.customer.model.CustInfo;
|
||||
import com.bonus.core.customer.vo.CustInfoVo;
|
||||
import com.bonus.core.customer.vo.PageCustInfoPhotoVO;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.bonus.core.customer.dto.CustChangePasswordDTO;
|
||||
import com.bonus.core.customer.dto.CustForgetPasswordDTO;
|
||||
import com.bonus.core.customer.service.CustInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import static com.bonus.common.core.utils.PageUtils.startPage;
|
||||
import static com.bonus.common.core.web.domain.AjaxResult.success;
|
||||
import static com.bonus.core.common.encrypt.SM4EncryptUtils.sm4Decrypt;
|
||||
|
||||
|
|
@ -30,6 +30,19 @@ public class CustInfoController extends BaseController {
|
|||
@Autowired
|
||||
CustInfoService custInfoService;
|
||||
|
||||
@ApiOperation("分页查询人员及生物识别特征")
|
||||
@GetMapping({"/pageCustInfoPhoto"})
|
||||
public TableDataInfo pageCustInfoPhoto(@RequestBody CustInfoParam dto) {
|
||||
try {
|
||||
startPage();
|
||||
List<PageCustInfoPhotoVO> list = this.custInfoService.pageCustInfoPhoto(dto);
|
||||
return getDataTable(list);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
return getDataTable(null);
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("小程序修改密码")
|
||||
@PostMapping({"/change/password"})
|
||||
public AjaxResult changePassword(@Validated @RequestBody CustChangePasswordDTO content) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
package com.bonus.core.customer.dto;
|
||||
|
||||
import com.bonus.core.common.page.PageDTO;
|
||||
import java.util.List;
|
||||
|
||||
public class CustPageParam {
|
||||
private PageDTO page;
|
||||
private CustInfoParam custInfoParam;
|
||||
private List<String> exportCols;
|
||||
|
||||
public PageDTO getPage() {
|
||||
return this.page;
|
||||
}
|
||||
|
||||
public CustInfoParam getCustInfoParam() {
|
||||
return this.custInfoParam;
|
||||
}
|
||||
|
||||
public List<String> getExportCols() {
|
||||
return this.exportCols;
|
||||
}
|
||||
|
||||
public void setPage(final PageDTO page) {
|
||||
this.page = page;
|
||||
}
|
||||
|
||||
public void setCustInfoParam(final CustInfoParam custInfoParam) {
|
||||
this.custInfoParam = custInfoParam;
|
||||
}
|
||||
|
||||
public void setExportCols(final List<String> exportCols) {
|
||||
this.exportCols = exportCols;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,12 +1,16 @@
|
|||
package com.bonus.core.customer.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.bonus.core.autth.config.LeNiuDataPermission;
|
||||
import com.bonus.core.autth.enums.DataPermissionTypeEnum;
|
||||
import com.bonus.core.customer.dto.CustInfoDTO;
|
||||
import com.bonus.core.customer.dto.CustInfoParam;
|
||||
import com.bonus.core.customer.dto.CustPayDTO;
|
||||
import com.bonus.core.customer.model.CustInfo;
|
||||
import com.bonus.core.customer.vo.CustInfoForRechargeVO;
|
||||
import com.bonus.core.customer.vo.CustInfoVo;
|
||||
import com.bonus.core.customer.vo.CustPayVO;
|
||||
import com.bonus.core.customer.vo.PageCustInfoPhotoVO;
|
||||
import com.bonus.core.order.vo.MacOrdCurrWriteOffVO;
|
||||
import com.bonus.domain.CustCasual;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
|
@ -18,6 +22,11 @@ import java.util.List;
|
|||
@Mapper
|
||||
public interface CustInfoMapper extends BaseMapper<CustInfo> {
|
||||
|
||||
@LeNiuDataPermission(
|
||||
alias = "ci",
|
||||
permissionType = DataPermissionTypeEnum.PERMISSION_ORG
|
||||
)
|
||||
List<PageCustInfoPhotoVO> pageCustInfoPhoto(@Param("infoParam") CustInfoParam infoParam);
|
||||
CustInfo selectOne(CustInfo custInfo);
|
||||
int updateById(CustInfo custInfo);
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@ import java.util.*;
|
|||
|
||||
public interface CustInfoService extends IService<CustInfo> {
|
||||
|
||||
List <PageCustInfoPhotoVO> pageCustInfoPhoto(CustInfoParam infoParam);
|
||||
|
||||
CustInfoVo queryCustInfoDetail(CustInfo custInfo, Integer sourceType);
|
||||
|
||||
AjaxResult custChangePassword(CustChangePasswordDTO content);
|
||||
|
|
|
|||
|
|
@ -25,9 +25,7 @@ import com.bonus.core.common.encrypt.SM4EncryptUtils;
|
|||
import com.bonus.core.common.utils.LogUtil;
|
||||
import com.bonus.core.customer.api.CustCasualApi;
|
||||
import com.bonus.core.customer.business.CustInfoBurialPointBusiness;
|
||||
import com.bonus.core.customer.constants.CustAgeEnum;
|
||||
import com.bonus.core.customer.constants.CustConstant;
|
||||
import com.bonus.core.customer.constants.PersonalStatusEnum;
|
||||
import com.bonus.core.customer.constants.*;
|
||||
import com.bonus.core.customer.dto.*;
|
||||
import com.bonus.core.customer.mapper.CustInfoMapper;
|
||||
import com.bonus.core.customer.model.CustAccTemp;
|
||||
|
|
@ -43,6 +41,7 @@ import com.bonus.core.customer.utils.DelFlagEnum;
|
|||
import com.bonus.core.customer.vo.CustInfoVo;
|
||||
import com.bonus.core.customer.vo.CustNoticeInfoVO;
|
||||
import com.bonus.core.customer.vo.CustPayVO;
|
||||
import com.bonus.core.customer.vo.PageCustInfoPhotoVO;
|
||||
import com.bonus.core.device.door.api.DcPushUserDataServiceApi;
|
||||
import com.bonus.core.order.mq.MqUtil;
|
||||
import com.bonus.domain.CustCasual;
|
||||
|
|
@ -117,6 +116,46 @@ public class CustInfoServiceImpl extends ServiceImpl<CustInfoMapper, CustInfo> i
|
|||
// @Value("${customer.h5-login-default-pwd}")
|
||||
// private String h5LoginPwd;
|
||||
|
||||
|
||||
public List<PageCustInfoPhotoVO> pageCustInfoPhoto(CustInfoParam infoParam) {
|
||||
this.convertQueryParam(infoParam);
|
||||
List<PageCustInfoPhotoVO> pageCustInfoPhotoVoPage = ((CustInfoMapper)this.baseMapper).pageCustInfoPhoto(infoParam);
|
||||
this.processCustomerPageReturnData(pageCustInfoPhotoVoPage);
|
||||
this.custInfoBurialPointBusiness.willQueryCustInfoByPage(infoParam, pageCustInfoPhotoVoPage);
|
||||
return pageCustInfoPhotoVoPage;
|
||||
}
|
||||
|
||||
protected void convertQueryParam(CustInfoParam infoParam) {
|
||||
if (CharSequenceUtil.isNotBlank(infoParam.getShape())) {
|
||||
infoParam.setShape(LeBeanUtil.fieldLikeHandle(infoParam.getShape()));
|
||||
}
|
||||
|
||||
if (CharSequenceUtil.isNotBlank(infoParam.getChronicIds())) {
|
||||
infoParam.setChronicIds(LeBeanUtil.fieldLikeHandle(infoParam.getChronicIds()));
|
||||
}
|
||||
|
||||
infoParam.setPhotoType(PhotoTypeEnum.PHOTO.getKey());
|
||||
infoParam.setCustState(PersonalStatusEnum.NORMAL.getKey());
|
||||
}
|
||||
|
||||
@Nullable
|
||||
protected List<PageCustInfoPhotoVO> processCustomerPageReturnData(List<PageCustInfoPhotoVO> custInfoVo) {
|
||||
if (CollUtil.isEmpty(custInfoVo)) {
|
||||
return custInfoVo;
|
||||
} else {
|
||||
Iterator var2 = custInfoVo.iterator();
|
||||
|
||||
while(var2.hasNext()) {
|
||||
PageCustInfoPhotoVO custInfoPhotoVO = (PageCustInfoPhotoVO)var2.next();
|
||||
if (ObjectUtil.isNull(custInfoPhotoVO.getFeaturesBuildStatus())) {
|
||||
custInfoPhotoVO.setFeaturesBuildStatus(FeaturesBuildStatusEnum.UN_CREATE.getKey());
|
||||
}
|
||||
}
|
||||
|
||||
return custInfoVo;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public CustInfoVo queryCustInfoDetail(CustInfo custInfo, Integer sourceType) {
|
||||
CustInfoVo result = this.getNormalCustInfoDetail(custInfo, sourceType);
|
||||
|
|
|
|||
|
|
@ -245,6 +245,164 @@
|
|||
set openid = #{openid}, mobile = #{mobile}
|
||||
where casual_id = #{casualId}
|
||||
</update>
|
||||
|
||||
<select id="pageCustInfoPhoto" resultType="com.bonus.core.customer.vo.PageCustInfoPhotoVO"
|
||||
parameterType="com.bonus.core.customer.dto.CustInfoParam">
|
||||
SELECT
|
||||
ci.id,
|
||||
ci.cust_id,
|
||||
ci.cust_num,
|
||||
ci.cust_name,
|
||||
ci.mobile,
|
||||
ci.email,
|
||||
ci.org_id,
|
||||
co.org_full_name,
|
||||
ci.cost_center_id,
|
||||
A.name costCenterName,
|
||||
ci.place_id,
|
||||
place.place_full_name,
|
||||
ci.sex,
|
||||
B.job_name job,
|
||||
ci.cust_third_id,
|
||||
ci.home_addr,
|
||||
ci.qq,
|
||||
ci.wechat,
|
||||
ci.psn_type,
|
||||
ci.psn_type_name,
|
||||
ci.dingtalk,
|
||||
ci.cust_state,
|
||||
ci.crtime,
|
||||
-- ci.cust_type,
|
||||
ci.birthday,
|
||||
cp.photo_url,
|
||||
cp.features_build_status,
|
||||
cp.features_build_time,
|
||||
cp.error_msg,
|
||||
cp.expire_date,
|
||||
ac.card_status cardStatus,
|
||||
ac.serial_num serialNum,
|
||||
ac.crtime openCardTime,
|
||||
ci.cust_limit_id,
|
||||
ci.extend_date,
|
||||
ci.extend_date_time,
|
||||
ci.extend_str1,
|
||||
ci.extend_str2
|
||||
FROM cust_info ci
|
||||
LEFT JOIN (
|
||||
SELECT cust_id,max(features_build_status) features_build_status ,MAX(features_build_time) features_build_time ,MAX(photo_url) photo_url,MAX(error_msg) error_msg ,MAX(expire_date) expire_date from cust_photo WHERE photo_type = 1 GROUP BY cust_id ) cp ON ci.cust_id = cp.cust_id
|
||||
LEFT JOIN cust_org co ON co.org_id = ci.org_id
|
||||
LEFT JOIN
|
||||
(SELECT cust_id,
|
||||
GROUP_CONCAT(serial_num SEPARATOR ', ') as serial_num,
|
||||
GROUP_CONCAT(card_status SEPARATOR ', ') as card_status,
|
||||
GROUP_CONCAT(DATE_FORMAT(crtime, '%Y-%m-%d %H:%i:%s') SEPARATOR ', ') as crtime
|
||||
FROM acc_card where card_status in(1,4)
|
||||
GROUP BY cust_id) ac ON ac.cust_id = ci.cust_id
|
||||
LEFT JOIN cust_place place ON place.place_id = ci.place_id
|
||||
LEFT JOIN cust_cost_center A ON A.cost_center_id = ci.cost_center_id
|
||||
LEFT JOIN cust_job B ON B.job_code = ci.job AND B.job_type = 1
|
||||
<where>
|
||||
<if test="infoParam.custId != null">
|
||||
and ci.cust_id = #{infoParam.custId}
|
||||
</if>
|
||||
<if test="infoParam.custName != null and infoParam.custName != ''">
|
||||
and ci.cust_name_like LIKE CONCAT('%',#{infoParam.custName,typeHandler=net.xnzn.core.common.encrypt.CipherQueryLikeHandler},'%')
|
||||
</if>
|
||||
<if test="infoParam.custNum != null and infoParam.custNum != ''">
|
||||
and ci.cust_num = #{infoParam.custNum}
|
||||
</if>
|
||||
|
||||
<if test="infoParam.keyword != null and infoParam.keyword != ''">
|
||||
and (ci.cust_num LIKE CONCAT('%', #{infoParam.keyword},'%')
|
||||
or ci.cust_name = #{infoParam.keyword,typeHandler=net.xnzn.core.common.encrypt.SM4EncDecHandler}
|
||||
or ci.cust_name_like LIKE CONCAT('%',#{infoParam.keyword,typeHandler=net.xnzn.core.common.encrypt.CipherQueryLikeHandler},'%')
|
||||
or ci.mobile = #{infoParam.keyword,typeHandler=net.xnzn.core.common.encrypt.SM4EncDecHandler}
|
||||
or ci.mobile_suffix = #{infoParam.keyword,typeHandler=net.xnzn.core.common.encrypt.SM4EncDecHandler}
|
||||
)
|
||||
</if>
|
||||
|
||||
<if test="infoParam.orgIdList != null and infoParam.orgIdList.size > 0">
|
||||
and ci.org_id in
|
||||
<foreach collection="infoParam.orgIdList" item="orgId" separator="," open="(" close=")">
|
||||
#{orgId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="infoParam.placeIdList != null and infoParam.placeIdList.size > 0">
|
||||
and ci.place_id in
|
||||
<foreach collection="infoParam.placeIdList" item="placeId" separator="," open="(" close=")">
|
||||
#{placeId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="infoParam.mobile != null and infoParam.mobile != ''">
|
||||
and ci.mobile = #{infoParam.mobile,typeHandler=net.xnzn.core.common.encrypt.SM4EncDecHandler}
|
||||
</if>
|
||||
<if test="infoParam.sex != null">
|
||||
and ci.sex = #{infoParam.sex}
|
||||
</if>
|
||||
<if test="infoParam.psnType != null and infoParam.psnType != -99">
|
||||
and ci.psn_type = #{infoParam.psnType}
|
||||
</if>
|
||||
<if test="infoParam.psnType == -99">
|
||||
and ci.psn_type is null
|
||||
</if>
|
||||
<if test="infoParam.psnTypeList != null and infoParam.psnTypeList.size > 0">
|
||||
and ci.psn_type in
|
||||
<foreach collection="infoParam.psnTypeList" item="item" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="infoParam.custState != null">
|
||||
and ci.cust_state = #{infoParam.custState}
|
||||
</if>
|
||||
<if test="infoParam.featuresBuildStatus == 1">
|
||||
and (cp.features_build_status is null or cp.features_build_status = 1)
|
||||
</if>
|
||||
<if test="infoParam.featuresBuildStatus == 2 or infoParam.featuresBuildStatus == 3">
|
||||
and cp.features_build_status = #{infoParam.featuresBuildStatus}
|
||||
</if>
|
||||
<if test="infoParam.serialNum != null or (infoParam.cardStatusList != null and infoParam.cardStatusList.size > 0) or infoParam.beginOpenCardTime != null">
|
||||
and EXISTS (SELECT 1 FROM acc_card acc
|
||||
WHERE acc.cust_id = ci.cust_id and acc.card_status in(1,4)
|
||||
<if test="infoParam.serialNum != null">
|
||||
AND acc.serial_num like concat('%', #{infoParam.serialNum},'%')
|
||||
</if>
|
||||
<if test="infoParam.cardStatusList != null and infoParam.cardStatusList.size > 0">
|
||||
and acc.card_status in
|
||||
<foreach collection="infoParam.cardStatusList" item="cardStatus" separator="," open="(" close=")">
|
||||
#{cardStatus}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="infoParam.beginOpenCardTime != null">
|
||||
<![CDATA[
|
||||
and acc.crtime >= #{infoParam.beginOpenCardTime}
|
||||
]]>
|
||||
</if>
|
||||
<if test="infoParam.endOpenCardTime != null">
|
||||
<![CDATA[
|
||||
and acc.crtime <= #{infoParam.endOpenCardTime}
|
||||
]]>
|
||||
</if>
|
||||
)
|
||||
</if>
|
||||
<if test="infoParam.birthdayStartTime">
|
||||
<![CDATA[
|
||||
and ci.birthday >= #{infoParam.birthdayStartTime}
|
||||
]]>
|
||||
</if>
|
||||
<if test="infoParam.birthdayEndTime != null">
|
||||
<![CDATA[
|
||||
and ci.birthday <= #{infoParam.birthdayEndTime}
|
||||
]]>
|
||||
</if>
|
||||
<if test="infoParam.costCenterIds != null and infoParam.costCenterIds.size > 0">
|
||||
and ci.cost_center_id in
|
||||
<foreach collection="infoParam.costCenterIds" item="item" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
order by ci.id desc
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
|
||||
|
|
|
|||
Reference in New Issue