Commit 4bff1d70 by guojuxing

Merge remote-tracking branch 'origin/developer' into developer

parents 969003fd b996a239
......@@ -14,9 +14,12 @@ import com.gic.enterprise.dto.BillingPayInfoDTO;
import com.gic.enterprise.dto.EnterpriseDTO;
import com.gic.enterprise.dto.OutPayDTO;
import com.gic.enterprise.entity.TabBillingPayInfo;
import com.gic.enterprise.entity.TabBillingRechargeRecord;
import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.service.*;
import com.gic.enterprise.utils.CreateRandomUtils;
import com.gic.log.api.dto.SystemSetLogDTO;
import com.gic.log.api.service.LogApiService;
import com.gic.marketing.process.api.service.sms.SmsSendApiService;
import com.gic.thirdparty.api.dto.ScanPayReqDataDTO;
import com.gic.thirdparty.api.service.Pay4WXService;
......@@ -55,6 +58,9 @@ public class WxPayStrategy implements PayStrategy {
private EnterpriseApiService enterpriseApiService;
@Autowired
SmsSendApiService smsSendApiService;
@Autowired
private LogApiService logApiService;
@Override
public ServiceResponse<BillingPayInfoDTO> savePrePayInfo(OutPayDTO outPayDTO) {
......@@ -121,10 +127,16 @@ public class WxPayStrategy implements PayStrategy {
billingRechargeRecordService.updateBySerialNumber(resData.getEnterpriseId(), billingPayInfo.getOrderSerialNumber(), resData.getTotalFeePaid(), resData.getTotalFeePaid(), BillingAuditStatusEnum.PASS.getCode(), resData.getTimeEnd(), resData.getOnlineSerialNumber());
this.pushMessageApiService.pushMessage(resData.getEnterpriseId(), "系统通知", "余额充值", "您的商户成功充值"+resData.getTotalFeePaid()+"元!感谢您的支持和使用!");
sendRechargeSuccessSms(resData, billingPayInfo.getEnterpriseId());
TabBillingRechargeRecord rechargeRecord = billingRechargeRecordService.getRechargeRecordBySerialNumber(billingPayInfo.getOrderSerialNumber());
UserDTO userDTO = userApiService.getUserById(rechargeRecord.getInitiatorUser()).getResult();
createLog("充值", "账户余额", userDTO);
break;
case 2:
// 短信套餐包购买
this.billingOrderService.updateBySerialNumber(billingPayInfo.getOrderSerialNumber(), resData.getTotalFeePaid(), BillingAuditStatusEnum.PASS.getCode(), resData.getTimeEnd());
TabBillingRechargeRecord rechargeRecord2 = billingRechargeRecordService.getRechargeRecordBySerialNumber(billingPayInfo.getOrderSerialNumber());
UserDTO userDTO2 = userApiService.getUserById(rechargeRecord2.getInitiatorUser()).getResult();
createLog("支付", "订单内容", userDTO2);
break;
default:
break;
......@@ -198,4 +210,39 @@ public class WxPayStrategy implements PayStrategy {
}
}
public void createLog(String content, String operationObject, UserDTO userDTO) {
doLog(content, operationObject, userDTO);
}
private void doLog(String content, String operationObject, UserDTO userDTO) {
final SystemSetLogDTO logDTO = new SystemSetLogDTO();
//操作时间
logDTO.setLogTime(new Date());
logDTO.setCreateTime(new Date());
//操作人
logDTO.setUserId(Long.valueOf(userDTO.getUserId()));
logDTO.setUserName(userDTO.getUserName());
//操作内容
logDTO.setContent(content);
//为了search查询,暂时用这个字段存
logDTO.setInterfaceName(content);
////操作对象
logDTO.setBusinessName(operationObject);
//操作模块
// String moduleMenuName = (String) RequestContext.getContext().getRequest().getAttribute("moduleMenuName");
// Integer moduleMenuId = (Integer) RequestContext.getContext().getRequest().getAttribute("moduleMenuId");
// if (moduleMenuId != null) {
logDTO.setRelationId(45000L);
logDTO.setProject("企业-计费中心");
// }
//账号(手机号)
logDTO.setRemark1(userDTO.getPhoneAreaCode());
logDTO.setRemark2(userDTO.getPhoneNumber());
logDTO.setEnterpriseId(userDTO.getEnterpriseId().longValue());
EnterpriseDTO enterpriseDTO = enterpriseApiService.getEnterpriseById(userDTO.getEnterpriseId()).getResult();
logDTO.setEnterpriseName(enterpriseDTO.getEnterpriseName());
logApiService.saveSystemSetLog(logDTO);
}
}
......@@ -95,7 +95,7 @@ public class PackageController {
}
ServiceResponse<Integer> response = this.billingOrderApiService.saveSmsOrderBuyNow(orderDTO, itemDTO);
if(response.isSuccess()){
LogUtils.createLog("套餐包购买", qo.getSmsPackageName());
LogUtils.createLog("购买短信套餐包", "短信套餐包");
return RestResponse.success(response.getResult());
}
return EnterpriseRestResponse.failure(response);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment