Commit 41c6b254 authored by hanfeng's avatar hanfeng

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

parents d93c2367 08aa0351
package com.github.wxiaoqi.security.admin.dto;
import lombok.Data;
import java.io.Serializable;
import java.sql.Timestamp;
/**
* 员工变更记录表
*/
@Data
public class AppUserPositionChangeRecordDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
private Integer id;
/**
* 用户id
*/
private String phone;
/**
* 用户名称
*/
private String userName;
/**
* 变更后所在公司ID
*/
private Integer newCompanyId;
/**
* 变更前所在公司ID
*/
private Integer oldCompanyId;
/**
* 变更后所在公司名称
*/
private String newCompanyName;
/**
* 变更前所在公司名称
*/
private String oldCompanyName;
/**
* 旧职位ID
*/
private Integer oldJobId;
/**
* 新职位ID
*/
private Integer newJobId;
/**
* 新职位名称
*/
private String newJobName;
/**
* 旧职位名称
*/
private String oldJobName;
/**
* 操作人名称
*/
private Integer operatorId;
/**
* 操作时间
*/
private Timestamp crtTime;
/**
* 状态
* 1:入职;2:职位变更;3:身份变更 4:公司所属变更;5离职
*/
private Integer jobRemark;
/***
* 旧身份ID
*/
private Integer oldPositionId;
/***
* 新身份ID
*/
private Integer newPositionId;
/***
* 新身份名称
*/
private String newPositionName;
/***
* 旧身份名称
*/
private String oldPositionName;
/**
* 员工职位、所属公司、离职、入职等的实际上任时间
*/
private Timestamp relTime;
}
...@@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModelProperty; ...@@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
import java.sql.Timestamp;
/** /**
* @author libin * @author libin
* @version 1.0 * @version 1.0
...@@ -37,4 +39,13 @@ public class AppUserPositionTempDTO { ...@@ -37,4 +39,13 @@ public class AppUserPositionTempDTO {
@ApiModelProperty(value = "分公司") @ApiModelProperty(value = "分公司")
private String companyName; private String companyName;
@ApiModelProperty(value = "变动操作内容")
private Integer ChangeStatus;
@ApiModelProperty(value = "员工职位、所属公司、离职、入职等的实际上任时间")
private Timestamp relTime;
@ApiModelProperty(value = "是否删除:0-正常;1-删除")
private Integer isDel;
} }
package com.github.wxiaoqi.security.admin.entity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Date;
/**
* 员工变更记录表
*/
@Table(name = "app_user_position_change_record")
@Data
public class AppUserPositionChangeRecord implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(generator = "JDBC")//此处加上注解
@ApiModelProperty("主键id")
private Integer id;
@ApiModelProperty("用户id")
@Column(name = "phone")
private String phone;
@ApiModelProperty("用户名称")
@Column(name = "user_name")
private String userName;
@ApiModelProperty("变更后所在公司ID")
@Column(name = "new_company_id")
private Integer newCompanyId;
@ApiModelProperty("变更前所在公司ID")
@Column(name = "old_company_id")
private Integer oldCompanyId;
@ApiModelProperty("变更后所在公司名称")
@Column(name = "new_company_name")
private String newCompanyName;
@ApiModelProperty("变更前所在公司名称")
@Column(name = "old_company_name")
private String oldCompanyName;
@ApiModelProperty("旧职位ID")
@Column(name = "old_job_id")
private Integer oldJobId;
@ApiModelProperty("新职位ID")
@Column(name = "new_job_id")
private Integer newJobId;
@ApiModelProperty("操作人名称")
@Column(name = "operator_id")
private Integer operatorId;
@ApiModelProperty("操作时间")
@Column(name = "crt_time")
private Timestamp crtTime;
@ApiModelProperty("员工职位、所属公司、离职、入职等的实际上任时间")
@Column(name = "rel_time")
private Timestamp relTime;
@ApiModelProperty("新身份ID")
@Column(name = "new_position_id")
private Integer newPositionId;
@ApiModelProperty("旧身份ID")
@Column(name = "old_position_id")
private Integer oldPositionId;
@ApiModelProperty("1:入职;2:职位变更;3:身份变更 4:公司所属变更;5离职")
@Column(name = "job_remark")
private Integer jobRemark;
@ApiModelProperty("新身份名称")
@Column(name = "new_position_name")
private String newPositionName;
@ApiModelProperty("旧身份名称")
@Column(name = "old_position_name")
private String oldPositionName;
@ApiModelProperty("新职位名称")
@Column(name = "new_job_name")
private String newJobName;
@ApiModelProperty("旧职位名称")
@Column(name = "old_job_name")
private String oldJobName;
}
...@@ -4,6 +4,8 @@ import cn.hutool.core.bean.BeanUtil; ...@@ -4,6 +4,8 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions; import cn.hutool.core.bean.copier.CopyOptions;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.github.wxiaoqi.security.admin.entity.AppUserAlipay; import com.github.wxiaoqi.security.admin.entity.AppUserAlipay;
import com.github.wxiaoqi.security.admin.entity.AppUserDetail;
import com.github.wxiaoqi.security.admin.entity.AppUserLogin;
import com.github.wxiaoqi.security.admin.mapper.AppUserAlipayMapper; import com.github.wxiaoqi.security.admin.mapper.AppUserAlipayMapper;
import com.github.wxiaoqi.security.auth.client.config.UserAuthConfig; import com.github.wxiaoqi.security.auth.client.config.UserAuthConfig;
import com.github.wxiaoqi.security.auth.client.jwt.UserAuthUtil; import com.github.wxiaoqi.security.auth.client.jwt.UserAuthUtil;
...@@ -94,16 +96,16 @@ public class AppUserAlipayBiz extends BaseBiz<AppUserAlipayMapper, AppUserAlipay ...@@ -94,16 +96,16 @@ public class AppUserAlipayBiz extends BaseBiz<AppUserAlipayMapper, AppUserAlipay
appUserAlipays.add(appUserAlipay); appUserAlipays.add(appUserAlipay);
} }
//微信 //微信
// AppUserLogin appUserLogin = appUserLoginBiz.getUserById(userId); AppUserLogin appUserLogin = appUserLoginBiz.getUserById(userId);
// if(appUserLogin != null && StringUtils.isNotBlank(appUserLogin.getWxOpenid())) { if(appUserLogin != null && StringUtils.isNotBlank(appUserLogin.getWxOpenid())) {
// AppUserDetail appUserDetail = appUserDetailBiz.getUserByUserid(userId); AppUserDetail appUserDetail = appUserDetailBiz.getUserByUserid(userId);
// AppUserAlipay wxAppUser = new AppUserAlipay(); AppUserAlipay wxAppUser = new AppUserAlipay();
// wxAppUser.setType(2); wxAppUser.setType(2);
// wxAppUser.setUserId(userId); wxAppUser.setUserId(userId);
// wxAppUser.setNickname(StringUtils.isEmpty(appUserDetail.getWxNickname())?appUserDetail.getNickname():appUserDetail.getWxNickname()); wxAppUser.setNickname(StringUtils.isEmpty(appUserDetail.getWxNickname())?appUserDetail.getNickname():appUserDetail.getWxNickname());
// wxAppUser.setTxAlipay(appUserLogin.getWxOpenid()); wxAppUser.setTxAlipay(appUserLogin.getWxOpenid());
// appUserAlipays.add(wxAppUser); appUserAlipays.add(wxAppUser);
// } }
return appUserAlipays; return appUserAlipays;
} }
......
package com.github.wxiaoqi.security.admin.biz;
import com.alibaba.druid.sql.visitor.functions.If;
import com.github.wxiaoqi.security.admin.dto.AppUserPositionChangeRecordDTO;
import com.github.wxiaoqi.security.admin.dto.AppUserPositionTempDTO;
import com.github.wxiaoqi.security.admin.entity.AppUserPosition;
import com.github.wxiaoqi.security.admin.entity.AppUserPositionChangeRecord;
import com.github.wxiaoqi.security.admin.entity.AppUserPositionTemp;
import com.github.wxiaoqi.security.admin.mapper.AppUserPositionChangeRecordMapper;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import org.apache.commons.lang3.StringUtils;
import org.jsoup.select.Evaluator;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.entity.Example;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Transactional
@Service("appUserPositionChangeRecordBiz")
public class AppUserPositionChangeRecordBiz extends BaseBiz<AppUserPositionChangeRecordMapper, AppUserPositionChangeRecord> {
@Autowired
private AppUserPositionBiz appUserPositionBiz;
@Autowired
private AppUserJobLevelBiz appUserJobLevelBiz;
public static final int USER_ADD_COMPANY = 1;
public static final int JOB_CHANGE = 2;
public static final int POSITION_CHANGE = 3;
public static final int COMPANY_CHANGE = 4;
public static final int USER_LEAVE_COMPANT = 5;
/**
* 变更记录表插入
*
* @param userPositionTemp
*/
public void addPositionChangeRecord(AppUserPositionTemp userPositionTemp, AppUserPositionTemp oldData, Integer operatorId, Timestamp relTime) {
AppUserPositionChangeRecord appUserPositionChangeRecord = new AppUserPositionChangeRecord();
if (!(userPositionTemp.getIsDel().equals(oldData.getIsDel()))) {
appUserPositionChangeRecord.setJobRemark(USER_LEAVE_COMPANT);
}
//状态1:职位变动
if (!(userPositionTemp.getJobId().equals(oldData.getJobId()))) {
appUserPositionChangeRecord.setOldJobId(oldData.getJobId());
appUserPositionChangeRecord.setNewJobId(userPositionTemp.getJobId());
appUserPositionChangeRecord.setJobRemark(JOB_CHANGE);
findUserJobName(appUserPositionChangeRecord);
}
//状态2:身份变动
if (!(userPositionTemp.getPositionId().equals(oldData.getPositionId()))) {
appUserPositionChangeRecord.setOldPositionId(oldData.getPositionId());
appUserPositionChangeRecord.setNewPositionId(userPositionTemp.getPositionId());
appUserPositionChangeRecord.setJobRemark(POSITION_CHANGE);
findUserPositionName(appUserPositionChangeRecord);
}
//状态3:公司变动调整
if (!(userPositionTemp.getCompanyId().equals(oldData.getCompanyId()))) {
appUserPositionChangeRecord.setOldCompanyId(oldData.getCompanyId());
appUserPositionChangeRecord.setOldCompanyName(oldData.getCompanyName());
appUserPositionChangeRecord.setNewCompanyId(userPositionTemp.getCompanyId());
appUserPositionChangeRecord.setNewCompanyName(userPositionTemp.getCompanyName());
appUserPositionChangeRecord.setJobRemark(COMPANY_CHANGE);
}
appUserPositionChangeRecord.setPhone(userPositionTemp.getPhone());
appUserPositionChangeRecord.setRelTime(relTime);
appUserPositionChangeRecord.setUserName(userPositionTemp.getName());
appUserPositionChangeRecord.setCrtTime(new Timestamp(System.currentTimeMillis()));
appUserPositionChangeRecord.setOperatorId(operatorId);
mapper.insert(appUserPositionChangeRecord);
}
/**
* 入职时插入记录表
*
* @param userPositionTemp
* @param updUserId
*/
public void addJoinJobRecord(AppUserPositionTempDTO userPositionTemp, Integer updUserId) {
AppUserPositionChangeRecord appUserPositionChangeRecord = new AppUserPositionChangeRecord();
appUserPositionChangeRecord.setPhone(userPositionTemp.getPhone());
appUserPositionChangeRecord.setUserName(userPositionTemp.getName());
appUserPositionChangeRecord.setRelTime(userPositionTemp.getRelTime());
appUserPositionChangeRecord.setCrtTime(new Timestamp(System.currentTimeMillis()));
appUserPositionChangeRecord.setJobRemark(USER_ADD_COMPANY);
appUserPositionChangeRecord.setOperatorId(updUserId);
mapper.insert(appUserPositionChangeRecord);
}
/**
* 查询新旧职位名称
* zyh
*
* @param appUserPositionChangeRecord
* @return
*/
public AppUserPositionChangeRecord findUserJobName(AppUserPositionChangeRecord appUserPositionChangeRecord) {
appUserPositionChangeRecord.setNewJobName(appUserJobLevelBiz.selectById(appUserPositionChangeRecord.getNewJobId()).getName());
appUserPositionChangeRecord.setOldJobName(appUserJobLevelBiz.selectById(appUserPositionChangeRecord.getOldJobId()).getName());
return appUserPositionChangeRecord;
}
/**
* 查询新旧身份名称
* zyh
*
* @param appUserPositionChangeRecord
* @return
*/
public AppUserPositionChangeRecord findUserPositionName(AppUserPositionChangeRecord appUserPositionChangeRecord) {
appUserPositionChangeRecord.setOldPositionName(appUserPositionBiz.selectById(appUserPositionChangeRecord.getOldPositionId()).getName());
appUserPositionChangeRecord.setNewPositionName(appUserPositionBiz.selectById(appUserPositionChangeRecord.getNewPositionId()).getName());
return appUserPositionChangeRecord;
}
/**
* 查询员工信息变更记录表
*/
public List<AppUserPositionChangeRecordDTO> findPositionChangeRecord(AppUserPositionTemp userPositionTemp) {
Example example = new Example(AppUserPositionChangeRecord.class);
example.createCriteria().andEqualTo("phone", userPositionTemp.getPhone());
List<AppUserPositionChangeRecord> list = selectByExample(example);
List<AppUserPositionChangeRecordDTO> listAppUserPositionChangeRecordDTO = new ArrayList<>();
list.stream().forEach(x -> {
AppUserPositionChangeRecordDTO appUserPositionChangeRecordDTO = new AppUserPositionChangeRecordDTO();
BeanUtils.copyProperties(x, appUserPositionChangeRecordDTO);
listAppUserPositionChangeRecordDTO.add(appUserPositionChangeRecordDTO);
});
return listAppUserPositionChangeRecordDTO;
}
}
...@@ -366,7 +366,7 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> implements In ...@@ -366,7 +366,7 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> implements In
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String host = StringUtils.defaultIfBlank(request.getHeader("userHost"), ClientUtil.getClientIp(request)); String host = StringUtils.defaultIfBlank(request.getHeader("userHost"), ClientUtil.getClientIp(request));
FundPayVo fundPayVo = FundPayVo.builder() FundPayVo fundPayVo = FundPayVo.builder()
.amount(applyCathVo.getCathType() == 0 ? String.valueOf(realAmount.multiply(new BigDecimal(100)).doubleValue()) : String.format("%.2f", realAmount.doubleValue())) .amount(applyCathVo.getCathType() == 0 ? String.format("%.0f",realAmount.multiply(new BigDecimal(100)).doubleValue()) : String.format("%.2f", realAmount.doubleValue()))
.orderNo(orderNo) .orderNo(orderNo)
.payeeAccount(applyCathVo.getAccountNumber()) .payeeAccount(applyCathVo.getAccountNumber())
.payerShowName("欣新房车网络科技(广东)股份有限公司") .payerShowName("欣新房车网络科技(广东)股份有限公司")
...@@ -414,7 +414,7 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> implements In ...@@ -414,7 +414,7 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> implements In
String host = StringUtils.defaultIfBlank(request.getHeader("userHost"), ClientUtil.getClientIp(request)); String host = StringUtils.defaultIfBlank(request.getHeader("userHost"), ClientUtil.getClientIp(request));
String cono = OrderUtil.GetOrderNumber(""); String cono = OrderUtil.GetOrderNumber("");
FundPayVo fundPayVo = FundPayVo.builder() FundPayVo fundPayVo = FundPayVo.builder()
.amount(cath.getCathType() == 0 ? String.valueOf(cath.getRealAmount().multiply(new BigDecimal(100)).doubleValue()) : String.format("%.2f", cath.getRealAmount().doubleValue())) .amount(cath.getCathType() == 0 ? String.format("%.0f",cath.getRealAmount().multiply(new BigDecimal(100)).doubleValue()) : String.format("%.2f", cath.getRealAmount().doubleValue()))
.payeeAccount(cath.getAccountNumber()) .payeeAccount(cath.getAccountNumber())
.orderNo(cono) .orderNo(cono)
.payerShowName("欣新房车网络科技(广东)股份有限公司") .payerShowName("欣新房车网络科技(广东)股份有限公司")
......
package com.github.wxiaoqi.security.admin.mapper;
import com.github.wxiaoqi.security.admin.entity.AppUserPositionChangeRecord;
import tk.mybatis.mapper.common.Mapper;
public interface AppUserPositionChangeRecordMapper extends Mapper<AppUserPositionChangeRecord> {
}
...@@ -6,15 +6,22 @@ import com.github.wxiaoqi.security.admin.biz.AppUserPositionTempBiz; ...@@ -6,15 +6,22 @@ import com.github.wxiaoqi.security.admin.biz.AppUserPositionTempBiz;
import com.github.wxiaoqi.security.admin.dto.AppUserPositionTempDTO; import com.github.wxiaoqi.security.admin.dto.AppUserPositionTempDTO;
import com.github.wxiaoqi.security.admin.dto.AppUserPositionTempFindDTO; import com.github.wxiaoqi.security.admin.dto.AppUserPositionTempFindDTO;
import com.github.wxiaoqi.security.admin.dto.UserPostionDTO; import com.github.wxiaoqi.security.admin.dto.UserPostionDTO;
import com.github.wxiaoqi.security.admin.entity.AppUserPositionTemp;
import com.github.wxiaoqi.security.admin.vo.AppUserPositionTempVo; import com.github.wxiaoqi.security.admin.vo.AppUserPositionTempVo;
import com.github.wxiaoqi.security.admin.vo.WalletPostionVo; import com.github.wxiaoqi.security.admin.vo.WalletPostionVo;
import com.github.wxiaoqi.security.auth.client.config.UserAuthConfig;
import com.github.wxiaoqi.security.auth.client.jwt.UserAuthUtil;
import com.github.wxiaoqi.security.auth.common.util.jwt.IJWTInfo;
import com.github.wxiaoqi.security.common.exception.BaseException;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.excel.ExcelImport; import com.github.wxiaoqi.security.common.util.excel.ExcelImport;
import com.github.wxiaoqi.security.common.vo.PageDataVO; import com.github.wxiaoqi.security.common.vo.PageDataVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -24,6 +31,7 @@ import java.util.Map; ...@@ -24,6 +31,7 @@ import java.util.Map;
* @description * @description
* @data 2019/7/17 16:13 * @data 2019/7/17 16:13
*/ */
@Slf4j
@RestController @RestController
@RequestMapping("/postion/admin") @RequestMapping("/postion/admin")
public class AppUserPositionController { public class AppUserPositionController {
...@@ -37,8 +45,16 @@ public class AppUserPositionController { ...@@ -37,8 +45,16 @@ public class AppUserPositionController {
@Autowired @Autowired
private AppUserPositionTempBiz appUserPositionTempBiz; private AppUserPositionTempBiz appUserPositionTempBiz;
@Autowired
private UserAuthUtil userAuthUtil;
@Autowired
private UserAuthConfig userAuthConfig;
@GetMapping("/jobs") @GetMapping("/jobs")
public ObjectRestResponse findAllJobs() { public ObjectRestResponse findAllJobs() {
return ObjectRestResponse.succ(jobLevelBiz.selectListAll()); return ObjectRestResponse.succ(jobLevelBiz.selectListAll());
} }
...@@ -57,60 +73,105 @@ public class AppUserPositionController { ...@@ -57,60 +73,105 @@ public class AppUserPositionController {
/** /**
* 新增或编辑身份信息 * 新增或编辑身份信息
*
* @return * @return
*/ */
@PostMapping("/addUserPostion") @PostMapping("/addUserPostion")
public ObjectRestResponse<Void> addUserPostion(@RequestBody AppUserPositionTempDTO appUserPositionTempDTO){ public ObjectRestResponse<Void> addUserPostion(@RequestBody AppUserPositionTempDTO appUserPositionTempDTO, HttpServletRequest request) {
return appUserPositionTempBiz.add(appUserPositionTempDTO); try {
IJWTInfo infoFromToken = userAuthUtil.getInfoFromToken(userAuthConfig.getToken(request));
Integer s= Integer.valueOf(infoFromToken.getId());
return appUserPositionTempBiz.add(appUserPositionTempDTO, Integer.valueOf(infoFromToken.getId()));
} catch (Exception e) {
log.error("新增失败【{}】", e);
throw new BaseException("新增失败");
}
} }
/** /**
* 新增或编辑身份信息 * 新增或编辑身份信息
*
* @return * @return
*/ */
@PostMapping("/updUserPostion") @PostMapping("/updUserPostion")
public ObjectRestResponse<Void> updUserPostion(@RequestBody AppUserPositionTempDTO appUserPositionTempDTO){ public ObjectRestResponse<Void> updUserPostion(@RequestBody AppUserPositionTempDTO appUserPositionTempDTO, HttpServletRequest request) {
try {
IJWTInfo infoFromToken = userAuthUtil.getInfoFromToken(userAuthConfig.getToken(request));
return appUserPositionTempBiz.add(appUserPositionTempDTO, Integer.valueOf(infoFromToken.getId()));
} catch (Exception e) {
log.error("修改失败【{}】", e);
throw new BaseException("修改失败");
}
}
/**
* 员工信息更改,并插入变更记录表
* zuoyh
*
* @return
*/
@PostMapping("/updUserChange")
public ObjectRestResponse<Void> updUserChange(@RequestBody AppUserPositionTempDTO appUserPositionTempDTO, HttpServletRequest request) {
try {
IJWTInfo infoFromToken = userAuthUtil.getInfoFromToken(userAuthConfig.getToken(request));
Integer operatorId = Integer.valueOf(infoFromToken.getId());
appUserPositionTempBiz.addUserPositionChangeRecord(appUserPositionTempDTO.getChangeStatus(), appUserPositionTempDTO, operatorId);
return ObjectRestResponse.succ();
} catch (Exception e) {
log.error("修改失败【{}】", e);
throw new BaseException("修改失败");
}
return appUserPositionTempBiz.add(appUserPositionTempDTO);
} }
/**
* 查询员工信息变更记录表
*/
@GetMapping("/findPositionChangeRecord")
public ObjectRestResponse findPositionChangeRecord(AppUserPositionTemp appUserPositionTemp) {
return ObjectRestResponse.succ(appUserPositionTempBiz.findPositionChangeRecord(appUserPositionTemp));
}
/** /**
* 批量导入 * 批量导入
*
* @param userPostionExcel * @param userPostionExcel
* @return * @return
*/ */
@PostMapping("/excel/import") @PostMapping("/excel/import")
public ObjectRestResponse<Map<String,Object>> importUserPostion(@RequestPart("file") MultipartFile userPostionExcel) { public ObjectRestResponse<Map<String, Object>> importUserPostion(@RequestPart("file") MultipartFile userPostionExcel) {
List<String[]> userPostionData = ExcelImport.getExcelData(userPostionExcel); List<String[]> userPostionData = ExcelImport.getExcelData(userPostionExcel);
if (userPostionData.size() < 2) { if (userPostionData.size() < 2) {
return ObjectRestResponse.createFailedResult(1001, "导入不能没数据!!!"); return ObjectRestResponse.createFailedResult(1001, "导入不能没数据!!!");
} }
userPostionData.remove(0); userPostionData.remove(0);
Map<String,Object> result = appUserPositionTempBiz.importUserPostion(userPostionData); Map<String, Object> result = appUserPositionTempBiz.importUserPostion(userPostionData);
return ObjectRestResponse.succ(result); return ObjectRestResponse.succ(result);
} }
/** /**
* 删除 * 删除
*
* @param id * @param id
* @return * @return
*/ */
@DeleteMapping("/{id}") @DeleteMapping("/{id}")
public ObjectRestResponse<Void> deleteUserPostion(@PathVariable(value = "id") Integer id){ public ObjectRestResponse<Void> deleteUserPostion(@PathVariable(value = "id") Integer id) {
appUserPositionTempBiz.updateAppuserPostionStatusById(id,1); appUserPositionTempBiz.updateAppuserPostionStatusById(id, 1);
return ObjectRestResponse.succ(); return ObjectRestResponse.succ();
} }
@PostMapping("/page") @PostMapping("/page")
public ObjectRestResponse<PageDataVO<AppUserPositionTempVo>> findWithPage(@RequestBody AppUserPositionTempFindDTO appUserPositionTempFindDTO){ public ObjectRestResponse<PageDataVO<AppUserPositionTempVo>> findWithPage(@RequestBody AppUserPositionTempFindDTO appUserPositionTempFindDTO) {
PageDataVO<AppUserPositionTempVo> dataVO = appUserPositionTempBiz.findWithPage(appUserPositionTempFindDTO); PageDataVO<AppUserPositionTempVo> dataVO = appUserPositionTempBiz.findWithPage(appUserPositionTempFindDTO);
return ObjectRestResponse.succ(dataVO); return ObjectRestResponse.succ(dataVO);
} }
@GetMapping("/userid") @GetMapping("/userid")
public List<Integer> getUserIdByParentCompany(@RequestParam("parentCompanyId") List<Integer> parentCompanyId){ public List<Integer> getUserIdByParentCompany(@RequestParam("parentCompanyId") List<Integer> parentCompanyId) {
return appUserPositionTempBiz.getUserIdByParentCompany(parentCompanyId); return appUserPositionTempBiz.getUserIdByParentCompany(parentCompanyId);
} }
} }
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
(SELECT * FROM `my_wallet_cath` WHERE 1 = 1 (SELECT * FROM `my_wallet_cath` WHERE 1 = 1
<if test="state != null"> <if test="state != null">
AND `stauts`=#{state} AND `stauts`=#{state}
i
</if> </if>
<if test="orderNo !=null and orderNo !=''"> <if test="orderNo !=null and orderNo !=''">
AND `order_no` = #{orderNo} AND `order_no` = #{orderNo}
......
...@@ -25,7 +25,6 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -25,7 +25,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations; import org.springframework.data.redis.core.ValueOperations;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
...@@ -205,4 +204,6 @@ public class ActivityAttendanceRecordBiz extends BaseBiz<ActivityAttendanceRecor ...@@ -205,4 +204,6 @@ public class ActivityAttendanceRecordBiz extends BaseBiz<ActivityAttendanceRecor
public void updateLotteryNumByActivityIdAndUserIdAndPrizeType(Integer activityId,Integer userId,Integer prizeType){ public void updateLotteryNumByActivityIdAndUserIdAndPrizeType(Integer activityId,Integer userId,Integer prizeType){
mapper.updateLotteryNumByActivityIdAndUserIdAndPrizeType(activityId,userId,prizeType); mapper.updateLotteryNumByActivityIdAndUserIdAndPrizeType(activityId,userId,prizeType);
} }
} }
\ No newline at end of file
...@@ -8,7 +8,6 @@ import com.google.common.collect.Lists; ...@@ -8,7 +8,6 @@ import com.google.common.collect.Lists;
import com.xxfc.platform.activity.bo.ActivityWinningRecordBo; import com.xxfc.platform.activity.bo.ActivityWinningRecordBo;
import com.xxfc.platform.activity.bo.ActivityWinningRecordTotalVo; import com.xxfc.platform.activity.bo.ActivityWinningRecordTotalVo;
import com.xxfc.platform.activity.constant.PrizeTypeEnum; import com.xxfc.platform.activity.constant.PrizeTypeEnum;
import com.xxfc.platform.activity.dto.ActivityWinningRecordDTO;
import com.xxfc.platform.activity.dto.ActivityWinningRecordFindDTO; import com.xxfc.platform.activity.dto.ActivityWinningRecordFindDTO;
import com.xxfc.platform.activity.dto.ActivityWinningRecordPageDTO; import com.xxfc.platform.activity.dto.ActivityWinningRecordPageDTO;
import com.xxfc.platform.activity.entity.ActivityWinningRecord; import com.xxfc.platform.activity.entity.ActivityWinningRecord;
...@@ -18,7 +17,6 @@ import org.apache.commons.collections.CollectionUtils; ...@@ -18,7 +17,6 @@ import org.apache.commons.collections.CollectionUtils;
import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.util.CellRangeAddress; import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet; import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
...@@ -31,6 +29,7 @@ import java.io.IOException; ...@@ -31,6 +29,7 @@ import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Optional;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
/** /**
...@@ -164,4 +163,11 @@ public class ActivityWinningRecordBiz extends BaseBiz<ActivityWinningRecordMappe ...@@ -164,4 +163,11 @@ public class ActivityWinningRecordBiz extends BaseBiz<ActivityWinningRecordMappe
activityWinningRecordPageDTO.getPositionName(),prizeType,activityWinningRecordPageDTO.getPrizeName(), activityWinningRecordPageDTO.getPositionName(),prizeType,activityWinningRecordPageDTO.getPrizeName(),
expiryDateCode,timeStr}; expiryDateCode,timeStr};
} }
public ActivityWinningRecordVo findActivityAttendanceRecordById(Long id) {
ActivityWinningRecordVo activityWinningRecordVo = new ActivityWinningRecordVo();
ActivityWinningRecord activityAttendanceRecord = mapper.selectByPrimaryKey(id);
Optional.ofNullable(activityAttendanceRecord).ifPresent(x->BeanUtils.copyProperties(x,activityWinningRecordVo));
return activityWinningRecordVo;
}
} }
\ No newline at end of file
...@@ -34,23 +34,23 @@ import java.util.concurrent.TimeUnit; ...@@ -34,23 +34,23 @@ import java.util.concurrent.TimeUnit;
@RequiredArgsConstructor(onConstructor = @__(@Autowired)) @RequiredArgsConstructor(onConstructor = @__(@Autowired))
@Slf4j @Slf4j
public class ActivityPrizeMqHandler { public class ActivityPrizeMqHandler {
private final ActivityPrizeBiz activityPrizeBiz; private final ActivityPrizeBiz activityPrizeBiz;
private final ActivityAttendanceRecordBiz activityAttendanceRecordBiz; private final ActivityAttendanceRecordBiz activityAttendanceRecordBiz;
private final ActivityWinningRecordBiz activityWinningRecordBiz; private final ActivityWinningRecordBiz activityWinningRecordBiz;
private final UserCouponBiz userCouponBiz; private final UserCouponBiz userCouponBiz;
private final RedisTemplate<String, Object> redisTemplate; private final RedisTemplate<String, Object> redisTemplate;
@Resource(name = "redisTemplate") @Resource(name = "redisTemplate")
private ValueOperations valueOperations; private ValueOperations valueOperations;
private final String R_CONSUME="lottery:reconsume"; private final String R_CONSUME = "lottery:reconsume";
private final int R_CONSUME_MAX_NUM=3; private final int R_CONSUME_MAX_NUM = 3;
@RabbitListener(queues = RabbitActivityConfig.PRIZE_RECORD_QUEUE) @RabbitListener(queues = RabbitActivityConfig.PRIZE_RECORD_QUEUE)
public void processActivityPrizeMsg(ActivityLotteryDTO activityLotteryDTO, Channel channel){ public void processActivityPrizeMsg(ActivityLotteryDTO activityLotteryDTO, Channel channel) {
log.info("抽奖消息的数据【{}】",activityLotteryDTO); log.info("抽奖消息的数据【{}】", activityLotteryDTO);
try { try {
if (activityLotteryDTO.getHasWinning() == 1) { if (activityLotteryDTO.getHasWinning() == 1) {
//更新库存 //更新库存
log.info("更新库存:参数【prizeType:{}==serialNumber:{}】",activityLotteryDTO.getPrizeType(), activityLotteryDTO.getSerialNumber()); log.info("更新库存:参数【prizeType:{}==serialNumber:{}】", activityLotteryDTO.getPrizeType(), activityLotteryDTO.getSerialNumber());
activityPrizeBiz.updatePrizeStock(activityLotteryDTO.getPrizeType(), activityLotteryDTO.getSerialNumber()); activityPrizeBiz.updatePrizeStock(activityLotteryDTO.getPrizeType(), activityLotteryDTO.getSerialNumber());
//发放优惠券 //发放优惠券
if (activityLotteryDTO.getPrizeGoodsType() == PrizeGoodsTypeEnum.COUPON.getCode()) { if (activityLotteryDTO.getPrizeGoodsType() == PrizeGoodsTypeEnum.COUPON.getCode()) {
...@@ -58,33 +58,33 @@ public class ActivityPrizeMqHandler { ...@@ -58,33 +58,33 @@ public class ActivityPrizeMqHandler {
userCouponSendDTO.setCouponId(activityLotteryDTO.getGoodsId()); userCouponSendDTO.setCouponId(activityLotteryDTO.getGoodsId());
userCouponSendDTO.setCouponNum(1); userCouponSendDTO.setCouponNum(1);
userCouponSendDTO.setPhone(activityLotteryDTO.getPhone()); userCouponSendDTO.setPhone(activityLotteryDTO.getPhone());
log.info("抽中优惠券发送:【参数:{}】",userCouponSendDTO); log.info("抽中优惠券发送:【参数:{}】", userCouponSendDTO);
userCouponBiz.sendCoupon(userCouponSendDTO); userCouponBiz.sendCoupon(userCouponSendDTO);
} }
} }
ActivityWinningRecord activityWinningRecord = new ActivityWinningRecord(); ActivityWinningRecord activityWinningRecord = new ActivityWinningRecord();
BeanUtils.copyProperties(activityLotteryDTO, activityWinningRecord); BeanUtils.copyProperties(activityLotteryDTO, activityWinningRecord);
activityWinningRecord.setCrtTime(new Date()); activityWinningRecord.setCrtTime(new Date());
log.info("抽奖记录【{}】",activityWinningRecord); log.info("抽奖记录【{}】", activityWinningRecord);
activityWinningRecordBiz.saveRecord(activityWinningRecord); activityWinningRecordBiz.saveRecord(activityWinningRecord);
//更改对应抽奖类型的抽奖次数 //更改对应抽奖类型的抽奖次数
log.info("更改对应抽奖类型的抽奖次数【activityId:{}==userId:{}==prizeType:{}】",activityLotteryDTO.getActivityId(), activityLotteryDTO.getUserId(), activityLotteryDTO.getPrizeType()); log.info("更改对应抽奖类型的抽奖次数【activityId:{}==userId:{}==prizeType:{}】", activityLotteryDTO.getActivityId(), activityLotteryDTO.getUserId(), activityLotteryDTO.getPrizeType());
activityAttendanceRecordBiz.updateLotteryNumByActivityIdAndUserIdAndPrizeType(activityLotteryDTO.getActivityId(), activityLotteryDTO.getUserId(), activityLotteryDTO.getPrizeType()); activityAttendanceRecordBiz.updateLotteryNumByActivityIdAndUserIdAndPrizeType(activityLotteryDTO.getActivityId(), activityLotteryDTO.getUserId(), activityLotteryDTO.getPrizeType());
}catch (Exception ex){ } catch (Exception ex) {
log.error("抽奖消息消费失败【{}】",ex); log.error("抽奖消息消费失败【{}】", ex);
try { try {
Long reConsumeCounter = valueOperations.increment(R_CONSUME); Long reConsumeCounter = valueOperations.increment(R_CONSUME);
if(reConsumeCounter <= R_CONSUME_MAX_NUM ) { if (reConsumeCounter <= R_CONSUME_MAX_NUM) {
channel.basicRecover(false); channel.basicRecover(false);
log.info("抽奖消息重回队列成功"); log.info("抽奖消息重回队列成功");
} }
if (reConsumeCounter==1){ if (reConsumeCounter == 1) {
redisTemplate.expire(R_CONSUME,1, TimeUnit.DAYS); redisTemplate.expire(R_CONSUME, 1, TimeUnit.DAYS);
} }
} catch (IOException e) { } catch (IOException e) {
log.error("消费抽奖消息重回队列失败【{}】",e); log.error("消费抽奖消息重回队列失败【{}】", e);
} }
} }
} }
} }
package com.xxfc.platform.activity.rest; package com.xxfc.platform.activity.rest;
import com.xxfc.platform.activity.biz.ActivityAttendanceRecordBiz; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.xxfc.platform.activity.biz.ActivityWinningRecordBiz;
import com.xxfc.platform.activity.vo.ActivityWinningRecordVo;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
...@@ -17,6 +21,13 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -17,6 +21,13 @@ import org.springframework.web.bind.annotation.RestController;
@RequiredArgsConstructor(onConstructor = @__(@Autowired)) @RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class ActivityWinningRecordController { public class ActivityWinningRecordController {
private final ActivityAttendanceRecordBiz activityAttendanceRecordBiz;
private final ActivityWinningRecordBiz activityWinningRecordBiz;
@GetMapping("/{id}")
public ObjectRestResponse<ActivityWinningRecordVo> findActivityAttendanceRecordById(@PathVariable(value = "id") Long id){
ActivityWinningRecordVo activityWinningRecordVo = activityWinningRecordBiz.findActivityAttendanceRecordById(id);
return ObjectRestResponse.succ(activityWinningRecordVo);
}
} }
\ No newline at end of file
...@@ -44,8 +44,16 @@ public class OrderMemberReceivedStatisticsBiz extends BaseBiz<OrderMemberReceive ...@@ -44,8 +44,16 @@ public class OrderMemberReceivedStatisticsBiz extends BaseBiz<OrderMemberReceive
* @param orderReceivedStatisticsFindDTO * @param orderReceivedStatisticsFindDTO
* @return * @return
*/ */
public List<OrderMemberReceivedStatistics> selectOrderReceivedStatistics(OrderReceivedStatisticsFindDTO orderReceivedStatisticsFindDTO) { public List<OrderMemberReceivedStatistics> selectOrderReceivedStatisticsGroupByDate(OrderReceivedStatisticsFindDTO orderReceivedStatisticsFindDTO) {
return mapper.selectOrderMemberReceivedStatistics(orderReceivedStatisticsFindDTO); return mapper.selectOrderMemberReceivedStatisticsGroupByDate(orderReceivedStatisticsFindDTO);
}
public List<OrderMemberReceivedStatistics> selectOrderReceivedStatisticsGroupByMonth(OrderReceivedStatisticsFindDTO orderReceivedStatisticsFindDTO) {
return mapper.selectOrderMemberReceivedStatisticsGroupByMonth(orderReceivedStatisticsFindDTO);
}
public List<OrderMemberReceivedStatistics> selectOrderReceivedStatisticsGroupByWeekOfYear(OrderReceivedStatisticsFindDTO orderReceivedStatisticsFindDTO) {
return mapper.selectOrderMemberReceivedStatisticsGroupByWeekOfYear(orderReceivedStatisticsFindDTO);
} }
/** /**
......
...@@ -41,8 +41,16 @@ public class OrderRentVehicleReceivedStatisticsBiz extends BaseBiz<OrderRentVehi ...@@ -41,8 +41,16 @@ public class OrderRentVehicleReceivedStatisticsBiz extends BaseBiz<OrderRentVehi
* @param orderReceivedStatisticsFindDTO * @param orderReceivedStatisticsFindDTO
* @return * @return
*/ */
public List<OrderRentVehicleReceivedStatistics> selectOrderReceivedStatistics(OrderReceivedStatisticsFindDTO orderReceivedStatisticsFindDTO) { public List<OrderRentVehicleReceivedStatistics> selectOrderReceivedStatisticsGroupByDate(OrderReceivedStatisticsFindDTO orderReceivedStatisticsFindDTO) {
return mapper.selectOrderRentVehicleReceivedStatistics(orderReceivedStatisticsFindDTO); return mapper.selectOrderRentVehicleReceivedStatisticsGroupByDate(orderReceivedStatisticsFindDTO);
}
public List<OrderRentVehicleReceivedStatistics> selectOrderReceivedStatisticsGroupByMonth(OrderReceivedStatisticsFindDTO orderReceivedStatisticsFindDTO) {
return mapper.selectOrderRentVehicleReceivedStatisticsGroupByMonth(orderReceivedStatisticsFindDTO);
}
public List<OrderRentVehicleReceivedStatistics> selectOrderReceivedStatisticsGroupByWeekOfYear(OrderReceivedStatisticsFindDTO orderReceivedStatisticsFindDTO) {
return mapper.selectOrderRentVehicleReceivedStatisticsGroupByWeekOfYear(orderReceivedStatisticsFindDTO);
} }
/** /**
......
...@@ -31,8 +31,14 @@ public class OrderTourReceivedStatisticsBiz extends BaseBiz<OrderTourReceivedSta ...@@ -31,8 +31,14 @@ public class OrderTourReceivedStatisticsBiz extends BaseBiz<OrderTourReceivedSta
private final BaseOrderBiz baseOrderBiz; private final BaseOrderBiz baseOrderBiz;
private final OrderAccountBiz orderAccountBiz; private final OrderAccountBiz orderAccountBiz;
public List<OrderTourReceivedStatistics> selectOrderReceivedStatistics(OrderReceivedStatisticsFindDTO orderReceivedStatisticsFindDTO) { public List<OrderTourReceivedStatistics> selectOrderReceivedStatisticsGroupByDate(OrderReceivedStatisticsFindDTO orderReceivedStatisticsFindDTO) {
return mapper.selectOrderTourReceivedStatistics(orderReceivedStatisticsFindDTO); return mapper.selectOrderTourReceivedStatisticsGroupByDate(orderReceivedStatisticsFindDTO);
}
public List<OrderTourReceivedStatistics> selectOrderReceivedStatisticsGroupByMonth(OrderReceivedStatisticsFindDTO orderReceivedStatisticsFindDTO) {
return mapper.selectOrderTourReceivedStatisticsGroupByMonth(orderReceivedStatisticsFindDTO);
}
public List<OrderTourReceivedStatistics> selectOrderReceivedStatisticsGroupByWeekOfYear(OrderReceivedStatisticsFindDTO orderReceivedStatisticsFindDTO) {
return mapper.selectOrderTourReceivedStatisticsGroupByWeekOfYear(orderReceivedStatisticsFindDTO);
} }
/** /**
......
...@@ -17,7 +17,8 @@ import java.util.List; ...@@ -17,7 +17,8 @@ import java.util.List;
*/ */
public interface OrderMemberReceivedStatisticsMapper extends Mapper<OrderMemberReceivedStatistics>, InsertListMapper<OrderMemberReceivedStatistics> { public interface OrderMemberReceivedStatisticsMapper extends Mapper<OrderMemberReceivedStatistics>, InsertListMapper<OrderMemberReceivedStatistics> {
List<OrderMemberReceivedStatistics> selectOrderMemberReceivedStatistics(OrderReceivedStatisticsFindDTO orderReceivedStatisticsFindDTO); List<OrderMemberReceivedStatistics> selectOrderMemberReceivedStatisticsGroupByDate(OrderReceivedStatisticsFindDTO orderReceivedStatisticsFindDTO);
List<OrderMemberReceivedStatistics> selectOrderMemberReceivedStatisticsGroupByMonth(OrderReceivedStatisticsFindDTO orderReceivedStatisticsFindDTO);
List<OrderMemberReceivedStatistics> selectOrderMemberReceivedStatisticsGroupByWeekOfYear(OrderReceivedStatisticsFindDTO orderReceivedStatisticsFindDTO);
void inserMemberReceivedtList(@Param("orderMembers") List<OrderMemberReceivedStatistics> orderMemberReceivedStatistics);
} }
...@@ -18,7 +18,9 @@ import java.util.List; ...@@ -18,7 +18,9 @@ import java.util.List;
*/ */
public interface OrderReceivedStatisticsMapper extends Mapper<OrderReceivedStatistics>, InsertListMapper<OrderReceivedStatistics> { public interface OrderReceivedStatisticsMapper extends Mapper<OrderReceivedStatistics>, InsertListMapper<OrderReceivedStatistics> {
List<OrderReceivedStatistics> selectOrderReceivedStatisticsList(OrderReceivedStatisticsFindDTO orderReceivedStatisticsFindDTO); List<OrderReceivedStatistics> selectOrderReceivedStatisticsDateList(OrderReceivedStatisticsFindDTO orderReceivedStatisticsFindDTO);
List<OrderReceivedStatistics> selectOrderReceivedStatisticsMonthList(OrderReceivedStatisticsFindDTO orderReceivedStatisticsFindDTO);
List<OrderReceivedStatistics> selectOrderReceivedStatisticsWeekOfYearList(OrderReceivedStatisticsFindDTO orderReceivedStatisticsFindDTO);
List<CompanyPerformanceBo> selectCompanyPerformanceWithDay(CompanyPerformanceFindDTO companyPerformanceFindDTO); List<CompanyPerformanceBo> selectCompanyPerformanceWithDay(CompanyPerformanceFindDTO companyPerformanceFindDTO);
......
...@@ -16,5 +16,7 @@ import java.util.List; ...@@ -16,5 +16,7 @@ import java.util.List;
*/ */
public interface OrderRentVehicleReceivedStatisticsMapper extends Mapper<OrderRentVehicleReceivedStatistics>, InsertListMapper<OrderRentVehicleReceivedStatistics> { public interface OrderRentVehicleReceivedStatisticsMapper extends Mapper<OrderRentVehicleReceivedStatistics>, InsertListMapper<OrderRentVehicleReceivedStatistics> {
List<OrderRentVehicleReceivedStatistics> selectOrderRentVehicleReceivedStatistics(OrderReceivedStatisticsFindDTO orderReceivedStatisticsFindDTO); List<OrderRentVehicleReceivedStatistics> selectOrderRentVehicleReceivedStatisticsGroupByDate(OrderReceivedStatisticsFindDTO orderReceivedStatisticsFindDTO);
List<OrderRentVehicleReceivedStatistics> selectOrderRentVehicleReceivedStatisticsGroupByMonth(OrderReceivedStatisticsFindDTO orderReceivedStatisticsFindDTO);
List<OrderRentVehicleReceivedStatistics> selectOrderRentVehicleReceivedStatisticsGroupByWeekOfYear(OrderReceivedStatisticsFindDTO orderReceivedStatisticsFindDTO);
} }
...@@ -16,5 +16,7 @@ import java.util.List; ...@@ -16,5 +16,7 @@ import java.util.List;
*/ */
public interface OrderTourReceivedStatisticsMapper extends Mapper<OrderTourReceivedStatistics>, InsertListMapper<OrderTourReceivedStatistics> { public interface OrderTourReceivedStatisticsMapper extends Mapper<OrderTourReceivedStatistics>, InsertListMapper<OrderTourReceivedStatistics> {
List<OrderTourReceivedStatistics> selectOrderTourReceivedStatistics(OrderReceivedStatisticsFindDTO orderReceivedStatisticsFindDTO); List<OrderTourReceivedStatistics> selectOrderTourReceivedStatisticsGroupByDate(OrderReceivedStatisticsFindDTO orderReceivedStatisticsFindDTO);
List<OrderTourReceivedStatistics> selectOrderTourReceivedStatisticsGroupByMonth(OrderReceivedStatisticsFindDTO orderReceivedStatisticsFindDTO);
List<OrderTourReceivedStatistics> selectOrderTourReceivedStatisticsGroupByWeekOfYear(OrderReceivedStatisticsFindDTO orderReceivedStatisticsFindDTO);
} }
...@@ -29,10 +29,12 @@ ...@@ -29,10 +29,12 @@
<result property="crtTime" column="crt_time"/> <result property="crtTime" column="crt_time"/>
</resultMap> </resultMap>
<select id="selectOrderMemberReceivedStatistics" resultMap="orderMemberReceivedStatisticsMap"> <select id="selectOrderMemberReceivedStatisticsGroupByDate" resultType="com.xxfc.platform.order.entity.OrderMemberReceivedStatistics">
select * from `order_member_received_statistics` where 1=1 select `date`,`year`,IFNULL(sum(`total_amount`),0) as `totalAmount`,IFNULL(sum(`total_quantity`),0) as `totalQuantity`,IFNULL(sum(`toal_common_ammount`),0) as `toalCommonAmmount`,
IFNULL(sum(`total_common_quantity`),0) as `totalCommonQuantity`,IFNULL(sum(`total_gold_amount`),0) as `totalGoldAmount`,IFNULL(sum(`total_gold_quantity`),0),
IFNULL(sum(`total_diamond_ammount`),0) as `totalDiamondAmmount`,IFNULL(sum(`total_diamond_quantity`),0) as `totalDiamondQuantity` from `order_member_received_statistics` where 1=1
<if test="orderState!=null"> <if test="orderState!=null">
and `is_finish`=#{orderState} and `has_pay`=#{orderState}
</if> </if>
<if test="orderOrigin!=null"> <if test="orderOrigin!=null">
and `order_origin`=#{orderOrigin} and `order_origin`=#{orderOrigin}
...@@ -53,9 +55,67 @@ ...@@ -53,9 +55,67 @@
`date` <= #{endDate} `date` <= #{endDate}
]]> ]]>
</if> </if>
group by `year`, `date`
order by null
</select> </select>
<delete id="inserMemberReceivedtList"> <select id="selectOrderMemberReceivedStatisticsGroupByMonth" resultType="com.xxfc.platform.order.entity.OrderMemberReceivedStatistics">
select `year`,`month`,IFNULL(sum(`total_amount`),0) as `totalAmount`,IFNULL(sum(`total_quantity`),0) as `totalQuantity`,IFNULL(sum(`toal_common_ammount`),0) as `toalCommonAmmount`,
IFNULL(sum(`total_common_quantity`),0) as `totalCommonQuantity`,IFNULL(sum(`total_gold_amount`),0) as `totalGoldAmount`,IFNULL(sum(`total_gold_quantity`),0),
IFNULL(sum(`total_diamond_ammount`),0) as `totalDiamondAmmount`,IFNULL(sum(`total_diamond_quantity`),0) as `totalDiamondQuantity` from `order_member_received_statistics` where 1=1
<if test="orderState!=null">
and `has_pay`=#{orderState}
</if>
<if test="orderOrigin!=null">
and `order_origin`=#{orderOrigin}
</if>
<if test="payWay!=null">
and `pay_way`=#{payWay}
</if>
<if test="startDate!=null and endDate!=null">
and `date` between #{startDate} and #{endDate}
</if>
<if test="startDate!=null and endDate==null">
and <![CDATA[
`date` >= #{startDate}
]]>
</if>
<if test="startDate==null and endDate!=null">
and <![CDATA[
`date` <= #{endDate}
]]>
</if>
group by `year`, `month`
order by null
</select>
</delete> <select id="selectOrderMemberReceivedStatisticsGroupByWeekOfYear" resultType="com.xxfc.platform.order.entity.OrderMemberReceivedStatistics">
select `year`,`week_of_year`,IFNULL(sum(`total_amount`),0) as `totalAmount`,IFNULL(sum(`total_quantity`),0) as `totalQuantity`,IFNULL(sum(`toal_common_ammount`),0) as `toalCommonAmmount`
,IFNULL(sum(`total_common_quantity`),0) as `totalCommonQuantity`,IFNULL(sum(`total_gold_amount`),0) as `totalGoldAmount`,IFNULL(sum(`total_gold_quantity`),0),
IFNULL(sum(`total_diamond_ammount`),0) as `totalDiamondAmmount`,IFNULL(sum(`total_diamond_quantity`),0) as `totalDiamondQuantity` from `order_member_received_statistics` where 1=1
<if test="orderState!=null">
and `has_pay`=#{orderState}
</if>
<if test="orderOrigin!=null">
and `order_origin`=#{orderOrigin}
</if>
<if test="payWay!=null">
and `pay_way`=#{payWay}
</if>
<if test="startDate!=null and endDate!=null">
and `date` between #{startDate} and #{endDate}
</if>
<if test="startDate!=null and endDate==null">
and <![CDATA[
`date` >= #{startDate}
]]>
</if>
<if test="startDate==null and endDate!=null">
and <![CDATA[
`date` <= #{endDate}
]]>
</if>
group by `year`, `week_of_year`
order by null
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -31,10 +31,10 @@ ...@@ -31,10 +31,10 @@
<result property="crtTime" column="crt_time"/> <result property="crtTime" column="crt_time"/>
</resultMap> </resultMap>
<select id="selectOrderReceivedStatisticsList" resultMap="orderReceivedStatisticsMap"> <select id="selectOrderReceivedStatisticsDateList" resultType="com.xxfc.platform.order.entity.OrderReceivedStatistics">
select * from `order_received_statistics` where 1=1 select `year`,`date`,IFNULL(sum(`total_amount`),0) as `totalAmount`,IFNULL(sum(`total_quantity`),0) as `totalQuantity` from `order_received_statistics` where 1=1
<if test="orderState!=null"> <if test="orderState!=null">
and `is_finish`=#{orderState} and `has_pay`=#{orderState}
</if> </if>
<if test="orderOrigin!=null"> <if test="orderOrigin!=null">
and `order_origin`=#{orderOrigin} and `order_origin`=#{orderOrigin}
...@@ -56,6 +56,66 @@ ...@@ -56,6 +56,66 @@
`date` <= #{endDate} `date` <= #{endDate}
]]> ]]>
</if> </if>
group by `year`, `date`
order by null
</select>
<select id="selectOrderReceivedStatisticsMonthList" resultType="com.xxfc.platform.order.entity.OrderReceivedStatistics">
select `year`,`month`,IFNULL(sum(`total_amount`),0) as `totalAmount`,IFNULL(sum(`total_quantity`),0) as `totalQuantity` from `order_received_statistics` where 1=1
<if test="orderState!=null">
and `has_pay`=#{orderState}
</if>
<if test="orderOrigin!=null">
and `order_origin`=#{orderOrigin}
</if>
<if test="payWay!=null">
and `pay_way`=#{payWay}
</if>
<if test="startDate!=null and endDate!=null">
and `date` between #{startDate} and #{endDate}
</if>
<if test="startDate!=null and endDate==null">
and <![CDATA[
`date` >= #{startDate}
]]>
</if>
<if test="startDate==null and endDate!=null">
and <![CDATA[
`date` <= #{endDate}
]]>
</if>
group by `year`, `month`
order by null
</select>
<select id="selectOrderReceivedStatisticsWeekOfYearList" resultType="com.xxfc.platform.order.entity.OrderReceivedStatistics">
select `year`,`week_of_year`,IFNULL(sum(`total_amount`),0) as `totalAmount`,IFNULL(sum(`total_quantity`),0) as `totalQuantity` from `order_received_statistics` where 1=1
<if test="orderState!=null">
and `has_pay`=#{orderState}
</if>
<if test="orderOrigin!=null">
and `order_origin`=#{orderOrigin}
</if>
<if test="payWay!=null">
and `pay_way`=#{payWay}
</if>
<if test="startDate!=null and endDate!=null">
and `date` between #{startDate} and #{endDate}
</if>
<if test="startDate!=null and endDate==null">
and <![CDATA[
`date` >= #{startDate}
]]>
</if>
<if test="startDate==null and endDate!=null">
and <![CDATA[
`date` <= #{endDate}
]]>
</if>
group by `year`, `week_of_year`
order by null
</select> </select>
<!--按日统计--> <!--按日统计-->
......
...@@ -18,10 +18,10 @@ ...@@ -18,10 +18,10 @@
<result property="companyId" column="company_id"/> <result property="companyId" column="company_id"/>
<result property="crtTime" column="crt_time"/> <result property="crtTime" column="crt_time"/>
</resultMap> </resultMap>
<select id="selectOrderRentVehicleReceivedStatistics" resultMap="orderRentVehicleReceivedStatisticsMap"> <select id="selectOrderRentVehicleReceivedStatisticsGroupByDate" resultType="com.xxfc.platform.order.entity.OrderRentVehicleReceivedStatistics">
select * from `order_rent_vehicle_received_statistics` where 1=1 select `year`,`date`,IFNULL(sum(`total_amount`),0) as `totalAmount`,IFNULL(sum(`total_quantity`),0) as `totalQuantity` from `order_rent_vehicle_received_statistics` where 1=1
<if test="orderState!=null"> <if test="orderState!=null">
and `is_finish`=#{orderState} and `has_pay`=#{orderState}
</if> </if>
<if test="orderOrigin!=null"> <if test="orderOrigin!=null">
and `order_origin`=#{orderOrigin} and `order_origin`=#{orderOrigin}
...@@ -42,6 +42,63 @@ ...@@ -42,6 +42,63 @@
`date` <= #{endDate} `date` <= #{endDate}
]]> ]]>
</if> </if>
group by `year`, `date`
order by null
</select> </select>
<select id="selectOrderRentVehicleReceivedStatisticsGroupByMonth" resultType="com.xxfc.platform.order.entity.OrderRentVehicleReceivedStatistics">
select `year`,`month`,IFNULL(sum(`total_amount`),0) as `totalAmount`,IFNULL(sum(`total_quantity`),0) as `totalQuantity` from `order_rent_vehicle_received_statistics` where 1=1
<if test="orderState!=null">
and `has_pay`=#{orderState}
</if>
<if test="orderOrigin!=null">
and `order_origin`=#{orderOrigin}
</if>
<if test="payWay!=null">
and `pay_way`=#{payWay}
</if>
<if test="startDate!=null and endDate!=null">
and `date` between #{startDate} and #{endDate}
</if>
<if test="startDate!=null and endDate==null">
and <![CDATA[
`date` >= #{startDate}
]]>
</if>
<if test="startDate==null and endDate!=null">
and <![CDATA[
`date` <= #{endDate}
]]>
</if>
group by `year`, `month`
order by null
</select>
<select id="selectOrderRentVehicleReceivedStatisticsGroupByWeekOfYear" resultType="com.xxfc.platform.order.entity.OrderRentVehicleReceivedStatistics">
select `year`,`week_of_year`,IFNULL(sum(`total_amount`),0) as `totalAmount`,IFNULL(sum(`total_quantity`),0) as `totalQuantity` from `order_rent_vehicle_received_statistics` where 1=1
<if test="orderState!=null">
and `has_pay`=#{orderState}
</if>
<if test="orderOrigin!=null">
and `order_origin`=#{orderOrigin}
</if>
<if test="payWay!=null">
and `pay_way`=#{payWay}
</if>
<if test="startDate!=null and endDate!=null">
and `date` between #{startDate} and #{endDate}
</if>
<if test="startDate!=null and endDate==null">
and <![CDATA[
`date` >= #{startDate}
]]>
</if>
<if test="startDate==null and endDate!=null">
and <![CDATA[
`date` <= #{endDate}
]]>
</if>
group by `year`, `week_of_year`
order by null
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -23,10 +23,10 @@ ...@@ -23,10 +23,10 @@
<result property="crtTime" column="crt_time"/> <result property="crtTime" column="crt_time"/>
</resultMap> </resultMap>
<select id="selectOrderTourReceivedStatistics" resultMap="orderTourReceivedStatisticsMap"> <select id="selectOrderTourReceivedStatisticsGroupByDate" resultType="com.xxfc.platform.order.entity.OrderTourReceivedStatistics">
select * from `order_tour_received_statistics` where 1=1 select `year`,`date`,IFNULL(sum(`total_amount`),0) as `totalAmount`,IFNULL(sum(`total_quantity`),0) as `totalQuantity` from `order_tour_received_statistics` where 1=1
<if test="orderState!=null"> <if test="orderState!=null">
and `is_finish`=#{orderState} and `has_pay`=#{orderState}
</if> </if>
<if test="orderOrigin!=null"> <if test="orderOrigin!=null">
and `order_origin`=#{orderOrigin} and `order_origin`=#{orderOrigin}
...@@ -47,6 +47,63 @@ ...@@ -47,6 +47,63 @@
`date` <= #{endDate} `date` <= #{endDate}
]]> ]]>
</if> </if>
group by `year`, `date`
order by null
</select> </select>
<select id="selectOrderTourReceivedStatisticsGroupByMonth" resultType="com.xxfc.platform.order.entity.OrderTourReceivedStatistics">
select `year`,`month`,IFNULL(sum(`total_amount`),0) as `totalAmount`,IFNULL(sum(`total_quantity`),0) as `totalQuantity` from `order_tour_received_statistics` where 1=1
<if test="orderState!=null">
and `has_pay`=#{orderState}
</if>
<if test="orderOrigin!=null">
and `order_origin`=#{orderOrigin}
</if>
<if test="payWay!=null">
and `pay_way`=#{payWay}
</if>
<if test="startDate!=null and endDate!=null">
and `date` between #{startDate} and #{endDate}
</if>
<if test="startDate!=null and endDate==null">
and <![CDATA[
`date` >= #{startDate}
]]>
</if>
<if test="startDate==null and endDate!=null">
and <![CDATA[
`date` <= #{endDate}
]]>
</if>
group by `year`, `month`
order by null
</select>
<select id="selectOrderTourReceivedStatisticsGroupByWeekOfYear" resultType="com.xxfc.platform.order.entity.OrderTourReceivedStatistics">
select `year`,`week_of_year`,IFNULL(sum(`total_amount`),0) as `totalAmount`,IFNULL(sum(`total_quantity`),0) as `totalQuantity` from `order_tour_received_statistics` where 1=1
<if test="orderState!=null">
and `has_pay`=#{orderState}
</if>
<if test="orderOrigin!=null">
and `order_origin`=#{orderOrigin}
</if>
<if test="payWay!=null">
and `pay_way`=#{payWay}
</if>
<if test="startDate!=null and endDate!=null">
and `date` between #{startDate} and #{endDate}
</if>
<if test="startDate!=null and endDate==null">
and <![CDATA[
`date` >= #{startDate}
]]>
</if>
<if test="startDate==null and endDate!=null">
and <![CDATA[
`date` <= #{endDate}
]]>
</if>
group by `year`, `week_of_year`
order by null
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -6,18 +6,7 @@ import com.github.wxiaoqi.security.common.util.OrderUtil; ...@@ -6,18 +6,7 @@ import com.github.wxiaoqi.security.common.util.OrderUtil;
import com.github.wxiaoqi.security.common.util.process.SystemConfig; import com.github.wxiaoqi.security.common.util.process.SystemConfig;
import com.xxfc.platform.universal.weixin.util.XMLUtil; import com.xxfc.platform.universal.weixin.util.XMLUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.security.KeyStore;
import java.util.HashMap;
import java.util.Map;
import java.util.TreeMap;
import javax.net.ssl.SSLContext;
import org.apache.http.HttpEntity; import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.protocol.HttpClientContext; import org.apache.http.client.protocol.HttpClientContext;
...@@ -25,11 +14,18 @@ import org.apache.http.conn.ssl.SSLConnectionSocketFactory; ...@@ -25,11 +14,18 @@ import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.conn.ssl.SSLContexts; import org.apache.http.conn.ssl.SSLContexts;
import org.apache.http.entity.StringEntity; import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.impl.client.HttpClients; import org.apache.http.impl.client.HttpClients;
import org.apache.http.protocol.HttpContext; import org.apache.http.protocol.HttpContext;
import org.apache.http.util.EntityUtils; import org.apache.http.util.EntityUtils;
import org.jdom.JDOMException; import org.jdom.JDOMException;
import org.springframework.core.io.ClassPathResource;
import javax.net.ssl.SSLContext;
import java.io.IOException;
import java.io.InputStream;
import java.security.KeyStore;
import java.util.Map;
import java.util.TreeMap;
/** /**
...@@ -54,66 +50,12 @@ public class WXSuppToUserPay { ...@@ -54,66 +50,12 @@ public class WXSuppToUserPay {
private String desc;//企业付款描述信息 private String desc;//企业付款描述信息
private String spbill_create_ip;//Ip地址 private String spbill_create_ip;//Ip地址
private String key; private String key;
public static void main(String[] args) throws Exception, IOException {
Map<String, String> map = WXSuppToUserPay.WeiXinTiXian("oRhMfwKwjNq2Ce-TxlqfoAqsYfww",OrderUtil.GetOrderNumber("TX"),"NO_CHECK", 500+"", "活动提现", "192.168.8.109");
if("SUCCESS".equals(map.get("return_code")))
{
if(!StringUtils.isBlank(map.get("payment_no")) && !StringUtils.isBlank(map.get("partner_trade_no")) )
{
System.out.println(map.get("partner_trade_no"));
System.out.println(map.get("payment_no"));
System.out.println(Integer.parseInt(System.currentTimeMillis()/1000+""));
}
System.out.println(map.get("return_code"));
}
// WXSuppToUserPay prePay = new WXSuppToUserPay();
/* prePay.setMch_appid(SystemConfig.WINXIN_AppID);
prePay.setMchid(SystemConfig.WINXIN_PARTNER);*/
// prePay.setMch_appid(SystemConfig.APP_ID);
// prePay.setMchid(SystemConfig.APP_PARTNER);
// prePay.setNonce_str( OrderUtil.CreateNoncestr());
// prePay.setPartner_trade_no(OrderUtil.GetOrderNumber("TX"));
// prePay.setOpenid("oRhMfwBQ-Ouqhff4AeFOqovgJOAs");
// prePay.setCheck_name("NO_CHECK");
// prePay.setAmount("100");
// prePay.setDesc("活动提现");
// prePay.setSpbill_create_ip("192.168.8.109");
// //prePay.setKey(SystemConfig.WINXIN_PARTNER_KEY);
// String result =postXML(suppTouser,prePay.getXMLTuiKuan());
// String result = "<xml>"+
// "<return_code><![CDATA[SUCCESS]]></return_code>"+
// "<return_msg><![CDATA[]]></return_msg>"+
// "<mch_appid><![CDATA[wxa9805823769294b6]]></mch_appid>"+
// "<mchid><![CDATA[1327473801]]></mchid>"+
// "<device_info><![CDATA[]]></device_info>"+
// "<nonce_str><![CDATA[FD45EBC1E1D76BC1FE0BA933E60E9957]]></nonce_str>"+
// "<result_code><![CDATA[SUCCESS]]></result_code>"+
// "<partner_trade_no><![CDATA[TX20160504120550000001]]></partner_trade_no>"+
// "<payment_no><![CDATA[1000018301201605040163328553]]></payment_no>"+
// "<payment_time><![CDATA[2016-05-04 12:05:51]]></payment_time>"+
// "</xml>";
//
//
// result = result.replaceAll("<![CDATA[|]]>", "");
//
// Map<String, String> map = XMLUtil.doXMLParse(result);
//
// System.out.println(map.get("return_code"));
// System.out.println(map.get("mchid"));
// System.out.println(map.get("payment_no"));
// System.out.println(map.get("partner_trade_no"));
// System.out.println(map.get("payment_time"));
}
public static Map<String,String> WeiXinTiXian(String openid,String partnerTradeNo,String check_name,String amount,String desc,String spbill_create_ip) public static Map<String,String> WeiXinTiXian(String openid,String partnerTradeNo,String check_name,String amount,String desc,String spbill_create_ip)
{ {
WXSuppToUserPay prePay = new WXSuppToUserPay(); WXSuppToUserPay prePay = new WXSuppToUserPay();
prePay.setMch_appid(SystemConfig.WINXIN_AppID); prePay.setMch_appid(SystemConfig.APP_ID);
prePay.setMchid(SystemConfig.WINXIN_PARTNER); prePay.setMchid(SystemConfig.APP_PARTNER);
prePay.setNonce_str( OrderUtil.CreateNoncestr()); prePay.setNonce_str( OrderUtil.CreateNoncestr());
prePay.setPartner_trade_no(partnerTradeNo); prePay.setPartner_trade_no(partnerTradeNo);
prePay.setOpenid(openid); prePay.setOpenid(openid);
...@@ -138,18 +80,19 @@ public class WXSuppToUserPay { ...@@ -138,18 +80,19 @@ public class WXSuppToUserPay {
try { try {
KeyStore keyStore = KeyStore.getInstance("PKCS12"); KeyStore keyStore = KeyStore.getInstance("PKCS12");
// FileInputStream instream = new FileInputStream(new File("E:/cert/apiclient_cert.p12")); // FileInputStream instream = new FileInputStream(new File("E:/cert/apiclient_cert.p12"));
String path = Thread.currentThread().getContextClassLoader().getResource("/").getPath(); ClassPathResource classPathResource = new ClassPathResource("apiclient_cert.p12");
FileInputStream instream = new FileInputStream(new File(path+"/apiclient_cert.p12")); InputStream instream = classPathResource.getInputStream();
try { try {
keyStore.load(instream, SystemConfig.WINXIN_PARTNER.toCharArray()); keyStore.load(instream, SystemConfig.APP_PARTNER.toCharArray());
} finally { } finally {
if (instream != null) if (instream != null) {
instream.close(); instream.close();
}
} }
SSLContext sslcontext = SSLContexts.custom().loadKeyMaterial(keyStore, SystemConfig.APP_PARTNER.toCharArray()).build(); SSLContext sslcontext = SSLContexts.custom().loadKeyMaterial(keyStore, SystemConfig.APP_PARTNER.toCharArray()).build();
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(sslcontext, new String[] { "TLSv1" }, SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(sslcontext, new String[] { "TLSv1" },
null, SSLConnectionSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER); null, SSLConnectionSocketFactory.getDefaultHostnameVerifier());
httpclient = HttpClients.custom().setSSLSocketFactory(sslsf).build(); httpclient = HttpClients.custom().setSSLSocketFactory(sslsf).build();
return post(httpclient, uri, xml, "text/xml; charset=UTF-8", "UTF-8", null, null); return post(httpclient, uri, xml, "text/xml; charset=UTF-8", "UTF-8", null, null);
} catch (Exception e) { } catch (Exception e) {
......
...@@ -401,7 +401,7 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay>{ ...@@ -401,7 +401,7 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay>{
} }
public String wxpayfundTrans(FundPayVo fundPayVo) { public String wxpayfundTrans(FundPayVo fundPayVo) {
Map<String, String> map = WXSuppToUserPay.WeiXinTiXian(fundPayVo.getAmount(),fundPayVo.getOutBizNo(),fundPayVo.getCheckName(), fundPayVo.getAmount(), fundPayVo.getRemark(), fundPayVo.getCreatIp()); Map<String, String> map = WXSuppToUserPay.WeiXinTiXian(fundPayVo.getPayeeAccount(),fundPayVo.getOutBizNo(),fundPayVo.getCheckName(), fundPayVo.getAmount(), fundPayVo.getRemark(), fundPayVo.getCreatIp());
if (SUCCESS.equals(map.get(WxResponseProperties.RETURN_CODE)) && SUCCESS.equals(map.get(WxResponseProperties.RESULT_CODE))) { if (SUCCESS.equals(map.get(WxResponseProperties.RETURN_CODE)) && SUCCESS.equals(map.get(WxResponseProperties.RESULT_CODE))) {
return map.get(WxResponseProperties.PARTNER_TRADE_NO); return map.get(WxResponseProperties.PARTNER_TRADE_NO);
} }
......
...@@ -95,7 +95,7 @@ public class WithDrawMqHandler implements InitializingBean { ...@@ -95,7 +95,7 @@ public class WithDrawMqHandler implements InitializingBean {
Long count = valueOperations.increment(orderNo); Long count = valueOperations.increment(orderNo);
if (count <= MAX_RETRY) { if (count <= MAX_RETRY) {
//重新把消息放回队列 //重新把消息放回队列
// basicNack(channel, message.getMessageProperties().getDeliveryTag(), false, true, pay_way); basicNack(channel, message.getMessageProperties().getDeliveryTag(), false, true, pay_way);
try { try {
channel.basicRecover(); channel.basicRecover();
}catch (IOException ex){ }catch (IOException ex){
......
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