Commit b175a37b by 董有沛

冲突解决

parents d8ebc5ec b293ad0f
......@@ -79,14 +79,15 @@ public class YxtCardController extends BaseController {
*/
@RequestMapping(value = "/weixinAuthorizati")
public void weixinAuthorization(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException {
String requestURL = request.getContextPath().toString();
String requestURL = request.getContextPath();
log.info(requestURL);
///redirect_uri=http://167460x6b0.51mypc.cn/ciop/forgerpw/callBackLogin
String redirect_uri = "http://192.168.1.165:3000/#/yxt/pay?userId=6399";
String redirect_uri="http://167460x6b0.51mypc.cn/ciop/forgerpw/callBackLogin";
String redirect_uri2 = "http://192.168.1.165:3000/#/yxt/pay?userId=6399";
String url = "https://open.weixin.qq.com/connect/oauth2/authorize?";
url += "appid=" + WxConfig.APPID;
url += "&redirect_uri=" + URLEncoder.encode("http://167460x6b0.51mypc.cn/ciop/forgerpw/callBackLogin", "UTF-8");//此处和微信回调用的域名相同
url += "&redirect_uri=" + URLEncoder.encode(redirect_uri2, "UTF-8");//此处和微信回调用的域名相同
url += "&response_type=code&scope=snsapi_userinfo&state=frommenu#wechat_redirect";
try {
response.sendRedirect(url);
} catch (Exception e) {
......@@ -137,10 +138,11 @@ public class YxtCardController extends BaseController {
try{
objectMap = new WxInterfacesUtil().getJspaiSign(url);
objectMap.put("appid", WxConfig.APPID);
return ResponseData.success(objectMap);
}catch(Exception e){
e.printStackTrace();
}
return ResponseData.success(objectMap);
return ResponseData.error("");
}
/**
* 下单新增订单
......@@ -274,7 +276,8 @@ public class YxtCardController extends BaseController {
@RequestMapping("/activePay")
public ResponseData<Map<String,Object>> activePay(
@RequestParam("orderNum") String orderNum,
@RequestParam("totalPrice") Double totalPrice,@RequestParam("openId") String openId){
@RequestParam("totalPrice") Double totalPrice,
@RequestParam("openId") String openId){
int totalPrice0 = (int)(totalPrice * 100);
String nonceStr = Sha1Util.getNonceStr();
......@@ -570,90 +573,6 @@ public class YxtCardController extends BaseController {
return ResponseData.error("新增地址失败!!!");
}
// 发起支付
public ResponseData<Map<String,Object>> activePay(String orderNum,double totalPrice){
int totalPricet = (int)(totalPrice * 100);
String nonceStr = Sha1Util.getNonceStr();
// 统一下单请求参数
PayRequest payRequest = new PayRequest();
payRequest.setAppid(WxConfig.APPID);
payRequest.setMch_id(WxConfig.MAC_ID);
payRequest.setNonce_str(nonceStr);
payRequest.setSign("sign");
payRequest.setBody("yuan_xian_tong");
payRequest.setOut_trade_no(orderNum);
payRequest.setTotal_fee(Integer.toString(totalPricet));
payRequest.setSpbill_create_ip("120.24.88.216");
payRequest.setNotify_url(WxConfig.NOTIFY_URL);
payRequest.setTrade_type("JSAPI");
//临时测试用
payRequest.setOpenid("o22lhwRZP2zbXff7UHH3J8oqH8A0");
//System.out.println("pay——openid:"+request.getSession().getAttribute("openId").toString());
//log.info("pay——openid:"+openId);
//payRequest.setOpenid(openId);
// 统一下单加密参数
SortedMap<Object,Object> parameters = new TreeMap<Object,Object>();
parameters.put("appid", payRequest.getAppid());
parameters.put("mch_id", payRequest.getMch_id());
parameters.put("nonce_str", payRequest.getNonce_str());
parameters.put("body", payRequest.getBody());
parameters.put("out_trade_no", payRequest.getOut_trade_no());
parameters.put("total_fee", payRequest.getTotal_fee());
parameters.put("spbill_create_ip", payRequest.getSpbill_create_ip());
parameters.put("notify_url", payRequest.getNotify_url());
parameters.put("trade_type", payRequest.getTrade_type());
parameters.put("openid", payRequest.getOpenid());
String sign = WXPayUtil.createSign("UTF-8", parameters);
payRequest.setSign(sign);
try{
Map<String, Object> map = ConvertMapBean.bean2map(payRequest);
String xmlStr = WXPayUtil.map2Xmlstring(map);
String url = "https://api.mch.weixin.qq.com/pay/unifiedorder";
String result = HTTPSClient.sendPostXml(url, xmlStr);
System.out.println(result);
Map<String, Object> resultMap = WXPayUtil.xmlString2Map(result);
long timeStamp = System.currentTimeMillis();
nonceStr = Sha1Util.getNonceStr();
// 加密参数
String packages = "prepay_id=" + resultMap.get("prepay_id").toString();
SortedMap<Object,Object> secretParams = new TreeMap<Object,Object>();
secretParams.put("timeStamp", timeStamp);
secretParams.put("nonceStr", nonceStr);
secretParams.put("package", packages);
secretParams.put("appId", WxConfig.APPID);
secretParams.put("signType", "MD5");
String secretSign = WXPayUtil.createSign("UTF-8", secretParams);
// 获取签名
// String params = "appid=wxfc18f5186b729d15&timestamp="+timeStamp+"&noncestr="+nonceStr+"&package="+resultMap.get("prepay_id")+"&signtype=MD5";
// MessageDigest crypt = MessageDigest.getInstance("MD5");
// crypt.reset();
// crypt.update(params.getBytes("UTF-8"));
// String signature = WxInterfacesUtil.byteToHex(crypt.digest());
Map<String,Object> objectMap = new HashMap<>();
objectMap.put("appId", WxConfig.APPID);
objectMap.put("timeStamp", timeStamp);
objectMap.put("nonceStr", nonceStr);
objectMap.put("package", packages);
objectMap.put("signType", "MD5");
objectMap.put("sign", secretSign);
return ResponseData.success(objectMap,"支付成功");
}catch(Exception e){
e.printStackTrace();
}
return ResponseData.error("支付失败");
}
// 返回目前可购买兑换券数量
public int returnCardNum(){
......
package com.winsun.bean;
import lombok.Data;
import java.io.Serializable;
/**
......@@ -8,6 +10,7 @@ import java.io.Serializable;
* @author PXL
* @create 2020/5/12 15:17
*/
@Data
public class PayRequest implements Serializable {
private static final long serialVersionUID = -7878937183538920548L;
......@@ -24,91 +27,4 @@ public class PayRequest implements Serializable {
private String trade_type;
public String getAppid() {
return appid;
}
public void setAppid(String appid) {
this.appid = appid;
}
public String getMch_id() {
return mch_id;
}
public void setMch_id(String mch_id) {
this.mch_id = mch_id;
}
public String getNonce_str() {
return nonce_str;
}
public void setNonce_str(String nonce_str) {
this.nonce_str = nonce_str;
}
public String getSign() {
return sign;
}
public void setSign(String sign) {
this.sign = sign;
}
public String getBody() {
return body;
}
public void setBody(String body) {
this.body = body;
}
public String getOut_trade_no() {
return out_trade_no;
}
public void setOut_trade_no(String out_trade_no) {
this.out_trade_no = out_trade_no;
}
public String getTotal_fee() {
return total_fee;
}
public void setTotal_fee(String total_fee) {
this.total_fee = total_fee;
}
public String getSpbill_create_ip() {
return spbill_create_ip;
}
public void setSpbill_create_ip(String spbill_create_ip) {
this.spbill_create_ip = spbill_create_ip;
}
public String getNotify_url() {
return notify_url;
}
public void setNotify_url(String notify_url) {
this.notify_url = notify_url;
}
public String getTrade_type() {
return trade_type;
}
public void setTrade_type(String trade_type) {
this.trade_type = trade_type;
}
public String getOpenid() {
return openid;
}
public void setOpenid(String openid) {
this.openid = openid;
}
}
......@@ -8,7 +8,7 @@ import java.util.Date;
@Data
@TableName("hhr_sales_order")
public class SalesOrder {
public class SalesList {
/**
* 主键
......
package com.winsun.bean;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
@TableName("hhr_sales_order")
public class SalesOrder implements Serializable {
private static final long serialVersionUID = -1093416820114819143L;
/**
* 主键
*/
private Integer id;
/**
* 放号号码
*/
private String orderPhone;
/**
* 用户id
*/
private String userId;
/**
* 放号人
*/
private String name;
/**
* 放号人账号
*/
private String account;
/**
* 创建时间
*/
private Date createTime;
/**
* 审核状态 1:未审核 2:系统审核不通过 3:充值审核通过 4、 充值审核不通过
*/
private String status;
/**
* 审核备注
*/
private String remark;
/**
* 销售县分
*/
private String salesSubst;
/**
* 销售学校
*/
private String salesSchool;
/**
* 审核时间
*/
private Date auditTime ;
/**
* 佣金状态
*/
private String bonusStatus;
/**
* 订单类型
*/
private String orderType;
/**
* 订单编码
*/
private String orderNum;
/**
* 升级套餐
*/
private String upgradeCombo;
/**
* 原套餐
*/
private String oldCombo;
/**
* 删除标价 0:未删除 1:已删除
*/
private String delFlag;
/**
* 号码激活时间
*/
private Date activateTime;
/**
* 网点编码
*/
private String networkCode;
/**
* 网点名称
*/
private String networkName;
/**
* 总激励
*/
private Double allBonus;
/**
* 未发放激励
*/
private Double nonSendBonus;
/**
* 已发放激励
*/
private Double sendBonus;
/**
* 最近充值金额
*/
private Double recentlyAmount;
/**
* 最近充值激励
*/
private Double recentlyBonus;
/**
* 累计充值金额
*/
private Double monthAmount;
/**
* 累计充值激励
*/
private Double monthBonus;
/**
* 本金激励
*/
private Double capitalBonus;
@TableField(exist = false)
private String positionZW;
@TableField(exist = false)
private String positionZJL;
@TableField(exist = false)
private String positionSJ;
}
......@@ -26,11 +26,13 @@ public class School implements Serializable {
/**
*县分
*/
@TableField("sub_name")
private String subName;
/**
* 学校
*/
@TableField("school_name")
private String schoolName;
/**
......
......@@ -18,8 +18,9 @@ import org.springframework.stereotype.Component;
@Component
public interface PartnerMapper extends BaseMapper<Partner> {
@Update("update sys_user set phone = #{phone} ,name = #{name} ,account = #{account} ,sex = #{sex} where id=#{id}")
int updateSysUser(@Param("phone") String phone,@Param("name") String name,@Param("account") String account,@Param("sex") String sex,@Param("id") String id);
@Update("update sys_user set phone = #{phone} ,name = #{name} ,account = #{account} ,sex = #{sex}, password = #{password} where id=#{id}")
int updateSysUser(@Param("phone") String phone,@Param("name") String name,@Param("account") String account,@Param("sex") String sex,
@Param("password") String password,@Param("id") String id);
@Update("update hhr_user set ysm = #{ysm} ,grade = #{grade} ,id_card = #{idCard},position = #{position} ,parent_id = #{parentId} ,parent_ids = #{parentIds} where id=#{id}")
int updateHhUser(@Param("ysm") String ysm,@Param("grade") String grade,@Param("idCard") String idCard,@Param("position") String position,@Param("parentId") String parentId,@Param("parentIds") String parentIds,@Param("id") String id);
......
......@@ -12,11 +12,11 @@ import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Component;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.winsun.bean.SalesOrder;
import com.winsun.bean.SalesList;
@Mapper
@Component
public interface SalesOrderMapper extends BaseMapper<SalesOrder> {
public interface SalesListMapper extends BaseMapper<SalesList> {
@Select(" select * from hhr_phone_school ")
List<Map<String, Object>> getPhoneSchool();
......
package com.winsun.mapper;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Component;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.winsun.bean.SalesOrder;
@Mapper
@Component
public interface SalesOrderMapper extends BaseMapper<SalesOrder> {
@Select(" select * from hhr_phone_school ")
List<Map<String, Object>> getPhoneSchool();
@Insert(" replace into hhr_phone_school(order_phone,school) VALUES(#{orderPhone},#{school})")
int updatePhoneSchool(@Param("orderPhone") String orderPhone,@Param("school") String school);
@Update(" update hhr_sales_order set status = #{status}, remark = #{remark} where order_phone = #{orderPhone} and del_flag = 0"
+ " and order_type = 1 and send_bonus = 0 ")
int updateRepealOrder(@Param("status") String status,@Param("remark") String remark,@Param("orderPhone") String orderPhone);
@Select(" select * from hhr_phone_school where order_phone = #{orderPhone} ")
List<Map<String, Object>> getPhoneSchoolByPhone(@Param("orderPhone") String orderPhone);
@Delete("delete from hhr_phone_school where order_phone = #{orderPhone} ")
int deletePhoneSchool(@Param("orderPhone") String orderPhone);
}
......@@ -37,7 +37,10 @@ public interface SchoolMapper extends BaseMapper<School> {
List<Map<String,Object>> getSchoolRef();
@Select("select * from `hhr_supervisor_school` ")
List<Map<String,Object>> getSupervisorSchoolRef();
List<Map<String,Object>> getSupervisorRef();
@Select("select * from `hhr_supervisor_school` where user_id = #userId ")
List<Map<String,Object>> getSupervisorByUserId(@Param("userId") String userId);
@Insert(" replace into hhr_supervisor_school(user_id,school) values(#{userId},#{school}) ")
int addSupervisorSchool(@Param("userId") String userId, @Param("school") String school);
......
......@@ -11,6 +11,7 @@ import com.winsun.item.core.util.ResponseEntity;
import com.winsun.item.modular.system.service.IUserService;
import com.winsun.item.util.LoginUtils;
import com.winsun.smsUtils.SendSmsAndMail;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
......
......@@ -23,6 +23,7 @@ import com.winsun.utils.HttpHelper;
import com.winsun.utils.IDCardUtil;
import com.winsun.utils.MyBatisPlusUpdateUtils;
import com.winsun.utils.PicturesUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
......
......@@ -453,6 +453,7 @@ public class LzSalaryController extends BaseController {
}
if(sysUserList.size()==0){
log.error("查询数据为空!");
return;
}
List<Integer> schoolIds = new ArrayList<>();
Wrapper<School> schoolWrapper = new EntityWrapper<>();
......@@ -464,6 +465,7 @@ public class LzSalaryController extends BaseController {
}
if(schoolList.size()==0){
log.error("查询数据为空!");
return;
}
List<String> userIds2 = new ArrayList<>();
Wrapper<UserSchool> usWrapper = new EntityWrapper<>();
......@@ -492,6 +494,7 @@ public class LzSalaryController extends BaseController {
List<LzWage> lzWages = lzWageMpapper.selectList(wrapper);
if(lzWages.size()==0){
log.error("查询数据为空!");
return;
}
for (LzWage lzWage : lzWages) {
Map<String,Object> map = new HashMap<>();
......
......@@ -16,13 +16,15 @@ public class ExcelDealUtils {
List<String> names = (List<String>)headData.get("names");
List<String> columns = (List<String>)headData.get("columns");
XSSFWorkbook workbook = new XSSFWorkbook();
//创建工作表
XSSFSheet sheet = workbook.createSheet(sheetName);
//添加表头
final XSSFRow row = sheet.createRow(0);
//设置列宽度
for (int i=1 ;i <= columns.size();i++ ){
sheet.setColumnWidth(i, 2500);
}
// sheet.setColumnWidth(1, 6500);
// sheet.setColumnWidth(2, 6500);
......@@ -46,6 +48,41 @@ public class ExcelDealUtils {
return workbook;
}
@SuppressWarnings("unchecked")
public static XSSFWorkbook getWorkBook2(Map<String, Object> headData,List<Map<String,Object>> list,List<Integer> list1) {
String sheetName = headData.get("sheetName").toString();
List<String> names = (List<String>)headData.get("names");
List<String> columns = (List<String>)headData.get("columns");
XSSFWorkbook workbook = new XSSFWorkbook();
//创建工作表
XSSFSheet sheet = workbook.createSheet(sheetName);
//添加表头
final XSSFRow row = sheet.createRow(0);
//设置列宽度
for (int i=0 ;i < list1.size();i++ ){
sheet.setColumnWidth(i, list1.get(i));
}
//第一行字段名称
names.forEach(column -> {
XSSFCell cell = row.createCell(Math.max(row.getLastCellNum(), 0));
cell.setCellValue(column);
});
//数据
int rowIndex = row.getRowNum();
for (Map<String, Object> maps: list) {
final XSSFRow rowdata = sheet.createRow(++rowIndex);
for (String column : columns) {
XSSFCell cell = rowdata.createCell(Math.max(rowdata.getLastCellNum(), 0));
if (maps.get(column) != null) {
cell.setCellValue(maps.get(column).toString());
}
}
}
return workbook;
}
public static Map<String, Object> dealHeadMap(Map<String, Object> map){
Map<String, Object> resultMap = new HashMap<String, Object>();
List<String> names = new ArrayList<>();
......@@ -144,7 +181,37 @@ public class ExcelDealUtils {
Map<String, Object> resultMap = dealHeadMap(headMap);
resultMap.put("sheetName", sheetName);
return resultMap;
}
// 导出放号充值达标清单excel表头
public static Map<String, Object> salesOrderExcel(String sheetName){
Map<String, Object> headMap = new LinkedHashMap<String, Object>();
headMap.put("放号号码", "orderPhone");
headMap.put("放号学校", "salesSchool");
headMap.put("放号县分", "salesSubst");
headMap.put("放号人", "name");
headMap.put("放号人账号", "account");
headMap.put("职位", "position");
headMap.put("上级领导", "leader");
headMap.put("总经理", "president");
headMap.put("上传时间", "createTime");
headMap.put("激活时间", "activateTime");
Map<String, Object> resultMap = dealHeadMap(headMap);
resultMap.put("sheetName", sheetName);
return resultMap;
}
// 导出学子公司销量统计清单excel表头
public static Map<String, Object> salesCensusExcel(String sheetName){
Map<String, Object> headMap = new LinkedHashMap<String, Object>();
headMap.put("放号人", "name");
headMap.put("放号人账号", "account");
headMap.put("放号县分", "salesSubst");
headMap.put("放号学校", "salesSchool");
headMap.put("达标充值数", "recentlyNum");
headMap.put("职位", "position");
headMap.put("上级领导", "leader");
Map<String, Object> resultMap = dealHeadMap(headMap);
resultMap.put("sheetName", sheetName);
return resultMap;
}
......
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