| @@ -134,6 +134,17 @@ public class WxPressBatchController extends BaseController { | |||||
| wxPressBatchService.deleteItemById(record.getId(), getTenantInfo().getTenantId()); | wxPressBatchService.deleteItemById(record.getId(), getTenantInfo().getTenantId()); | ||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @ApiOperation("详情接口") | |||||
| @PostMapping("updateStatus") | |||||
| public ResultData updateStatus(@RequestBody WxPressBatch record) { | |||||
| if (null == record.getId() || null == record.getStatus()) { | |||||
| return new ResultData(Result.ERROR,"参数错误"); | |||||
| } | |||||
| record.updateTenantInfo(getTenantInfo()); | |||||
| wxPressBatchService.updateStatus(record); | |||||
| return new ResultData(); | |||||
| } | |||||
| @@ -47,6 +47,8 @@ public interface WxPressBatchService { | |||||
| void deleteItemById(Long itemId,String tenantId); | void deleteItemById(Long itemId,String tenantId); | ||||
| void deleteItemByBatchId(Long batchId,String tenantId); | void deleteItemByBatchId(Long batchId,String tenantId); | ||||
| void updateStatus(WxPressBatch pressBatch); | |||||
| //验证砍价人规则 | //验证砍价人规则 | ||||
| ResultData checkBargainerPressBatchRule(WxOrder order, Long cUserId); | ResultData checkBargainerPressBatchRule(WxOrder order, Long cUserId); | ||||
| @@ -2588,7 +2588,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| sharingOrder.setMerchantId(wxMerchantBUser.getMerchantId()); | sharingOrder.setMerchantId(wxMerchantBUser.getMerchantId()); | ||||
| sharingOrder.setType(EnumProfitSharingOrderType.PROFIT_SHARING_SINGLE.getCode()); | sharingOrder.setType(EnumProfitSharingOrderType.PROFIT_SHARING_SINGLE.getCode()); | ||||
| sharingOrder.setPayAmount(wxPayOrder.getPayAmount()); | sharingOrder.setPayAmount(wxPayOrder.getPayAmount()); | ||||
| WxComposeChildOrderShare share = wxPayOrder.getChildOrderShare(orderId); | |||||
| WxComposeChildOrderShare share = wxPayOrder.getChildOrderShare(wxOrder.getId()); | |||||
| sharingOrder.setMerchantShareAmount(share.getShareAmount()); | sharingOrder.setMerchantShareAmount(share.getShareAmount()); | ||||
| sharingOrder.setMallRealRateAmount(share.getRateAmount()); | sharingOrder.setMallRealRateAmount(share.getRateAmount()); | ||||
| sharingOrder.setRealRateAmount(share.getRealRateAmount()); | sharingOrder.setRealRateAmount(share.getRealRateAmount()); | ||||
| @@ -2601,13 +2601,14 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| sharingOrder.updateTenantInfo(wxPayOrder); | sharingOrder.updateTenantInfo(wxPayOrder); | ||||
| sharingOrder.setTransactionId(wxPayOrder.getTransactionId()); | sharingOrder.setTransactionId(wxPayOrder.getTransactionId()); | ||||
| wxProfitSharingOrderService.createSharingOrder(sharingOrder,wxPayOrder); | wxProfitSharingOrderService.createSharingOrder(sharingOrder,wxPayOrder); | ||||
| } else { | } else { | ||||
| logger.error("微信分账: 未找到payorder or merchant at orderid-" + orderId); | logger.error("微信分账: 未找到payorder or merchant at orderid-" + orderId); | ||||
| } | } | ||||
| } catch (MallinkException e) { | } catch (MallinkException e) { | ||||
| logger.error("微信分账: " + e.getMessage(),e); | logger.error("微信分账: " + e.getMessage(),e); | ||||
| } catch (Exception e){ | |||||
| logger.error("微信分账"+e.getMessage(),e); | |||||
| } | } | ||||
| } | } | ||||
| @@ -4,6 +4,7 @@ import com.aliyun.openservices.shade.org.apache.commons.lang3.StringUtils; | |||||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||||
| import com.github.pagehelper.PageHelper; | import com.github.pagehelper.PageHelper; | ||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.common.IdWorker; | |||||
| import com.iformall.common.Result; | import com.iformall.common.Result; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| @@ -69,6 +70,8 @@ public class WxPressBatchServiceImpl implements WxPressBatchService { | |||||
| @Override | @Override | ||||
| public void saveOrUpdate(WxPressBatch record) { | public void saveOrUpdate(WxPressBatch record) { | ||||
| if (null == record.getId()) { | if (null == record.getId()) { | ||||
| final IdWorker idWorker = IdWorker.get(); | |||||
| record.setId(idWorker.nextId()); | |||||
| record.setCreateDate(new Date()); | record.setCreateDate(new Date()); | ||||
| record.setUpdateDate(new Date()); | record.setUpdateDate(new Date()); | ||||
| wxPressBatchMapper.insert(record); | wxPressBatchMapper.insert(record); | ||||
| @@ -106,8 +109,8 @@ public class WxPressBatchServiceImpl implements WxPressBatchService { | |||||
| } | } | ||||
| } | } | ||||
| @Override | |||||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | ||||
| @Override | |||||
| public void deleteBatch(Long id, String tenantId) { | public void deleteBatch(Long id, String tenantId) { | ||||
| wxPressBatchMapper.deleteById(id, tenantId); | wxPressBatchMapper.deleteById(id, tenantId); | ||||
| deleteItemByBatchId(id, tenantId); | deleteItemByBatchId(id, tenantId); | ||||
| @@ -128,6 +131,17 @@ public class WxPressBatchServiceImpl implements WxPressBatchService { | |||||
| iteq.setPressBatchId(batchId); | iteq.setPressBatchId(batchId); | ||||
| wxPressBatchItemMapper.deleteAllItem(iteq); | wxPressBatchItemMapper.deleteAllItem(iteq); | ||||
| } | } | ||||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | |||||
| @Override | |||||
| public void updateStatus(WxPressBatch pressBatch) { | |||||
| wxPressBatchMapper.updateWxPressBatchStatus(pressBatch); | |||||
| WxPressBatchItem item = new WxPressBatchItem(); | |||||
| item.updateTenantInfo(pressBatch); | |||||
| item.setPressBatchId(pressBatch.getId()); | |||||
| item.setPressBatchStatus(pressBatch.getStatus()); | |||||
| wxPressBatchItemMapper.updateWxPressBatchStatus(item); | |||||
| } | |||||
| @Override | @Override | ||||
| public ResultData checkBargainerPressBatchRule(WxOrder order, Long cUserId) { | public ResultData checkBargainerPressBatchRule(WxOrder order, Long cUserId) { | ||||
| @@ -202,5 +216,4 @@ public class WxPressBatchServiceImpl implements WxPressBatchService { | |||||
| } | } | ||||
| return null; | return null; | ||||
| } | } | ||||
| } | } | ||||
| @@ -440,7 +440,8 @@ public class TtPayShareService extends PayShareBaseAdapterService{ | |||||
| List<WxProfitSharingReceiver> list = wxProfitSharingReceiverMapper.findList(psReceiverQ); | List<WxProfitSharingReceiver> list = wxProfitSharingReceiverMapper.findList(psReceiverQ); | ||||
| if(list == null || list.isEmpty()){ | if(list == null || list.isEmpty()){ | ||||
| throw new MallinkException(ErrorCode.PROFIT_SHARING_RECEIVER_INVALID.getCode(),"该商户未未进件."+payMsg); | |||||
| return null; | |||||
| // throw new MallinkException(ErrorCode.PROFIT_SHARING_RECEIVER_INVALID.getCode(),"该商户未未进件."+payMsg); | |||||
| } | } | ||||
| if(list.size() > 1){ | if(list.size() > 1){ | ||||
| throw new MallinkException(ErrorCode.PROFIT_SHARING_RECEIVER_UNKNOWN.getCode(),"该商户分账帐号异常."); | throw new MallinkException(ErrorCode.PROFIT_SHARING_RECEIVER_UNKNOWN.getCode(),"该商户分账帐号异常."); | ||||
| @@ -410,7 +410,8 @@ public class WxPayShareService extends PayShareBaseAdapterService{ | |||||
| psReceiverQ.setPlat(EnumAppPlat.WX.getCode()); | psReceiverQ.setPlat(EnumAppPlat.WX.getCode()); | ||||
| List<WxProfitSharingReceiver> psReceiverList = wxProfitSharingReceiverMapper.findList(psReceiverQ); | List<WxProfitSharingReceiver> psReceiverList = wxProfitSharingReceiverMapper.findList(psReceiverQ); | ||||
| if (null == psReceiverList || psReceiverList.size() == 0) { | if (null == psReceiverList || psReceiverList.size() == 0) { | ||||
| throw new MallinkException(ErrorCode.PROFIT_SHARING_RECEIVER_INVALID.getCode(),"该商户未设置分账账号."); | |||||
| return null; | |||||
| // throw new MallinkException(ErrorCode.PROFIT_SHARING_RECEIVER_INVALID.getCode(),"该商户未设置分账账号."); | |||||
| }else { | }else { | ||||
| for (WxProfitSharingReceiver receiver:psReceiverList) { | for (WxProfitSharingReceiver receiver:psReceiverList) { | ||||
| if (EnumProfitSharingReceiverType.PROFIT_SHARING_RECEIVER_PERSONAL_WECHATID.getCode().intValue() | if (EnumProfitSharingReceiverType.PROFIT_SHARING_RECEIVER_PERSONAL_WECHATID.getCode().intValue() | ||||
| @@ -149,9 +149,9 @@ public class WxPayShareV3Service extends PayShareBaseAdapterService{ | |||||
| }else if (EnumPayMchType.TOTAL.getCode() == mchType) { | }else if (EnumPayMchType.TOTAL.getCode() == mchType) { | ||||
| receiver = wxProfitSharingReceiverService.findReceiver(tenantEntity, merchantId,EnumAppPlat.WX,EnumProfitSharingType.PROFIT_SHARING_TYPE_WECHAT); | receiver = wxProfitSharingReceiverService.findReceiver(tenantEntity, merchantId,EnumAppPlat.WX,EnumProfitSharingType.PROFIT_SHARING_TYPE_WECHAT); | ||||
| } | } | ||||
| if (null == receiver) { | |||||
| throw new MallinkException(ErrorCode.PROFIT_SHARING_RECEIVER_INVALID.getCode(),"该商户未设置分账账号."); | |||||
| } | |||||
| // if (null == receiver) { | |||||
| // throw new MallinkException(ErrorCode.PROFIT_SHARING_RECEIVER_INVALID.getCode(),"该商户未设置分账账号."); | |||||
| // } | |||||
| return receiver; | return receiver; | ||||
| } | } | ||||
| @@ -79,7 +79,7 @@ | |||||
| </select> | </select> | ||||
| <update id="updateWxPressBatchStatus" parameterType="com.iformall.domain.po.WxPressBatchItem" > | <update id="updateWxPressBatchStatus" parameterType="com.iformall.domain.po.WxPressBatchItem" > | ||||
| update wx_press_batch_item set press_batch_status = #{status} where `press_batch_id` = #{pressBatchId} and tenant_id=#{tenantId} | |||||
| update wx_press_batch_item set press_batch_status = #{pressBatchStatus} where `press_batch_id` = #{pressBatchId} and tenant_id=#{tenantId} | |||||
| </update> | </update> | ||||
| <delete id= "deleteItem" parameterType="com.iformall.domain.po.WxPressBatchItem" > | <delete id= "deleteItem" parameterType="com.iformall.domain.po.WxPressBatchItem" > | ||||