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