Commit 6eff8527 by yuanlin

提交包活干检修安装拆除审核驳回 finished by yuanlin

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@26610 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent 56c94ec3
...@@ -280,10 +280,12 @@ public class DaSouCheOrderServiceImpl implements DaSouCheOrderService { ...@@ -280,10 +280,12 @@ public class DaSouCheOrderServiceImpl implements DaSouCheOrderService {
List<SysOrderDeviceSupplier> supplierByOrderId = sysOrderDeviceSupplierMapper.getSupplierByOrderId(originalOrderId); List<SysOrderDeviceSupplier> supplierByOrderId = sysOrderDeviceSupplierMapper.getSupplierByOrderId(originalOrderId);
if(CollectionUtils.isNotEmpty(supplierByOrderId)){ if(CollectionUtils.isNotEmpty(supplierByOrderId)){
int indexNo = 0;
for (SysOrderDeviceSupplier sysOrderDeviceSupplier : supplierByOrderId) { for (SysOrderDeviceSupplier sysOrderDeviceSupplier : supplierByOrderId) {
sysOrderDeviceSupplier.setOrderId(order.getId()); sysOrderDeviceSupplier.setOrderId(order.getId());
sysOrderDeviceSupplier.setSort(-1); sysOrderDeviceSupplier.setIndexNo(indexNo);
sysOrderDeviceSupplier.setCreateTime(new Date()); sysOrderDeviceSupplier.setCreateTime(new Date());
indexNo++;
} }
sysOrderDeviceSupplierMapper.insertBatchSelective(supplierByOrderId); sysOrderDeviceSupplierMapper.insertBatchSelective(supplierByOrderId);
} }
...@@ -709,11 +711,12 @@ public class DaSouCheOrderServiceImpl implements DaSouCheOrderService { ...@@ -709,11 +711,12 @@ public class DaSouCheOrderServiceImpl implements DaSouCheOrderService {
*/ */
private void addOrderDeviceSupplier(SysOrder sysOrder, Map<String, List<String>> deviceMap, List<DaSouCheDevice> orderDeviceIds,int type) { private void addOrderDeviceSupplier(SysOrder sysOrder, Map<String, List<String>> deviceMap, List<DaSouCheDevice> orderDeviceIds,int type) {
List<SysOrderDeviceSupplier> suppliers = new ArrayList<>(); List<SysOrderDeviceSupplier> suppliers = new ArrayList<>();
int indexNo = 0;
for (Map.Entry<String, List<String>> entry : deviceMap.entrySet()) { for (Map.Entry<String, List<String>> entry : deviceMap.entrySet()) {
int count = 0; int count = 0;
SysOrderDeviceSupplier sysOrderDeviceSupplier = new SysOrderDeviceSupplier(); SysOrderDeviceSupplier sysOrderDeviceSupplier = new SysOrderDeviceSupplier();
sysOrderDeviceSupplier.setOrderId(sysOrder.getId()); sysOrderDeviceSupplier.setOrderId(sysOrder.getId());
if(1 == type){ if(0 == type){
sysOrderDeviceSupplier.setSupplierType(entry.getKey().substring(0,entry.getKey().indexOf("-"))); sysOrderDeviceSupplier.setSupplierType(entry.getKey().substring(0,entry.getKey().indexOf("-")));
count = Integer.parseInt(entry.getKey().substring(entry.getKey().indexOf("-")+1)); count = Integer.parseInt(entry.getKey().substring(entry.getKey().indexOf("-")+1));
}else{ }else{
...@@ -722,14 +725,19 @@ public class DaSouCheOrderServiceImpl implements DaSouCheOrderService { ...@@ -722,14 +725,19 @@ 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());
if(type == 1 && count > 1){ sysOrderDeviceSupplier.setIndexNo(indexNo);
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);
suppliers.add(temp); suppliers.add(temp);
} }
}else{
sysOrderDeviceSupplier.setIndexNo(indexNo);
} }
suppliers.add(sysOrderDeviceSupplier); suppliers.add(sysOrderDeviceSupplier);
indexNo++;
} }
if (CollectionUtils.isNotEmpty(orderDeviceIds) && CollectionUtils.isNotEmpty(suppliers)) { if (CollectionUtils.isNotEmpty(orderDeviceIds) && CollectionUtils.isNotEmpty(suppliers)) {
for (DaSouCheDevice daSouCheDevice : orderDeviceIds) { for (DaSouCheDevice daSouCheDevice : orderDeviceIds) {
......
...@@ -4242,6 +4242,7 @@ public class OrderServiceImpl implements IOrderService { ...@@ -4242,6 +4242,7 @@ public class OrderServiceImpl implements IOrderService {
/* /*
* 插入订单设备列表 * 插入订单设备列表
*/ */
int indexNo = 0;
for (SysOrderDevice sysOrderDevice : orderDeviceList) { for (SysOrderDevice sysOrderDevice : orderDeviceList) {
SysOrderDevice orderDevice = new SysOrderDevice(); SysOrderDevice orderDevice = new SysOrderDevice();
orderDevice.setOrderId(orderId); orderDevice.setOrderId(orderId);
...@@ -4254,7 +4255,7 @@ public class OrderServiceImpl implements IOrderService { ...@@ -4254,7 +4255,7 @@ public class OrderServiceImpl implements IOrderService {
supplier.setOrderId(orderId); supplier.setOrderId(orderId);
supplier.setSupplierType(sysOrderDevice.getDeviceType()); supplier.setSupplierType(sysOrderDevice.getDeviceType());
supplier.setChooseSupplier(sysOrderDevice.getChooseSupplier()); supplier.setChooseSupplier(sysOrderDevice.getChooseSupplier());
supplier.setSort(sysOrderDevice.getSort()); supplier.setIndexNo(indexNo);
sysOrderDeviceSupplierMapper.updateSupplier(supplier); sysOrderDeviceSupplierMapper.updateSupplier(supplier);
} }
/* /*
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!