Commit 3744f592 by chaizheng

大搜车工单需求

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@26625 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent dd07709a
...@@ -914,10 +914,10 @@ public class OrderController extends BaseController { ...@@ -914,10 +914,10 @@ public class OrderController extends BaseController {
orderDevice.setOrderId(id); orderDevice.setOrderId(id);
List<SysOrderDevice> orderDeviceList = orderDeviceService.getOrderDeviceList(orderDevice); List<SysOrderDevice> orderDeviceList = orderDeviceService.getOrderDeviceList(orderDevice);
for(SysOrderDevice sysOrderDevice : orderDeviceList){ for(SysOrderDevice sysOrderDevice : orderDeviceList){
SysOrderDeviceSupplier supplierByType = orderService.getSupplierByType(id, sysOrderDevice.getDeviceType()); SysOrderDeviceSupplier supplierByType = orderService.getSupplierByType(id, sysOrderDevice.getDeviceType(),sysOrderDevice.getSort());
if(supplierByType != null){ if(supplierByType != null){
sysOrderDevice.setChooseSupplier(supplierByType.getChooseSupplier()); sysOrderDevice.setChooseSupplier(supplierByType.getChooseSupplier());
sysOrderDevice.setIndexNo(supplierByType.getIndexNo()); sysOrderDevice.setIndexNo(supplierByType.getSort());
if(StringUtils.isNotBlank(supplierByType.getSupplier())){ if(StringUtils.isNotBlank(supplierByType.getSupplier())){
sysOrderDevice.setSuppliers(Arrays.asList(supplierByType.getSupplier().split("#"))); sysOrderDevice.setSuppliers(Arrays.asList(supplierByType.getSupplier().split("#")));
} }
...@@ -927,10 +927,10 @@ public class OrderController extends BaseController { ...@@ -927,10 +927,10 @@ public class OrderController extends BaseController {
} else { } else {
List<SysServiceItemDeviceConfig> deviceConfigList = orderService.getOrderDeviceConfigList(id); List<SysServiceItemDeviceConfig> deviceConfigList = orderService.getOrderDeviceConfigList(id);
for(SysServiceItemDeviceConfig deviceConfig : deviceConfigList){ for(SysServiceItemDeviceConfig deviceConfig : deviceConfigList){
SysOrderDeviceSupplier supplierByType = orderService.getSupplierByType(id, deviceConfig.getDeviceType()); SysOrderDeviceSupplier supplierByType = orderService.getSupplierByType(id, deviceConfig.getDeviceType(),(int)deviceConfig.getSort());
if(supplierByType != null){ if(supplierByType != null){
deviceConfig.setChooseSupplier(supplierByType.getChooseSupplier()); deviceConfig.setChooseSupplier(supplierByType.getChooseSupplier());
deviceConfig.setIndexNo(supplierByType.getIndexNo()); deviceConfig.setIndexNo(supplierByType.getSort());
if(StringUtils.isNotBlank(supplierByType.getSupplier())){ if(StringUtils.isNotBlank(supplierByType.getSupplier())){
deviceConfig.setSuppliers(Arrays.asList(supplierByType.getSupplier().split("#"))); deviceConfig.setSuppliers(Arrays.asList(supplierByType.getSupplier().split("#")));
} }
......
...@@ -15,7 +15,9 @@ public interface SysOrderDeviceSupplierMapper { ...@@ -15,7 +15,9 @@ public interface SysOrderDeviceSupplierMapper {
* @param supplierType * @param supplierType
* @return * @return
*/ */
SysOrderDeviceSupplier getDeviceSupplierByType(@Param("orderId") Integer orderId, @Param("supplierType")String supplierType); List<SysOrderDeviceSupplier> getDeviceSupplierByType(@Param("orderId") Integer orderId, @Param("supplierType")String supplierType);
SysOrderDeviceSupplier getDeviceSupplier(@Param("orderId") Integer orderId, @Param("supplierType")String supplierType, @Param("sort") Integer sort);
void insertBatchSelective(List<SysOrderDeviceSupplier> list); void insertBatchSelective(List<SysOrderDeviceSupplier> list);
......
...@@ -11,7 +11,7 @@ public class SysOrderDeviceSupplier { ...@@ -11,7 +11,7 @@ public class SysOrderDeviceSupplier {
private String supplier; private String supplier;
private String supplierType; private String supplierType;
private String chooseSupplier; private String chooseSupplier;
private Integer indexNo; private Integer sort;
private Date createTime; private Date createTime;
private Date updateTime; private Date updateTime;
...@@ -31,12 +31,12 @@ public class SysOrderDeviceSupplier { ...@@ -31,12 +31,12 @@ public class SysOrderDeviceSupplier {
this.orderId = orderId; this.orderId = orderId;
} }
public Integer getIndexNo() { public Integer getSort() {
return indexNo; return sort;
} }
public void setIndexNo(Integer indexNo) { public void setSort(Integer sort) {
this.indexNo = indexNo; this.sort = sort;
} }
public String getSupplier() { public String getSupplier() {
......
...@@ -437,5 +437,5 @@ public interface IOrderService { ...@@ -437,5 +437,5 @@ public interface IOrderService {
void carOcr(OrderDeviceReq orderDeviceReq); void carOcr(OrderDeviceReq orderDeviceReq);
SysOrderDeviceSupplier getSupplierByType(Integer orderId, String deviceType); SysOrderDeviceSupplier getSupplierByType(Integer orderId, String deviceType,Integer sort);
} }
...@@ -283,7 +283,7 @@ public class DaSouCheOrderServiceImpl implements DaSouCheOrderService { ...@@ -283,7 +283,7 @@ public class DaSouCheOrderServiceImpl implements DaSouCheOrderService {
int indexNo = 0; int indexNo = 0;
for (SysOrderDeviceSupplier sysOrderDeviceSupplier : supplierByOrderId) { for (SysOrderDeviceSupplier sysOrderDeviceSupplier : supplierByOrderId) {
sysOrderDeviceSupplier.setOrderId(order.getId()); sysOrderDeviceSupplier.setOrderId(order.getId());
sysOrderDeviceSupplier.setIndexNo(indexNo); sysOrderDeviceSupplier.setSort(indexNo);
sysOrderDeviceSupplier.setCreateTime(new Date()); sysOrderDeviceSupplier.setCreateTime(new Date());
indexNo++; indexNo++;
} }
...@@ -748,16 +748,16 @@ public class DaSouCheOrderServiceImpl implements DaSouCheOrderService { ...@@ -748,16 +748,16 @@ public class DaSouCheOrderServiceImpl implements DaSouCheOrderService {
String supper = entry.getValue().stream().collect(Collectors.joining("#")); String supper = entry.getValue().stream().collect(Collectors.joining("#"));
sysOrderDeviceSupplier.setSupplier(supper); sysOrderDeviceSupplier.setSupplier(supper);
sysOrderDeviceSupplier.setCreateTime(new Date()); sysOrderDeviceSupplier.setCreateTime(new Date());
sysOrderDeviceSupplier.setIndexNo(indexNo); sysOrderDeviceSupplier.setSort(indexNo);
if(type == 0 && count > 1){ if(type == 0 && count > 1){
for(int i = 0 ;i< count ; i++){ for(int i = 0 ;i< count ; i++){
SysOrderDeviceSupplier temp = new SysOrderDeviceSupplier(); SysOrderDeviceSupplier temp = new SysOrderDeviceSupplier();
BeanUtils.copyBeanProp(temp,sysOrderDeviceSupplier); BeanUtils.copyBeanProp(temp,sysOrderDeviceSupplier);
temp.setIndexNo(indexNo); temp.setSort(indexNo);
suppliers.add(temp); suppliers.add(temp);
} }
}else{ }else{
sysOrderDeviceSupplier.setIndexNo(indexNo); sysOrderDeviceSupplier.setSort(indexNo);
} }
suppliers.add(sysOrderDeviceSupplier); suppliers.add(sysOrderDeviceSupplier);
indexNo++; indexNo++;
......
...@@ -1977,13 +1977,6 @@ public class OrderServiceImpl implements IOrderService { ...@@ -1977,13 +1977,6 @@ public class OrderServiceImpl implements IOrderService {
if (orderDeviceList != null && orderDeviceList.size() >0) { if (orderDeviceList != null && orderDeviceList.size() >0) {
for (SysOrderDevice sysOrderDevice : orderDeviceList) { for (SysOrderDevice sysOrderDevice : orderDeviceList) {
orderDeviceDao.updateByPrimaryKeySelective(sysOrderDevice); orderDeviceDao.updateByPrimaryKeySelective(sysOrderDevice);
SysOrderDeviceSupplier supplier = new SysOrderDeviceSupplier();
supplier.setOrderId(orderId);
supplier.setSupplierType(sysOrderDevice.getDeviceType());
supplier.setChooseSupplier(sysOrderDevice.getChooseSupplier());
supplier.setIndexNo(sysOrderDevice.getIndexNo());
supplier.setIndexNo(sysOrderDevice.getIndexNo());
sysOrderDeviceSupplierMapper.updateSupplier(supplier);
} }
} }
/** /**
...@@ -1991,6 +1984,14 @@ public class OrderServiceImpl implements IOrderService { ...@@ -1991,6 +1984,14 @@ public class OrderServiceImpl implements IOrderService {
*/ */
if("DSC".equals(order.getChannel())){ if("DSC".equals(order.getChannel())){
SysOrder oneOrder = orderDao.selectByPrimaryKey(order.getId()); SysOrder oneOrder = orderDao.selectByPrimaryKey(order.getId());
for (SysOrderDevice sysOrderDevice : orderDeviceList){
SysOrderDeviceSupplier supplier = new SysOrderDeviceSupplier();
supplier.setOrderId(orderId);
supplier.setSupplierType(sysOrderDevice.getDeviceType());
supplier.setChooseSupplier(sysOrderDevice.getChooseSupplier());
supplier.setSort(sysOrderDevice.getSort());
sysOrderDeviceSupplierMapper.updateSupplier(supplier);
}
List<SysOrder> sysOrders = orderDao.queryOrderByWorkOrderNo(oneOrder.getWorkOrderNo()); List<SysOrder> sysOrders = orderDao.queryOrderByWorkOrderNo(oneOrder.getWorkOrderNo());
if(!CollectionUtils.isEmpty(sysOrders)&&sysOrders.size()<2){ if(!CollectionUtils.isEmpty(sysOrders)&&sysOrders.size()<2){
boolean syncFlag = true; boolean syncFlag = true;
...@@ -4268,12 +4269,6 @@ public class OrderServiceImpl implements IOrderService { ...@@ -4268,12 +4269,6 @@ public class OrderServiceImpl implements IOrderService {
orderDevice.setInstallLocation(sysOrderDevice.getInstallLocation()); orderDevice.setInstallLocation(sysOrderDevice.getInstallLocation());
orderDevice.setSort(sysOrderDevice.getSort()); orderDevice.setSort(sysOrderDevice.getSort());
orderDeviceDao.insertSelective(orderDevice); orderDeviceDao.insertSelective(orderDevice);
SysOrderDeviceSupplier supplier = new SysOrderDeviceSupplier();
supplier.setOrderId(orderId);
supplier.setSupplierType(sysOrderDevice.getDeviceType());
supplier.setChooseSupplier(sysOrderDevice.getChooseSupplier());
supplier.setIndexNo(sysOrderDevice.getIndexNo());
sysOrderDeviceSupplierMapper.updateSupplier(supplier);
} }
/* /*
* 同步设备到渠道(E盾) * 同步设备到渠道(E盾)
...@@ -4287,6 +4282,14 @@ public class OrderServiceImpl implements IOrderService { ...@@ -4287,6 +4282,14 @@ public class OrderServiceImpl implements IOrderService {
*/ */
if("DSC".equals(order.getChannel())){ if("DSC".equals(order.getChannel())){
SysOrder oneOrder = orderDao.selectByPrimaryKey(order.getId()); SysOrder oneOrder = orderDao.selectByPrimaryKey(order.getId());
for (SysOrderDevice sysOrderDevice : orderDeviceList){
SysOrderDeviceSupplier supplier = new SysOrderDeviceSupplier();
supplier.setOrderId(orderId);
supplier.setSupplierType(sysOrderDevice.getDeviceType());
supplier.setChooseSupplier(sysOrderDevice.getChooseSupplier());
supplier.setSort(sysOrderDevice.getSort());
sysOrderDeviceSupplierMapper.updateSupplier(supplier);
}
List<SysOrder> sysOrders = orderDao.queryOrderByWorkOrderNo(oneOrder.getWorkOrderNo()); List<SysOrder> sysOrders = orderDao.queryOrderByWorkOrderNo(oneOrder.getWorkOrderNo());
if(!CollectionUtils.isEmpty(sysOrders)){ if(!CollectionUtils.isEmpty(sysOrders)){
boolean syncFlag = true; boolean syncFlag = true;
...@@ -5031,8 +5034,8 @@ public class OrderServiceImpl implements IOrderService { ...@@ -5031,8 +5034,8 @@ public class OrderServiceImpl implements IOrderService {
} }
@Override @Override
public SysOrderDeviceSupplier getSupplierByType(Integer orderId, String deviceType) { public SysOrderDeviceSupplier getSupplierByType(Integer orderId, String deviceType,Integer sort) {
return sysOrderDeviceSupplierMapper.getDeviceSupplierByType(orderId,deviceType); return sysOrderDeviceSupplierMapper.getDeviceSupplier(orderId,deviceType,sort);
} }
} }
...@@ -83,6 +83,7 @@ public class DscInstallOrderFeedBackTask implements Runnable{ ...@@ -83,6 +83,7 @@ public class DscInstallOrderFeedBackTask implements Runnable{
continue; continue;
} }
SysOrderDeviceSupplier supplier = sysOrderDeviceSupplierMapper.getDeviceSupplier(order.getId(),dev_type,d.getSort()); SysOrderDeviceSupplier supplier = sysOrderDeviceSupplierMapper.getDeviceSupplier(order.getId(),dev_type,d.getSort());
logger.info("---安装单供应商-----"+JSON.toJSONString(supplier));
deviceDTO.setDevSupplier(supplier.getChooseSupplier()); deviceDTO.setDevSupplier(supplier.getChooseSupplier());
deviceDTO.setDevModel(""); //设备型号 deviceDTO.setDevModel(""); //设备型号
deviceDTO.setDevPosition(d.getInstallLocation()); deviceDTO.setDevPosition(d.getInstallLocation());
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!