Commit ef975899 by 陈浩建

Merge remote-tracking branch 'origin/master'

parents 7dcbd001 6b557a6e
...@@ -222,7 +222,6 @@ public class DankuanController { ...@@ -222,7 +222,6 @@ public class DankuanController {
try{ try{
String uuid = UUID.randomUUID().toString(); String uuid = UUID.randomUUID().toString();
String id = uuid.split("-")[0] + uuid.split("-")[1]; String id = uuid.split("-")[0] + uuid.split("-")[1];
order.setId(id);
order.setId(id); order.setId(id);
SimpleDateFormat sd = new SimpleDateFormat("yyyyMMdd"); SimpleDateFormat sd = new SimpleDateFormat("yyyyMMdd");
...@@ -252,21 +251,24 @@ public class DankuanController { ...@@ -252,21 +251,24 @@ public class DankuanController {
order.setHehuorenName(sysUser.getName()); order.setHehuorenName(sysUser.getName());
order.setHehuorenArea(sysUser.getSubstName()); order.setHehuorenArea(sysUser.getSubstName());
order.setSignImg(filePath); order.setSignImg(filePath);
List<String> userId1 = appMapper.selectsupervisorBySchool(schoolId); List<String> userId1 = appMapper.selectsupervisorBySchool(schoolId);
SysUser user = sysUserMapper.selectById(userId1.get(0)); if (userId1 != null && userId1.size() != 0) {
order.setSupervisorName(user.getName()); SysUser user = sysUserMapper.selectById(userId1.get(0));
order.setSupervisorName(user.getName());
}
order.setLzgh(school.getLzgh()); order.setLzgh(school.getLzgh());
order.setOrderStatus(orderStatus); order.setOrderStatus(orderStatus);
// 根据订单号,获取该订单信息 // 根据订单号,获取该订单信息
// 根据学校名称,获取该学校信息 // 根据学校名称,获取该学校信息
Product product = productMapper.selectById(productId); // Product product = productMapper.selectById(productId);
Wrapper<UniversityInfo> uiWrapper = new EntityWrapper<>(); // Wrapper<UniversityInfo> uiWrapper = new EntityWrapper<>();
uiWrapper.eq("university_id", product.getUniversityId()); // uiWrapper.eq("university_id", product.getUniversityId());
Map<String, Object> schoolMap = universityInfoMapper.selectMaps(uiWrapper).get(0); // Map<String, Object> schoolMap = universityInfoMapper.selectMaps(uiWrapper).get(0);
orderMapper.insert(order); orderMapper.insert(order);
appMapper.inserOrderHis(id, "待审核!", new Date(), orderView.getOrderName());
}catch (Exception e){ }catch (Exception e){
e.getMessage(); e.printStackTrace();
Wrapper<OrderView> wrapper = new EntityWrapper<>(); Wrapper<OrderView> wrapper = new EntityWrapper<>();
wrapper.eq(StringUtils.isNotBlank(orderView.getOrderSeq().toString()), "orderSeq", orderView.getOrderSeq().toString()); wrapper.eq(StringUtils.isNotBlank(orderView.getOrderSeq().toString()), "orderSeq", orderView.getOrderSeq().toString());
orderViewMapper.delete(wrapper); orderViewMapper.delete(wrapper);
...@@ -310,8 +312,16 @@ public class DankuanController { ...@@ -310,8 +312,16 @@ public class DankuanController {
Map<String, Object> dataMapping2 = new HashMap<>(); Map<String, Object> dataMapping2 = new HashMap<>();
dataMapping2.put("order_status", "未下单"); dataMapping2.put("order_status", "未下单");
orderMapper.updateForSet(MyBatisPlusUpdateUtils.toUpdateSet(dataMapping2), objectEntityWrapper); orderMapper.updateForSet(MyBatisPlusUpdateUtils.toUpdateSet(dataMapping2), objectEntityWrapper);
List<Order> orders = orderMapper.selectList(objectEntityWrapper); Map<String, Object> stringObjectMap = orderMapper.selectKdOrder(orderseq);
appMapper.inserOrderHis(orders.get(0).getId(), "支付完成,未下单!", new Date(), orders.get(0).getCustomerName());
if (stringObjectMap != null) {
appMapper.inserOrderHis(stringObjectMap.get("id") != null ? stringObjectMap.get("id").toString() : "", "支付完成,待提交!", new Date(), stringObjectMap.get("customer_name") != null ? stringObjectMap.get("customer_name").toString() : "");
log.info("------------单宽提交智能平台--------------");
// 提交智能平台
log.info(JSONObject.toJSONString(stringObjectMap));
intelligenceSendOrder.singleBroadSendOrder(stringObjectMap);
}
} }
/** /**
...@@ -495,7 +505,7 @@ public class DankuanController { ...@@ -495,7 +505,7 @@ public class DankuanController {
map.put("MERCHANTURL", MERCHANTURL); map.put("MERCHANTURL", MERCHANTURL);
//单宽回调后端接口地址 //单宽回调后端接口地址
// 正式环境 // 正式环境
map.put("BACKDROPURL", "https://dx.dianyuanjiangli.com/apply-net/ciop/dankuan/toSubmisOrderPreser"); map.put("BACKDROPURL", "https://dx.dianyuanjiangli.com/app/ciop/dankuan/toSubmisOrderPreser");
//测试地址 //测试地址
// map.put("BACKDROPURL", "http://3715zj2369.qicp.vip/ciop/dankuan/toSubmisOrderPreser"); // map.put("BACKDROPURL", "http://3715zj2369.qicp.vip/ciop/dankuan/toSubmisOrderPreser");
......
...@@ -20,12 +20,17 @@ import java.io.IOException; ...@@ -20,12 +20,17 @@ import java.io.IOException;
@RestController @RestController
public class ImgController { public class ImgController {
/**
* 服务器访问路径
*/
private static String pathPre = "/springboot/school_center/manager/";
//menuname = "图片路径" 只支持jpeg 和 png //menuname = "图片路径" 只支持jpeg 和 png
@RequestMapping( value = "/images/**",produces ={MediaType.IMAGE_JPEG_VALUE,MediaType.IMAGE_PNG_VALUE} ) @RequestMapping( value = "/images/**",produces ={MediaType.IMAGE_JPEG_VALUE,MediaType.IMAGE_PNG_VALUE} )
public byte[] getbackground(HttpServletRequest request) { public byte[] getbackground(HttpServletRequest request) {
byte[] bytes=new byte[10]; byte[] bytes=new byte[10];
request.getServletPath(); request.getServletPath();
String imgurl= FilePath.BACKGROUNDIMG.getValue()+"/"+request.getServletPath(); String imgurl= pathPre + FilePath.BACKGROUNDIMG.getValue()+"/"+request.getServletPath();
imgurl = imgurl.replace("//", "/"); imgurl = imgurl.replace("//", "/");
File file = new File(imgurl); File file = new File(imgurl);
FileInputStream inputStream = null; FileInputStream inputStream = null;
......
...@@ -287,6 +287,7 @@ public class RongHeController { ...@@ -287,6 +287,7 @@ public class RongHeController {
return ResponseData.success(orderV, "订单提交完成!"); return ResponseData.success(orderV, "订单提交完成!");
} }
}catch (Exception e){ }catch (Exception e){
e.printStackTrace();
return ResponseData.error("网络超时,请重试!"); return ResponseData.error("网络超时,请重试!");
}finally { }finally {
redisTemplate.delete(orderNumber); redisTemplate.delete(orderNumber);
...@@ -480,7 +481,7 @@ public class RongHeController { ...@@ -480,7 +481,7 @@ public class RongHeController {
map.put("MERCHANTURL", MERCHANTURL); map.put("MERCHANTURL", MERCHANTURL);
// 融合回调后端接口地址 // 融合回调后端接口地址
//正式地址 //正式地址
// map.put("BACKDROPURL", "https://dx.dianyuanjiangli.com/apply-net/ciop/rongHe/toSubmisOrderPreser"); map.put("BACKDROPURL", "https://dx.dianyuanjiangli.com/app/ciop/rongHe/toSubmisOrderPreser");
String str = "ORDERSEQ=" + orderView.getOrderSeq() + "&ORDERDATE=" + ft.format(orderdate) + "&ORDERAMOUNT=" + orderView.getWebOrderAmount() + "&KEY=" + Constant.APPK;//商户标识 String str = "ORDERSEQ=" + orderView.getOrderSeq() + "&ORDERDATE=" + ft.format(orderdate) + "&ORDERAMOUNT=" + orderView.getWebOrderAmount() + "&KEY=" + Constant.APPK;//商户标识
//* 将值转换为大写 *//* //* 将值转换为大写 *//*
......
package com.winsun.bean;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import lombok.Data;
import java.util.Date;
/**
* 第三方应用密匙配置
* @author chengfengluo
* @date 2021-02-20 10:36
*/
@Data
@TableName("sys_app_config")
public class AppConfig {
/**
* 主键
*/
@TableId(value = "id" ,type = IdType.AUTO)
private Integer id;
/**
* 应用名称
*/
@TableField("app_name")
private String appName;
/**
* 应用id
*/
@TableField("app_id")
private String appId;
/**
* 应用密匙
*/
@TableField("app_secret")
private String appSecret;
/**
* 创建人
*/
@TableField("create_by")
private String createBy;
/**
* 创建时间
*/
@TableField("create_time")
private Date createTime;
/**
* 更新人
*/
@TableField("update_by")
private String updateBy;
/**
* 更新时间
*/
@TableField("update_time")
private Date updateTime;
}
...@@ -209,4 +209,17 @@ public class School implements Serializable { ...@@ -209,4 +209,17 @@ public class School implements Serializable {
*/ */
@TableField("sjktcsj") @TableField("sjktcsj")
private String sjktcsj; private String sjktcsj;
/**
* 终端编码
*/
@TableField("app_id")
private String appId;
/**
* 终端密匙
*/
@TableField("app_key")
private String appKey;
} }
package com.winsun.mapper;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.winsun.bean.AppConfig;
import com.winsun.bean.PackageUpgrade;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;
/**
* @author chengfengluo
* @date 2021-02-20 10:40
*/
@Mapper
@Component
public interface AppConfigMapper extends BaseMapper<AppConfig> {
}
package com.winsun.mapper; package com.winsun.mapper;
import com.winsun.bean.School;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
...@@ -69,4 +70,11 @@ public interface HhrUserMapper extends BaseMapper<HhrUser> { ...@@ -69,4 +70,11 @@ public interface HhrUserMapper extends BaseMapper<HhrUser> {
* @return * @return
*/ */
Map<String, Object> selectHehuorenInfo(@Param("hehuorenId") String hehuorenId); Map<String, Object> selectHehuorenInfo(@Param("hehuorenId") String hehuorenId);
/**
* 查询合伙人学校
* @param userId
* @return
*/
List<Map<String, Object>> selectHehuorenSchool(String userId);
} }
...@@ -70,12 +70,15 @@ public class IntelligenceSendOrder { ...@@ -70,12 +70,15 @@ public class IntelligenceSendOrder {
// 初始化下单支付参数 // 初始化下单支付参数
String ORDERSEQ = "", ORDERAMOUNT = "", ORDERREQTRANSEQ = "", UPTRANSEQ = ""; String ORDERSEQ = "", ORDERAMOUNT = "", ORDERREQTRANSEQ = "", UPTRANSEQ = "";
if (order.get("kd_order_id") == null) {
log.info("kd_order_id为空。");
return;
}
Map<String, Object> orderMap = null; Map<String, Object> orderMap = null;
Map<String, Object> schoolMap = null; Map<String, Object> schoolMap = null;
List<Map<String, Object>> list1 = new ArrayList<>(); List<Map<String, Object>> list1 = new ArrayList<>();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmss"); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
String currentTimeStr = ""; String currentTimeStr = "";
ORDERSEQ = order.get("kd_order_id").toString(); ORDERSEQ = order.get("kd_order_id").toString();
currentTimeStr = simpleDateFormat.format(new Date()); currentTimeStr = simpleDateFormat.format(new Date());
Wrapper<OrderView> orderViewWrapper = new EntityWrapper<>(); Wrapper<OrderView> orderViewWrapper = new EntityWrapper<>();
...@@ -84,7 +87,6 @@ public class IntelligenceSendOrder { ...@@ -84,7 +87,6 @@ public class IntelligenceSendOrder {
if (orderViewMaps != null && orderViewMaps.size() > 0) { if (orderViewMaps != null && orderViewMaps.size() > 0) {
orderMap = orderViewMaps.get(0); orderMap = orderViewMaps.get(0);
} }
if (orderMap == null) { if (orderMap == null) {
log.info("错误记录:" + JSONObject.toJSONString(order)); log.info("错误记录:" + JSONObject.toJSONString(order));
log.info("订单号:" + ORDERSEQ + ",在order_view表中无记录,无法进行智能平台下单"); log.info("订单号:" + ORDERSEQ + ",在order_view表中无记录,无法进行智能平台下单");
...@@ -191,25 +193,20 @@ public class IntelligenceSendOrder { ...@@ -191,25 +193,20 @@ public class IntelligenceSendOrder {
String state = queryOrderJsonObject.getString("state"); String state = queryOrderJsonObject.getString("state");
// 更新hhr_order // 更新hhr_order
Wrapper<Order> orderWrapper = new EntityWrapper<>(); Wrapper<Order> orderWrapper = new EntityWrapper<>();
orderWrapper.eq("kd_order_id", orderNum); orderWrapper.eq("kd_order_id", order.get("kd_order_id"));
Order updateOrder = new Order(); Order updateOrder = new Order();
updateOrder.setOrderId(ORDERSEQ); updateOrder.setOrderId(orderNum);
updateOrder.setOrderStatus("审核中"); updateOrder.setOrderStatus("审核中");
orderMapper.update(updateOrder, orderWrapper); orderMapper.update(updateOrder, orderWrapper);
log.info("支付成功后更新订单状态");
if (StringUtils.isNotBlank(state)) { OrderView updateOrderView = new OrderView();
log.info("支付成功后更新订单状态"); updateOrderView.setStatus(QueOrderNum(state));
OrderView updateOrderView = new OrderView(); updateOrderView.setOrderseqThd(orderNum);
updateOrderView.setStatus(QueOrderNum(state)); Wrapper<OrderView> wrapperOrderView = new EntityWrapper<>();
updateOrderView.setOrderseqThd(orderNum); wrapperOrderView.eq("orderSeq", order.get("kd_order_id").toString());
Wrapper<OrderView> wrapperOrderView = new EntityWrapper<>(); orderViewMapper.update(updateOrderView, wrapperOrderView);
wrapperOrderView.eq("orderSeq", ORDERSEQ); log.info("----------将智能订单状态更新至数据库success:" + state);
orderViewMapper.update(updateOrderView, wrapperOrderView);
log.info("----------将智能订单状态更新至数据库success:" + state);
} else {
log.info("----------将智能订单状态更新至数据库error:" + state);
}
} }
} else { } else {
log.info( log.info(
...@@ -224,7 +221,8 @@ public class IntelligenceSendOrder { ...@@ -224,7 +221,8 @@ public class IntelligenceSendOrder {
log.info("重复订单"); log.info("重复订单");
} }
}catch (Exception e){ }catch (Exception e){
e.getMessage(); log.info("单宽下单失败");
e.printStackTrace();
} }
} }
...@@ -254,6 +252,7 @@ public class IntelligenceSendOrder { ...@@ -254,6 +252,7 @@ public class IntelligenceSendOrder {
} }
}catch( Exception e) { }catch( Exception e) {
log.info(e.toString()); log.info(e.toString());
e.printStackTrace();
} }
} }
...@@ -700,7 +699,7 @@ public class IntelligenceSendOrder { ...@@ -700,7 +699,7 @@ public class IntelligenceSendOrder {
log.error("查询单宽带(预付费、移动、融合、续约、增值)产品接口异常尝试20次失误。请检查接口"); log.error("查询单宽带(预付费、移动、融合、续约、增值)产品接口异常尝试20次失误。请检查接口");
} }
} catch (Exception e) { } catch (Exception e) {
System.out.println("单宽带下单接口异常"); log.info("单宽带下单接口异常");
e.printStackTrace(); e.printStackTrace();
} finally { } finally {
httpPost.releaseConnection(); httpPost.releaseConnection();
...@@ -765,7 +764,7 @@ public class IntelligenceSendOrder { ...@@ -765,7 +764,7 @@ public class IntelligenceSendOrder {
log.error("查询单宽带(预付费、移动、融合、续约、增值)产品接口异常尝试20次失误。请检查接口"); log.error("查询单宽带(预付费、移动、融合、续约、增值)产品接口异常尝试20次失误。请检查接口");
} }
} catch (Exception e) { } catch (Exception e) {
System.out.println("查询单宽带(预付费、移动、融合、续约、增值)产品接口异常"); log.info("查询单宽带(预付费、移动、融合、续约、增值)产品接口异常");
e.printStackTrace(); e.printStackTrace();
} finally { } finally {
httpPost.releaseConnection(); httpPost.releaseConnection();
...@@ -1825,7 +1824,7 @@ public class IntelligenceSendOrder { ...@@ -1825,7 +1824,7 @@ public class IntelligenceSendOrder {
log.info("宽叠移下单接口,返回信息:" + httpResult); log.info("宽叠移下单接口,返回信息:" + httpResult);
resultDataJson = net.sf.json.JSONObject.fromObject(httpResult); resultDataJson = net.sf.json.JSONObject.fromObject(httpResult);
} catch (Exception e) { } catch (Exception e) {
System.out.println("宽叠移下单接口异常"); log.info("宽叠移下单接口异常");
e.printStackTrace(); e.printStackTrace();
} finally { } finally {
httpPost.releaseConnection(); httpPost.releaseConnection();
......
package com.winsun.utils;
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;
import java.io.IOException;
/**
* @author chengfengluo
* @date 2021-02-19 14:58
*/
public class EThreeDES {
private static final String Algorithm = "DESede"; //定义 加密算法,可用 DES,DESede,Blowfish
//keybyte为加密密钥,长度为24字节
//src为被加密的数据缓冲区(源)
//3DES加密
public static byte[] encryptMode(byte[] keybyte, byte[] src) {
try {
//生成密钥
SecretKey deskey = new SecretKeySpec(keybyte, Algorithm);
//加密
Cipher c1 = Cipher.getInstance(Algorithm);
c1.init(Cipher.ENCRYPT_MODE, deskey);
return c1.doFinal(src);
} catch (java.security.NoSuchAlgorithmException e1) {
e1.printStackTrace();
} catch (javax.crypto.NoSuchPaddingException e2) {
e2.printStackTrace();
} catch (Exception e3) {
e3.printStackTrace();
}
return null;
}
//keybyte为加密密钥,长度为24字节
//src为加密后的缓冲区
//3DES解密
public static byte[] decryptMode(byte[] keybyte, byte[] src) throws Exception {
try {
//生成密钥
SecretKey deskey = new SecretKeySpec(keybyte, Algorithm);
//解密
Cipher c1 = Cipher.getInstance(Algorithm);
c1.init(Cipher.DECRYPT_MODE, deskey);
return c1.doFinal(src);
} catch (java.security.NoSuchAlgorithmException e1) {
e1.printStackTrace();
} catch (javax.crypto.NoSuchPaddingException e2) {
e2.printStackTrace();
}
return null;
}
//转换成十六进制字符串
public static String byte2hex(byte[] b) {
String hs="";
String stmp="";
for (int n=0;n<b.length;n++) {
stmp=(Integer.toHexString(b[n] & 0XFF));
if (stmp.length()==1) hs=hs+"0"+stmp;
else hs=hs+stmp;
if (n<b.length-1) hs=hs+":";
}
return hs.toUpperCase();
}
//转为base64
public static String enBase64(byte[] bparm) throws IOException {
BASE64Encoder enc=new BASE64Encoder();
String bdnParm = enc.encodeBuffer(bparm);
return bdnParm;
}
//从BASE64反转回来
public static byte[] deBase64(String parm) throws IOException {
BASE64Decoder dec=new BASE64Decoder();
byte[] dnParm = dec.decodeBuffer(parm);
return dnParm;
}
public static String replace(String source, String oldString,
String newString) {
StringBuffer output = new StringBuffer();
int lengthOfSource = source.length();
int lengthOfOld = oldString.length();
int posStart = 0;
int pos; //
while ( (pos = source.indexOf(oldString, posStart)) >= 0) {
output.append(source.substring(posStart, pos));
output.append(newString);
posStart = pos + lengthOfOld;
}
if (posStart < lengthOfSource) {
output.append(source.substring(posStart));
}
return output.toString();
}
/**
* 3DES解密
* @param toThreeDES
* @return
*/
public static String deThreeDES(String toThreeDES){
String deThreeDes="";
if (toThreeDES==null || toThreeDES.equals(""))
{
deThreeDes="";
}
else
{
try{
EThreeDES edes = new EThreeDES();
String key_VALUE = "A314BA5A3C85E86KK887WSWS";
byte[] keyBytes = key_VALUE.getBytes();
byte[] toBASE64ToStr = edes.deBase64(toThreeDES);
byte[] toWK_DESToStr = EThreeDES.decryptMode(keyBytes, toBASE64ToStr);
deThreeDes = new String(toWK_DESToStr,"utf-8");
}
catch(Exception ex)
{
//System.out.println("3DES解密出错!!!"+ex.getMessage());
}
}
return deThreeDes;
}
public static void main(String[] args) throws IOException
{
EThreeDES eThreeDES = new EThreeDES();
String KEY = "C314BONC3C85E86KK996WSWS"; //密匙
//加密
String original = "{termNo:\"yxsst_ht191106\", orderTime:\"2021-01-27 11:30:00\", prodName:\"套餐名称\", reqCode:\"GZ202101261234567\", subsCode: [\"611234\", \"612345\", \"611226\"], custName:\"张*三\", certNo: \"4401**********1234\", accNbr:\"13888888888\", orderState: \"S0K\", orderStateName:\"已完成/已取卡\", payState: \"1\", crmStateName:\"完工\", crmStateReason:\"000\", recNo:\"0200202101251030423400027500\"}";
byte[] eBy = EThreeDES.encryptMode(KEY.getBytes(),original.getBytes());
String eBase64 = eThreeDES.enBase64(eBy);
System.out.println("3DES加密后的字符串:" + eBase64);
//解密
String dBase64 = eBase64;
byte[] dBy = EThreeDES.deBase64(dBase64);
// byte[] srcBytes = EThreeDES.decryptMode(KEY.getBytes(), dBy);
// System.out.println("3DES解密后的字符串:" + new String(srcBytes,"utf-8"));
}
}
...@@ -20,6 +20,11 @@ import java.util.Date; ...@@ -20,6 +20,11 @@ import java.util.Date;
public class PicturesUtil { public class PicturesUtil {
/** /**
* 服务器上传路径
*/
private static String UPLOAD_PRE = "/springboot/school_center/manager/";
/**
* 上传图片 * 上传图片
* <p> * <p>
* 前端传来图片必须为jpeg格式 * 前端传来图片必须为jpeg格式
...@@ -50,17 +55,14 @@ public class PicturesUtil { ...@@ -50,17 +55,14 @@ public class PicturesUtil {
if (!multipartFiles[i].isEmpty()) { if (!multipartFiles[i].isEmpty()) {
String base64Data = multipartFiles[i].split(",")[1]; String base64Data = multipartFiles[i].split(",")[1];
String houzhui = multipartFiles[i].split(",")[0].split("/")[1].split(";")[0]; String houzhui = multipartFiles[i].split(",")[0].split("/")[1].split(";")[0];
String filePath1 = FilePath.PATH.getValue()+ pathType+ "/" + yymmdd + "/" + orderNum; String filePath1 = UPLOAD_PRE + FilePath.PATH.getValue()+ pathType+ "/" + yymmdd + "/" + orderNum;
File dir = new File(filePath1); File dir = new File(filePath1);
if (!dir.exists()) { if (!dir.exists()) {
dir.mkdirs(); dir.mkdirs();
}//enclosure/images/idCard/temp/年/月/日/name.jpeg }//enclosure/images/idCard/temp/年/月/日/name.jpeg
filePath = FilePath.PATH.getValue()+ pathType+ "/" + yymmdd + "/" + orderNum + "/" + (new Date()).getTime() + "." + PicturesUtil.checkSuffix(houzhui);
filePath = UPLOAD_PRE + FilePath.PATH.getValue()+ pathType+ "/" + yymmdd + "/" + orderNum + "/" + (new Date()).getTime() + "." + PicturesUtil.checkSuffix(houzhui);
//byte[] bytes = Base64.getUrlDecoder().decode(base64Data);
//byte[] bytes =new BASE64Decoder().decodeBuffer(base64Data);
//byte[] bytes = Base64.getDecoder().decode(base64Data);
byte[] bytes = Base64.getMimeDecoder().decode(base64Data.replace(" ","+")); byte[] bytes = Base64.getMimeDecoder().decode(base64Data.replace(" ","+"));
FileOutputStream fos = null; FileOutputStream fos = null;
try { try {
...@@ -85,7 +87,7 @@ public class PicturesUtil { ...@@ -85,7 +87,7 @@ public class PicturesUtil {
} }
String enclosure = ""; String enclosure = "";
if (filePath != null) { if (filePath != null) {
enclosure = filePath.replace("enclosure", "manager/ciop"); enclosure = filePath.replace(UPLOAD_PRE + "enclosure", "manager/ciop");
} }
return enclosure; return enclosure;
...@@ -112,7 +114,7 @@ public class PicturesUtil { ...@@ -112,7 +114,7 @@ public class PicturesUtil {
* @return * @return
*/ */
public static boolean deletePictures(String fileName){ public static boolean deletePictures(String fileName){
File file = new File(fileName.replace("manager/ciop","enclosure")); File file = new File(fileName.replace("manager/ciop",UPLOAD_PRE + "enclosure"));
Boolean flag = false; Boolean flag = false;
//判断文件是否存在 //判断文件是否存在
if (file.exists() == true){ if (file.exists() == true){
......
...@@ -50,4 +50,23 @@ public class RandomUtil { ...@@ -50,4 +50,23 @@ public class RandomUtil {
return sb.toString(); return sb.toString();
} }
/**
* 获取纯数字随机数
* @param length
* @return
*/
public static String ramdomNum(Integer length){
String str="1234567890";
Random random=new Random();
StringBuffer sb=new StringBuffer();
for(int i=0;i<length;i++){
int number =random.nextInt(10);
sb.append(str.charAt(number));
}
return sb.toString();
}
} }
...@@ -99,4 +99,17 @@ ...@@ -99,4 +99,17 @@
WHERE WHERE
su.id = #{hehuorenId} su.id = #{hehuorenId}
</select> </select>
<select id="selectHehuorenSchool" parameterType="String" resultType="HashMap">
select
hs.*
from
hhr_user_school hus
LEFT JOIN
hhr_school hs
ON
hus.school_id = hs.id
WHERE
hus.user_id = #{userId}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -96,8 +96,8 @@ spring: ...@@ -96,8 +96,8 @@ spring:
prohibition: 600 prohibition: 600
datasource: datasource:
url: jdbc:mysql://localhost:3306/school_center?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&allowPublicKeyRetrieval=true url: jdbc:mysql://localhost:3306/school_center?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&allowPublicKeyRetrieval=true
username: yzzx username: root
password: yzzx123!@# password: AMrGBg6ZSsRrDLs6
#用来搜集数据库的所有表 #用来搜集数据库的所有表
db-name: guns db-name: guns
filters: wall,mergeStat filters: wall,mergeStat
...@@ -131,6 +131,8 @@ mybatis-plus: ...@@ -131,6 +131,8 @@ mybatis-plus:
typeAliasesPackage: com.winsun.auth.model.common,com.winsun.auth.model.merchant,com.winsun.auth.model.user,com.winsun.auth.core.node typeAliasesPackage: com.winsun.auth.model.common,com.winsun.auth.model.merchant,com.winsun.auth.model.user,com.winsun.auth.core.node
mapper-locations: mapper-locations:
- /com/winsun/item/modular/system/dao/mapping/*.xml - /com/winsun/item/modular/system/dao/mapping/*.xml
- /com/winsun/modular/dao/mapping/*.xml
- com/winsun/mapper/mapping/*.xml
management: management:
endpoints: endpoints:
web: web:
......
...@@ -131,6 +131,7 @@ mybatis-plus: ...@@ -131,6 +131,7 @@ mybatis-plus:
mapper-locations: mapper-locations:
- /com/winsun/item/modular/system/dao/mapping/*.xml - /com/winsun/item/modular/system/dao/mapping/*.xml
- /com/winsun/modular/dao/mapping/*.xml - /com/winsun/modular/dao/mapping/*.xml
- com/winsun/mapper/mapping/*.xml
management: management:
endpoints: endpoints:
web: web:
......
package com.winsun.migration.mapper.db3;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.Map;
/**
* 一人一码数据接口
* @author chengfengluo
* @date 2021-02-02 10:06
*/
@Mapper
@Component
public interface YrymDatabases {
@Select("SELECT " +
" du.*, " +
" GROUP_CONCAT( dr.NAME ) role_name, " +
" dus.spervisor " +
" FROM " +
" dzqd_user du " +
" LEFT JOIN dzqd_user_role dur ON du.user_id = dur.user_id " +
" LEFT JOIN dzqd_user_supervisor dus ON du.user_id = dus.id " +
" LEFT JOIN dzqd_role dr ON dur.role_id = dr.role_id " +
" GROUP BY " +
" du.user_id ")
List<Map<String, Object>> getLoginUserList();
@Select("select * from hhr_school_package where package_id is not null")
List<Map<String, Object>> getSchoolPackage();
@Select("select * from hhr_school_xb_package")
List<Map<String, Object>> getSchoolXbPackage();
}
eureka:
instance:
hostname: localhost
# 心跳时间,即服务续约间隔时间(缺省为30s)
lease-renewal-interval-in-seconds: 10
# 发呆时间,即服务续约到期时间(缺省为90s)
lease-expiration-duration-in-seconds: 20
client:
registry-fetch-interval-seconds: 5
serviceUrl:
defaultZone: http://localhost:20000/eureka/
server:
port: 8080
# 应用名称
spring:
devtools:
restart:
enabled: false
application:
name: migration
datasource:
db1:
jdbc-url: jdbc:mysql://localhost:3306/school_center?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&allowPublicKeyRetrieval=true
username: root
password: root
driver-class-name: com.mysql.cj.jdbc.Driver
db2:
#jdbc-url: jdbc:mysql://172.18.101.171:3306/xyjl?useUnicode=true&characterEncoding=utf-8&serverTimezone=CTT&useSSL=false
#username: yzzx
#password: yzzx123!@#
jdbc-url: jdbc:mysql://localhost:3306/xyjl?useUnicode=true&characterEncoding=utf-8&serverTimezone=CTT&useSSL=false
username: root
password: root
driver-class-name: com.mysql.cj.jdbc.Driver
db3:
#jdbc-url: jdbc:mysql://172.18.101.171:3306/dzqd?useUnicode=true&characterEncoding=utf-8&serverTimezone=CTT&useSSL=false
#username: yzzx
#password: yzzx123!@#
jdbc-url: jdbc:mysql://localhost:3306/dzqd?useUnicode=true&characterEncoding=utf-8&serverTimezone=CTT&useSSL=false
username: root
password: root
driver-class-name: com.mysql.cj.jdbc.Driver
...@@ -131,10 +131,10 @@ ...@@ -131,10 +131,10 @@
<artifactId>easyexcel</artifactId> <artifactId>easyexcel</artifactId>
<version>2.1.6</version> <version>2.1.6</version>
</dependency> </dependency>
<!-- <dependency> <dependency>
<groupId>com.winsun.framework</groupId> <groupId>com.winsun.framework</groupId>
<artifactId>winsun-core-service</artifactId> <artifactId>winsun-core-service</artifactId>
</dependency>--> </dependency>
<dependency> <dependency>
<groupId>dom4j</groupId> <groupId>dom4j</groupId>
......
package com.winsun.controller;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.winsun.auth.core.annotion.Permission;
import com.winsun.auth.core.base.controller.BaseController;
import com.winsun.auth.core.common.model.ResponseData;
import com.winsun.auth.core.shiro.ShiroUser;
import com.winsun.bean.AppConfig;
import com.winsun.mapper.AppConfigMapper;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.session.RowBounds;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* 应用配置
* @author chengfengluo
* @date 2021-02-20 10:45
*/
@RestController
@RequestMapping("/appConfig")
public class AppConfigController extends BaseController {
@Autowired
private AppConfigMapper appConfigMapper;
/**
* 新增应用配置
* @param appConfig
* @return
*/
@Permission(menuname = "添加应用配置", value = "add", method = RequestMethod.POST)
public ResponseData<String> addAppConfig(AppConfig appConfig) {
ShiroUser user = getShiroUser();
if (StringUtils.isBlank(appConfig.getAppName())) {
return ResponseData.error("应用名称不能为空");
}
if (StringUtils.isBlank(appConfig.getAppSecret())) {
return ResponseData.error("应用密匙不能为空");
}
// 查重
Wrapper<AppConfig> wrapper = new EntityWrapper<>();
wrapper.eq("app_name", appConfig.getAppName());
Integer integer = appConfigMapper.selectCount(wrapper);
if (integer != null && integer > 0) {
return ResponseData.error("应用名称重复");
}
appConfig.setCreateBy(user.getName());
appConfig.setCreateTime(new Date());
Integer insert = appConfigMapper.insert(appConfig);
if (insert > 0) {
return ResponseData.success(insert + "", "插入成功");
}
return ResponseData.error("插入失败");
}
/**
* 编辑应用配置
* @param appConfig
* @return
*/
@Permission(menuname = "更新应用配置", value = "update", method = RequestMethod.POST)
public ResponseData<String> updateAppConfig(AppConfig appConfig) {
ShiroUser user = getShiroUser();
if (appConfig.getId() == null || StringUtils.isBlank(appConfig.getAppName())) {
return ResponseData.error("参数错误");
}
// 查重
Wrapper<AppConfig> wrapper = new EntityWrapper<>();
wrapper.eq("app_name", appConfig.getAppName());
wrapper.ne("id", appConfig.getId());
Integer integer = appConfigMapper.selectCount(wrapper);
if (integer != null && integer > 0) {
return ResponseData.error("应用名称重复");
}
appConfig.setUpdateBy(user.getName());
appConfig.setUpdateTime(new Date());
Integer integer1 = appConfigMapper.updateById(appConfig);
if(integer1 > 0) {
return ResponseData.success(null, "更新成功");
}
return ResponseData.error("更新失败");
}
/**
* 获取配置信息
* @return
*/
@RequestMapping("/getConfigInfo")
public ResponseData<AppConfig> getConfigInfo (Integer id) {
AppConfig appConfig = appConfigMapper.selectById(id);
return ResponseData.success(appConfig);
}
/**
* 查询应用列表
* @param appConfig
* @param pageIndex
* @param pageSize
* @return
*/
@RequestMapping("/list")
public ResponseData<Page<AppConfig>> list(@RequestParam(value = "appName", required = false) String appName,
@RequestParam(name = "pageNo", required = false) Integer pageIndex,
@RequestParam(name = "pageSize", required = false) Integer pageSize) {
Wrapper<AppConfig> wrapper = new EntityWrapper<>();
wrapper.like(StringUtils.isNotBlank(appName),"app_name", appName);
List<AppConfig> appConfigs = appConfigMapper.selectList(wrapper);
Page<AppConfig> page = new Page<>();
page.setTotal(appConfigs.size());
Integer endpageSize = (pageIndex-1) == appConfigs.size()/pageSize ? (pageIndex-1)*pageSize+appConfigs.size()%pageSize : pageIndex*pageSize;
appConfigs = appConfigs.subList((pageIndex - 1)*pageSize, endpageSize);
page.setRecords(appConfigs);
page.setSize(appConfigs.size());
return ResponseData.success(page, "查询成功");
}
}
package com.winsun.controller; package com.winsun.controller;
import com.winsun.auth.core.annotion.Permission;
import com.winsun.constant.FilePath; import com.winsun.constant.FilePath;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
...@@ -20,7 +21,7 @@ import java.io.FileInputStream; ...@@ -20,7 +21,7 @@ import java.io.FileInputStream;
public class ImgController { public class ImgController {
//menuname = "图片路径" 只支持jpeg 和 png //menuname = "图片路径" 只支持jpeg 和 png
@RequestMapping( value = "/images/**",produces ={MediaType.IMAGE_JPEG_VALUE,MediaType.IMAGE_PNG_VALUE} ) @Permission(menuname = "图片查询", value = "/images/**", produces ={MediaType.IMAGE_JPEG_VALUE,MediaType.IMAGE_PNG_VALUE})
public byte[] getbackground(HttpServletRequest request) { public byte[] getbackground(HttpServletRequest request) {
byte[] bytes={}; byte[] bytes={};
request.getServletPath(); request.getServletPath();
......
...@@ -261,7 +261,7 @@ public class OrderController extends BaseController { ...@@ -261,7 +261,7 @@ public class OrderController extends BaseController {
updateOrder.setMsg(msg); updateOrder.setMsg(msg);
try { try {
// 添加操作记录 // 添加操作记录
appMapper.inserOrderHis(order.getId(), "审核失败!", new Date(), "智能平台"); appMapper.inserOrderHis(order.getId(), msg, new Date(), "智能平台");
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
......
...@@ -120,6 +120,9 @@ spring: ...@@ -120,6 +120,9 @@ spring:
exprie: 600 exprie: 600
prohibition: 600 prohibition: 600
datasource: datasource:
url: jdbc:mysql://localhost:3306/school_center?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&allowPublicKeyRetrieval=true
username: root
password: AMrGBg6ZSsRrDLs6
dynamic: dynamic:
primary: master primary: master
p6spy: true p6spy: true
...@@ -128,9 +131,9 @@ spring: ...@@ -128,9 +131,9 @@ spring:
max-active: 30 max-active: 30
datasource: datasource:
master: master:
url: jdbc:mysql://localhost:3306/school_center?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&allowPublicKeyRetrieval=true url: ${spring.datasource.url}
username: yzzx username: ${spring.datasource.username}
password: yzzx123!@# password: ${spring.datasource.password}
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
devtools: devtools:
restart: restart:
......
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