Commit 7442de1e by wubh

包活干V1.9.2-修改:订单设备信息遗失问题

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@28570 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent daba73fa
package com.glsx.ordercenter.mapper; package com.glsx.ordercenter.mapper;
import java.util.List; import java.util.List;
import com.glsx.ordercenter.pojo.SysOrderDevice; import com.glsx.ordercenter.pojo.SysOrderDevice;
public interface SysOrderDeviceMapper { public interface SysOrderDeviceMapper {
...@@ -16,11 +15,11 @@ public interface SysOrderDeviceMapper { ...@@ -16,11 +15,11 @@ public interface SysOrderDeviceMapper {
int updateByPrimaryKeySelective(SysOrderDevice record); int updateByPrimaryKeySelective(SysOrderDevice record);
int updateByPrimaryKey(SysOrderDevice record); int updateByPrimaryKey(SysOrderDevice record);
/** /**
* *
* @author zhanghj * @author zhanghj
* @Title: getOrderDeviceList * @Title: getOrderDeviceList
* @Description: TODO 获取某个订单的设备列表 * @Description: TODO 获取某个订单的设备列表
* @param record * @param record
* @return * @return
...@@ -31,4 +30,6 @@ public interface SysOrderDeviceMapper { ...@@ -31,4 +30,6 @@ public interface SysOrderDeviceMapper {
List<SysOrderDevice> selectByOrderDevice(SysOrderDevice record); List<SysOrderDevice> selectByOrderDevice(SysOrderDevice record);
}
\ No newline at end of file \ No newline at end of file
int deleteByRecord(SysOrderDevice record);
}
...@@ -98,7 +98,7 @@ public class SysOrderDevice { ...@@ -98,7 +98,7 @@ public class SysOrderDevice {
public void setInstallLocation(String installLocation) { public void setInstallLocation(String installLocation) {
this.installLocation = installLocation == null ? null : installLocation.trim(); this.installLocation = installLocation == null ? null : installLocation.trim();
this.isInstallLocation = StringUtils.isNotEmpty(installLocation)?true:false; this.isInstallLocation = StringUtils.isNotEmpty(installLocation);
} }
public Boolean getIsInstallLocation() { public Boolean getIsInstallLocation() {
......
...@@ -3939,27 +3939,28 @@ public class OrderServiceImpl implements IOrderService { ...@@ -3939,27 +3939,28 @@ public class OrderServiceImpl implements IOrderService {
orderStatusMapper.insertSelective(sysOrderStatus); orderStatusMapper.insertSelective(sysOrderStatus);
} }
// 如果渠道不为大搜车,则直接插入设备 // 如果当前订单关联了设备信息,则删除已有的设备信息,再添加
// 如果渠道是大搜车,并且对应工单只有一个订单,则插入设备 // 大搜车生成驳回单时会插入设备信息,如果不删除会导致设备信息重复
// 如果是大搜车,且工单号对应多个订单(普通安装单和驳回安装单),则不插入设备 SysOrderDevice odExample = new SysOrderDevice();
//if (!BizConstants.DA_SOU_CHE.equalsIgnoreCase(order.getChannel()) odExample.setOrderId(orderId);
// || orderMapper.queryOrderByWorkOrderNo(order.getWorkOrderNo()).size() == 1) { int deletedCount = orderDeviceMapper.deleteByRecord(odExample);
//插入订单设备列表 logger.info("==== install Deleted duplicate orderDevice: {}", deletedCount);
for (SysOrderDevice sysOrderDevice : orderDeviceList) {
SysOrderDevice orderDevice = new SysOrderDevice(); //插入订单设备列表
orderDevice.setOrderId(orderId); for (SysOrderDevice sysOrderDevice : orderDeviceList) {
orderDevice.setDeviceNo(sysOrderDevice.getDeviceNo()); SysOrderDevice orderDevice = new SysOrderDevice();
orderDevice.setDeviceType(sysOrderDevice.getDeviceType()); orderDevice.setOrderId(orderId);
orderDevice.setInstallLocation(sysOrderDevice.getInstallLocation()); orderDevice.setDeviceNo(sysOrderDevice.getDeviceNo());
orderDevice.setSort(sysOrderDevice.getSort()); orderDevice.setDeviceType(sysOrderDevice.getDeviceType());
orderDevice.setInstallLocation(sysOrderDevice.getInstallLocation());
if (sysOrderDevice.getId() != null) { orderDevice.setSort(sysOrderDevice.getSort());
orderDeviceMapper.updateByPrimaryKeySelective(sysOrderDevice);
} else { if (sysOrderDevice.getId() != null) {
orderDeviceMapper.insertSelective(orderDevice); orderDeviceMapper.updateByPrimaryKeySelective(sysOrderDevice);
} } else {
orderDeviceMapper.insertSelective(orderDevice);
} }
//} }
this.updateOrderDeviceSupplier(order, orderDeviceList); this.updateOrderDeviceSupplier(order, orderDeviceList);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!