chenjiahe
2024-01-26 107298167376a751e03846d7322fd0d5dbf47360
Merge branch 'master-prod-new' into chenjiahe-再生俱乐部
5个文件已修改
134 ■■■■ 已修改文件
phi_platform_user/src/main/java/com/hx/phip/controller/login/EmployeeLoginController.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/service/impl/UserServiceImpl.java 107 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/service/userMoney/impl/UserMoneyUnclaimedServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/tool/refund/OrderRefundCancelTool.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/util/api/UserMoneyUtil.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/controller/login/EmployeeLoginController.java
@@ -108,7 +108,7 @@
       //解析code
        PersonnelQr personnelQr = PersonnelTool.qrLoginInfo(sysParameter.getParamValue(),employeeQrLogin.getCode());
        logger.info("扫码登录:"+personnelQr.toString());
        logger.info("企业员工-扫码登录:"+personnelQr.toString());
        if(personnelQr == null){
            throw new PlatTipsException(PlatformCode.ERROR_TIPS,"人员信息不存在");
@@ -212,12 +212,11 @@
        //获取userId
        net.sf.json.JSONObject oauthObj = com.hx.mp.util.CorpMpUtil.code2Session(sysParameter.getParamValue(),employeeQrLogin.getCode());
        logger.info("网页登录获取userId,返回数据:"+oauthObj);
        //String errcode = oauthObj.optString("errcode", "");// 有错误的时候才有
       // String corpId = oauthObj.optString("corpid", "");// 有错误的时候才有
        // String corpId = oauthObj.optString("corpid", "");// 有错误的时候才有
        String userId = oauthObj.optString("userid", "");
       // String sessionKey = oauthObj.optString("session_key");
        logger.info("网页登录:"+oauthObj.toString());
        // String sessionKey = oauthObj.optString("session_key");
        if (StringUtils.isEmpty(userId)) {
            throw new PlatTipsException(PlatformCode.ERROR_TIPS,"人员没有权限登录");
@@ -229,7 +228,6 @@
            throw new PlatTipsException(PlatformCode.ERROR_TIPS,"该员工不存在企业微信");
        }
        if (weiXinInfo.getStatus() == null){
            logger.error("网页登录,返回数据"+ JSON.toJSONString(weiXinInfo));
            throw new PlatTipsException(PlatformCode.ERROR_TIPS,"该员工账号异常");
        }
        if (1 != weiXinInfo.getStatus()){
@@ -310,13 +308,13 @@
        //获取openId
        net.sf.json.JSONObject oauthObj = MPWeixinBaseUtil.getJscode2session(applyParameter.getMpAppId(),AesUtil.aesDecryp(applyParameter.getMpSecretKey()),employeeQrLogin.getCode());
        logger.info("企业员工-网页登录(普通小程序):"+oauthObj);
        String errcode = oauthObj.optString("errcode", "");// 有错误的时候才有
        String openId = oauthObj.optString("openid", "");
        //String session_key = oauthObj.optString("session_key");
        String unionid = oauthObj.optString("unionid", "");
        if(StringUtils.noNull(errcode)){
            logger.error("企业员工-网页登录(普通小程序):"+oauthObj.toString());
            throw new PlatTipsException(PlatformCode.ERROR_TIPS,"解析code获取用户信息失败");
        }
@@ -328,6 +326,7 @@
        //openId转userId
        OpenIdAUserId openIdAUserId =  CorpMpUtil.openIdToUserId(openId,sysParameter.getParamValue());
        logger.info("企业员工-网页登录(普通小程序)openId转userId:"+openIdAUserId);
        if(openIdAUserId.getErrcode() != 0){
            throw new PlatTipsException(PlatformCode.ERROR_TIPS,openIdAUserId.getErrmsg());
        }
phi_platform_user/src/main/java/com/hx/phip/service/impl/UserServiceImpl.java
@@ -39,7 +39,6 @@
import com.hx.phip.service.SystemParameterService;
import com.hx.phip.service.UserService;
import com.hx.phip.service.UserUnionHisService;
import com.hx.phip.service.user.UserDoctorNewService;
import com.hx.resultTool.Result;
import com.hx.util.DateUtil;
import com.hx.util.SimpleTool;
@@ -182,24 +181,24 @@
    }
    /**新增*/
    @Override
    public void insert(User user) {
        int count = userMapper.insert(user);
        if(count != 1) {
            throw new TipsException("新增失败!");
        }
    }
    @Override
    public void insert(User user) {
        int count = userMapper.insert(user);
        if(count != 1) {
            throw new TipsException("新增失败!");
        }
    }
    /**修改*/
    @Override
    public void updateAll(User user) {
        int count = userMapper.updateAll(user);
        if(count!=1) {
            throw new TipsException("保存失败!");
        }
    }
    /**修改*/
    @Override
    public void updateAll(User user) {
        int count = userMapper.updateAll(user);
        if(count!=1) {
            throw new TipsException("保存失败!");
        }
    }
    /**修改*/
    /**修改*/
    @Override
    public void updateWhere(SqlSentence sqlSentence) {
        int count = userMapper.updateWhere(sqlSentence);
@@ -208,16 +207,16 @@
        }
    }
    /**删除一个*/
    @Override
    public void deleteOne(String delId) {
        int count = userMapper.deleteById(delId);
        if(count!=1) {
            throw new TipsException("删除失败!");
        }
    }
    /**删除一个*/
    @Override
    public void deleteOne(String delId) {
        int count = userMapper.deleteById(delId);
        if(count!=1) {
            throw new TipsException("删除失败!");
        }
    }
    /**查询条数*/
    /**查询条数*/
    @Override
    public int selectCount(SqlSentence sqlSentence) {
        int count = userMapper.selectCount(sqlSentence);
@@ -3344,8 +3343,8 @@
            userDiagnosisDoctorItem.setRoomName(userDoctorRoomItemDto.getFamiliesRoomName());
            //旧的
            List<UserFamiliesRoom> rooms = oldList.stream().filter(a
                    -> (StringUtils.noNull(a.getFamiliesRoomId()) && a.getFamiliesRoomId().equals(userDoctorRoomItemDto.getFamiliesRoomId()))
                    ||(StringUtils.noNull(a.getFamiliesRoomName()) && a.getFamiliesRoomName().equals(userDoctorRoomItemDto.getFamiliesRoomName())))
                            -> (StringUtils.noNull(a.getFamiliesRoomId()) && a.getFamiliesRoomId().equals(userDoctorRoomItemDto.getFamiliesRoomId()))
                            ||(StringUtils.noNull(a.getFamiliesRoomName()) && a.getFamiliesRoomName().equals(userDoctorRoomItemDto.getFamiliesRoomName())))
                    .collect(Collectors.toList());
            if (rooms.size() > 0){
                userDoctorRoomItemDto.setOldDoctorId(rooms.get(0).getDoctorId());
@@ -3821,7 +3820,7 @@
            //婚否
            marriageTyp.setTypeNo("LT202208162cHDcz");
            if(userInfoCompleteDto.getMarriageTypeName().equals("已婚")){
            if(!StringUtils.isEmpty(userInfoCompleteDto.getMarriageTypeName()) && userInfoCompleteDto.getMarriageTypeName().equals("已婚")){
                marriageTyp.setTagNo("LA20220816MsuHuP");
            }else {
                marriageTyp.setTagNo("LA20220816Gl0vLL");
@@ -3841,7 +3840,7 @@
            //婚否
            marriageTyp.setTypeNo("LT20230921zyrMZC");
            if(userInfoCompleteDto.getMarriageTypeName().trim().equals("已婚")){
            if(!StringUtils.isEmpty(userInfoCompleteDto.getMarriageTypeName()) &&userInfoCompleteDto.getMarriageTypeName().trim().equals("已婚")){
                marriageTyp.setTagNo("LA20230921hkVYme");
            }else {
                marriageTyp.setTagNo("LA20230921s87r0q");
@@ -3849,7 +3848,7 @@
            //生育
            growthType.setTypeNo("LT20230921Mg7yoF");
            if(userInfoCompleteDto.getGrowthTypeName().trim().equals("已育")){
            if(!StringUtils.isEmpty(userInfoCompleteDto.getGrowthTypeName()) && userInfoCompleteDto.getGrowthTypeName().trim().equals("已育")){
                growthType.setTagNo("LA202309218d5OFD");
            }else {
                growthType.setTagNo("LA20230921KtufiX");
@@ -3859,38 +3858,44 @@
        List<UserLabelDcpDto> list = new ArrayList<>();
        UserLabelDcpAddDto userLabelAddDto = new UserLabelDcpAddDto();
        userLabelAddDto.setUserId(userInfoCompleteDto.getUserId());
        professionType.setTagName(userInfoCompleteDto.getProfessionTypeName().trim());
        list.add(professionType);
        marriageTyp.setTagName(userInfoCompleteDto.getMarriageTypeName().trim());
        list.add(marriageTyp);
        growthType.setTagName(userInfoCompleteDto.getGrowthTypeName().trim());
        list.add(growthType);
        if (!StringUtils.isEmpty(userInfoCompleteDto.getProfessionTypeName())){
            professionType.setTagName(userInfoCompleteDto.getProfessionTypeName().trim());
            list.add(professionType);
        }
        if (!StringUtils.isEmpty(userInfoCompleteDto.getMarriageTypeName())){
            marriageTyp.setTagName(userInfoCompleteDto.getMarriageTypeName().trim());
            list.add(marriageTyp);
        }
        if (!StringUtils.isEmpty(userInfoCompleteDto.getGrowthTypeName())){
            growthType.setTagName(userInfoCompleteDto.getGrowthTypeName().trim());
            list.add(growthType);
        }
        userLabelAddDto.setUserLabelDtoList(list);
        List<UserLabelDcpDto> userLabelDtoLists = userLabelAddDto.getUserLabelDtoList();
        if (userLabelDtoLists == null) {
      /*  if (userLabelDtoLists == null) {
            userLabelDtoLists = new ArrayList<>();
        }
        for (UserLabelDcpDto userLabelDcpDto : userLabelDtoLists) {
            if (StringUtils.isEmpty(userLabelDcpDto.getTagName())) {
                throw new TipsException("标签名称为空!");
            }
            if (userLabelDcpDto.getIsCustom() == null) {
                throw new TipsException("请选择标签是否自定义!");
            }
        }
        }*/
        JSONObject data = new JSONObject();
        data.put("userId", userLabelAddDto.getUserId());
        data.put("sourceType", "phis");
        List<String> tagList = new ArrayList<>();
        List<UserLabelDcpDto> userLabelDtoList = userLabelAddDto.getUserLabelDtoList();
        if (userLabelDtoList != null && userLabelDtoList.size() > 0) {
        if (null != userLabelDtoLists && userLabelDtoLists.size() > 0){
            for (UserLabelDcpDto userLabelDcpDto : userLabelDtoLists) {
                if (StringUtils.isEmpty(userLabelDcpDto.getTagName())) {
                    throw new TipsException("标签名称为空!");
                }
                if (userLabelDcpDto.getIsCustom() == null) {
                    throw new TipsException("请选择标签是否自定义!");
                }
            }
            List<Map<String, Object>> editUserTagInfoList = new ArrayList<>();
            Map<String, Object> editUserTagInfo;
            for (UserLabelDcpDto userLabelDcpDto : userLabelDtoList) {
            for (UserLabelDcpDto userLabelDcpDto : userLabelDtoLists) {
                editUserTagInfo = new HashMap<>();
                editUserTagInfo.put("typeNo", userLabelDcpDto.getTypeNo());
                editUserTagInfo.put("tagName", userLabelDcpDto.getTagName().trim());
phi_platform_user/src/main/java/com/hx/phip/service/userMoney/impl/UserMoneyUnclaimedServiceImpl.java
@@ -769,6 +769,7 @@
            userMoneyUnclaimed.setFundType(UserMoneyUnclaimed.FUND_TYPE_INTEGRAL);
            userMoneyUnclaimed.setOpNumber(new BigDecimal(userTurnDto.getIntegral()).negate());
        }
        userMoneyUnclaimed.setOpType(0);
        userMoneyUnclaimed.setOriginChannel(userTurnDto.getAppIdCode());
        userMoneyUnclaimed.setOperatorId(userTurnDto.getCreateId());
        userMoneyUnclaimed.setOperatorName(userTurnDto.getCreateName());
phi_platform_user/src/main/java/com/hx/phip/tool/refund/OrderRefundCancelTool.java
@@ -159,7 +159,7 @@
        OrderLog orderLog;
        if(optType == OPT_TYPE_EXECUTE){
            //充值金额扣减
            UserMoneyUtil.setNewUserMoneyUnclaimed(refundRecord.getUserId(),REFUND_REMARK+"["+ordersTotal.getOrderNo()+"]","退款单:"+refundRecord.getCode()+";"+optName+",扣减充值资金:"+ordersTotal.getTotal(),refundRecord.getOperatorId(),refundRecord.getOrderId(),refundRecord.getInvalidAppCode(),refundRecord.getId(),ordersTotal.getTotal().negate(), UserMoneyUnclaimed.FUND_TYPE_STORED_VALUE_FUND, OperationReasonConstants.OP_REASON_REFUND_CANCEL,commonService,UserMoneyUnclaimed.NO);
            UserMoneyUtil.setNewUserMoneyUnclaimed(refundRecord.getUserId(),REFUND_REMARK+"["+ordersTotal.getOrderNo()+"]","退款单:"+refundRecord.getCode()+";"+optName+",扣减充值资金:"+ordersTotal.getTotal(),refundRecord.getOperatorId(),refundRecord.getOrderId(),refundRecord.getInvalidAppCode(),refundRecord.getId(),ordersTotal.getTotal().negate(), UserMoneyUnclaimed.FUND_TYPE_STORED_VALUE_FUND, OperationReasonConstants.OP_REASON_RECHARGE_REFUND,commonService,UserMoneyUnclaimed.NO);
            orderLog = RefundToolUtil.setOrderLog(refundRecord, refundRecord.getOperatorId(), refundRecord.getOperatorName(), "充值单:"+ordersTotal.getOrderNo()+";"+optName+",预扣除金额:"+ordersTotal.getTotal(), 0, OrderLogConstants.LOG_TYPE_REFUND);
        }else if(optType == OPT_TYPE_CANCEL){
@@ -242,7 +242,7 @@
                    if(optType == OPT_TYPE_EXECUTE){
                        UserMoneyUtil.setNewUserMoneyUnclaimed(refundRecord.getUserId(),refundRecord.getRemarks(),"订单:"+ordersTotal.getOrderNo()+";"+optName+",预扣除活动规则赠送储值金金额:"+activityAction.getWorth(),refundRecord.getOperatorId(),refundRecord.getOrderId(),ordersTotal.getAppIdCode(),refundRecord.getId(),new BigDecimal(activityAction.getWorth()).negate(), UserMoneyUnclaimed.FUND_TYPE_INTEGRAL,OperationReasonConstants.OP_REASON_RECHARGE_REFUND,commonService,UserMoneyUnclaimed.YES);
                    }else if(optType == OPT_TYPE_CANCEL){
                        UserMoneyUtil.setNewUserMoneyUnclaimed(refundRecord.getUserId(),refundRecord.getRemarks(),"订单:"+ordersTotal.getOrderNo()+";"+optName+",返还赠送储值金预扣除金额:"+activityAction.getWorth(),refundRecord.getInvalidId(),refundRecord.getOrderId(),ordersTotal.getAppIdCode(),refundRecord.getId(),new BigDecimal(activityAction.getWorth()), UserMoneyUnclaimed.FUND_TYPE_INTEGRAL,OperationReasonConstants.OP_REASON_RECHARGE_REFUND,commonService,UserMoneyUnclaimed.YES);
                        UserMoneyUtil.setNewUserMoneyUnclaimed(refundRecord.getUserId(),refundRecord.getRemarks(),"订单:"+ordersTotal.getOrderNo()+";"+optName+",返还赠送储值金预扣除金额:"+activityAction.getWorth(),refundRecord.getInvalidId(),refundRecord.getOrderId(),ordersTotal.getAppIdCode(),refundRecord.getId(),new BigDecimal(activityAction.getWorth()), UserMoneyUnclaimed.FUND_TYPE_INTEGRAL,OperationReasonConstants.OP_REASON_REFUND_CANCEL,commonService,UserMoneyUnclaimed.YES);
                    }else{
                        throw new PlatTipsException(PlatformCode.ERROR_TIPS,"操作类型错误[2]["+optType+"]!");
                    }
@@ -257,7 +257,7 @@
                    if(optType == OPT_TYPE_EXECUTE){
                        UserMoneyUtil.setNewUserMoneyUnclaimed(refundRecord.getUserId(),refundRecord.getRemarks(),"订单:"+ordersTotal.getOrderNo()+";"+optName+",预扣除活动规则赠送增值金金额:"+activityAction.getWorth(),refundRecord.getOperatorId(),refundRecord.getOrderId(),ordersTotal.getAppIdCode(),refundRecord.getId(),new BigDecimal(activityAction.getWorth()).negate(), UserMoneyUnclaimed.FUND_TYPE_VALUE_ADDED_FUND,OperationReasonConstants.OP_REASON_RECHARGE_REFUND,commonService,UserMoneyUnclaimed.YES);
                    }else if(optType == OPT_TYPE_CANCEL){
                        UserMoneyUtil.setNewUserMoneyUnclaimed(refundRecord.getUserId(),refundRecord.getRemarks(),"订单:"+ordersTotal.getOrderNo()+";"+optName+",返还赠送增值金预扣除金额:"+activityAction.getWorth(),refundRecord.getInvalidId(),refundRecord.getOrderId(),ordersTotal.getAppIdCode(),refundRecord.getId(),new BigDecimal(activityAction.getWorth()), UserMoneyUnclaimed.FUND_TYPE_VALUE_ADDED_FUND,OperationReasonConstants.OP_REASON_RECHARGE_REFUND,commonService,UserMoneyUnclaimed.YES);
                        UserMoneyUtil.setNewUserMoneyUnclaimed(refundRecord.getUserId(),refundRecord.getRemarks(),"订单:"+ordersTotal.getOrderNo()+";"+optName+",返还赠送增值金预扣除金额:"+activityAction.getWorth(),refundRecord.getInvalidId(),refundRecord.getOrderId(),ordersTotal.getAppIdCode(),refundRecord.getId(),new BigDecimal(activityAction.getWorth()), UserMoneyUnclaimed.FUND_TYPE_VALUE_ADDED_FUND,OperationReasonConstants.OP_REASON_REFUND_CANCEL,commonService,UserMoneyUnclaimed.YES);
                    }else{
                        throw new PlatTipsException(PlatformCode.ERROR_TIPS,"操作类型错误[3]["+optType+"]!");
                    }
phi_platform_user/src/main/java/com/hx/phip/util/api/UserMoneyUtil.java
@@ -172,8 +172,11 @@
        userMoneyUnclaimed.setOriginChannel(originChannel);
        userMoneyUnclaimed.setOperationReason(operationReason);
        if(OperationReasonConstants.OP_REASON_RECHARGE_REFUND.equals(operationReason)
                || OperationReasonConstants.OP_REASON_BRING_NEW_USER_GIFT_RETRU_CANCEL.equals(operationReason)){
        //退款,作废退款,老带新退回,老带新作废退回 默认系统处理
        if(OperationReasonConstants.OP_REASON_RECHARGE_REFUND.equals(operationReason) ||
                OperationReasonConstants.OP_REASON_REFUND_CANCEL.equals(operationReason) ||
                OperationReasonConstants.OP_REASON_BRING_NEW_USER_GIFT_RETRUN.equals(operationReason) ||
                OperationReasonConstants.OP_REASON_BRING_NEW_USER_GIFT_RETRU_CANCEL.equals(operationReason)){
            userMoneyUnclaimed.setOpType(BaseEntity.NO);
        }
        userMoneyUnclaimed.setCommonId(commonId);