Commit 14347a7cfca24c413f333d8816c29d6e5099e773

Authored by liujun001
1 parent f4fd80f6

优化车辆信息,将客户的数据拉入我们的库

trash-garbage/src/main/java/com/trash/garbage/controller/GarbageOrderController.java
@@ -212,7 +212,7 @@ public class GarbageOrderController { @@ -212,7 +212,7 @@ public class GarbageOrderController {
212 List<GarOrder> list = garOrderService.queryOrderListByGarOrder(garOrder); 212 List<GarOrder> list = garOrderService.queryOrderListByGarOrder(garOrder);
213 ExcelUtil<GarOrder> util = new ExcelUtil<GarOrder>(GarOrder.class); 213 ExcelUtil<GarOrder> util = new ExcelUtil<GarOrder>(GarOrder.class);
214 AjaxResult ajaxResult = util.exportExcel(list, "order"); 214 AjaxResult ajaxResult = util.exportExcel(list, "order");
215 - 215 + ajaxResult.put("msg",ajaxResult.get(AjaxResult.MSG_TAG));
216 return ajaxResult; 216 return ajaxResult;
217 // try 217 // try
218 // { 218 // {
trash-unit/src/main/java/com/trash/carInfo/service/impl/CarInfoServiceImpl.java
@@ -9,6 +9,8 @@ import com.trash.common.config.trashConfig; @@ -9,6 +9,8 @@ import com.trash.common.config.trashConfig;
9 import com.trash.common.utils.DateUtils; 9 import com.trash.common.utils.DateUtils;
10 import com.trash.common.utils.SecurityUtils; 10 import com.trash.common.utils.SecurityUtils;
11 import com.trash.enterprise.mapper.TransportationEnterpriseMapper; 11 import com.trash.enterprise.mapper.TransportationEnterpriseMapper;
  12 +import org.slf4j.Logger;
  13 +import org.slf4j.LoggerFactory;
12 import org.springframework.beans.factory.annotation.Autowired; 14 import org.springframework.beans.factory.annotation.Autowired;
13 import org.springframework.stereotype.Service; 15 import org.springframework.stereotype.Service;
14 import org.springframework.transaction.annotation.Transactional; 16 import org.springframework.transaction.annotation.Transactional;
@@ -27,6 +29,7 @@ import static com.trash.common.utils.file.FileUploadUtils.upload; @@ -27,6 +29,7 @@ import static com.trash.common.utils.file.FileUploadUtils.upload;
27 */ 29 */
28 @Service 30 @Service
29 public class CarInfoServiceImpl implements ICarInfoService { 31 public class CarInfoServiceImpl implements ICarInfoService {
  32 + private static final Logger log = LoggerFactory.getLogger(CarInfoServiceImpl.class);
30 @Autowired 33 @Autowired
31 private CarInfoMapper carInfoMapper; 34 private CarInfoMapper carInfoMapper;
32 35
@@ -129,11 +132,21 @@ public class CarInfoServiceImpl implements ICarInfoService { @@ -129,11 +132,21 @@ public class CarInfoServiceImpl implements ICarInfoService {
129 } 132 }
130 133
131 public int save(CarInfo carInfo) { 134 public int save(CarInfo carInfo) {
132 - return carInfoMapper.saveCarInfo(carInfo); 135 + try {
  136 + return carInfoMapper.saveCarInfo(carInfo);
  137 + } catch (Exception e) {
  138 + log.error(e.getMessage(), e);
  139 + }
  140 + return 0;
133 } 141 }
134 142
135 public int updateById(CarInfo carInfo) { 143 public int updateById(CarInfo carInfo) {
136 - return carInfoMapper.updateCarInfo(carInfo); 144 + try {
  145 + return carInfoMapper.updateCarInfo(carInfo);
  146 + } catch (Exception e) {
  147 + log.error(e.getMessage(), e);
  148 + }
  149 + return 0;
137 } 150 }
138 151
139 /** 152 /**
trash-unit/src/main/java/com/trash/driver/service/impl/DriverServiceImpl.java
@@ -101,7 +101,12 @@ public class DriverServiceImpl implements IDriverService { @@ -101,7 +101,12 @@ public class DriverServiceImpl implements IDriverService {
101 @Override 101 @Override
102 public int save(Driver driver, String carId) { 102 public int save(Driver driver, String carId) {
103 saveCarDriver(driver.getId(), carId); 103 saveCarDriver(driver.getId(), carId);
104 - return driverMapper.saveDriver(driver); 104 + try {
  105 + return driverMapper.saveDriver(driver);
  106 + } catch (Exception e) {
  107 + log.error(e.getMessage(), e);
  108 + }
  109 + return 0;
105 } 110 }
106 111
107 @Override 112 @Override
trash-unit/src/main/resources/mapper/unit/DriverMapper.xml
@@ -129,6 +129,7 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot; @@ -129,6 +129,7 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
129 <insert id="saveDriver" parameterType="Driver" useGeneratedKeys="true" keyProperty="id"> 129 <insert id="saveDriver" parameterType="Driver" useGeneratedKeys="true" keyProperty="id">
130 insert into driver 130 insert into driver
131 <trim prefix="(" suffix=")" suffixOverrides=","> 131 <trim prefix="(" suffix=")" suffixOverrides=",">
  132 + <if test="id != null">id,</if>
132 <if test="name != null">name,</if> 133 <if test="name != null">name,</if>
133 <if test="identityCard != null">identity_card,</if> 134 <if test="identityCard != null">identity_card,</if>
134 <if test="companyId != null">company_id,</if> 135 <if test="companyId != null">company_id,</if>
@@ -152,6 +153,7 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot; @@ -152,6 +153,7 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
152 <if test="phoneNo != null">phoneNo,</if> 153 <if test="phoneNo != null">phoneNo,</if>
153 </trim> 154 </trim>
154 <trim prefix="values (" suffix=")" suffixOverrides=","> 155 <trim prefix="values (" suffix=")" suffixOverrides=",">
  156 + <if test="id != null">#{id},</if>
155 <if test="name != null">#{name},</if> 157 <if test="name != null">#{name},</if>
156 <if test="identityCard != null">#{identityCard},</if> 158 <if test="identityCard != null">#{identityCard},</if>
157 <if test="companyId != null">#{companyId},</if> 159 <if test="companyId != null">#{companyId},</if>