diff --git a/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/util/AuthenticationUtils.java b/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/util/AuthenticationUtils.java index d0ac3e59..ea519e88 100644 --- a/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/util/AuthenticationUtils.java +++ b/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/util/AuthenticationUtils.java @@ -7,6 +7,7 @@ import cn.hutool.crypto.asymmetric.RSA; import cn.hutool.http.HttpUtil; import com.alibaba.fastjson.JSONObject; import com.jero.common.exception.JeroBootException; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; @@ -102,6 +103,22 @@ public class AuthenticationUtils { } } + public static JSONObject checkGetResult(String response) { + JSONObject jsonObject = JSONObject.parseObject(response); + String code = jsonObject.getString("code"); + String message = jsonObject.getString("message"); + if (!"200".equals(code)){ + throw new JeroBootException("查询数据失败!"+message); + }else { + String result = jsonObject.getString("result"); + if (StringUtils.isNotBlank(result)) { + return JSONObject.parseObject(result); + }else { + return null; + } + } + } + /** * 调用会员系统post接口 * @param methodName @@ -123,6 +140,27 @@ public class AuthenticationUtils { checkResult(post); } + /** + * 调用会员系统post接口 + * @param methodName + * @param requestParam + * @param requestBody + */ + public static JSONObject postResult(String methodName, String requestParam, Object requestBody) { + Map stringStringMap = encryptByRsaPriKey(); + String publicKey = stringStringMap.get("publicKey"); + String token = stringStringMap.get("token"); + String jsonString = JSONObject.toJSONString(requestBody); + //拼接url路径 + StringBuilder urlBuilder = new StringBuilder(AuthenticationUtils.URL); + urlBuilder.append(methodName).append("?publicKey=").append(publicKey).append("&pushToken=").append(token); + if (StrUtil.isNotBlank(requestParam)){ + urlBuilder.append(requestParam); + } + String post = HttpUtil.post(urlBuilder.toString(), jsonString); + return checkGetResult(post); + } + /** * 调用会员系统post接口 * @param methodName diff --git a/jero-boot-incoming-payment/src/main/java/com/jero/payment/controller/PayPaymentRecordController.java b/jero-boot-incoming-payment/src/main/java/com/jero/payment/controller/PayPaymentRecordController.java index 2c6d4766..f1dbf132 100644 --- a/jero-boot-incoming-payment/src/main/java/com/jero/payment/controller/PayPaymentRecordController.java +++ b/jero-boot-incoming-payment/src/main/java/com/jero/payment/controller/PayPaymentRecordController.java @@ -112,6 +112,18 @@ public class PayPaymentRecordController extends JeroController { */ Result standardsAddAR(String tbPaymentId, PayPaymentRecord payPaymentRecord, MemberInfo memberInfo); + void updateStandards(String tbPaymentId, MemberInfo memberInfo); + /** * 编辑来款 * @param payPaymentRecord @@ -71,4 +73,6 @@ public interface IPayPaymentRecordService extends IService { * @Exception */ BigDecimal getMonthAmountCount(String time); + + } diff --git a/jero-boot-incoming-payment/src/main/java/com/jero/payment/service/impl/PayPaymentRecordServiceImpl.java b/jero-boot-incoming-payment/src/main/java/com/jero/payment/service/impl/PayPaymentRecordServiceImpl.java index 7664c0a6..fa9de9fa 100644 --- a/jero-boot-incoming-payment/src/main/java/com/jero/payment/service/impl/PayPaymentRecordServiceImpl.java +++ b/jero-boot-incoming-payment/src/main/java/com/jero/payment/service/impl/PayPaymentRecordServiceImpl.java @@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.jero.common.api.vo.Result; -import com.jero.common.common.RoleCommon; import com.jero.common.dto.SendMessageDTO; import com.jero.common.enums.CompanyMessageEnums; import com.jero.common.enums.ManagementMessageEnums; @@ -39,7 +38,6 @@ import com.jero.payment.entity.PayPaymentRecord; import com.jero.payment.mapper.PayPaymentRecordMapper; import com.jero.payment.service.IPayPaymentRecordService; import com.jero.payment.vo.TbCheckVo; -import com.jero.project.common.PayProjectCommon; import com.jero.project.entity.PayCommonProject; import com.jero.project.entity.PayWorkingGroup; import com.jero.project.entity.PayWorkingGroupSubItem; @@ -54,7 +52,6 @@ import com.jero.temporary.entity.PayContactsManagementTemporary; import com.jero.temporary.service.IPayCompanyManagementTemporaryService; import com.jero.temporary.service.IPayContactsManagementTemporaryService; import org.apache.commons.beanutils.PropertyUtils; -import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.shiro.SecurityUtils; import org.jeecgframework.poi.excel.def.NormalExcelConstants; @@ -64,6 +61,7 @@ import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.servlet.ModelAndView; import javax.annotation.Resource; @@ -79,7 +77,7 @@ import java.util.stream.Collectors; * @Date: 2021-08-31 * @Version: V1.0 */ -@Transactional(rollbackFor = Exception.class) +@Transactional(propagation = Propagation.REQUIRES_NEW,rollbackFor = Exception.class) @Service public class PayPaymentRecordServiceImpl extends ServiceImpl implements IPayPaymentRecordService { @Resource @@ -153,8 +151,19 @@ public class PayPaymentRecordServiceImpl extends ServiceImpl0){ - AuthenticationUtils.post("/paymentInfo/incomingPaymentCheck",null,typr5List); + if(typr5List.size()>0){ + JSONObject jsonObject = AuthenticationUtils.postResult("/paymentInfo/incomingPaymentCheck", null, typr5List); + String memberNo = jsonObject.getString("memberNo"); + Integer memberType = jsonObject.getInteger("memberType"); + Integer memberStatus = jsonObject.getInteger("memberStatus"); + MemberInfo memberInfo = new MemberInfo(); + memberInfo.setMemberNo(memberNo); + memberInfo.setMemberType(memberType); + memberInfo.setMemberStatus(memberStatus); + for (TbCheckVo tbCheckVo : typr5List) { + String id = tbCheckVo.getId(); + updateStandards(id,memberInfo); + } } } @@ -493,6 +502,17 @@ public class PayPaymentRecordServiceImpl extends ServiceImpl wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(TbMemberProjectSubitem::getTbPaymentId,tbPaymentId); + TbMemberProjectSubitem tbMember = tbMemberProjectSubitemMapper.selectOne(wrapper); + tbMember.setMemberNo(memberInfo.getMemberNo()); + tbMember.setMemberType(memberInfo.getMemberType()); + tbMember.setMemberStatus(memberInfo.getMemberStatus()); + tbMemberProjectSubitemMapper.updateById(tbMember); + } + //标协类型新增时条件校验 private void type5AddCheck(PayPaymentRecord payPaymentRecord){