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 {
orderDevice.setOrderId(id);
List<SysOrderDevice> orderDeviceList = orderDeviceService.getOrderDeviceList(orderDevice);
for(SysOrderDevice sysOrderDevice : orderDeviceList){
SysOrderDeviceSupplier supplierByType = orderService.getSupplierByType(id, sysOrderDevice.getDeviceType());
SysOrderDeviceSupplier supplierByType = orderService.getSupplierByType(id, sysOrderDevice.getDeviceType(),sysOrderDevice.getSort());
if(supplierByType != null){
sysOrderDevice.setChooseSupplier(supplierByType.getChooseSupplier());
sysOrderDevice.setIndexNo(supplierByType.getIndexNo());
sysOrderDevice.setIndexNo(supplierByType.getSort());
if(StringUtils.isNotBlank(supplierByType.getSupplier())){
sysOrderDevice.setSuppliers(Arrays.asList(supplierByType.getSupplier().split("#")));
}
......@@ -927,10 +927,10 @@ public class OrderController extends BaseController {
} else {
List<SysServiceItemDeviceConfig> deviceConfigList = orderService.getOrderDeviceConfigList(id);
for(SysServiceItemDeviceConfig deviceConfig : deviceConfigList){
SysOrderDeviceSupplier supplierByType = orderService.getSupplierByType(id, deviceConfig.getDeviceType());
SysOrderDeviceSupplier supplierByType = orderService.getSupplierByType(id, deviceConfig.getDeviceType(),(int)deviceConfig.getSort());
if(supplierByType != null){
deviceConfig.setChooseSupplier(supplierByType.getChooseSupplier());
deviceConfig.setIndexNo(supplierByType.getIndexNo());
deviceConfig.setIndexNo(supplierByType.getSort());
if(StringUtils.isNotBlank(supplierByType.getSupplier())){
deviceConfig.setSuppliers(Arrays.asList(supplierByType.getSupplier().split("#")));
}
......
......@@ -15,7 +15,9 @@ public interface SysOrderDeviceSupplierMapper {
* @param supplierType
* @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);
......
......@@ -11,7 +11,7 @@ public class SysOrderDeviceSupplier {
private String supplier;
private String supplierType;
private String chooseSupplier;
private Integer indexNo;
private Integer sort;
private Date createTime;
private Date updateTime;
......@@ -31,12 +31,12 @@ public class SysOrderDeviceSupplier {
this.orderId = orderId;
}
public Integer getIndexNo() {
return indexNo;
public Integer getSort() {
return sort;
}
public void setIndexNo(Integer indexNo) {
this.indexNo = indexNo;
public void setSort(Integer sort) {
this.sort = sort;
}
public String getSupplier() {
......
......@@ -437,5 +437,5 @@ public interface IOrderService {
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 {
int indexNo = 0;
for (SysOrderDeviceSupplier sysOrderDeviceSupplier : supplierByOrderId) {
sysOrderDeviceSupplier.setOrderId(order.getId());
sysOrderDeviceSupplier.setIndexNo(indexNo);
sysOrderDeviceSupplier.setSort(indexNo);
sysOrderDeviceSupplier.setCreateTime(new Date());
indexNo++;
}
......@@ -748,16 +748,16 @@ public class DaSouCheOrderServiceImpl implements DaSouCheOrderService {
String supper = entry.getValue().stream().collect(Collectors.joining("#"));
sysOrderDeviceSupplier.setSupplier(supper);
sysOrderDeviceSupplier.setCreateTime(new Date());
sysOrderDeviceSupplier.setIndexNo(indexNo);
sysOrderDeviceSupplier.setSort(indexNo);
if(type == 0 && count > 1){
for(int i = 0 ;i< count ; i++){
SysOrderDeviceSupplier temp = new SysOrderDeviceSupplier();
BeanUtils.copyBeanProp(temp,sysOrderDeviceSupplier);
temp.setIndexNo(indexNo);
temp.setSort(indexNo);
suppliers.add(temp);
}
}else{
sysOrderDeviceSupplier.setIndexNo(indexNo);
sysOrderDeviceSupplier.setSort(indexNo);
}
suppliers.add(sysOrderDeviceSupplier);
indexNo++;
......
......@@ -1977,13 +1977,6 @@ public class OrderServiceImpl implements IOrderService {
if (orderDeviceList != null && orderDeviceList.size() >0) {
for (SysOrderDevice sysOrderDevice : orderDeviceList) {
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 {
*/
if("DSC".equals(order.getChannel())){
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());
if(!CollectionUtils.isEmpty(sysOrders)&&sysOrders.size()<2){
boolean syncFlag = true;
......@@ -4268,12 +4269,6 @@ public class OrderServiceImpl implements IOrderService {
orderDevice.setInstallLocation(sysOrderDevice.getInstallLocation());
orderDevice.setSort(sysOrderDevice.getSort());
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盾)
......@@ -4287,6 +4282,14 @@ public class OrderServiceImpl implements IOrderService {
*/
if("DSC".equals(order.getChannel())){
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());
if(!CollectionUtils.isEmpty(sysOrders)){
boolean syncFlag = true;
......@@ -5031,8 +5034,8 @@ public class OrderServiceImpl implements IOrderService {
}
@Override
public SysOrderDeviceSupplier getSupplierByType(Integer orderId, String deviceType) {
return sysOrderDeviceSupplierMapper.getDeviceSupplierByType(orderId,deviceType);
public SysOrderDeviceSupplier getSupplierByType(Integer orderId, String deviceType,Integer sort) {
return sysOrderDeviceSupplierMapper.getDeviceSupplier(orderId,deviceType,sort);
}
}
......@@ -83,6 +83,7 @@ public class DscInstallOrderFeedBackTask implements Runnable{
continue;
}
SysOrderDeviceSupplier supplier = sysOrderDeviceSupplierMapper.getDeviceSupplier(order.getId(),dev_type,d.getSort());
logger.info("---安装单供应商-----"+JSON.toJSONString(supplier));
deviceDTO.setDevSupplier(supplier.getChooseSupplier());
deviceDTO.setDevModel(""); //设备型号
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!