| @@ -361,8 +361,7 @@ public class WxCardInfoServiceImpl implements WxCardInfoService { | |||||
| Integer type = cardInfo.getStatus() == 0 ? EnumOperateLogType.ENABLE.getCode() : EnumOperateLogType.STOP_USING.getCode(); | Integer type = cardInfo.getStatus() == 0 ? EnumOperateLogType.ENABLE.getCode() : EnumOperateLogType.STOP_USING.getCode(); | ||||
| String remark = user.getUsername() + "给卡密[" + cardInfo.getId() + "]" + EnumOperateLogType.getEnum(type).getInfo(); | String remark = user.getUsername() + "给卡密[" + cardInfo.getId() + "]" + EnumOperateLogType.getEnum(type).getInfo(); | ||||
| insertWxCardDailyLogInfo(user, wxCardInfo, wxCoupon, type, remark); | |||||
| insertWxCardDailyLogInfo(user, wxCardInfo, wxCoupon, type, remark, wxCardInfo.getRemainingAmount()); | |||||
| }catch (Exception e){ | }catch (Exception e){ | ||||
| logger.error("startOrStop insert error"); | logger.error("startOrStop insert error"); | ||||
| @@ -522,7 +521,7 @@ public class WxCardInfoServiceImpl implements WxCardInfoService { | |||||
| } | } | ||||
| String remark = user.getUsername() + "给卡密[" + wxCardInfo.getId() + "]" + "充值,金额:" + wxCardInfo.getAmount() + "分"; | String remark = user.getUsername() + "给卡密[" + wxCardInfo.getId() + "]" + "充值,金额:" + wxCardInfo.getAmount() + "分"; | ||||
| insertWxCardDailyLogInfo(user, wxCardInfo, wxCoupon,EnumOperateLogType.RECHARGE.getCode(),remark); | |||||
| insertWxCardDailyLogInfo(user, wxCardInfo, wxCoupon,EnumOperateLogType.RECHARGE.getCode(),remark, cardInfo.getAmount()); | |||||
| if(record.getCardBeforeAmount().equals(0)){ | if(record.getCardBeforeAmount().equals(0)){ | ||||
| if (wxCardSpendService.cardFinishedUsing(currentDate, cardInfo)) { | if (wxCardSpendService.cardFinishedUsing(currentDate, cardInfo)) { | ||||
| @@ -535,12 +534,12 @@ public class WxCardInfoServiceImpl implements WxCardInfoService { | |||||
| } | } | ||||
| public void insertWxCardDailyLogInfo(MallUserInfo user, WxCardInfo wxCardInfo, WxCoupon wxCoupon, Integer code, String remark) { | |||||
| public void insertWxCardDailyLogInfo(MallUserInfo user, WxCardInfo wxCardInfo, WxCoupon wxCoupon, Integer code, String remark, Integer amount) { | |||||
| try { | try { | ||||
| WxCardDailyLog cardSetPrice = new WxCardDailyLog(); | WxCardDailyLog cardSetPrice = new WxCardDailyLog(); | ||||
| cardSetPrice.updateTenantInfo(wxCardInfo); | cardSetPrice.updateTenantInfo(wxCardInfo); | ||||
| cardSetPrice.setCardPasswordId(wxCardInfo.getCouponPasswordId()); | cardSetPrice.setCardPasswordId(wxCardInfo.getCouponPasswordId()); | ||||
| cardSetPrice.setPrice(wxCardInfo.getAmount()); | |||||
| cardSetPrice.setPrice(amount); | |||||
| cardSetPrice.setOperatorType(EnumUserType.MALLUSER.getCode()); | cardSetPrice.setOperatorType(EnumUserType.MALLUSER.getCode()); | ||||
| cardSetPrice.setOperatorId(user.getId()); | cardSetPrice.setOperatorId(user.getId()); | ||||
| cardSetPrice.setOperatorUser(user.getUsername()); | cardSetPrice.setOperatorUser(user.getUsername()); | ||||
| @@ -341,7 +341,7 @@ public class WxCouponPasswordServiceImpl implements WxCouponPasswordService { | |||||
| WxCardDailyLog cardSetPrice = new WxCardDailyLog(); | WxCardDailyLog cardSetPrice = new WxCardDailyLog(); | ||||
| cardSetPrice.updateTenantInfo(wxCouponPassword); | cardSetPrice.updateTenantInfo(wxCouponPassword); | ||||
| cardSetPrice.setCardPasswordId(wxCouponPassword.getId()); | cardSetPrice.setCardPasswordId(wxCouponPassword.getId()); | ||||
| cardSetPrice.setPrice(cardInfo.getAmount()); | |||||
| cardSetPrice.setPrice(cardInfo.getRemainingAmount()); | |||||
| cardSetPrice.setOperatorType(EnumUserType.MALLUSER.getCode()); | cardSetPrice.setOperatorType(EnumUserType.MALLUSER.getCode()); | ||||
| cardSetPrice.setOperatorId(user.getId()); | cardSetPrice.setOperatorId(user.getId()); | ||||
| cardSetPrice.setOperatorUser(user.getUsername()); | cardSetPrice.setOperatorUser(user.getUsername()); | ||||
| @@ -394,10 +394,10 @@ public class WxCouponPasswordServiceImpl implements WxCouponPasswordService { | |||||
| cardSetPrice.setOperatorType(EnumUserType.MALLUSER.getCode()); | cardSetPrice.setOperatorType(EnumUserType.MALLUSER.getCode()); | ||||
| cardSetPrice.setOperatorId(user.getId()); | cardSetPrice.setOperatorId(user.getId()); | ||||
| cardSetPrice.setOperatorUser(user.getUsername()); | cardSetPrice.setOperatorUser(user.getUsername()); | ||||
| cardSetPrice.setCouponId(wxCouponPassword.getCouponId()); | |||||
| cardSetPrice.setCouponId(wxCoupon.getCouponId()); | |||||
| cardSetPrice.setType(EnumOperateLogType.SET_DENOMINATION.getCode()); | cardSetPrice.setType(EnumOperateLogType.SET_DENOMINATION.getCode()); | ||||
| cardSetPrice.setCount(1); | cardSetPrice.setCount(1); | ||||
| cardSetPrice.setRemark(user.getUsername() + "给卡密[" + cardSetPrice.getCardInfoId() + "]设置了面额,金额:" + cardSetPrice.getPrice() + "分"); | |||||
| cardSetPrice.setRemark(user.getUsername() + "给卡密[" + cardSetPrice.getCardPasswordId() + "]设置了面额,金额:" + cardSetPrice.getPrice() + "分"); | |||||
| wxCardDailyLogService.saveOrUpdate(cardSetPrice); | wxCardDailyLogService.saveOrUpdate(cardSetPrice); | ||||
| } | } | ||||
| return count; | return count; | ||||
| @@ -35,7 +35,6 @@ import com.iformall.service.pay.PayServiceFactory; | |||||
| import com.iformall.service.pay.service.share.PayShareAdapterService; | import com.iformall.service.pay.service.share.PayShareAdapterService; | ||||
| import com.iformall.utils.Constant; | import com.iformall.utils.Constant; | ||||
| import com.iformall.utils.DateUtils; | import com.iformall.utils.DateUtils; | ||||
| import io.swagger.models.auth.In; | |||||
| import org.apache.commons.collections.CollectionUtils; | import org.apache.commons.collections.CollectionUtils; | ||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| @@ -658,7 +657,8 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| } | } | ||||
| wxCouponMapper.insert(record); | wxCouponMapper.insert(record); | ||||
| insertWxCardDailyLogInfo(user, record, true); | |||||
| String remark = (user != null ? user.getUsername() : "") + "创建了卡[" + record.getTitle() + "]," + record.getInventory() + "张卡密"; | |||||
| insertWxCardDailyLogInfo(user, record, true, remark); | |||||
| } else { | } else { | ||||
| if(EnumCouponType.getDouYinType().contains(record.getType())){ | if(EnumCouponType.getDouYinType().contains(record.getType())){ | ||||
| @@ -1828,12 +1828,13 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| wxCouponChannelService.spuStatusSyncByCoupon(tenantInfo,couponId); | wxCouponChannelService.spuStatusSyncByCoupon(tenantInfo,couponId); | ||||
| WxCoupon record = wxCouponMapper.selectById(couponId, tenantInfo.getTenantId()); | WxCoupon record = wxCouponMapper.selectById(couponId, tenantInfo.getTenantId()); | ||||
| insertWxCardDailyLogInfo(user, record,false); | |||||
| String remark = (user != null ? user.getUsername() : "") + "创建了卡[" + record.getTitle() + "], 库存:"; | |||||
| insertWxCardDailyLogInfo(user, record, false, remark); | |||||
| } | } | ||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| public void insertWxCardDailyLogInfo(MallUserInfo user, WxCoupon record, Boolean flag) { | |||||
| public void insertWxCardDailyLogInfo(MallUserInfo user, WxCoupon record, Boolean flag, String remark) { | |||||
| if (EnumCouponType.CARD_MULTIMCH.getCode().equals(record.getType())) { | if (EnumCouponType.CARD_MULTIMCH.getCode().equals(record.getType())) { | ||||
| try { | try { | ||||
| WxCardDailyLog cardSetPrice = new WxCardDailyLog(); | WxCardDailyLog cardSetPrice = new WxCardDailyLog(); | ||||
| @@ -1845,7 +1846,7 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| cardSetPrice.setOperatorType(user != null ? EnumUserType.MALLUSER.getCode() : 0); | cardSetPrice.setOperatorType(user != null ? EnumUserType.MALLUSER.getCode() : 0); | ||||
| cardSetPrice.setOperatorId(user != null ? user.getId() : 0); | cardSetPrice.setOperatorId(user != null ? user.getId() : 0); | ||||
| cardSetPrice.setOperatorUser(user != null ? user.getUsername() : ""); | cardSetPrice.setOperatorUser(user != null ? user.getUsername() : ""); | ||||
| cardSetPrice.setRemark((user != null ? user.getUsername() : "") + "创建了卡[" + record.getTitle() + "]" + "库存:" + cardSetPrice.getPrice()); | |||||
| cardSetPrice.setRemark(flag ? remark : remark + cardSetPrice.getPrice()); | |||||
| wxCardDailyLogService.saveOrUpdate(cardSetPrice); | wxCardDailyLogService.saveOrUpdate(cardSetPrice); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error("insertWxCardDailyLogInfo insert error"); | logger.error("insertWxCardDailyLogInfo insert error"); | ||||