| @@ -315,6 +315,7 @@ public enum ErrorCode{ | |||||
| PROFIT_SHARING_NUM_UP_LIMIT(12039, "分账次数超限"), | PROFIT_SHARING_NUM_UP_LIMIT(12039, "分账次数超限"), | ||||
| PROFIT_SHARING_QUERY_UNKNOWN_TYPE(12040, "分账查询类型不支持"), | PROFIT_SHARING_QUERY_UNKNOWN_TYPE(12040, "分账查询类型不支持"), | ||||
| PROFIT_SHARING_RECEIVER_UNKNOWN(12041, "收款方账户异常"), | PROFIT_SHARING_RECEIVER_UNKNOWN(12041, "收款方账户异常"), | ||||
| PROFIT_SHARING_TIME_EXPIRED(12042, "分账已过期"), | |||||
| /** | /** | ||||
| * 核销 | * 核销 | ||||
| */ | */ | ||||
| @@ -761,7 +761,13 @@ public class WxCUserTagsServiceImpl implements WxCUserTagsService { | |||||
| @Override | @Override | ||||
| public void updateTagByUserId(Long cUserId, List<Long> tags) { | public void updateTagByUserId(Long cUserId, List<Long> tags) { | ||||
| WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectById(cUserId); | WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectById(cUserId); | ||||
| WxCUserTags userTags = getById(wxCUserBasicInfo.getTagId()); | |||||
| WxCUserTags userTags = null; | |||||
| if (wxCUserBasicInfo.getTagId() != null) { | |||||
| userTags = getById(wxCUserBasicInfo.getTagId()); | |||||
| } else { | |||||
| userTags = new WxCUserTags(); | |||||
| userTags.setTags("[]"); | |||||
| } | |||||
| List<Long> tagList = JSONArray.parseArray(userTags.getTags(), Long.class); | List<Long> tagList = JSONArray.parseArray(userTags.getTags(), Long.class); | ||||
| //先从现有标签中查看用户是否有 服饰尺码 和 鞋码 类别 有 删除 | //先从现有标签中查看用户是否有 服饰尺码 和 鞋码 类别 有 删除 | ||||
| Long tagId = 0L; | Long tagId = 0L; | ||||
| @@ -781,7 +787,13 @@ public class WxCUserTagsServiceImpl implements WxCUserTagsService { | |||||
| String tagStr = JSONArray.toJSONString(tagList); | String tagStr = JSONArray.toJSONString(tagList); | ||||
| userTags.setTags(tagStr); | userTags.setTags(tagStr); | ||||
| userTags.setUpdateDate(new Date()); | userTags.setUpdateDate(new Date()); | ||||
| wxCUserTagsMapper.updateById(userTags); | |||||
| if (userTags.getId() != null) { | |||||
| wxCUserTagsMapper.updateById(userTags); | |||||
| } else { | |||||
| userTags.setCreateDate(new Date()); | |||||
| userTags.setUpdateDate(new Date()); | |||||
| wxCUserTagsMapper.insert(userTags); | |||||
| } | |||||
| } | } | ||||
| public Long getTagId(List<Long> tagList, Long id, WxTags wxTags) { | public Long getTagId(List<Long> tagList, Long id, WxTags wxTags) { | ||||
| @@ -251,8 +251,10 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||||
| shareForCardPay(record, record.getCardId(), record.getOrderId(), record.getId()); | shareForCardPay(record, record.getCardId(), record.getOrderId(), record.getId()); | ||||
| } catch (MallinkException e) { | } catch (MallinkException e) { | ||||
| logger.error(e.getMessage()); | logger.error(e.getMessage()); | ||||
| if (ErrorCode.PROFIT_SHARING_NUM_UP_LIMIT.getCode() == e.getErrorCode()) { | |||||
| // 分账已到20次限制,后面只记录,无法分账 | |||||
| if (ErrorCode.PROFIT_SHARING_NUM_UP_LIMIT.getCode() == e.getErrorCode() || | |||||
| ErrorCode.PROFIT_SHARING_TIME_EXPIRED.getCode() == e.getErrorCode()) { | |||||
| // 分账已到20次限制,后面只记录,不分账 | |||||
| // 分账已过期,后面只记录,不分账 | |||||
| logger.error("分账已到20次限制,后面只记录,无法分账"); | logger.error("分账已到20次限制,后面只记录,无法分账"); | ||||
| try { | try { | ||||
| creteMerchantSubsidy(record, curDate, idWorker, coupon, payment); | creteMerchantSubsidy(record, curDate, idWorker, coupon, payment); | ||||
| @@ -467,6 +469,12 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||||
| logger.error(e.getMessage()); | logger.error(e.getMessage()); | ||||
| throw new MallinkException(ErrorCode.DB_FAIL); | throw new MallinkException(ErrorCode.DB_FAIL); | ||||
| } | } | ||||
| // 分账时间检查 | |||||
| WxCouponOrder couponOrder = wxCouponOrderMapper.selectById(cardId); | |||||
| if (couponOrder.getExpiredTime().before(new Date())) { | |||||
| throw new MallinkException(ErrorCode.PROFIT_SHARING_TIME_EXPIRED); | |||||
| } | |||||
| // 微信分账 | // 微信分账 | ||||
| try { | try { | ||||
| WxCardSpend cardSpend = new WxCardSpend(); | WxCardSpend cardSpend = new WxCardSpend(); | ||||
| @@ -862,9 +870,18 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||||
| shareForCardPay(record, record.getCardId(), record.getOrderId(), record.getId()); | shareForCardPay(record, record.getCardId(), record.getOrderId(), record.getId()); | ||||
| } catch (MallinkException e) { | } catch (MallinkException e) { | ||||
| logger.error(e.getMessage()); | logger.error(e.getMessage()); | ||||
| if (ErrorCode.PROFIT_SHARING_NUM_UP_LIMIT.getCode() == e.getErrorCode()) { | |||||
| if (ErrorCode.PROFIT_SHARING_NUM_UP_LIMIT.getCode() == e.getErrorCode() || | |||||
| ErrorCode.PROFIT_SHARING_TIME_EXPIRED.getCode() == e.getErrorCode()) { | |||||
| // 分账已到20次限制,后面只记录,无法分账 | // 分账已到20次限制,后面只记录,无法分账 | ||||
| // 分账已过期,后面只记录,无法分账 | |||||
| logger.error("分账已到20次限制,后面只记录,无法分账"); | logger.error("分账已到20次限制,后面只记录,无法分账"); | ||||
| /* | |||||
| try { | |||||
| creteMerchantSubsidy(record, curDate, idWorker, coupon, payment); | |||||
| } catch (Exception ex) { | |||||
| logger.error("分账已到20次限制,记录到结算表失败"); | |||||
| } | |||||
| */ | |||||
| } else { | } else { | ||||
| throw new MallinkException(e.getErrorCode(), e.getMessage()); | throw new MallinkException(e.getErrorCode(), e.getMessage()); | ||||
| } | } | ||||
| @@ -1763,13 +1763,8 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| //查签约 | //查签约 | ||||
| WxPropertyContract wxPropertyContract = new WxPropertyContract(); | WxPropertyContract wxPropertyContract = new WxPropertyContract(); | ||||
| wxPropertyContract.setRentContractId(record.getId()); | wxPropertyContract.setRentContractId(record.getId()); | ||||
| wxPropertyContract.setStatus(EnumRentContractStatus.WAIT_SIGN.getCode()); | |||||
| WxPropertyContract propertyContract = wxPropertyContractMapper.selectOne(new QueryWrapper(wxPropertyContract)); | WxPropertyContract propertyContract = wxPropertyContractMapper.selectOne(new QueryWrapper(wxPropertyContract)); | ||||
| //查补录 | |||||
| if(propertyContract==null){ | |||||
| wxPropertyContract.setStatus(EnumRentContractStatus.SUPPLE.getCode()); | |||||
| propertyContract = wxPropertyContractMapper.selectOne(new QueryWrapper(wxPropertyContract)); | |||||
| } | |||||
| logger.info("物业合同状态及账单状态修改:{}",propertyContract); | |||||
| if (propertyContract != null) { | if (propertyContract != null) { | ||||
| propertyContract.setMerchantId(record.getMerchantId()); | propertyContract.setMerchantId(record.getMerchantId()); | ||||
| wxPropertyContractMapper.updateById(propertyContract); | wxPropertyContractMapper.updateById(propertyContract); | ||||
| @@ -219,6 +219,10 @@ public class BoLinkUtil { | |||||
| //打印StatusLine | //打印StatusLine | ||||
| logger.debug("StatusLine: " + response.getStatusLine()); | logger.debug("StatusLine: " + response.getStatusLine()); | ||||
| if (response.getStatusLine().getStatusCode() != 200) { | |||||
| logger.error("status error: " + response.getStatusLine().getReasonPhrase()); | |||||
| throw new MallinkException(ErrorCode.CAR_CMD_FAIL); | |||||
| } | |||||
| try{ | try{ | ||||
| //获取实体 | //获取实体 | ||||
| HttpEntity httpEntity= response.getEntity(); | HttpEntity httpEntity= response.getEntity(); | ||||