Commit ffec81bb by yuanlin

添加日志打印

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@26663 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent e06fc809
...@@ -78,4 +78,15 @@ public class SysOrderDeviceSupplier { ...@@ -78,4 +78,15 @@ public class SysOrderDeviceSupplier {
public void setUpdateTime(Date updateTime) { public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime; this.updateTime = updateTime;
} }
@Override
public String toString() {
return "SysOrderDeviceSupplier{" +
"orderId=" + orderId +
", supplier='" + supplier + '\'' +
", supplierType='" + supplierType + '\'' +
", chooseSupplier='" + chooseSupplier + '\'' +
", sort=" + sort +
'}';
}
} }
...@@ -335,9 +335,9 @@ public class DaSouCheOrderServiceImpl implements DaSouCheOrderService { ...@@ -335,9 +335,9 @@ public class DaSouCheOrderServiceImpl implements DaSouCheOrderService {
} }
if(CollectionUtils.isNotEmpty(insertList)){ if(CollectionUtils.isNotEmpty(insertList)){
sysOrderDeviceSupplierMapper.insertBatchSelective(insertList); sysOrderDeviceSupplierMapper.insertBatchSelective(insertList);
logger.info(insertList+"审核驳回供应商创建完成"+orderSn);
} }
} }
logger.info("审核驳回供应商创建完成"+orderSn);
} }
} }
} }
...@@ -541,6 +541,7 @@ public class DaSouCheOrderServiceImpl implements DaSouCheOrderService { ...@@ -541,6 +541,7 @@ public class DaSouCheOrderServiceImpl implements DaSouCheOrderService {
} }
} }
if(CollectionUtils.isNotEmpty(suppliers)){ if(CollectionUtils.isNotEmpty(suppliers)){
logger.info(suppliers+"供应商批量插入完成"+sysOrder.getOrderSn());
sysOrderDeviceSupplierMapper.insertBatchSelective(suppliers); sysOrderDeviceSupplierMapper.insertBatchSelective(suppliers);
} }
} }
...@@ -906,8 +907,8 @@ public class DaSouCheOrderServiceImpl implements DaSouCheOrderService { ...@@ -906,8 +907,8 @@ public class DaSouCheOrderServiceImpl implements DaSouCheOrderService {
} }
if(CollectionUtils.isNotEmpty(suppliers)){ if(CollectionUtils.isNotEmpty(suppliers)){
sysOrderDeviceSupplierMapper.insertBatchSelective(suppliers); sysOrderDeviceSupplierMapper.insertBatchSelective(suppliers);
logger.info(suppliers+"供应商插入完成"+sysOrder.getOrderSn());
} }
logger.info("供应商插入完成"+sysOrder.getOrderSn());
} }
/** /**
...@@ -1024,30 +1025,30 @@ public class DaSouCheOrderServiceImpl implements DaSouCheOrderService { ...@@ -1024,30 +1025,30 @@ public class DaSouCheOrderServiceImpl implements DaSouCheOrderService {
content.append("详细地址:" + sysOrder.getAddress()+"\n"); content.append("详细地址:" + sysOrder.getAddress()+"\n");
content.append("联系人:" + sysOrder.getContact()+"\n"); content.append("联系人:" + sysOrder.getContact()+"\n");
if (type == 0) { if (type == 0) {
subject = "大搜车安装单" + orderSn; subject = "大搜车安装单:" + orderSn;
content.append("联系方式 :" + sysOrder.getPhoneNumber()+"\n"); content.append("联系方式 :" + sysOrder.getPhoneNumber()+"\n");
content.append(params[0]); content.append(params[0]);
content.append(params[1]); content.append(params[1]);
content.append(params[2]); content.append(params[2]);
} else if (type == 1) { } else if (type == 1) {
content.append("联系方式 :" + sysOrder.getPhoneNumber()+"\n"); content.append("联系方式 :" + sysOrder.getPhoneNumber()+"\n");
subject = "大搜车拆除单" + orderSn; subject = "大搜车拆除单:" + orderSn;
} else if (type == 2) { } else if (type == 2) {
subject = "大搜车检修单" + orderSn; subject = "大搜车检修单:" + orderSn;
content.append(params[0]+"\n"); content.append(params[0]+"\n");
content.append(params[1]+"\n"); content.append(params[1]+"\n");
content.append(params[2]+"\n"); content.append(params[2]+"\n");
content.append(params[3]+"\n"); content.append(params[3]+"\n");
} else if (type == 3) { } else if (type == 3) {
subject = "大搜检修单(加装微型)单" + orderSn; subject = "大搜检修单(加装微型)单:" + orderSn;
} else if (4 == type) { } else if (4 == type) {
content.append("驳回原因:" + sysOrder.getRemark()+"\n"); content.append("驳回原因:" + sysOrder.getRemark()+"\n");
content.append("联系方式 :" + sysOrder.getPhoneNumber()+"\n"); content.append("联系方式 :" + sysOrder.getPhoneNumber()+"\n");
subject = "大搜车审核驳回单" + orderSn; subject = "大搜车审核驳回单:" + orderSn;
} else if (5 == type) { } else if (5 == type) {
subject = "大搜车获取服务项目出错" + orderSn; subject = "大搜车获取服务项目出错:" + orderSn;
} else if (6 == type) { } else if (6 == type) {
subject = "大搜车订单撤销成功" + orderSn; subject = "大搜车订单撤销成功:" + orderSn;
} }
String finalSubject = subject; String finalSubject = subject;
executorService.submit(new Runnable() { executorService.submit(new Runnable() {
......
...@@ -3,9 +3,12 @@ package com.glsx.ordercenter.utils; ...@@ -3,9 +3,12 @@ package com.glsx.ordercenter.utils;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.glsx.ordercenter.constants.BizConstants; import com.glsx.ordercenter.constants.BizConstants;
import com.glsx.ordercenter.dto.req.*; import com.glsx.ordercenter.dto.req.*;
import com.glsx.ordercenter.service.impl.DaSouCheOrderServiceImpl;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.ArrayUtils; import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.beans.BeanInfo; import java.beans.BeanInfo;
import java.beans.IntrospectionException; import java.beans.IntrospectionException;
...@@ -23,14 +26,22 @@ import java.util.regex.Pattern; ...@@ -23,14 +26,22 @@ import java.util.regex.Pattern;
public class DaSouCheUtil { public class DaSouCheUtil {
private static Logger logger = LoggerFactory.getLogger(DaSouCheUtil.class);
public static Map<String, String> doGetSign(Object base) { public static Map<String, String> doGetSign(Object base) {
Map<String, String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
javabeanToMap(base,map); javabeanToMap(base,map);
System.out.println("======签名map=========" + map); logger.info("======签名map=========" + map);
return map; return map;
} }
/**
* 把 java bean 转成 map
* @param bean
* @param result
* @return
*/
public static Map<String, String> javabeanToMap(Object bean,Map<String, String> result) { public static Map<String, String> javabeanToMap(Object bean,Map<String, String> result) {
if (bean == null) { if (bean == null) {
return result; return result;
...@@ -135,6 +146,13 @@ public class DaSouCheUtil { ...@@ -135,6 +146,13 @@ public class DaSouCheUtil {
return result; return result;
} }
/**
* 比较两个时间的大小
* @param startDate
* @param endDate
* @param timeUnitType
* @return
*/
public static long getDifferenceBetweenTwoTime(Date startDate, Date endDate, DaSouCheUtil.TimeUnitType timeUnitType) { public static long getDifferenceBetweenTwoTime(Date startDate, Date endDate, DaSouCheUtil.TimeUnitType timeUnitType) {
long duration = endDate.getTime() - startDate.getTime(); long duration = endDate.getTime() - startDate.getTime();
if (timeUnitType != null) { if (timeUnitType != null) {
...@@ -280,6 +298,12 @@ public class DaSouCheUtil { ...@@ -280,6 +298,12 @@ public class DaSouCheUtil {
} }
/**
* 通过键获取值的个数
* @param map
* @param value
* @return
*/
public static Integer getMapKey(Map map, Object value) { public static Integer getMapKey(Map map, Object value) {
List<Object> keyList = new ArrayList<>(); List<Object> keyList = new ArrayList<>();
for (Object key : map.keySet()) { for (Object key : map.keySet()) {
...@@ -293,6 +317,11 @@ public class DaSouCheUtil { ...@@ -293,6 +317,11 @@ public class DaSouCheUtil {
return 0; return 0;
} }
/**
* 验证安装单参数
* @param orderReq
* @return
*/
public static String valiateInstall(DaSouCheInstallOrderReq orderReq){ public static String valiateInstall(DaSouCheInstallOrderReq orderReq){
StringBuffer errorStr = new StringBuffer(); StringBuffer errorStr = new StringBuffer();
if(orderReq.getWirelessDevCount() == null){ if(orderReq.getWirelessDevCount() == null){
...@@ -313,6 +342,11 @@ public class DaSouCheUtil { ...@@ -313,6 +342,11 @@ public class DaSouCheUtil {
return errorStr.toString(); return errorStr.toString();
} }
/**
* 验证检修单参数
* @param repairOrderReq
* @return
*/
public static String valiateRepair(DaSouCheRepairOrderReq repairOrderReq) { public static String valiateRepair(DaSouCheRepairOrderReq repairOrderReq) {
List<DaSouCheDevice> devList = repairOrderReq.getDevList(); List<DaSouCheDevice> devList = repairOrderReq.getDevList();
StringBuffer errorStr = new StringBuffer(); StringBuffer errorStr = new StringBuffer();
...@@ -343,6 +377,11 @@ public class DaSouCheUtil { ...@@ -343,6 +377,11 @@ public class DaSouCheUtil {
return errorStr.toString(); return errorStr.toString();
} }
/**
* 验证拆除单参数
* @param removeOrderReq
* @return
*/
public static String valiateRemove(DaSouCheRemoveOrderReq removeOrderReq) { public static String valiateRemove(DaSouCheRemoveOrderReq removeOrderReq) {
List<DaSouCheRemoveDevice> devList = removeOrderReq.getDevList(); List<DaSouCheRemoveDevice> devList = removeOrderReq.getDevList();
StringBuffer errorStr = new StringBuffer(); StringBuffer errorStr = new StringBuffer();
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!